Comments (3)
temporarily published own package without npm-shinkwrap.json file: https://www.npmjs.com/package/@web-bee-ru/branch-name-lint
from branch-name-lint.
I don't think the idea of having an npm-shrinkwrap.json
file is wrong.
When you publish a package whose purpose is to run as a tool, you want to make sure that all runtime dependencies (and their dependencies) are those you tested with. You cannot control transitive dependencies without this npm-shrinkwrap.json
.
The problem is this file contains both runtime and dev dependencies.
I had to deal with a similar issue in my project, and the solution was this:
- Commit the
package-lock.json
file and not thenpm-shrinkwrap.json
- In your pipeline, after you run tests and build the project and before you pack your package, run a script that:
- Removes dev dependencies
- Deletes
package-lock.json
file* - Creates
npm-shrinkwrap.json
file
Something like this:
npm prune --production && del package-lock.json && npm shrinkwrap
* The reason to delete the package-lock.json
file is that npm prune --production
only deletes files from the node_modules
folder and does not update the package-lock.json
file, and the npm shrinkwrap
only rename the package-lock.json
to npm-shrinkwrap.json
if it exists. When package-lock.json
does not exist, the npm-shrinkwrap.json
file is created from the existing dependencies tree (which represent the committed package-lock.json
file, without the dev dependencies)
from branch-name-lint.
@barzik
I can open a PR with the above change, but let me know if the solution is accepted
from branch-name-lint.
Related Issues (15)
- support for regex HOT 1
- Move Master to Main
- Not able to use uppercase prefixes HOT 1
- Seperator HOT 1
- Typo in description of latest release HOT 1
- Support for case insensitivity in regex HOT 1
- Remove eslint disable lines
- Move from commonJS module to ESM
- [Security] Fix vulnerability issue
- Add MD template for PR
- this tool needs better output message
- Github actions compatibility HOT 1
- Allow an arbitrary branch pattern generated by a tool
- Config file as JS instead of JSON
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from branch-name-lint.