-
Notifications
You must be signed in to change notification settings - Fork 238
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] Add support to plugin dependencies. #225
Comments
Global things are not and should not be requireable. If you need something in a project, why wouldn't you want it installed locally, in that project? |
@ljharb not a global dependency, a global-style dependency.
|
Hi @mshima I do wonder what is the main motivation behind the proposal, I'm trying to follow along with the example and can't really figure out the concept:
|
Hi @ruyadorno. Probably yo isn’t the best example since it’s supposed to run globally.
The main reason for this feature request is to allow to install an optional dependency (blueprints, which are yeoman generators) locally in current node_modules without breaking the running application (jhipster). |
ok, so the actual problem is that |
@ruyadorno yes, that's the main reason. |
A little more background about Yeoman. Lookup (resolver)It looks for generators everywhere (npm/yarn paths, local/global, and sub-packages probably to workaround missing peer dependency). Caching a generator (store)It implements it's own generator cache. Running a generatorYo command runs the root generator Composing with another generator
Running a missing generator:
Running a missing generator with plugin feature:Plugin feature is experimental because it does too much that npm 7 makes unnecessary.
NPXnpx installs yo and yo install generator-license, you can see both install process when executing this command:
Plugin using NPX implementationIt should be a lib (preferably) that installs modules like npx.
I don't know specifics of how it's installed and how yeoman would load it. |
Action item from the OpenRFC call:
|
@ruyadorno looks great thanks. |
Motivation ("The Why")
Add support to plugin dependencies.
More specific title would be: add support to optional (not installed by default) global-style dependencies.
This would allow a running application installed at current (node_modules) to install an optional dependency and load it.
npm ci
, and forced bynpm ci --with-plugins
.Example
Using a real yeoman project generation:
npx yo node
is using a generator callednode
that is provided bygenerator-node
package.--experimental
flag uses an auto install feature that installsgenerator-node
inside a hidden global-style node_modules.yo
loads it and executes.yo
is running so if we mutate current node_modules, it will break.node
generator can install another generator, so if we mutate the hidden node_modules will breaknode
generator.This hidden global-style node_modules is a workaround, I want to get rid of it.
A implementation would be to add
dependenciesMeta
likepeerDependenciesMeta
:How
Current Behaviour
Desired Behaviour
References
The text was updated successfully, but these errors were encountered: