Charles Lyding d36c53bc82 refactor(@angular-devkit/schematics-cli): use latest inquirer prompt package
The `inquirer` package has been rewritten with a new set of packages.
The rewrite had a focus on reduced package size and improved performance.
The main prompt package is now `@inquirer/prompts`. The API is very similar
but did require some refactoring to adapt to Angular's usage.
2024-06-07 08:58:25 -04:00

111 lines
2.8 KiB
Python

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:ts_json_schema.bzl", "ts_json_schema")
# 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
licenses(["notice"])
package(default_visibility = ["//visibility:public"])
# @angular-devkit/schematics-cli
ts_library(
name = "schematics_cli",
package_name = "@angular-devkit/schematics-cli",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*_spec.ts",
"schematic/files/**",
"blank/project-files/**",
"blank/schematic-files/**",
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
"node_modules/**",
],
) + [
# @external_begin
# These files are generated from the JSON schema
"//packages/angular_devkit/schematics_cli:blank/schema.ts",
"//packages/angular_devkit/schematics_cli:schematic/schema.ts",
# @external_end
],
data = [
"blank/schema.json",
"collection.json",
"package.json",
"schematic/schema.json",
] + glob(
include = [
"blank/project-files/**/*",
"blank/schematic-files/**/*",
"schematic/files/**/*",
],
),
module_name = "@angular-devkit/schematics-cli",
module_root = "bin/schematics.d.ts",
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"//packages/angular_devkit/schematics",
"//packages/angular_devkit/schematics/tasks",
"//packages/angular_devkit/schematics/tools",
"@npm//@inquirer/prompts",
"@npm//@types/node",
"@npm//@types/yargs-parser",
"@npm//ansi-colors",
"@npm//symbol-observable",
"@npm//yargs-parser",
],
)
ts_library(
name = "schematics_cli_test_lib",
testonly = True,
srcs = glob(
include = [
"bin/**/*_spec.ts",
],
),
deps = [
":schematics_cli",
],
)
jasmine_node_test(
name = "schematics_cli_test",
srcs = [":schematics_cli_test_lib"],
)
ts_json_schema(
name = "blank_schema",
src = "blank/schema.json",
)
ts_json_schema(
name = "schematic_schema",
src = "schematic/schema.json",
)
genrule(
name = "license",
srcs = ["//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $(execpath //:LICENSE) $@",
)
pkg_npm(
name = "npm_package",
pkg_deps = [
"//packages/angular_devkit/schematics:package.json",
"//packages/angular_devkit/core:package.json",
],
tags = ["release-package"],
deps = [
":README.md",
":license",
":schematics_cli",
],
)