Skip to content
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: check for renamed yarn.lock during install #648

Merged
merged 3 commits into from
Sep 1, 2023

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Aug 24, 2023

@W-14010705@

src/plugins.ts Outdated
await fs.promises.rename(path.join(root, 'oclif.lock'), path.join(root, 'yarn.lock'))
await doRefresh()
await fs.promises.unlink(path.join(root, 'yarn.lock'))
} else if (await fileExists(path.join(root, 'yarn.lock'))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check for yarn.lock first? Say npm@10 comes out and it allows you to package a yarn.lock. I could see a situation where someone has an old oclif.lock checked into their repo (even though we discourage that here) and the shipped yarn.lock would get overwritten with an old oclif.lock.

@iowillhoit
Copy link
Contributor

QA NOTES

  • Installed latest of sf
  • cdd to the sf install directory
  • yarn link @oclif/plugin-plugins
  • Ran npm why @oclif/core
> npm why @oclif/core
@oclif/core@2.11.10
node_modules/@oclif/core
  @oclif/core@"2.11.10" from the root project
  • Bumped oclif core in oclif-hello-world to @oclif/core@2.14.0
> yarn why @oclif/core
yarn why v1.22.19
[...]
=> Found "@oclif/core@2.14.0"
  • Ran yarn oclif lock
  • Published oclif-hello-world to verdaccio
  • Installed with SF_NPM_REGISTRY=http://localhost:4873/ sf plugins install oclif-hello-world
  • Inspect shows @oclif/core@2.14.0
> sf plugins inspect oclif-hello-world
└─ oclif-hello-world
   ├─ [...]
   └─ dependencies
      ├─ @oclif/core 2.14.0 => 2.14.0
      ├─ @oclif/plugin-help ^5 => 5.2.18
      └─ @oclif/plugin-plugins ^3.3.0 => 3.3.2
  • Confirmed that there is a yarn.lock in ~/.local/share/sf
  • yarn why in that dir
> yarn why @oclif/core
yarn why v1.22.19
[...]
=> Found "@oclif/core@2.14.0"
  • npm why in sf install dir still shows 2.11.10

@iowillhoit
Copy link
Contributor

Looks great!

@mdonnalley mdonnalley merged commit 9830b0a into main Sep 1, 2023
6 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/check-renamed-yarn-lock branch September 1, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants