Skip to content

Latest commit

 

History

History
106 lines (62 loc) · 5.09 KB

link_js_package.md

File metadata and controls

106 lines (62 loc) · 5.09 KB

link_js_package rule

link_js_package_direct

link_js_package_direct(name, src)

Defines a node package that is linked into a node_modules tree as a direct dependency.

This is used in co-ordination with link_js_package that links into the virtual store in with a pnpm style symlinked node_modules output tree.

The term "package" is defined at https://nodejs.org/docs/latest-v16.x/api/packages.html

See https://pnpm.io/symlinked-node-modules-structure for more information on the symlinked node_modules structure. Npm may also support a symlinked node_modules structure called "Isolated mode" in the future: https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
src The link_js_package target to link as a direct dependency. Label required

link_js_package_store

link_js_package_store(name, deps, package, src, version)

Defines a node package that is linked into a node_modules tree.

The node package is linked with a pnpm style symlinked node_modules output tree.

The term "package" is defined at https://nodejs.org/docs/latest-v16.x/api/packages.html

See https://pnpm.io/symlinked-node-modules-structure for more information on the symlinked node_modules structure. Npm may also support a symlinked node_modules structure called "Isolated mode" in the future: https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
deps Other node packages this one depends on.

This should include all modules the program may need at runtime.

> In typical usage, a node.js program sometimes requires modules which were > never declared as dependencies. > This pattern is typically used when the program has conditional behavior > that is enabled when the module is found (like a plugin) but the program > also runs without the dependency. > > This is possible because node.js doesn't enforce the dependencies are sound. > All files under node_modules are available to any program. > In contrast, Bazel makes it possible to make builds hermetic, which means that > all dependencies of a program must be declared when running in Bazel's sandbox.
List of labels optional []
package The package name to link to.

If unset, the package name in the JsPackageInfo src must be set. If set, takes precendance over the package name in the JsPackageInfo src.
String optional ""
src A js_package target or or any other target that provides a JsPackageInfo. Label required
version The package version being linked.

If unset, the package name in the JsPackageInfo src must be set. If set, takes precendance over the package name in the JsPackageInfo src.
String optional ""

link_js_package_direct_lib.implementation

link_js_package_direct_lib.implementation(ctx)

PARAMETERS

Name Description Default Value
ctx

-

none

link_js_package_store_lib.implementation

link_js_package_store_lib.implementation(ctx)

PARAMETERS

Name Description Default Value
ctx

-

none