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

Detect if a package-lock.json is present, and error out blocking everything if true #69

Open
caesarsol opened this issue May 19, 2020 · 5 comments

Comments

@caesarsol
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Sometimes for developers overlook, an npm command gets run in the repo and a package-lock.json gets created even if a yarn.lock is already present.
This creates problems in Netlify and other auto-deploy platforma, because they choose the tool depending on which files they find.

Describe the solution you'd like

Any accurapp command (start / build / lint) could check: if package-lock.json AND yarn.lock are present, block everything and alert with a big red flashy warning.
Solution for the user: delete one of the two files (preferably the NPM one)

Thoughts?

@marcofugaro
Copy link
Contributor

What about simply adding package-lock.json to the .gitignore?

@caesarsol
Copy link
Contributor Author

caesarsol commented May 19, 2020

That would make it behave strangely only on developers machines...
And I fear anyone would think "this is wrong!" and remove the line from the gitignore!

@marcofugaro
Copy link
Contributor

You're right @caesarsol

Should the big red message block the execution of the script in your opinion? Or just be a message like the "upgrade accurapp" one?

I think it's safe to tell the user to just use yarn. I've already put the yarn command in the start one because people would forget to reinstall the new dependencies when pulling updates your teammates did:

start: 'yarn && accurapp-scripts start',

@caesarsol
Copy link
Contributor Author

I'd say ZERO TOLERANCE, because noone really reads the alert messages.

@caesarsol
Copy link
Contributor Author

caesarsol commented May 22, 2020

We could also simply update that script to something similar to:

start: '[[ ! -f package-lock.json ]] && yarn && accurapp-scripts start', 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants