2020-10-01 19:06:56 -04:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "pkg_npm")
|
2020-06-25 04:32:41 -04:00
|
|
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
2020-10-01 19:06:56 -04:00
|
|
|
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
|
2020-03-04 12:42:45 -05:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "cli",
|
|
|
|
srcs = [
|
|
|
|
"cli.ts",
|
|
|
|
],
|
2020-03-17 07:58:17 -04:00
|
|
|
module_name = "@angular/dev-infra-private",
|
2020-03-04 12:42:45 -05:00
|
|
|
deps = [
|
2020-08-26 16:49:43 -04:00
|
|
|
"//dev-infra/caretaker",
|
2020-03-10 13:29:44 -04:00
|
|
|
"//dev-infra/commit-message",
|
2020-04-20 16:00:10 -04:00
|
|
|
"//dev-infra/format",
|
2020-09-30 17:32:19 -04:00
|
|
|
"//dev-infra/ngbot",
|
2020-05-05 18:37:31 -04:00
|
|
|
"//dev-infra/pr",
|
2020-03-04 17:37:21 -05:00
|
|
|
"//dev-infra/pullapprove",
|
2020-04-20 17:44:25 -04:00
|
|
|
"//dev-infra/release",
|
2020-03-26 13:45:09 -04:00
|
|
|
"//dev-infra/ts-circular-dependencies",
|
2020-04-20 16:00:10 -04:00
|
|
|
"//dev-infra/utils",
|
2020-03-04 12:42:45 -05:00
|
|
|
"@npm//@types/node",
|
2020-03-26 13:45:09 -04:00
|
|
|
"@npm//@types/yargs",
|
|
|
|
"@npm//yargs",
|
2020-03-04 12:42:45 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-10-01 19:06:56 -04:00
|
|
|
rollup_bundle(
|
|
|
|
name = "cli_rollup",
|
|
|
|
entry_point = ":cli.ts",
|
|
|
|
format = "cjs",
|
|
|
|
silent = True,
|
|
|
|
sourcemap = "false",
|
|
|
|
deps = [
|
|
|
|
":cli",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
generated_file_test(
|
|
|
|
name = "local_ng_dev",
|
|
|
|
src = "ng-dev.js",
|
|
|
|
generated = "cli_rollup",
|
|
|
|
)
|
|
|
|
|
2020-03-17 07:58:17 -04:00
|
|
|
genrule(
|
|
|
|
name = "package-json",
|
|
|
|
srcs = [
|
|
|
|
"tmpl-package.json",
|
|
|
|
"//:package.json",
|
2020-03-04 17:37:21 -05:00
|
|
|
],
|
2020-03-17 07:58:17 -04:00
|
|
|
outs = ["package.json"],
|
|
|
|
cmd = """
|
2020-03-29 16:29:50 -04:00
|
|
|
$(execpath //tools:inline-package-json-deps) $(execpath tmpl-package.json) \
|
|
|
|
$(execpath //:package.json) $@
|
2020-03-17 07:58:17 -04:00
|
|
|
""",
|
|
|
|
tools = ["//tools:inline-package-json-deps"],
|
2020-03-04 17:37:21 -05:00
|
|
|
)
|
|
|
|
|
2020-03-04 12:42:45 -05:00
|
|
|
pkg_npm(
|
|
|
|
name = "npm_package",
|
2020-05-15 13:26:01 -04:00
|
|
|
srcs = [
|
2020-07-08 04:06:35 -04:00
|
|
|
"index.bzl",
|
2020-07-02 08:45:23 -04:00
|
|
|
"//dev-infra/bazel:files",
|
2020-05-15 13:26:01 -04:00
|
|
|
"//dev-infra/benchmark:files",
|
|
|
|
],
|
|
|
|
substitutions = {
|
|
|
|
# angular/angular should not consume it's own packages, so we use
|
2020-05-08 15:56:39 -04:00
|
|
|
# substitutions to replace these in the published version of dev-infra.
|
|
|
|
"//dev-infra/": "@npm_angular_dev_infra_private//",
|
2020-05-15 13:26:01 -04:00
|
|
|
"//packages/benchpress": "@npm//@angular/benchpress",
|
2020-06-25 04:32:41 -04:00
|
|
|
"//packages/bazel": "@npm//@angular/bazel",
|
2020-07-09 16:16:53 -04:00
|
|
|
"//packages/zone.js/bundles:zone.umd.js": "@npm//:node_modules/zone.js/dist/zone.js",
|
2020-05-15 13:26:01 -04:00
|
|
|
"//packages/core": "@npm//@angular/core",
|
|
|
|
"//packages/platform-browser": "@npm//@angular/platform-browser",
|
|
|
|
|
|
|
|
# This substitution is particularly verbose because we need to make sure
|
|
|
|
# that only things available via Angular Bazel are imported from
|
|
|
|
# tools/defaults.bzl.
|
2020-06-25 04:32:41 -04:00
|
|
|
"load\(\"//tools:defaults.bzl\", \"ng_module\"\)": "load(\"@npm//@angular/bazel:index.bzl\", \"ng_module\")",
|
2020-05-15 13:26:01 -04:00
|
|
|
},
|
2020-03-04 12:42:45 -05:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2020-03-17 07:58:17 -04:00
|
|
|
":cli",
|
|
|
|
":package-json",
|
2020-05-15 13:26:01 -04:00
|
|
|
"//dev-infra/benchmark/driver-utilities",
|
2020-03-10 13:29:44 -04:00
|
|
|
"//dev-infra/commit-message",
|
2020-03-17 07:58:17 -04:00
|
|
|
"//dev-infra/ts-circular-dependencies",
|
2020-03-04 12:42:45 -05:00
|
|
|
],
|
|
|
|
)
|