Skip to content

Commit

Permalink
Update docs for release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Sep 13, 2018
1 parent 4554a9f commit e4eae5a
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 20 deletions.
126 changes: 124 additions & 2 deletions docs/node/node.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,70 @@ <h3 id="nodejs_binary_args">Attributes</h3>
<tr id="nodejs_binary.node_modules">
<td><code>node_modules</code></td>
<td>
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @//:node_modules</code></p>
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional</code></p>
<p>The npm packages which should be available to <code>require()</code> during
execution.</p>
<pre><code> This attribute is DEPRECATED. As of version 0.13.0 the recommended approach
to npm dependencies is to use fine grained npm dependencies which are setup
with the `yarn_install` or `npm_install` rules. For example, in targets
that used a `//:node_modules` filegroup,

```
nodejs_binary(
name = "my_binary",
...
node_modules = "//:node_modules",
)
```

which specifies all files within the `//:node_modules` filegroup
to be inputs to the `my_binary`. Using fine grained npm dependencies,
`my_binary` is defined with only the npm dependencies that are
needed:

```
nodejs_binary(
name = "my_binary",
...
data = [
"@npm//:foo",
"@npm//:bar",
...
],
)
```

In this case, only the `foo` and `bar` npm packages and their
transitive deps are includes as inputs to the `my_binary` target
which reduces the time required to setup the runfiles for this
target (see https://github.com/bazelbuild/bazel/issues/5153).

The @npm external repository and the fine grained npm package
targets are setup using the `yarn_install` or `npm_install` rule
in your WORKSPACE file:

yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)

For other rules such as `jasmine_node_test`, fine grained
npm dependencies are specified in the `deps` attribute:

```
jasmine_node_test(
name = "my_test",
...
deps = [
"@npm//:jasmine",
"@npm//:foo",
"@npm//:bar",
...
],
)
```
</code></pre>
</td>
</tr>
<tr id="nodejs_binary.templated_args">
Expand Down Expand Up @@ -427,9 +488,70 @@ <h3 id="nodejs_test_args">Attributes</h3>
<tr id="nodejs_test.node_modules">
<td><code>node_modules</code></td>
<td>
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @//:node_modules</code></p>
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional</code></p>
<p>The npm packages which should be available to <code>require()</code> during
execution.</p>
<pre><code> This attribute is DEPRECATED. As of version 0.13.0 the recommended approach
to npm dependencies is to use fine grained npm dependencies which are setup
with the `yarn_install` or `npm_install` rules. For example, in targets
that used a `//:node_modules` filegroup,

```
nodejs_binary(
name = "my_binary",
...
node_modules = "//:node_modules",
)
```

which specifies all files within the `//:node_modules` filegroup
to be inputs to the `my_binary`. Using fine grained npm dependencies,
`my_binary` is defined with only the npm dependencies that are
needed:

```
nodejs_binary(
name = "my_binary",
...
data = [
"@npm//:foo",
"@npm//:bar",
...
],
)
```

In this case, only the `foo` and `bar` npm packages and their
transitive deps are includes as inputs to the `my_binary` target
which reduces the time required to setup the runfiles for this
target (see https://github.com/bazelbuild/bazel/issues/5153).

The @npm external repository and the fine grained npm package
targets are setup using the `yarn_install` or `npm_install` rule
in your WORKSPACE file:

yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)

For other rules such as `jasmine_node_test`, fine grained
npm dependencies are specified in the `deps` attribute:

```
jasmine_node_test(
name = "my_test",
...
deps = [
"@npm//:jasmine",
"@npm//:foo",
"@npm//:bar",
...
],
)
```
</code></pre>
</td>
</tr>
<tr id="nodejs_test.templated_args">
Expand Down
40 changes: 22 additions & 18 deletions docs/npm_install/npm_install.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ <h2 id="overview">Overview</h2>

<h2 id="npm_install">npm_install</h2>

<pre>npm_install(<a href="#npm_install.name">name</a>, <a href="#npm_install.data">data</a>, <a href="#npm_install.node_modules_filegroup">node_modules_filegroup</a>, <a href="#npm_install.package_json">package_json</a>, <a href="#npm_install.package_lock_json">package_lock_json</a>, <a href="#npm_install.prod_only">prod_only</a>)</pre>
<pre>npm_install(<a href="#npm_install.name">name</a>, <a href="#npm_install.data">data</a>, <a href="#npm_install.manual_build_file_contents">manual_build_file_contents</a>, <a href="#npm_install.package_json">package_json</a>, <a href="#npm_install.package_lock_json">package_lock_json</a>, <a href="#npm_install.prod_only">prod_only</a>)</pre>

<p>Runs npm install during workspace setup.</p>

Expand All @@ -159,16 +159,18 @@ <h3 id="npm_install_args">Attributes</h3>

</td>
</tr>
<tr id="npm_install.node_modules_filegroup">
<td><code>node_modules_filegroup</code></td>
<tr id="npm_install.manual_build_file_contents">
<td><code>manual_build_file_contents</code></td>
<td>
<p><code>String; Optional; Default is ''</code></p>
<p>Experimental attribute that can be used to work-around
a bazel performance issue if the default node_modules filegroup
has too many files in it. Use it to define the node_modules
filegroup used by this rule such as
"filegroup(name = "node_modules", srcs = glob([...]))". See
<a href="https://github.com/bazelbuild/bazel/issues/5153">https://github.com/bazelbuild/bazel/issues/5153</a>.</p>
<p>Experimental attribute that can be used to override
the generated BUILD.bazel file and set its contents manually.
Can be used to work-around a bazel performance issue if the
default node_modules filegroup has too many files in it. See
<a href="https://github.com/bazelbuild/bazel/issues/5153">https://github.com/bazelbuild/bazel/issues/5153</a>. If
you are running into performance issues due to a large
node_modules filegroup it is recommended to switch to using
fine grained npm dependencies.</p>
</td>
</tr>
<tr id="npm_install.package_json">
Expand Down Expand Up @@ -198,7 +200,7 @@ <h3 id="npm_install_args">Attributes</h3>

<h2 id="yarn_install">yarn_install</h2>

<pre>yarn_install(<a href="#yarn_install.name">name</a>, <a href="#yarn_install.data">data</a>, <a href="#yarn_install.node_modules_filegroup">node_modules_filegroup</a>, <a href="#yarn_install.package_json">package_json</a>, <a href="#yarn_install.prod_only">prod_only</a>, <a href="#yarn_install.yarn_lock">yarn_lock</a>)</pre>
<pre>yarn_install(<a href="#yarn_install.name">name</a>, <a href="#yarn_install.data">data</a>, <a href="#yarn_install.manual_build_file_contents">manual_build_file_contents</a>, <a href="#yarn_install.package_json">package_json</a>, <a href="#yarn_install.prod_only">prod_only</a>, <a href="#yarn_install.yarn_lock">yarn_lock</a>)</pre>

<p>Runs yarn install during workspace setup.</p>

Expand All @@ -225,16 +227,18 @@ <h3 id="yarn_install_args">Attributes</h3>

</td>
</tr>
<tr id="yarn_install.node_modules_filegroup">
<td><code>node_modules_filegroup</code></td>
<tr id="yarn_install.manual_build_file_contents">
<td><code>manual_build_file_contents</code></td>
<td>
<p><code>String; Optional; Default is ''</code></p>
<p>Experimental attribute that can be used to work-around
a bazel performance issue if the default node_modules filegroup
has too many files in it. Use it to define the node_modules
filegroup used by this rule such as
"filegroup(name = "node_modules", srcs = glob([...]))". See
<a href="https://github.com/bazelbuild/bazel/issues/5153">https://github.com/bazelbuild/bazel/issues/5153</a>.</p>
<p>Experimental attribute that can be used to override
the generated BUILD.bazel file and set its contents manually.
Can be used to work-around a bazel performance issue if the
default node_modules filegroup has too many files in it. See
<a href="https://github.com/bazelbuild/bazel/issues/5153">https://github.com/bazelbuild/bazel/issues/5153</a>. If
you are running into performance issues due to a large
node_modules filegroup it is recommended to switch to using
fine grained npm dependencies.</p>
</td>
</tr>
<tr id="yarn_install.package_json">
Expand Down

0 comments on commit e4eae5a

Please sign in to comment.