build: review comments addressed (#26488)

PR Close #26488
This commit is contained in:
Greg Magolan
2018-10-18 09:58:38 -07:00
committed by Igor Minar
parent 74ea4e9b5d
commit 15c2467dbd
25 changed files with 124 additions and 164 deletions

View File

@ -551,13 +551,14 @@ NG_MODULE_RULE_ATTRS = dict(dict(COMMON_ATTRIBUTES, **NG_MODULE_ATTRIBUTES), **{
"node_modules": attr.label(
doc = """The npm packages which should be available during the compile.
The default value is `@npm//typescript:typescript__typings` is setup
for projects that use bazel managed npm deps that. It is recommended
The default value of `@npm//typescript:typescript__typings` is
for projects that use bazel managed npm deps. 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
default value works out of the box. Otherwise, you'll have to
override the node_modules attribute manually. This default is in place
since ng_module will always depend on at least the typescript
default libs which are provided by `@npm//typescript:typescript__typings`.
since code compiled by ng_module will always depend on at least the
typescript 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
@ -569,7 +570,7 @@ NG_MODULE_RULE_ATTRS = dict(dict(COMMON_ATTRIBUTES, **NG_MODULE_ATTRIBUTES), **{
ng_module(
name = "my_lib",
...
node_modules = "@npm//node_modules",
node_modules = "//:node_modules",
)
```

View File

@ -11,14 +11,20 @@ exports_files([
ts_library(
name = "lib",
srcs = glob(["*.ts"]),
node_modules = "@angular_packager_deps//:node_modules",
node_modules = "@ngdeps//typescript:typescript__typings",
tsconfig = ":tsconfig.json",
deps = [
"@ngdeps//@types/node",
"@ngdeps//@types/shelljs",
],
)
nodejs_binary(
name = "packager",
data = ["lib"],
data = [
"lib",
"@ngdeps//shelljs",
],
entry_point = "angular/packages/bazel/src/ng_package/packager.js",
install_source_map_support = False,
node_modules = "@angular_packager_deps//:node_modules",
)

View File

@ -1,9 +0,0 @@
{
"description": "runtime dependences for packager",
"devDependencies": {
"@types/node": "6.0.84",
"@types/shelljs": "0.7.7",
"shelljs": "0.8.2",
"typescript": "2.7.2"
}
}

View File

@ -1,6 +1,7 @@
{
"compilerOptions": {
"noImplicitAny": true,
"lib": ["es2015"]
"lib": ["es2015"],
"types": []
}
}

View File

@ -5,7 +5,6 @@
"Install toolchain dependencies"
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version")
def ng_setup_workspace():
@ -14,11 +13,6 @@ def ng_setup_workspace():
It creates some additional Bazel external repositories that are used internally
by the Angular rules.
"""
yarn_install(
name = "angular_packager_deps",
package_json = "@angular//packages/bazel/src/ng_package:package.json",
yarn_lock = "@angular//packages/bazel/src/ng_package:yarn.lock",
)
# 0.16.0: minimal version required to work with ng_module
# 0.16.2: bazel type resolution for zone.js types