forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a node_scope option to node_module targets to support package-sco…
…pes (pantsbuild#6616) This is the implementation of pantsbuild#6540. ### Problem Pants source-level dependencies for Node.js targets does not support [node-scopes](https://docs.npmjs.com/misc/scope). ### Solution Add a `node_scope` config to `node_module` targets and a repo-level `node_scope` to `node-distribution`. ### Result The repo-owner may specify a target-level and/or global node-scope that will resolve all Node.js source-level dependencies under the correct node-scope rules. For example, if you have a target dependency on **src/node/pants/custom/web-package:web-package** with a package name of `web-package`, the installed path under the `node_modules` directory would be `*/node_modules/web-package`. If a node_scope=pants is defined for `src/node/pants/custom/web-package:web-package`. Then the installed directory would be `*/node_modules/@pants/web-package`. Target-level `node_scope` overrides repo-level `node_scope`. ### Defining scope in package.json When dep inference is ready, a potential update to this implementation is to be able to infer the node_scope from the name defined in package.json.
- Loading branch information
1 parent
aa656d6
commit 31f4000
Showing
4 changed files
with
281 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.