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

Add package-lock.json #113

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Conversation

jazhen
Copy link
Contributor

@jazhen jazhen commented Oct 30, 2022

Working on adding a GitHub Action for linting on push, pr and mostly need to add package-lock.json to enable caching node_modules for the CI/CD pipeline.

However it is recommended to commit lock files to vcs.

All supported package managers recommend that you always commit the lockfile, although implementations vary doing so generally provides the following benefits:

  • Enables faster installation for CI and production environments, due to being able to skip package resolution.
  • Describes a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
  • Provides a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.
  • Facilitates greater visibility of tree changes through readable source control diffs.

https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#working-with-lockfiles

It is highly recommended you commit the generated package lock to source control: this will allow anyone else on your team, your deployments, your CI/continuous integration, and anyone else who runs npm install in your package source to get the exact same dependency tree that you were developing on. Additionally, the diffs from these changes are human-readable and will inform you of any changes npm has made to your node_modules, so you can notice if any transitive dependencies were updated, hoisted, etc.

https://docs.npmjs.com/cli/v6/configuring-npm/package-locks#using-locked-packages

Closes #112

@jazhen jazhen self-assigned this Oct 30, 2022
@jazhen jazhen linked an issue Oct 30, 2022 that may be closed by this pull request
@zoobot
Copy link
Member

zoobot commented Oct 31, 2022

We should change install directions to npm ci so it installs w package lock versions

@jazhen
Copy link
Contributor Author

jazhen commented Oct 31, 2022

@zoobot - Sure, I can do that. The readme for this repo is a bit outdated. I can kind of mirror what wtt_front looks like now. Do you still want the Production section in the readme?

@jazhen
Copy link
Contributor Author

jazhen commented Oct 31, 2022

Actually, wtt_server is not set up well for instructions concerning only this repo. Unlike wtt_front there is not really a way atm to work only in this repo without needing wtt_db and then at that point we probably just want the user to run 80% of the fullstack instructions. I am considering just linking to our waterthetrees/waterthetrees README. Thoughts?

I changed the install directions in waterthetrees/waterthetrees#26.

@zoobot zoobot merged commit 8b5be85 into main Oct 31, 2022
@zoobot
Copy link
Member

zoobot commented Nov 1, 2022

@jazhen Linking to the waterthetrees readme sounds good. Its ok if this has its own readme but dev install should go to there at least until we have some kind of curl or postman library. It'd be worth having a curl or postman library of all the posts and gets documented at some point.

@jazhen jazhen linked an issue Nov 2, 2022 that may be closed by this pull request
2 tasks
@zoobot zoobot deleted the jazhen/feature/add-package-lock-to-vcs branch December 6, 2022 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add package-lock.json to version control Set up initial CI/CD using Github Actions
2 participants