mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
9a27c5befb
Use defaults.bzl for the common macros PR Close #63384
159 lines
5.2 KiB
Python
159 lines
5.2 KiB
Python
load("@aspect_rules_js//js:defs.bzl", "js_library")
|
|
load("@npm//:rollup/package_json.bzl", rollup = "bin")
|
|
load("//tools:defaults.bzl", "npm_package", "ts_config")
|
|
|
|
exports_files([
|
|
"tsconfig.json",
|
|
"migrations.json",
|
|
"collection.json",
|
|
])
|
|
|
|
js_library(
|
|
name = "schematics_jsons",
|
|
srcs = [
|
|
"collection.json",
|
|
"migrations.json",
|
|
"tsconfig.json",
|
|
],
|
|
visibility = ["//packages/core/schematics:__subpackages__"],
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig_build",
|
|
src = "tsconfig.json",
|
|
visibility = ["//packages/core/schematics:__subpackages__"],
|
|
deps = [
|
|
"//:node_modules/@types/node",
|
|
],
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig_test",
|
|
src = "tsconfig-test.json",
|
|
visibility = ["//packages/core/schematics:__subpackages__"],
|
|
deps = [
|
|
":tsconfig_build",
|
|
"//:node_modules/@types/jasmine",
|
|
],
|
|
)
|
|
|
|
npm_package(
|
|
srcs = [
|
|
"collection.json",
|
|
"migrations.json",
|
|
":bundles",
|
|
"//packages/core/schematics/migrations/control-flow-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/cleanup-unused-imports:static_files",
|
|
"//packages/core/schematics/ng-generate/inject-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/output-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/route-lazy-loading:static_files",
|
|
"//packages/core/schematics/ng-generate/self-closing-tags-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/signal-input-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/signal-queries-migration:static_files",
|
|
"//packages/core/schematics/ng-generate/signals:static_files",
|
|
"//packages/core/schematics/ng-generate/standalone-migration:static_files",
|
|
],
|
|
visibility = ["//packages/core:__pkg__"],
|
|
)
|
|
|
|
bundle_entrypoints = [
|
|
[
|
|
"inject-migration",
|
|
"packages/core/schematics/ng-generate/inject-migration/index.js",
|
|
],
|
|
[
|
|
"route-lazy-loading",
|
|
"packages/core/schematics/ng-generate/route-lazy-loading/index.js",
|
|
],
|
|
[
|
|
"standalone-migration",
|
|
"packages/core/schematics/ng-generate/standalone-migration/index.js",
|
|
],
|
|
[
|
|
"cleanup-unused-imports",
|
|
"packages/core/schematics/ng-generate/cleanup-unused-imports/index.js",
|
|
],
|
|
[
|
|
"signals",
|
|
"packages/core/schematics/ng-generate/signals/index.js",
|
|
],
|
|
[
|
|
"signal-input-migration",
|
|
"packages/core/schematics/ng-generate/signal-input-migration/index.js",
|
|
],
|
|
[
|
|
"signal-queries-migration",
|
|
"packages/core/schematics/ng-generate/signal-queries-migration/index.js",
|
|
],
|
|
[
|
|
"output-migration",
|
|
"packages/core/schematics/ng-generate/output-migration/index.js",
|
|
],
|
|
[
|
|
"self-closing-tags-migration",
|
|
"packages/core/schematics/ng-generate/self-closing-tags-migration/index.js",
|
|
],
|
|
[
|
|
"inject-flags",
|
|
"packages/core/schematics/migrations/inject-flags/index.js",
|
|
],
|
|
[
|
|
"test-bed-get",
|
|
"packages/core/schematics/migrations/test-bed-get/index.js",
|
|
],
|
|
[
|
|
"document-core",
|
|
"packages/core/schematics/migrations/document-core/index.js",
|
|
],
|
|
[
|
|
"control-flow-migration",
|
|
"packages/core/schematics/migrations/control-flow-migration/index.js",
|
|
],
|
|
[
|
|
"router-current-navigation",
|
|
"packages/core/schematics/migrations/router-current-navigation/index.js",
|
|
],
|
|
]
|
|
|
|
rollup.rollup(
|
|
name = "bundles",
|
|
srcs = [
|
|
"rollup.config.js",
|
|
"//:node_modules/@rollup/plugin-commonjs",
|
|
"//:node_modules/@rollup/plugin-node-resolve",
|
|
"//:node_modules/magic-string",
|
|
"//:node_modules/semver",
|
|
"//packages/core/schematics:tsconfig_build",
|
|
"//packages/core/schematics/migrations/control-flow-migration",
|
|
"//packages/core/schematics/migrations/document-core",
|
|
"//packages/core/schematics/migrations/inject-flags",
|
|
"//packages/core/schematics/migrations/router-current-navigation",
|
|
"//packages/core/schematics/migrations/test-bed-get",
|
|
"//packages/core/schematics/ng-generate/cleanup-unused-imports",
|
|
"//packages/core/schematics/ng-generate/inject-migration",
|
|
"//packages/core/schematics/ng-generate/output-migration",
|
|
"//packages/core/schematics/ng-generate/route-lazy-loading",
|
|
"//packages/core/schematics/ng-generate/self-closing-tags-migration",
|
|
"//packages/core/schematics/ng-generate/signal-input-migration",
|
|
"//packages/core/schematics/ng-generate/signal-queries-migration",
|
|
"//packages/core/schematics/ng-generate/signals",
|
|
"//packages/core/schematics/ng-generate/standalone-migration",
|
|
"//tools/bazel/rollup:path-plugin",
|
|
],
|
|
args = [
|
|
"--format=cjs",
|
|
"--config=$(rootpath rollup.config.js)",
|
|
"--dir=packages/core/schematics/bundles",
|
|
"--no-sourcemap",
|
|
] + ["--input=%s=%s" % (name, path) for [
|
|
name,
|
|
path,
|
|
] in bundle_entrypoints],
|
|
out_dirs = [
|
|
"bundles",
|
|
],
|
|
visibility = [
|
|
"//packages/core/schematics/test:__pkg__",
|
|
],
|
|
)
|