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(cli): Generate an empty lockfile when there are no dependencies #5843

Merged
merged 2 commits into from
May 23, 2018

Conversation

jimmyhchan
Copy link
Contributor

@jimmyhchan jimmyhchan commented May 21, 2018

Summary

this reverts most of #3395 992b5c9 which appears only necessary to work around #3329 (requesting the yarn version with -v triggered install). As noted in #5839, yarn -v and yarn check no longer have install as a side effect and IMO, the original behavior where an empty lock file is generated as part of install is the correct behavior.

Many tools currently sniff for a yarn.lock file to determine if yarn is being used. It seems more consistent with yarn import which generates a lockfile even if the existing node_modules is empty.

fixes #5839

Test plan

yarn run test passes
yarn run lint passes
yarn-local install saves an empty lockfile
yarn-local import continues to save an empty lockfile
yarn-local -v will not trigger install and will not generate a lock file. correctly displays a version.
yarn-local check will not trigger install and will not generate a lock file

…encies

this reverts most of yarnpkg#3395 992b5c9
which appears only necessary to work around yarnpkg#3329 (requesting the yarn
version with -v triggered install)
@rally25rs rally25rs requested a review from BYK May 23, 2018 00:22
Copy link
Contributor

@rally25rs rally25rs left a comment

Choose a reason for hiding this comment

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

I like this change. IMO if there is a package.json and you run yarn install, an empty lockfile makes sense. @BYK thoughts?

Verified that yarn -h, yarn help, yarn check, yarn -v don't create the lockfile.

@rally25rs rally25rs changed the title Fix #5839: Generate an empty lockfile when there are no dependencies feat(cli Generate an empty lockfile when there are no dependencies May 23, 2018
@rally25rs rally25rs changed the title feat(cli Generate an empty lockfile when there are no dependencies feat(cli): Generate an empty lockfile when there are no dependencies. May 23, 2018
@BYK BYK requested review from imsnif and arcanis and removed request for BYK May 23, 2018 11:22
@BYK
Copy link
Member

BYK commented May 23, 2018

I really like this change but wanna hear what @arcanis and @imsnif thinks befor merging. Also cc @Daniel15 and @bestander. I'll merge from master in the meantime to kick off Node 10 builds.

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

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

Yep, looks fine by me 👍

@BYK BYK changed the title feat(cli): Generate an empty lockfile when there are no dependencies. feat(cli): Generate an empty lockfile when there are no dependencies May 23, 2018
@BYK BYK merged commit a2defdb into yarnpkg:master May 23, 2018
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.

yarn install should generate an empty yarn lock even if there are no dependencies
4 participants