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

@ -40,15 +40,6 @@ def rules_angular_dependencies():
],
)
# Angular apps don't necessarily depend on Sass, but it's common enough
_maybe(
http_archive,
name = "io_bazel_rules_sass",
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
strip_prefix = "rules_sass-1.11.0",
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
)
rules_typescript_dependencies()
rules_nodejs_dependencies()
@ -103,6 +94,13 @@ def rules_angular_dev_dependencies():
#############################################
# Dependencies for generating documentation #
#############################################
http_archive(
name = "io_bazel_rules_sass",
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
strip_prefix = "rules_sass-1.11.0",
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
)
http_archive(
name = "io_bazel_skydoc",
sha256 = "7bfb5545f59792a2745f2523b9eef363f9c3e7274791c030885e7069f8116016",

View File

@ -12,9 +12,10 @@
},
"typings": "./src/ngc-wrapped/index.d.ts",
"dependencies": {
"@bazel/typescript": "^0.19.1",
"@bazel/typescript": "^0.20.3",
"@types/node": "6.0.84",
"tsickle": "0.28.0"
"shelljs": "0.8.2",
"tsickle": "0.32.1"
},
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",

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