diff --git a/BUILD.bazel b/BUILD.bazel index 7ef857b8..d52ad791 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -41,8 +41,8 @@ gazelle( js_library( name = "protobufjs_bootstrap_scripts", srcs = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/long/dist/long.js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/protobufjs/dist/minimal/protobuf.min.js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/long:dist/long.js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/protobufjs:dist/minimal/protobuf.min.js", ], # Make devmode loading work when it does require("protobufjs/minimal") # so this is shimmed to define it to equal global.protobuf @@ -56,15 +56,15 @@ js_library( load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") # A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in -# ts_library that depends on @npm//:@bazel/typescript instead of the +# ts_library that depends on @npm//@bazel/typescript instead of the # output of the //internal/tsc_wrapped ts_library rule. This -# default is for downstream users that depend on the @bazel/karma npm -# package. The generated @npm//:@bazel/typescript/tsc_wrapped target +# default is for downstream users that depend on the @bazel/typescript npm +# package. The generated @npm//@bazel/typescript/bin:tsc_wrapped target # does not work because it does not have the node `--expose-gc` flag # set which is required to support the call to `global.gc()`. nodejs_binary( name = "@bazel/typescript/tsc_wrapped", - data = ["@npm//:@bazel/typescript"], + data = ["@npm//@bazel/typescript"], entry_point = "@bazel/typescript/tsc_wrapped/tsc_wrapped.js", install_source_map_support = False, templated_args = ["--node_options=--expose-gc"], diff --git a/README.md b/README.md index 9ab648cb..e9878f91 100644 --- a/README.md +++ b/README.md @@ -183,15 +183,15 @@ ts_library( name = "my_code", srcs = glob(["*.ts"]), deps = [ - "@npm//:@types/node", - "@npm//:@types/foo", - "@npm//:foo", + "@npm//@types/node", + "@npm//@types/foo", + "@npm//foo", "//path/to/other:library", ], ) ``` -You can also you the `@npm//:@types` target which will include all +You can also you the `@npm//@types` target which will include all packages in the `@types` scope as dependencies. If you are using self-managed npm dependencies, you can use the diff --git a/WORKSPACE b/WORKSPACE index e80d8904..457079bd 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -42,21 +42,15 @@ yarn_install( # Install a hermetic version of node. node_repositories(preserve_symlinks = True) +# Note: We depend on @bazel/typescript in package.json +# so that the target @npm//@bazel/typescript is defined +# as it is referenced in /BUILD.bazel for use downstream. +# This target and package is not used locally so +# the version of this depedency does not matter. yarn_install( name = "npm", package_json = "//:package.json", yarn_lock = "//:yarn.lock", - manual_build_file_contents = """ -filegroup( - name = "@bazel/typescript", - srcs = [], -) - -filegroup( - name = "@bazel/karma", - srcs = [], -) -""", ) load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") diff --git a/docs/api/build_defs.html b/docs/api/build_defs.html index 4d0f181e..048c2aec 100644 --- a/docs/api/build_defs.html +++ b/docs/api/build_defs.html @@ -239,7 +239,7 @@

Attributes

Sets a different TypeScript compiler binary to use for this library. For example, we use the vanilla TypeScript tsc.js for bootstrapping, and Angular compilations can replace this with ngc.

-
        The default ts_library compiler depends on the `@npm//:@bazel/typescript`
+
        The default ts_library compiler depends on the `@npm//@bazel/typescript`
         target which is setup for projects that use bazel managed npm deps that
         fetch the @bazel/typescript npm package. It is recommended that you use
         the workspace name `@npm` for bazel managed deps so the default
@@ -258,15 +258,15 @@ 

Attributes

node_modules -

Label; Optional; Default is @npm//:typescript__typings

+

Label; Optional; Default is @npm//typescript:typescript__typings

The npm packages which should be available during the compile.

-
        The default value is `@npm//:typescript__typings` is setup
+
        The default value is `@npm//typescript:typescript__typings` is setup
         for projects that use bazel managed npm deps that. It is recommended
         that you use the workspace name `@npm` for bazel managed deps so the
         default node_modules works out of the box. Otherwise, you'll have to
         override the node_modules attribute manually. This default is in place
         since ts_library will always depend on at least the typescript
-        default libs which are provided by `@npm//:typescript__typings`.
+        default libs which are provided by `@npm//typescript:typescript__typings`.
 
         This attribute is DEPRECATED. As of version 0.18.0 the recommended
         approach to npm dependencies is to use fine grained npm dependencies
@@ -292,10 +292,10 @@ 

Attributes

name = "my_lib", ... deps = [ - "@npm//:@types/foo", - "@npm//:@types/bar", - "@npm//:foo", - "@npm//:bar", + "@npm//@types/foo", + "@npm//@types/bar", + "@npm//foo", + "@npm//bar", ... ], ) diff --git a/docs/api/karma/ts_web_test.html b/docs/api/karma/ts_web_test.html index 3d9a2333..f9e9cf1a 100644 --- a/docs/api/karma/ts_web_test.html +++ b/docs/api/karma/ts_web_test.html @@ -360,7 +360,7 @@

Attributes

karma -

Label; Optional; Default is @npm//:@bazel/karma/karma

+

Label; Optional; Default is @npm//@bazel/karma/bin:karma

diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index fc784ce7..ef8ef1de 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -40,14 +40,14 @@ ts_library( ":foo_ts_library", "//examples/generated_ts", "//examples/some_library:lib", - "@npm//:typescript", - # Example of using the `@npm//:@types` target to depend on all + "@npm//typescript", + # Example of using the `@npm//@types` target to depend on all # @types packages and with the types attribute of tsconfig not # specified. In this case, typescript will automatically discover # all types under node_modules/@types and included them in the compile. # See getAutomaticTypeDirectiveNames in # https://github.com/Microsoft/TypeScript/blob/master/src/compiler/moduleNameResolver.ts. - "@npm//:@types", + "@npm//@types", ], ) diff --git a/examples/app/BUILD.bazel b/examples/app/BUILD.bazel index f5c9211d..8c217c80 100644 --- a/examples/app/BUILD.bazel +++ b/examples/app/BUILD.bazel @@ -41,8 +41,8 @@ ts_library( srcs = ["app_e2e_test.ts"], tsconfig = "//examples:tsconfig-test", deps = [ - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:protractor", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//protractor", ], ) diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index 7f132f80..89beb257 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -20,6 +20,6 @@ jasmine_node_test( srcs = ["googmodule_output_test.js"], data = [ ":es5_output", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index 63e3289a..8259cc1a 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -31,10 +31,10 @@ ts_library( tsconfig = "//examples:tsconfig-test", deps = [ ":car", - "@npm//:@types/jasmine", - "@npm//:@types/long", - "@npm//:@types/node", - "@npm//:long", + "@npm//@types/jasmine", + "@npm//@types/long", + "@npm//@types/node", + "@npm//long", ], ) @@ -83,8 +83,8 @@ rollup_bundle( genrule( name = "protobufjs", srcs = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/protobufjs/dist/minimal/protobuf.min.js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:node_modules/long/dist/long.js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/protobufjs:dist/minimal/protobuf.min.js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/long:dist/long.js", ], outs = [ "protobuf.min.js", @@ -108,8 +108,8 @@ ts_library( srcs = ["app_e2e_test.ts"], tsconfig = "//examples:tsconfig-test", deps = [ - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:protractor", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//protractor", ], ) diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel index ba21a1b2..eb7c73f7 100644 --- a/examples/testing/BUILD.bazel +++ b/examples/testing/BUILD.bazel @@ -12,8 +12,8 @@ ts_library( tsconfig = "//examples:tsconfig-test", deps = [ ":lib", - "@npm//:@types/jasmine", - "@npm//:@types/node", + "@npm//@types/jasmine", + "@npm//@types/node", ], ) diff --git a/examples/tsconfig-bar.json b/examples/tsconfig-bar.json index 350f0f3b..0307f474 100644 --- a/examples/tsconfig-bar.json +++ b/examples/tsconfig-bar.json @@ -3,7 +3,7 @@ "strict": true, "lib": ["es2015.promise", "dom", "es5"], // Auto-discover all types in this configuration since we don't - // specify `types = []` and the ts_library rule depends on `@npm//:@types`. + // specify `types = []` and the ts_library rule depends on `@npm//@types`. // Typescript will automatically discover all types under node_modules/@types // and included them in the build. See getAutomaticTypeDirectiveNames in // https://github.com/Microsoft/TypeScript/blob/master/src/compiler/moduleNameResolver.ts. diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index c7f04bc5..908addd0 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -31,8 +31,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "jasmine_node_test nodejs_binary( name = "tsc", data = [ - "@npm//:source-map-support", - "@npm//:typescript", + "@npm//source-map-support", + "@npm//typescript", ], entry_point = "typescript/lib/tsc.js", visibility = ["//internal:__subpackages__"], @@ -65,25 +65,25 @@ ts_library( # work with vanilla tsc. # Workaround for https://github.com/Microsoft/TypeScript/issues/22208 deps = [ - "@npm//:@types/node", - "@npm//:tsickle", - "@npm//:tsutils", - "@npm//:typescript", + "@npm//@types/node", + "@npm//tsickle", + "@npm//tsutils", + "@npm//typescript", ], ) # Other ts_library rules will use this custom compiler, which calls the # TypeScript APIs to act like tsc, but adds capabilities like Bazel workers. -# TODO(gregmagolan): make @npm//:tsickle dependency optional +# TODO(gregmagolan): make @npm//tsickle dependency optional nodejs_binary( name = "tsc_wrapped_bin", data = [ ":tsc_wrapped", - "@npm//:protobufjs", - "@npm//:source-map-support", - "@npm//:tsickle", - "@npm//:tsutils", - "@npm//:typescript", + "@npm//protobufjs", + "@npm//source-map-support", + "@npm//tsickle", + "@npm//tsutils", + "@npm//typescript", ], entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", templated_args = ["--node_options=--expose-gc"], @@ -96,9 +96,9 @@ ts_library( tsconfig = "//internal:tsc_wrapped/tsconfig.json", deps = [ ":tsc_wrapped", - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//typescript", ], ) @@ -107,8 +107,8 @@ jasmine_node_test( srcs = [], deps = [ ":test_lib", - "@npm//:jasmine", - "@npm//:typescript", + "@npm//jasmine", + "@npm//typescript", ], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index ea980cf8..28d3f262 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -23,6 +23,17 @@ load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeMod _DEFAULT_COMPILER = "@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped" +def _trim_package_node_modules(package_name): + # trim a package name down to its path prior to a node_modules + # segment. 'foo/node_modules/bar' would become 'foo' and + # 'node_modules/bar' would become '' + segments = [] + for n in package_name.split("/"): + if n == "node_modules": + break + segments += [n] + return "/".join(segments) + def _compute_node_modules_root(ctx): """Computes the node_modules root from the node_modules and deps attributes. @@ -37,7 +48,7 @@ def _compute_node_modules_root(ctx): # ctx.files.node_modules is not an empty list node_modules_root = "/".join([f for f in [ ctx.attr.node_modules.label.workspace_root, - ctx.attr.node_modules.label.package, + _trim_package_node_modules(ctx.attr.node_modules.label.package), "node_modules", ] if f]) for d in ctx.attr.deps: @@ -257,7 +268,7 @@ ts_library = rule( For example, we use the vanilla TypeScript tsc.js for bootstrapping, and Angular compilations can replace this with `ngc`. - The default ts_library compiler depends on the `@npm//:@bazel/typescript` + The default ts_library compiler depends on the `@npm//@bazel/typescript` target which is setup for projects that use bazel managed npm deps that fetch the @bazel/typescript npm package. It is recommended that you use the workspace name `@npm` for bazel managed deps so the default @@ -282,13 +293,13 @@ ts_library = rule( "node_modules": attr.label( doc = """The npm packages which should be available during the compile. - The default value is `@npm//:typescript__typings` is setup + The default value is `@npm//typescript:typescript__typings` is setup for projects that use bazel managed npm deps that. It is recommended that you use the workspace name `@npm` for bazel managed deps so the default node_modules works out of the box. Otherwise, you'll have to override the node_modules attribute manually. This default is in place since ts_library will always depend on at least the typescript - default libs which are provided by `@npm//:typescript__typings`. + default libs which are provided by `@npm//typescript:typescript__typings`. This attribute is DEPRECATED. As of version 0.18.0 the recommended approach to npm dependencies is to use fine grained npm dependencies @@ -314,10 +325,10 @@ ts_library = rule( name = "my_lib", ... deps = [ - "@npm//:@types/foo", - "@npm//:@types/bar", - "@npm//:foo", - "@npm//:bar", + "@npm//@types/foo", + "@npm//@types/bar", + "@npm//foo", + "@npm//bar", ... ], ) @@ -340,7 +351,7 @@ ts_library = rule( yarn_lock = "//:yarn.lock", ) """, - default = Label("@npm//:typescript__typings"), + default = Label("@npm//typescript:typescript__typings"), ), }), outputs = { diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index 0b732c9b..2c9637bd 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -162,7 +162,7 @@ ts_devserver = rule( doc = """The port that the devserver will listen on.""", default = 5432, ), - "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//:node_modules/requirejs/require.js")), + "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), "_devserver": attr.label( default = Label("//devserver"), executable = True, diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index 7d410238..0969a144 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -24,9 +24,8 @@ const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'wksp')); const WORKSPACE_BOILERPLATE = ` http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.14.1.zip"], - strip_prefix = "rules_nodejs-0.14.1", - sha256 = "813eb51733d3632f456f3bb581d940ed64e80dab417595c93bf5ad19079898e2", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/f56561116dadb3ce7b9e065b8d091c72c976eac8.zip"], + strip_prefix = "rules_nodejs-f56561116dadb3ce7b9e065b8d091c72c976eac8", ) http_archive( name = "bazel_skylib", @@ -375,7 +374,7 @@ ${WORKSPACE_BOILERPLATE}`); write('a/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm # package in this test. This changes the ts_library compiler from the default '@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped' -# which depends on @npm//:@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is +# which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") ts_library( name = "a_lib", @@ -398,7 +397,7 @@ ${WORKSPACE_BOILERPLATE}`); write('b/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm # package in this test. This changes the ts_library compiler from the default '@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped' -# which depends on @npm//:@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is +# which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") exports_files(["tsconfig.json"]) ts_library( diff --git a/internal/e2e/package_typescript_2.7/BUILD.bazel b/internal/e2e/package_typescript_2.7/BUILD.bazel index ebf2da60..3c9602c3 100644 --- a/internal/e2e/package_typescript_2.7/BUILD.bazel +++ b/internal/e2e/package_typescript_2.7/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:@bazel/typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//@bazel/typescript", ], ) @@ -36,6 +36,6 @@ jasmine_node_test( name = "test", deps = [ ":test_lib", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/internal/e2e/package_typescript_2.8/BUILD.bazel b/internal/e2e/package_typescript_2.8/BUILD.bazel index ebf2da60..3c9602c3 100644 --- a/internal/e2e/package_typescript_2.8/BUILD.bazel +++ b/internal/e2e/package_typescript_2.8/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:@bazel/typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//@bazel/typescript", ], ) @@ -36,6 +36,6 @@ jasmine_node_test( name = "test", deps = [ ":test_lib", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/internal/e2e/package_typescript_2.9/BUILD.bazel b/internal/e2e/package_typescript_2.9/BUILD.bazel index ebf2da60..3c9602c3 100644 --- a/internal/e2e/package_typescript_2.9/BUILD.bazel +++ b/internal/e2e/package_typescript_2.9/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:@bazel/typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//@bazel/typescript", ], ) @@ -36,6 +36,6 @@ jasmine_node_test( name = "test", deps = [ ":test_lib", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/internal/e2e/package_typescript_3.0/BUILD.bazel b/internal/e2e/package_typescript_3.0/BUILD.bazel index ebf2da60..3c9602c3 100644 --- a/internal/e2e/package_typescript_3.0/BUILD.bazel +++ b/internal/e2e/package_typescript_3.0/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", - "@npm//:@types/jasmine", - "@npm//:@types/node", - "@npm//:@bazel/typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//@bazel/typescript", ], ) @@ -36,6 +36,6 @@ jasmine_node_test( name = "test", deps = [ ":test_lib", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/internal/e2e/package_typescript_karma/BUILD.bazel b/internal/e2e/package_typescript_karma/BUILD.bazel index 26eeddbd..b607b43b 100644 --- a/internal/e2e/package_typescript_karma/BUILD.bazel +++ b/internal/e2e/package_typescript_karma/BUILD.bazel @@ -25,7 +25,7 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":lib", - "@npm//:@types/jasmine", + "@npm//@types/jasmine", ], ) diff --git a/internal/e2e/reference_types_directive/BUILD.bazel b/internal/e2e/reference_types_directive/BUILD.bazel index e1bb862a..024fa65d 100644 --- a/internal/e2e/reference_types_directive/BUILD.bazel +++ b/internal/e2e/reference_types_directive/BUILD.bazel @@ -23,6 +23,6 @@ jasmine_node_test( name = "test", deps = [ ":test_lib", - "@npm//:jasmine", + "@npm//jasmine", ], ) diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 0bb2b94b..2c5bb4a2 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -16,8 +16,8 @@ ts_library( module_name = "@bazel/karma", tsconfig = "//internal/karma:tsconfig.json", deps = [ - "@npm//:@types/node", - "@npm//:tmp", + "@npm//@types/node", + "@npm//tmp", ], ) @@ -27,16 +27,16 @@ nodejs_binary( name = "karma_bin", data = [ ":karma_concat_js", - "@npm//:jasmine-core", - "@npm//:karma", - "@npm//:karma-chrome-launcher", - "@npm//:karma-firefox-launcher", - "@npm//:karma-jasmine", - "@npm//:karma-requirejs", - "@npm//:karma-sauce-launcher", - "@npm//:karma-sourcemap-loader", - "@npm//:requirejs", - "@npm//:tmp", + "@npm//jasmine-core", + "@npm//karma", + "@npm//karma-chrome-launcher", + "@npm//karma-firefox-launcher", + "@npm//karma-jasmine", + "@npm//karma-requirejs", + "@npm//karma-sauce-launcher", + "@npm//karma-sourcemap-loader", + "@npm//requirejs", + "@npm//tmp", ], entry_point = "karma/bin/karma", install_source_map_support = False, diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl index 5c584e6e..ddb3b02d 100644 --- a/internal/karma/ts_web_test.bzl +++ b/internal/karma/ts_web_test.bzl @@ -23,7 +23,7 @@ load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") _CONF_TMPL = "//internal/karma:karma.conf.js" -_DEFAULT_KARMA_BIN = "@npm//:@bazel/karma/karma" +_DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" def _ts_web_test_impl(ctx): conf = ctx.actions.declare_file( diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel index b1691991..8cb2f77b 100644 --- a/internal/protobufjs/BUILD.bazel +++ b/internal/protobufjs/BUILD.bazel @@ -11,21 +11,21 @@ exports_files([ nodejs_binary( name = "pbjs", data = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:protobufjs", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//protobufjs", # these deps are needed even tho they are not automatic transitive deps of # protobufjs since if they are not in the runfiles then protobufjs attempts to # run `npm install` at runtime to get thhem which fails as it tries to access # the npm cache outside of the sandbox - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:semver", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:chalk", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:glob", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:jsdoc", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:minimist", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:tmp", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:uglify-js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:espree", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:escodegen", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:estraverse", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//semver", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//chalk", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//glob", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//jsdoc", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//minimist", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//tmp", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//uglify-js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//espree", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//escodegen", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//estraverse", ], entry_point = "protobufjs/bin/pbjs", install_source_map_support = False, @@ -34,21 +34,21 @@ nodejs_binary( nodejs_binary( name = "pbts", data = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:protobufjs", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//protobufjs", # these deps are needed even tho they are not automatic transitive deps of # protobufjs since if they are not in the runfiles then protobufjs attempts to # run `npm install` at runtime to get thhem which fails as it tries to access # the npm cache outside of the sandbox - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:semver", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:chalk", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:glob", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:jsdoc", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:minimist", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:tmp", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:uglify-js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:espree", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:escodegen", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//:estraverse", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//semver", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//chalk", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//glob", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//jsdoc", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//minimist", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//tmp", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//uglify-js", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//espree", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//escodegen", + "@build_bazel_rules_typescript_protobufs_compiletime_deps//estraverse", ], entry_point = "protobufjs/bin/pbts", install_source_map_support = False, diff --git a/package.bzl b/package.bzl index 5339f248..dccb5eb2 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.19.0" +VERSION = "0.19.1" def rules_typescript_dependencies(): """ @@ -38,9 +38,8 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.14.2.zip"], - strip_prefix = "rules_nodejs-0.14.2", - sha256 = "af481421c9e74f754a693a8bf5e9409484e38cf7be6f73f85879bdc7ed1b1d82", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/3501f9b6a9a78a01fd1ef9b808f022bfcbb478a0.zip"], + strip_prefix = "rules_nodejs-3501f9b6a9a78a01fd1ef9b808f022bfcbb478a0", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.json b/package.json index b8784814..78c3b4b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.19.0", + "version": "0.19.1", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", @@ -19,6 +19,7 @@ }, "devDependencies": { "@bazel/ibazel": "^0.2.0", + "@bazel/typescript": "0.19.1", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", diff --git a/yarn.lock b/yarn.lock index 279010fe..d6e61ba2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,6 +6,15 @@ version "0.2.0" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" +"@bazel/typescript@0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.19.1.tgz#61dd57c0ab8a6c9930d2463d44e9522ec007fe3a" + dependencies: + protobufjs "5.0.0" + source-map-support "0.5.9" + tsickle "0.28.0" + tsutils "2.27.2" + "@types/jasmine@^2.8.2": version "2.8.2" resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" @@ -3434,6 +3443,15 @@ tree-kill@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" +tsickle@0.28.0: + version "0.28.0" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" + dependencies: + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map "^0.6.0" + source-map-support "^0.5.0" + tsickle@0.32.1: version "0.32.1" resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"