Repository navigation
feat: option to skip npm-shrinkwrap.json generation - #2294
Conversation
4912b02 to
536bae7
Compare
536bae7 to
6035605
Compare
|
It also occurs to me I could probably have left the |
98cfbc4 to
3537c8b
Compare
Gankra
left a comment
There was a problem hiding this comment.
The feature itself makes sense, I'm a bit perplexed by the random other changes.
| - name: Copy package.json to npm installer folder | ||
| working-directory: cargo-dist/templates/installer/npm | ||
| run: | | ||
| cp ../package.json . | ||
| cp ../npm-shrinkwrap.json . |
There was a problem hiding this comment.
Sorry, should have explained this properly. I moved these out of the template directory with the rest of the files so we can write these two files individually, which simplified the choice of whether to skip npm-shrinkwrap.json. However, for the lint CI step to work, they need to be in the same directory as the contents of the module.
There was a problem hiding this comment.
Added a comment above this to explain why.
| let package_json_path = Utf8Path::new(PACKAGE_JSON); | ||
| let orig_package_json = | ||
| templates.render_file_to_clean_string(TEMPLATE_INSTALLER_NPM_PACKAGE_JSON, &info)?; | ||
|
|
||
| // Now mangle the package.json with data we want | ||
| let orig_package_json = files | ||
| .remove(package_json_path) | ||
| .expect("npm template didn't have package.json!?"); |
There was a problem hiding this comment.
Previously, the package.json and npm-shrinkwrap were in a template directory that was written in a single batch. Since I moved them out of that directory, they need to be written individually.
3537c8b to
00772ae
Compare
00772ae to
3c3a1b1
Compare
We've had a request to provide an option to disable
npm-shrinkwrap.jsonfor generated packages due to the ongoing churn of dependency versions. I've chosen to keep the current default, which disables it; the option can be used to flip it off. I've updated one of our tests to disable it in order to confirm that it's working.cc @stewartadam
Fixes #2286.
Closes #2293.