Releases: bazel-contrib/rules_nodejs
0.31.1
- Compatibility changes for future Bazel 0.27.0 release
jasmine_node_test
macro now passestemplated_args
through tonodejs_test
BREAKING CHANGES:
-
@bazel/typescript
restricted an API return type which breaksngc-wrapped
like so:TypeError: digests.entries(...) is not a function or its return value is not iterable
Update to@angular/[email protected]
to pick up the fix (when Angular 8.0.1 is released, the fix will be there too) -
-preserve-symlinks-main
flag is now set along with--preserve-symlinks
flag when node version is 10.2.0 or greater. If using avendored_node
version older than 10.2.0, you must specify thenode_version
you are using so that this flag is not set. Setting the flag on an older version of node will lead to an error. -
The
entry_point
attribute ofnodejs_binary
,nodejs_test
androllup_bundle
has been changed to a label from a string.
Updating your BUILD files should be trivial in most cases.
For example:
nodejs_binary(
name = "example",
entry_point = "workspace_name/src/main.js",
...
)
would become either,
nodejs_binary(
name = "example",
entry_point = ":main.js",
...
)
or
nodejs_binary(
name = "example",
entry_point = "//src:main.js",
...
)
if using relative or absolute label syntax respectively.
If the entry_point
was referencing a .js
file that is the output of a ts_library rule then you now must point the entry_point
to the corresponding .ts
and the affected rules will use the corresponding .js
output.
For example:
ts_library(
name = "main",
srcs = ["main.ts"],
)
nodejs_binary(
name = "bin",
data = [":main"],
entry_point = "my_workspace/some_module/main.js",
)
becomes,
ts_library(
name = "main",
srcs = ["main.ts"],
)
nodejs_binary(
name = "bin",
data = [":main"],
entry_point = "//my_workspace/some_module:main.ts",
)
For more information and examples see https://bazelbuild.github.io/rules_nodejs/node/node.html#nodejs_binary.entry_point and https://bazelbuild.github.io/rules_nodejs/rollup/rollup_bundle.html#rollup_bundle.entry_point.
0.30.2
New @bazel/create
package simplifies the quickstart experience.
Just yarn create @bazel
or npm init @bazel
to create a Bazel + JavaScript workspace.
Other changes
- We now mirror the
@bazel/buildozer
package. This is a program and Go library for machine-editing BUILD.bazel files, and we plan to use it to automate migrations when we make breaking changes in the future. - Fixed an
npm_install
crash where Bazel reports a target cycle, looks likeEXPAND_TEST_SUITES com.google.devtools.build.lib.pkgcache.TestFilter@e17a1
- `@bazel/karma: fix static_files overwrite files specified in dependencies
@bazel/bazel
no longer warns about running from a global install
0.30.1
0.30.0
BREAKING CHANGES:
-
We depend on Bazel 0.26 which has a new "managed directories" feature. This was added specifically to improve the integration with external package managers npm and yarn.
-
we now use the same node_modules directory under Bazel as your package manager does when run locally.
See https://github.com/bazelbuild/rules_nodejs/wiki#migrating-to-rules_nodejs-030 for migration instructions. -
yarn_install
&npm_install
attributeexcluded_packages
is now deprecated. Now that yarn_install and npm_install use node_modules in the user's folder by default, this attribute is no longer useful since large packages such as@bazel/bazel
will no longer be installed twice. -
yarn_install
&npm_install
attributedata
is no longer needed, unless you'vesymlink_node_modules = False
. This is because Bazel runs the package manager in your project directory so all files are available without explicit declaration. -
npm_install#package_lock_json
attribute is now mandatory
0.29.2
0.29.1
0.29.0
BREAKING CHANGES
ts_library
strict dependencies now apply to libraries from npm.
You can use deps=["@npm//:node_modules"]
to depend on all node_modules, but this has performance implications.
We suggest adding missing dependencies individually to the deps
of the ts_library
, following guidance from the compile errors.
Changes
New check_bazel_version_range
function to ensure your team uses the Bazel version you require
We automatically generate a named UMD bundle at @npm//node_modules/package:package.umd.js
so that the concatjs bundler can work with third-party libraries.
ts_library
now automatically gathers typings from npm packages in the deps
.
web_package
- Support the same root paths as
ts_devserver
, fix for #728
rollup_bundle
- now includes the json plugin
- bugfix for downleveling
0.28.0
BREAKING CHANGES
npm_package
now throws for any files insrcs
which do not reside in the same package as the target. These files should be in thedeps
instead. (Note that in previous releases, we didn't permit these files in deps.)
Features
rollup_bundle
: new output_group lets you select .js and .js.map files together for different output flavors, thanks @jbedardrollup_bundle
: UMD bundles can now be requested es5 and es5 minified, thanks @jbedard
Fixes
- don't depend on Windows PowerShell, fixes angular/angular#29760
- fixes for karma: get right dependency versions, use the same version of karma-jasmine as Angular CLI
- add missing progress_messages, fixes #705
- add LICENSE files for @bazel/bazel mirrored packages
- don't create
nodejs_binary
targets when the package.jsonbin
entry is empty, fixes #692 - thanks @manekinekko - external source maps on Windows, thanks @devversion
jasmine_node_test
uses native test wrapper on windows, thanks @laszlocsomor
0.27.12
Fixed an issue with transitive node_modules not being available to the rollup_bundle
rule. Such deps don't need to be repeated now.
Introduced new package http://npmjs.com/package/@bazel/labs - this contains more experimental features that might be breaking or even removed in the future.
This contains the start of a webpack_bundle
rule.
0.27.10
- add a special case when Angular Package Format packages are found in node_modules, generating a special BUILD file for them so that devmode scripts flow to downstream targets
- you can now access the devmode manifest output of a
ts_devserver
, useful for plumbing through to your own server - packages can now publish a
bazelBin
key in their package.json, indicating additional attributes to put on the generatednodejs_binary