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

Unstage yarn.lock pre-commit #2700

Merged
merged 1 commit into from
Aug 2, 2017
Merged

Conversation

jdcrensh
Copy link
Contributor

@jdcrensh jdcrensh commented Jun 30, 2017

Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to unstage any staged
yarn.lock files before they can even be committed.

Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to remove any staged
yarn.lock files before they can even be committed.
@ggascoigne
Copy link

Why shouldn't it be checked in?

The docs suggest otherwise https://yarnpkg.com/lang/en/docs/yarn-lock/.

I should add that we specifically check this file in to get reproducible builds and would find it very awkward to work around this change.

@jdcrensh
Copy link
Contributor Author

To be clear, this PR is relevant only to the create-react-app repo, where yarn.lock is neither committed nor gitignored. Apps using react-scripts would not be affected in any way.

@ggascoigne
Copy link

Ah, sorry, that makes much more sense.

@Timer
Copy link
Contributor

Timer commented Aug 2, 2017

Seems very useful to me, thanks!

@Timer Timer merged commit 20c953d into facebook:master Aug 2, 2017
@Timer Timer added this to the 1.0.11 milestone Aug 2, 2017
JohnNilsson referenced this pull request in JohnNilsson/create-react-app-typescript Aug 9, 2017
Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to remove any staged
yarn.lock files before they can even be committed.
zangrafx added a commit to absolvent/create-react-app that referenced this pull request Aug 13, 2017
* commit 'bfaee410c502a95076a6bd89721c76ca08e15f7b': (39 commits)
  Publish
  Prepare for 1.0.11 release (facebook#2924)
  Update dev deps (facebook#2923)
  Update README.md
  Use env variable to disable source maps (facebook#2818)
  Make formatWebpackMessages return all messages (facebook#2834)
  Adjust the `checkIfOnline` check if in a corporate proxy environment (facebook#2884)
  Fix the order of arguments in spawned child proc (facebook#2913)
  Feature/webpack 3 4 (facebook#2875)
  Allow importing package.json (facebook#2468)
  Re-enable flowtype warning (facebook#2718)
  Format UglifyJs error (facebook#2650)
  Unstage yarn.lock pre-commit (facebook#2700)
  Update README.md
  Update README.md
  Add Electrode to alternatives (facebook#2728)
  Fix parsing HTML/JSX tags to real elements (facebook#2796)
  Update webpack version note (facebook#2798)
  Use modern syntax feature (facebook#2873)
  Allow use of scoped packages with a pinned version (facebook#2853)
  ...

# Conflicts:
#	packages/react-scripts/config/webpack.config.dev.js
#	packages/react-scripts/config/webpack.config.prod.js
#	packages/react-scripts/package.json
JohnNilsson referenced this pull request in JohnNilsson/create-react-app-typescript Sep 9, 2017
Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to remove any staged
yarn.lock files before they can even be committed.
kasperpeulen pushed a commit to kasperpeulen/create-react-app that referenced this pull request Sep 24, 2017
Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to remove any staged
yarn.lock files before they can even be committed.
swengorschewski referenced this pull request in swengorschewski/cra-typescript-electron Oct 16, 2017
Since yarn.lock shouldn't be added to the repo, nor excluded via
.gitignore, lets take advantage of lint-staged to remove any staged
yarn.lock files before they can even be committed.
@just-boris
Copy link
Contributor

What's going on there? Why not to just add the file into .gitignore instead of abusing pre-commit hook functionality?

@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2018

We don’t want repo developers each to get their own lockfile that would be respected by Yarn. Since then they wouldn’t get the freshest versions that match what users would get.

@luftywiranda13
Copy link
Contributor

luftywiranda13 commented Jan 13, 2018

@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2018

In any case unstaging should be unnecessary now that we:

  • only support Yarn for development
  • have .yarnrc disabling the lockfile

@jdcrensh jdcrensh deleted the git-rm-yarn-lock branch January 16, 2018 00:35
papermana pushed a commit to netguru/create-react-app that referenced this pull request Jan 21, 2018
The create-react-app repo itself should not be using yarn.lock. See e.g. facebook#2700.
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants