mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 08:06:17 +08:00
Migrates `@angular-devkit/schematics` jasmine rules to the native `rules_js` variant. As part of this commit, we are performing a few adjustments that we've discussed as preparation for this migration: - cross package imports are always using the module name - inside package imports are always using relative imports, matching existing tests, fixing a few outliers.
92 lines
2.4 KiB
Python
92 lines
2.4 KiB
Python
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
|
|
load("@npm2//:defs.bzl", "npm_link_all_packages")
|
|
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
|
|
|
|
# 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.dev/license
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
licenses(["notice"])
|
|
|
|
npm_link_all_packages()
|
|
|
|
# @angular-devkit/schematics
|
|
|
|
ts_project(
|
|
name = "schematics",
|
|
srcs = glob(
|
|
include = ["src/**/*.ts"],
|
|
exclude = [
|
|
"src/**/*_spec.ts",
|
|
],
|
|
) + ["index.ts"],
|
|
data = [
|
|
"package.json",
|
|
],
|
|
module_name = "@angular-devkit/schematics",
|
|
deps = [
|
|
":node_modules/@angular-devkit/core",
|
|
"//:node_modules/@types/node",
|
|
"//:node_modules/jsonc-parser",
|
|
"//:node_modules/magic-string",
|
|
"//:node_modules/rxjs",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "schematics_test_lib",
|
|
testonly = True,
|
|
srcs = glob(["src/**/*_spec.ts"]),
|
|
deps = [
|
|
":node_modules/@angular-devkit/core",
|
|
":schematics",
|
|
"//:node_modules/@types/jasmine",
|
|
"//:node_modules/rxjs",
|
|
"//packages/angular_devkit/schematics/testing:testing_rjs",
|
|
],
|
|
)
|
|
|
|
jasmine_test(
|
|
name = "schematics_test",
|
|
data = [":schematics_test_lib_rjs"],
|
|
)
|
|
|
|
genrule(
|
|
name = "license",
|
|
srcs = ["//:LICENSE"],
|
|
outs = ["LICENSE"],
|
|
cmd = "cp $(execpath //:LICENSE) $@",
|
|
)
|
|
|
|
npm_package(
|
|
name = "pkg",
|
|
pkg_deps = [
|
|
"//packages/angular_devkit/core:package.json",
|
|
],
|
|
tags = ["release-package"],
|
|
deps = [
|
|
":README.md",
|
|
":collection-schema.json",
|
|
":license",
|
|
":schematics_rjs",
|
|
"//packages/angular_devkit/schematics/tasks:package.json",
|
|
"//packages/angular_devkit/schematics/tasks:tasks_rjs",
|
|
"//packages/angular_devkit/schematics/testing:package.json",
|
|
"//packages/angular_devkit/schematics/testing:testing_rjs",
|
|
"//packages/angular_devkit/schematics/tools:package.json",
|
|
],
|
|
)
|
|
|
|
api_golden_test_npm_package(
|
|
name = "schematics_api",
|
|
data = [
|
|
":npm_package",
|
|
"//goldens:public-api",
|
|
],
|
|
golden_dir = "angular_cli/goldens/public-api/angular_devkit/schematics",
|
|
npm_package = "angular_cli/packages/angular_devkit/schematics/npm_package",
|
|
types = ["@npm//@types/node"],
|
|
)
|