Sort file lists in artifacts.json #5474
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
scripts/prepublish.js
is (as far as I understand) meant to be run in the local working copy before publishing to npm.It
npm pack --dry-run
to get the list of files that would be publishedjscomp/artifacts.json
andThis way the person doing npm publishing can see if all expected files are there (e.g., binaries for the different platforms) and if there are any new or removed files since the last publish.
I ran the script on my Mac and got a huge amount of changes, because the files were returned in a different sort order than in the current artifacts.json.
I have therefore sorted the current artifacts.json manually (actually with a small helper script) and also changed
prepublish.js
to sort the files. Now when I runprepublish.js
again, I get an actually usable and useful diff of "current" vs. "expected".