Comments (4)
Both of these suggestions make a lot of sense to me, so thanks! 👍 I think I can do it this weekend or leave it to you if you'd rather do it.
I'd also appreciate investigating similar sane defaults for other supported package managers if you decide you wanna do it.
from yarnhook.
npm:
--prefer-offline
(https://blog.npmjs.org/post/161081169345/v500)
A new --prefer-offline option will make npm skip any conditional requests (304 checks) for stale cache data, and only hit the network if something is missing from the cache.
--no-audit
maybe ? https://docs.npmjs.com/cli/install
The --no-audit argument can be used to disable sending of audit reports to the configured registries. See npm-audit for details on what is sent.
There is no option for read-only the package-lock.json, except npm ci
but not something I would use here
from yarnhook.
pnpm:
--prefer-offline
https://pnpm.js.org/docs/en/pnpm-install.html#prefer-offline
If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.
--frozen-shrinkwrap
If true, pnpm doesn't generate a shrinkwrap file and fails if an update is needed.
--prefer-frozen-shrinkwrap
When true and the available shrinkwrap.yaml satisfies the package.json then a headless installation is performed. A headless installation is faster than a regular one because it skips dependencies resolution and peers resolution.
Unfortunately, there is no equivalent to pure-lockfile
: either it fails (which I think is not a good thing for a hook) or it can be updated with prefer-frozen-shrinkwrap
. I think prefer-frozen-shrinkwrap
is better here ?
from yarnhook.
I think these options make more sense than the alternatives, and I agree that the package managers should offer more options. It may make sense to open issues to address these problems.
from yarnhook.
Related Issues (20)
- Switching from a branch where yarnhook is installed to one where it isn't results in detached head HOT 1
- Support monorepos HOT 7
- Support just messaging, no install HOT 1
- Rename project (lockfilehook?) HOT 7
- Handle shrinkwrap
- Use `npm ci` instead of `npm i` if it's supported HOT 1
- Adoption
- Switching from a branch and yarnhook fails result in detached head
- Support appending additional arguments HOT 5
- Support sourcing environment variables from `.env` files HOT 1
- Handle other languages package managers HOT 5
- git error when running yarnhook HOT 1
- Create mrm task
- yarnhook: command not found error HOT 4
- Consider dropping execa HOT 2
- Yarn 2 (berry) support HOT 13
- Consider using `preferred-pm` HOT 1
- pnpm v7 support HOT 6
- Add `bun` support
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 yarnhook.