Skip to content

Commit

Permalink
docs: document the node_context_data attribute
Browse files Browse the repository at this point in the history
It can be useful if you need to turn on/off stamping per-target.
`java_binary` gives a dedicated stamp attribute for this purpose

Fixes bazel-contrib#1693
  • Loading branch information
Alex Eagle committed Aug 31, 2020
1 parent ba4fdb8 commit 9510c2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion internal/pkg_npm/pkg_npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ PKG_NPM_ATTRS = {
"node_context_data": attr.label(
default = "@build_bazel_rules_nodejs//internal:node_context_data",
providers = [NodeContextInfo],
doc = "Internal use only",
doc = """Provides info about the build context, such as stamping.
By default it reads from the bazel command line, such as the `--stamp` argument.
Use this to override values for this target, such as enabling or disabling stamping.
You can use the `node_context_data` rule in `@build_bazel_rules_nodejs//internal/node:context.bzl`
to create a NodeContextInfo.
""",
),
"package_name": attr.string(
doc = """Optional package_name that this npm package may be imported as.""",
Expand Down
8 changes: 7 additions & 1 deletion packages/rollup/rollup_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ Either this attribute or `entry_point` must be specified, but not both.
"node_context_data": attr.label(
default = "@build_bazel_rules_nodejs//internal:node_context_data",
providers = [NodeContextInfo],
doc = "Internal use only",
doc = """Provides info about the build context, such as stamping.
By default it reads from the bazel command line, such as the `--stamp` argument.
Use this to override values for this target, such as enabling or disabling stamping.
You can use the `node_context_data` rule in `@build_bazel_rules_nodejs//internal/node:context.bzl`
to create a NodeContextInfo.
""",
),
"output_dir": attr.bool(
doc = """Whether to produce a directory output.
Expand Down

0 comments on commit 9510c2b

Please sign in to comment.