Skip to content

Conversation

BryceStevenWilley
Copy link
Collaborator

@BryceStevenWilley BryceStevenWilley commented Apr 14, 2023

Ran npm shrinkwrap, which renamed my local package-lock.json to npm-shrinkwrap.json. Should work, will have to test publish to npm though.

Resolves #614 and resolves #532

Ran `npm shrinkwrap`, which renamed my local package-lock.json
to npm-shrinkwrap.json. Should work, will have to test publish
to npm though.
Copy link
Collaborator

@plocket plocket left a comment

Choose a reason for hiding this comment

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

This is awesome! Does it also close #594? For some reason I can't seem to link 614 to close it, and 532 is a discussion. We'll have to do those manually. I'd also like to document the workflow for updating (and not updating) with shrinkwrap.

@plocket
Copy link
Collaborator

plocket commented Apr 15, 2023

Shall we add an entry to the changelog for this? It'll be getting its own release.

@BryceStevenWilley
Copy link
Collaborator Author

BryceStevenWilley commented Apr 16, 2023

I can update the changelog and document usage!

Does it also close #594?

#624 should have closed that, but since we're working on the v5 branch, and v4 is still marked as the default branch, Github doesn't close things when merged. I'll close that one now.

532 is a discussion

that discussion's purpose was to decide on a mechanism to freeze dependencies, and this PR implements the one we decided on.

It'll be getting its own release

We haven't actually released v5 yet, have we? This one is v5 only too, it won't work with v4.

@plocket
Copy link
Collaborator

plocket commented Apr 19, 2023

We haven't actually released v5 yet, have we? This one isna v5 only too, it won't work with v4.

True, but I plan to make a new pre-release with this.

Now that we've ran `npm shrinkwrap`, the only thing we need to do going
forward is run `npm install`.
@BryceStevenWilley
Copy link
Collaborator Author

Added to the CHANGELOG and CONTRIBUTING!

@plocket
Copy link
Collaborator

plocket commented Apr 19, 2023

Love the new docs! Instead of the ### Added section, should this be in a ### Security section?

I feel like we've covered these before, but I just can't locate the info - if someone just does npm install without changing the package.json, the shrinkwrap will stay the same? Secondly, do we have to edit the package.json? Can we no longer install using npm install --save some-package?

@BryceStevenWilley
Copy link
Collaborator Author

Instead of the ### Added section, should this be in a ### Security section

Happy to put it there, but my understanding was that Security was for things that are specific security fixes (i.e. we found this vulnerability and patched it, etc). This change is related to Security, and it's always good to update, but there's not the urgency of fixing a patch; we can't point to a specific library and say "this had a security flaw in it, this change avoids that", right?

if someone just does npm install without changing the package.json, the shrinkwrap will stay the same?

That's my experience with it. Just to test it, I checked on a different machine, checked out this branch and ran npm install, and nothing in npm-shrinkwrap.json changed. Not sure all the other corner cases to test, but we will stall have control over all of the changes of npm-shrinkwrap.json going into main.

Secondly, do we have to edit the package.json? Can we no longer install using npm install --save some-package?

I wanted to have one simple instruction for adding dependencies that didn't have any ambiguity, so I only documented that one. Extra benefit that the version in the package.json will more explicit and under our control, and not the default semver range operator like --save does apparently.

There are still a ton of ways to change package.json that were confusing to me, like npm rm, npm update, --save, --save-exact, --save-prod, and I couldn't tell what the difference was between each, so I just stuck with the simplest one. Those other steps probably still work fine; you can do whatever, and if you didn't expect to change npm-shrinkwrap.json, but it shows up in the PR diff (or vice versa), then you can always revert just that file. (I was looking at the npm install params that didn't have --save, only realized now that it was an older version of the docs, I thought it was a newer version).

@plocket
Copy link
Collaborator

plocket commented Apr 20, 2023

This change is related to Security, and it's always good to update, but there's not the urgency of fixing a patch

Makes sense to me! All the rest are great answers too, thanks and looks great! If I could approve again, I would 🚀

@BryceStevenWilley BryceStevenWilley merged commit 700e360 into v5 Apr 20, 2023
@BryceStevenWilley BryceStevenWilley deleted the shrinkwrap branch April 20, 2023 03:01
plocket pushed a commit that referenced this pull request Jun 15, 2023
* Adds npm-shrinkwrap.json file

Ran `npm shrinkwrap`, which renamed my local package-lock.json
to npm-shrinkwrap.json. Should work, will have to test publish
to npm though.

* Add shrinkwrap to CHANGELOG.md and CONTRIBUTING.md

Now that we've ran `npm shrinkwrap`, the only thing we need to do going
forward is run `npm install`.
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.

Security: Freeze both our and the dev's package with package-lock.json
2 participants