build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871)

PR Close #28871
This commit is contained in:
Greg Magolan
2019-02-20 09:54:42 -08:00
committed by Andrew Kushnir
parent cd83a43462
commit ea09430039
220 changed files with 660 additions and 781 deletions

View File

@ -13,13 +13,13 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
nodejs_binary(
name = "rollup_with_build_optimizer",
data = [
"@ngdeps//@angular-devkit/build-optimizer",
"@ngdeps//is-builtin-module",
"@ngdeps//rollup",
"@ngdeps//rollup-plugin-node-resolve",
"@ngdeps//rollup-plugin-sourcemaps",
"@npm//@angular-devkit/build-optimizer",
"@npm//is-builtin-module",
"@npm//rollup",
"@npm//rollup-plugin-node-resolve",
"@npm//rollup-plugin-sourcemaps",
],
entry_point = "ngdeps/node_modules/rollup/bin/rollup",
entry_point = "npm/node_modules/rollup/bin/rollup",
install_source_map_support = False,
visibility = ["//visibility:public"],
)

View File

@ -11,9 +11,9 @@ ts_library(
"index.ts",
],
deps = [
"@ngdeps//@bazel/typescript",
"@ngdeps//@microsoft/api-extractor",
"@ngdeps//@types/node",
"@npm//@bazel/typescript",
"@npm//@microsoft/api-extractor",
"@npm//@types/node",
],
)
@ -22,8 +22,8 @@ nodejs_binary(
name = "api_extractor",
data = [
":lib",
"@ngdeps//@bazel/typescript",
"@ngdeps//@microsoft/api-extractor",
"@npm//@bazel/typescript",
"@npm//@microsoft/api-extractor",
],
entry_point = "angular/packages/bazel/src/api-extractor/index.js",
visibility = ["//visibility:public"],

View File

@ -22,9 +22,9 @@ ts_library(
],
module_name = "@angular/bazel/src/builders",
deps = [
"@ngdeps//@angular-devkit/architect",
"@ngdeps//@angular-devkit/core",
"@ngdeps//@types/node",
"@ngdeps//rxjs",
"@npm//@angular-devkit/architect",
"@npm//@angular-devkit/core",
"@npm//@types/node",
"@npm//rxjs",
],
)

View File

@ -33,7 +33,7 @@ compile_ts = _compile_ts
DEPS_ASPECTS = _DEPS_ASPECTS
ts_providers_dict_to_struct = _ts_providers_dict_to_struct
DEFAULT_NG_COMPILER = "@angular//:@angular/bazel/ngc-wrapped"
DEFAULT_NG_COMPILER = "@npm//@angular/bazel/bin:ngc-wrapped"
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
TsConfigInfo = _TsConfigInfo

View File

@ -3,16 +3,16 @@ package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
# BEGIN-DEV-ONLY
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
ts_library(
name = "lib",
srcs = glob(["*.ts"]),
node_modules = "@ngdeps//typescript:typescript__typings",
node_modules = "@npm//typescript:typescript__typings",
tsconfig = ":tsconfig.json",
deps = [
"@ngdeps//@types/node",
"@ngdeps//@types/shelljs",
"@npm//@types/node",
"@npm//@types/shelljs",
],
)
@ -21,7 +21,7 @@ nodejs_binary(
name = "packager",
data = [
"lib",
"@ngdeps//shelljs",
"@npm//shelljs",
],
entry_point = "angular/packages/bazel/src/ng_package/packager.js",
install_source_map_support = False,

View File

@ -43,7 +43,7 @@ PACKAGES = [
PLUGIN_CONFIG = "{sideEffectFreeModules: [\n%s]}" % ",\n".join(
[" '.esm5/{0}'".format(p) for p in PACKAGES],
)
BO_ROLLUP = "ngdeps/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/rollup-plugin.js"
BO_ROLLUP = "npm/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/rollup-plugin.js"
BO_PLUGIN = "require('%s').default(%s)" % (BO_ROLLUP, PLUGIN_CONFIG)
def _use_plain_rollup(ctx):

View File

@ -1,13 +0,0 @@
# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
"Install toolchain dependencies"
def ng_setup_workspace():
"""This repository rule should be called from your WORKSPACE file.
It creates some additional Bazel external repositories that are used internally
by the Angular rules.
"""

View File

@ -1,5 +1,5 @@
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
ts_library(
name = "ngc_lib",
@ -8,7 +8,7 @@ ts_library(
"index.ts",
],
module_name = "@angular/bazel",
node_modules = "@ngdeps//typescript:typescript__typings",
node_modules = "@npm//typescript:typescript__typings",
tsconfig = ":tsconfig.json",
visibility = [
"//packages/bazel:__pkg__",
@ -20,10 +20,10 @@ ts_library(
# Users will get this dependency from node_modules.
"//packages/compiler-cli",
# END-INTERNAL
"@ngdeps//@bazel/typescript",
"@ngdeps//@types/node",
"@ngdeps//tsickle",
"@ngdeps//typescript",
"@npm//@bazel/typescript",
"@npm//@types/node",
"@npm//tsickle",
"@npm//typescript",
],
)
@ -33,8 +33,8 @@ nodejs_binary(
data = [
":ngc_lib",
"//packages/bazel/third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto",
"@ngdeps//source-map-support",
"@ngdeps//tslib",
"@npm//source-map-support",
"@npm//tslib",
],
entry_point = "angular/packages/bazel/src/ngc-wrapped/index.js",
visibility = ["//visibility:public"],
@ -44,7 +44,7 @@ nodejs_binary(
name = "xi18n",
data = [
":ngc_lib",
"@ngdeps//source-map-support",
"@npm//source-map-support",
],
entry_point = "angular/packages/bazel/src/ngc-wrapped/extract_i18n.js",
visibility = ["//visibility:public"],

View File

@ -1,12 +1,12 @@
package(default_visibility = ["//visibility:public"])
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
ts_library(
name = "utils",
srcs = ["index.ts"],
module_name = "@angular/bazel/protractor-utils",
node_modules = "@ngdeps//typescript:typescript__typings",
node_modules = "@npm//typescript:typescript__typings",
tsconfig = ":tsconfig.json",
deps = ["@ngdeps//@types/node"],
deps = ["@npm//@types/node"],
)

View File

@ -12,9 +12,9 @@ ts_library(
"schema.json",
],
deps = [
"@ngdeps//@angular-devkit/core",
"@ngdeps//@angular-devkit/schematics",
"@ngdeps//@schematics/angular",
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//@schematics/angular",
],
)
@ -29,6 +29,6 @@ ts_library(
],
deps = [
":bazel-workspace",
"@ngdeps//@angular-devkit/schematics",
"@npm//@angular-devkit/schematics",
],
)

View File

@ -55,11 +55,9 @@ web_test_repositories()
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
browser_repositories()
load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace")
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")
ts_setup_workspace()
<% if (sass) { %>
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
sass_repositories()
<% } %>
load("@npm_angular_bazel//:index.bzl", "ng_setup_workspace")
ng_setup_workspace()

View File

@ -1,4 +1,4 @@
load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("@npm_angular_bazel//:index.bzl", "protractor_web_test_suite")
ts_library(

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//visibility:public"])
load("@npm_angular_bazel//:index.bzl", "ng_module")
load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite")
load("@npm_bazel_karma//:index.bzl", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle", "history_server")
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
<% if (sass) { %>load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary")
multi_sass_binary(

View File

@ -57,8 +57,8 @@ export default function(options: BazelWorkspaceOptions): Rule {
}
const workspaceVersions = {
'RULES_NODEJS_VERSION': '0.18.6',
'RULES_NODEJS_SHA256': '1416d03823fed624b49a0abbd9979f7c63bbedfd37890ddecedd2fe25cccebc6',
'RULES_NODEJS_VERSION': '0.26.0',
'RULES_NODEJS_SHA256': '5c86b055c57e15bf32d9009a15bcd6d8e190c41b1ff2fb18037b75e0012e4e7c',
'RULES_SASS_VERSION': '1.17.2',
'RULES_SASS_SHA256': 'e5316ee8a09d1cbb732d3938b400836bf94dba91a27476e9e27706c4c0edae1f',
};

View File

@ -14,10 +14,10 @@ ts_library(
deps = [
"//packages/bazel/src/schematics/bazel-workspace",
"//packages/bazel/src/schematics/utility",
"@ngdeps//@angular-devkit/core",
"@ngdeps//@angular-devkit/schematics",
"@ngdeps//@schematics/angular",
"@ngdeps//typescript",
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//@schematics/angular",
"@npm//typescript",
],
)
@ -32,6 +32,6 @@ ts_library(
],
deps = [
":ng-add",
"@ngdeps//@angular-devkit/schematics",
"@npm//@angular-devkit/schematics",
],
)

View File

@ -46,7 +46,7 @@ function addDevDependenciesToPackageJson(options: Schema) {
'@angular/upgrade': angularCoreVersion,
'@bazel/bazel': '^0.22.1',
'@bazel/ibazel': '^0.9.0',
'@bazel/karma': '^0.25.1',
'@bazel/karma': '^0.26.0',
};
const recorder = host.beginUpdate(packageJson);

View File

@ -13,8 +13,8 @@ ts_library(
],
deps = [
"//packages/bazel/src/schematics/ng-add",
"@ngdeps//@angular-devkit/schematics",
"@ngdeps//@schematics/angular",
"@npm//@angular-devkit/schematics",
"@npm//@schematics/angular",
],
)
@ -29,6 +29,6 @@ ts_library(
],
deps = [
":ng-new",
"@ngdeps//@angular-devkit/schematics",
"@npm//@angular-devkit/schematics",
],
)

View File

@ -9,10 +9,10 @@ ts_library(
],
module_name = "@angular/bazel/src/schematics/utility",
deps = [
"@ngdeps//@angular-devkit/core",
"@ngdeps//@angular-devkit/schematics",
"@ngdeps//@schematics/angular",
"@ngdeps//typescript",
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//@schematics/angular",
"@npm//typescript",
],
)
@ -24,7 +24,7 @@ ts_library(
],
deps = [
":utility",
"@ngdeps//@angular-devkit/core",
"@ngdeps//@angular-devkit/schematics",
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
],
)