-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RRFC] Query Installs #638
Comments
Queries work on an installed node_modules dir, i thought - it definitely seems like a reasonable addition to |
Arborist has a |
True - presumably it could also function off the ideal tree in the absence of a lockfile. |
@jamiebuilds-signal love that you see the value of the Dependency Selector Syntax/Queries & 100% +1 your understanding/hope for Love how you've framed this though & appreciate that you're able to see the value here (it may just take some time to implement). |
|
Motivation ("The Why")
1. Extending the usefulness of
npm query
With the new
npm query
command it's now possible to select subtrees of your dependencies for many different purposes, auditing, inspecting, upgrading dependencies, funding, etc.For all of these purposes, you sometimes also want the contents of these dependencies as well, even a full install. You can run a full install today, but that tends to take awhile and if you're auditing or want to do something sensitive
2. Allow users to install just the packages they need for a task
For users with sizable installs,
npm install
is one of the longest steps in their CI process. And oftentimes its not worthwhile to parallelize running separate npm scripts across CI nodes, simply because npm install takes much longer than the script itself.If you could run:
And get the subtree of your dependencies queried, it would be much faster than trying to run a full
npm install/ci
and splitting tasks across ci nodes would be much more impactful.Other tools could be written around
npm install --query
to make this more powerful by generating queries for you.3. "Explain" existing features like
--production
Features like
--production
could be implemented via queries, it could be called an alias.4. Avoid building one-off features in installs
By giving users a powerful querying syntax in installs, many feature requests related to installs could point to this instead.
Example
How
Current Behaviour
N/A, only options are
npm install [--production]
Desired Behaviour
npm install --query <query>
<query>
npm install
's other behaviors otherwiseReferences
Related to #360, #592
The text was updated successfully, but these errors were encountered: