-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: fall back to global npm and yarn if not found #871
Conversation
f41be01
to
e69f75a
Compare
50f794d
to
bafa6c1
Compare
.github/workflows/test.yml
Outdated
@@ -42,9 +42,12 @@ jobs: | |||
matrix: | |||
os: [ubuntu-latest, windows-latest] | |||
test: ['test:integration:install', 'test:integration:link'] | |||
lite: [true, false] |
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.
That's clever
return require.resolve('yarn/bin/yarn.js', {paths: [this.config.root, fileURLToPath(import.meta.url)]}) | ||
if (this.bin) return this.bin | ||
try { | ||
this.bin = require.resolve('yarn/bin/yarn.js', {paths: [this.config.root, fileURLToPath(import.meta.url)]}) |
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.
Why the different resolve logic for yarn? When I remove yarn
from my linked plugin-plugins
it resolves the to yarn that is included with the sf
cli rather than falling back to my locally installed version
@oclif/plugin-plugins:yarn yarn binary path /Users/ewillhoit/.nvm/versions/node/v20.12.2/lib/node_modules/@salesforce/cli/node_modules/yarn/bin/yarn.j
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.
I just pulled the logic in exactly as it was in the last major: https://github.com/oclif/plugin-plugins/blob/4.3.10/src/yarn.ts#L30
I can replicate the same logic that we use for npm... but I'm wondering if it's worth it if we one day hope to remove the "install dependencies after linking" logic altogether. What do you think?
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.
I think that's fine since we'd like to get rid of this. I don't really see an issue with this, I was just curious if it was deliberate.
QA NOTES
|
Fixes #864
@W-15703207@