-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn Berry refactoring and minor improvements #775
Yarn Berry refactoring and minor improvements #775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a minor suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, thank you for this effort which I started in the past but failed to finish (https://github.com/eskultety/cachi2/commits/yarn-misc/). I left a couple of design comments, one major, the rest is minor.
15cac3c
to
1301bfa
Compare
f1f8b50
to
87638b4
Compare
So the integration test is failing because [1] https://yarnpkg.com/configuration/yarnrc |
When the class was initially envisioned, we assumed we would need to map just a few attributes from all the possible keys for yarnrc. As the implementation progressed, this proved to be a shortcoming. This patch changes the class to be a UserDict subclass, and effectively abandons the effort to control the keys that can be used. Default values for each attribute are also no longer mapped, so the class will only contain what is explicitly written in the yarnrc file. With these changes, we already have the benefit of a greatly simplified class, since we are removing all the properties that mapped to every single necessary yarnrc option. Any option that we might eventually need can now be used with no or little changes to YarnRc. Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
This change is meant to keep both the YarnRc and PackageJson classes with similar implementations. Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
With the change of the YarnRc class to a UserDict subclass, the test that covers parsing a valid .yarnrc.yml file can be greatly simplified. Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
This makes it possible to avoid parsing the version from package.json a second time when setting the .yarnrc.yaml configuration (there's a configuration key that is dependent on the Yarn version). Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
There's no need for Cachi2 to directly access the contents of the "npmRegistryServer" yarn_rc variable, since Yarn itself will read it when we execute "yarn install". The code refering to it is a leftover of the development phase. Signed-off-by: Bruno Pimentel <bpimente@redhat.com>
87638b4
to
2c4ffa9
Compare
:shakes_fist: yarn Well, this is tricky, because we'd still need to have the "default" Since we only rely on three config keys, I changed the approach to completely drop the defaults, and treat the cases where we need them during the code (each key is only accessed once, anyways). |
That's fair and should suffice for now. We can improve upon that in the future. |
7557f2c
.yarnrc.yml
configurationMaintainers will complete the following section