22
33# Installation
44
5- load ` rules_node ` in your ` WORKSPACE ` and load main repository
6- dependencies:
5+ Put ` rules_node ` in your ` WORKSPACE ` and load the main repository
6+ dependencies. This will download the nodejs toolchain including
7+ ` node ` and ` npm ` .
78
89``` python
910git_repository(
@@ -14,13 +15,13 @@ git_repository(
1415
1516load(" @org_pubref_rules_node//node:rules.bzl" , " node_repositories" )
1617
17- node_repositories() # installs node toolchain incl. 'node' and 'npm'
18+ node_repositories()
1819```
1920
2021# Rules
2122
2223| Rule | Description |
23- | :--- | ---: | :---------- |
24+ | ---: | :---------- |
2425| [ node_repositories] ( #node_repositories ) | Install node toolchain. |
2526| [ npm_library] ( #npm_library ) | Declare an npm dependency. |
2627| [ node_binary] ( #node_binary ) | Build or execute a nodejs script. |
@@ -49,11 +50,11 @@ node_binary(
4950)
5051```
5152
52- ## node _ \repositories
53+ ## node_repositories
5354
5455WORKSPACE rule. No current options.
5556
56- ## npm _ \library
57+ ## npm_library
5758
5859BUILD rule. Declares a set of npm dependencies. Functionally
5960equivalent to ` npm install --global ` (global being relative to the npm
@@ -66,7 +67,14 @@ Takes two forms:
66671 . ** Multiple import** : uses a string_dict declaring the
6768 ` name@version ` dependency. (see ` react-stack ` above).
6869
69- ## node _ \binary
70+ ## node_binary
7071
7172BUILD rule. Create an executable script that will run the file named
7273in the ` main_script ` attribute.
74+
75+
76+ > ** WARNING** : these rules are not hermetic or secure! It trusts that
77+ > the ` npm install ` command does what is it supposed to do. There is
78+ > no current support for valdating that a particular npm package(s)
79+ > matches a sha256 (this is the the norm for npm, but it is
80+ > sub-standard for bazel).
0 commit comments