2020-10-01 16:06:56 -07:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "pkg_npm")
|
2020-06-25 01:32:41 -07:00
|
|
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
2020-10-01 16:06:56 -07:00
|
|
|
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
|
2020-03-04 09:42:45 -08:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "cli",
|
|
|
|
srcs = [
|
|
|
|
"cli.ts",
|
|
|
|
],
|
2020-03-17 12:58:17 +01:00
|
|
|
module_name = "@angular/dev-infra-private",
|
2020-03-04 09:42:45 -08:00
|
|
|
deps = [
|
2020-08-26 13:49:43 -07:00
|
|
|
"//dev-infra/caretaker",
|
2020-03-10 10:29:44 -07:00
|
|
|
"//dev-infra/commit-message",
|
2020-04-20 13:00:10 -07:00
|
|
|
"//dev-infra/format",
|
2020-09-30 14:32:19 -07:00
|
|
|
"//dev-infra/ngbot",
|
2020-05-05 15:37:31 -07:00
|
|
|
"//dev-infra/pr",
|
2020-03-04 14:37:21 -08:00
|
|
|
"//dev-infra/pullapprove",
|
2020-04-20 14:44:25 -07:00
|
|
|
"//dev-infra/release",
|
2020-03-26 10:45:09 -07:00
|
|
|
"//dev-infra/ts-circular-dependencies",
|
2020-04-20 13:00:10 -07:00
|
|
|
"//dev-infra/utils",
|
2020-03-04 09:42:45 -08:00
|
|
|
"@npm//@types/node",
|
2020-03-26 10:45:09 -07:00
|
|
|
"@npm//@types/yargs",
|
|
|
|
"@npm//yargs",
|
2020-03-04 09:42:45 -08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-10-01 16:06:56 -07:00
|
|
|
rollup_bundle(
|
|
|
|
name = "cli_rollup",
|
2020-10-26 19:42:23 -07:00
|
|
|
args = [
|
|
|
|
"--plugin",
|
|
|
|
"rollup-plugin-hashbang",
|
|
|
|
],
|
2020-10-01 16:06:56 -07:00
|
|
|
entry_point = ":cli.ts",
|
|
|
|
format = "cjs",
|
|
|
|
silent = True,
|
|
|
|
sourcemap = "false",
|
|
|
|
deps = [
|
|
|
|
":cli",
|
2020-10-26 19:42:23 -07:00
|
|
|
# TODO(josephperrott): Determine if this plugin is the best method for ensuring the hashbang
|
|
|
|
# in both local and published use case.
|
|
|
|
"@npm//rollup-plugin-hashbang",
|
2020-10-01 16:06:56 -07:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
generated_file_test(
|
|
|
|
name = "local_ng_dev",
|
|
|
|
src = "ng-dev.js",
|
|
|
|
generated = "cli_rollup",
|
|
|
|
)
|
|
|
|
|
2020-03-17 12:58:17 +01:00
|
|
|
genrule(
|
|
|
|
name = "package-json",
|
|
|
|
srcs = [
|
|
|
|
"tmpl-package.json",
|
|
|
|
"//:package.json",
|
2020-03-04 14:37:21 -08:00
|
|
|
],
|
2020-03-17 12:58:17 +01:00
|
|
|
outs = ["package.json"],
|
|
|
|
cmd = """
|
2020-03-29 13:29:50 -07:00
|
|
|
$(execpath //tools:inline-package-json-deps) $(execpath tmpl-package.json) \
|
|
|
|
$(execpath //:package.json) $@
|
2020-03-17 12:58:17 +01:00
|
|
|
""",
|
|
|
|
tools = ["//tools:inline-package-json-deps"],
|
2020-03-04 14:37:21 -08:00
|
|
|
)
|
|
|
|
|
2020-03-04 09:42:45 -08:00
|
|
|
pkg_npm(
|
|
|
|
name = "npm_package",
|
2020-05-15 10:26:01 -07:00
|
|
|
srcs = [
|
2020-07-08 10:06:35 +02:00
|
|
|
"index.bzl",
|
2020-07-02 14:45:23 +02:00
|
|
|
"//dev-infra/bazel:files",
|
2020-05-15 10:26:01 -07:00
|
|
|
"//dev-infra/benchmark:files",
|
|
|
|
],
|
|
|
|
substitutions = {
|
|
|
|
# angular/angular should not consume it's own packages, so we use
|
2020-05-08 12:56:39 -07:00
|
|
|
# substitutions to replace these in the published version of dev-infra.
|
|
|
|
"//dev-infra/": "@npm_angular_dev_infra_private//",
|
2020-05-15 10:26:01 -07:00
|
|
|
"//packages/benchpress": "@npm//@angular/benchpress",
|
2020-06-25 01:32:41 -07:00
|
|
|
"//packages/bazel": "@npm//@angular/bazel",
|
2020-07-09 13:16:53 -07:00
|
|
|
"//packages/zone.js/bundles:zone.umd.js": "@npm//:node_modules/zone.js/dist/zone.js",
|
2020-05-15 10:26:01 -07: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 01:32:41 -07:00
|
|
|
"load\(\"//tools:defaults.bzl\", \"ng_module\"\)": "load(\"@npm//@angular/bazel:index.bzl\", \"ng_module\")",
|
2020-05-15 10:26:01 -07:00
|
|
|
},
|
2020-03-04 09:42:45 -08:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2020-03-17 12:58:17 +01:00
|
|
|
":cli",
|
|
|
|
":package-json",
|
2020-05-15 10:26:01 -07:00
|
|
|
"//dev-infra/benchmark/driver-utilities",
|
2020-03-10 10:29:44 -07:00
|
|
|
"//dev-infra/commit-message",
|
2020-03-17 12:58:17 +01:00
|
|
|
"//dev-infra/ts-circular-dependencies",
|
2020-03-04 09:42:45 -08:00
|
|
|
],
|
|
|
|
)
|