@bazel/jasmine
Advanced tools
Changelog
3.2.1 (2021-02-23)
--keep-names
(4a26898)Changelog
3.2.0 (2021-02-13)
Changelog
3.1.0 (2021-02-02)
Changelog
3.0.0 (2020-12-22)
For a full list for the breaking changes in 3.0.0 and other notes on migrating, see the Migrating to 3.0.0 wiki page.
nodejs_binary
, nodejs_test
, jasmine_node_test
& ts_library
.If you are using the node_modules
attribute, you can simply add the target specified there to the data
or deps
attribute of the rule instead.
For example,
nodejs_test(
name = "test",
data = [
"test.js",
"@npm//:node_modules",
],
entry_point = "test.js",
)
or
ts_library(
name = "lib",
srcs = glob(["*.ts"]),
tsconfig = ":tsconfig.json",
deps = ["@npm//:node_modules"],
)
We also dropped support for filegroup based node_modules target and removed node_modules_filegroup
from index.bzl
.
If you are using this feature for user-managed deps, you must now a js_library
target
with external_npm_package
set to True
instead.
For example,
js_library(
name = "node_modules",
srcs = glob(
include = [
"node_modules/**/*.js",
"node_modules/**/*.d.ts",
"node_modules/**/*.json",
"node_modules/.bin/*",
],
exclude = [
# Files under test & docs may contain file names that
# are not legal Bazel labels (e.g.,
# node_modules/ecstatic/test/public/中文/檔案.html)
"node_modules/**/test/**",
"node_modules/**/docs/**",
# Files with spaces in the name are not legal Bazel labels
"node_modules/**/* */**",
"node_modules/**/* *",
],
),
# Provide ExternalNpmPackageInfo which is used by downstream rules
# that use these npm dependencies
external_npm_package = True,
)
nodejs_test(
name = "test",
data = [
"test.js",
":node_modules",
],
entry_point = "test.js",
)
See examples/user_managed_deps
for a working example of user-managed npm dependencies.
Changelog
3.0.0-rc.1 (2020-12-18)
Changelog
3.0.0-rc.0 (2020-12-11)
templated_args = ["--bazel_patch_module_resolver"]
, see https://github.com/bazelbuild/rules_nodejs/pull/2344 as an example.
Another fix is to explicitly use our runfiles helper library, see https://github.com/bazelbuild/rules_nodejs/pull/2341 as an example.packages/karma:package.bzl
is gone, in your WORKSPACE replaceload("//packages/karma:package.bzl", "npm_bazel_karma_dependencies")
npm_bazel_karma_dependencies()
with the equivalent
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.3/rules_webtesting.tar.gz"],
)
Then in BUILD files replace
load("@npm//@bazel/karma:index.bzl", "karma_web_test_suite")
with
load("@npm//@bazel/concatjs:index.bzl", "concatjs_web_test_suite")
finally drop npm dependencies on @bazel/karma
and depend on @bazel/concatjs
instead
build_bazel_rules_typescript
to npm_bazel_typescript
and build_bazel_rules_karma
to npm_bazel_karma
in their projects