mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 01:54:04 +08:00
refactor(@angular-devkit/schematics-cli): move @schematics/schematics
into this package
This change removes the need for the `@schematics/schematics` package and moves it inside `@angular-devkit/schematics-cli`.
This commit is contained in:
parent
8185558e79
commit
f6e1fd84a2
@ -156,11 +156,6 @@
|
|||||||
"name": "Angular Schematics",
|
"name": "Angular Schematics",
|
||||||
"section": "Schematics",
|
"section": "Schematics",
|
||||||
"snapshotRepo": "angular/schematics-angular-builds"
|
"snapshotRepo": "angular/schematics-angular-builds"
|
||||||
},
|
|
||||||
"@schematics/schematics": {
|
|
||||||
"name": "Schematics Schematics",
|
|
||||||
"section": "Schematics",
|
|
||||||
"snapshotRepo": "angular/schematics-schematics-builds"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,6 @@ The following is the list of supported scopes:
|
|||||||
* **@angular-devkit/schematics-cli**
|
* **@angular-devkit/schematics-cli**
|
||||||
* **@ngtools/webpack**
|
* **@ngtools/webpack**
|
||||||
* **@schematics/angular**
|
* **@schematics/angular**
|
||||||
* **@schematics/schematics**
|
|
||||||
|
|
||||||
|
|
||||||
### Subject
|
### Subject
|
||||||
|
@ -196,7 +196,6 @@ This is a monorepo which contains many tools and packages:
|
|||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
**Angular PWA Schematics** | [`@angular/pwa`](https://npmjs.com/package/@angular/pwa) | [](https://npmjs.com/package/@angular/pwa) | [](https://github.com/angular/angular-pwa-builds)
|
**Angular PWA Schematics** | [`@angular/pwa`](https://npmjs.com/package/@angular/pwa) | [](https://npmjs.com/package/@angular/pwa) | [](https://github.com/angular/angular-pwa-builds)
|
||||||
**Angular Schematics** | [`@schematics/angular`](https://npmjs.com/package/@schematics/angular) | [](https://npmjs.com/package/@schematics/angular) | [](https://github.com/angular/schematics-angular-builds)
|
**Angular Schematics** | [`@schematics/angular`](https://npmjs.com/package/@schematics/angular) | [](https://npmjs.com/package/@schematics/angular) | [](https://github.com/angular/schematics-angular-builds)
|
||||||
**Schematics Schematics** | [`@schematics/schematics`](https://npmjs.com/package/@schematics/schematics) | [](https://npmjs.com/package/@schematics/schematics) | [](https://github.com/angular/schematics-schematics-builds)
|
|
||||||
|
|
||||||
#### Misc
|
#### Misc
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ export const analyticsPackageSafelist = [
|
|||||||
/^@angular-devkit\//,
|
/^@angular-devkit\//,
|
||||||
/^@ngtools\//,
|
/^@ngtools\//,
|
||||||
'@schematics/angular',
|
'@schematics/angular',
|
||||||
'@schematics/schematics',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export function isPackageNameSafeForAnalytics(name: string): boolean {
|
export function isPackageNameSafeForAnalytics(name: string): boolean {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
|
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
|
||||||
load("//tools:defaults.bzl", "ts_library")
|
load("//tools:defaults.bzl", "ts_library")
|
||||||
|
load("//tools:ts_json_schema.bzl", "ts_json_schema")
|
||||||
|
|
||||||
# Copyright Google Inc. All Rights Reserved.
|
# Copyright Google Inc. All Rights Reserved.
|
||||||
#
|
#
|
||||||
@ -10,24 +11,35 @@ licenses(["notice"])
|
|||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
# @angular-devkit/schematics-cli
|
# @angular-devkit/schematics-cli
|
||||||
|
|
||||||
ts_library(
|
ts_library(
|
||||||
name = "schematics_cli",
|
name = "schematics_cli",
|
||||||
srcs = glob(
|
srcs = glob(
|
||||||
include = ["bin/**/*.ts"],
|
include = ["**/*.ts"],
|
||||||
exclude = [
|
|
||||||
"bin/**/*_spec.ts",
|
|
||||||
"bin/**/*_benchmark.ts",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
# The attribute below is needed in g3 to turn off strict typechecking
|
|
||||||
# strict_checks = False,
|
|
||||||
data = glob(
|
|
||||||
include = ["**/*.json"],
|
|
||||||
exclude = [
|
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
|
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
|
||||||
"node_modules/**",
|
"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 = glob(
|
||||||
|
include = [
|
||||||
|
"collection.json",
|
||||||
|
"package.json",
|
||||||
|
"blank/schema.json",
|
||||||
|
"blank/project-files/**/*",
|
||||||
|
"blank/schematic-files/**/*",
|
||||||
|
"schematic/schema.json",
|
||||||
|
"schematic/files/**/*",
|
||||||
|
],
|
||||||
),
|
),
|
||||||
module_name = "@angular-devkit/schematics-cli",
|
module_name = "@angular-devkit/schematics-cli",
|
||||||
module_root = "bin/schematics.d.ts",
|
module_root = "bin/schematics.d.ts",
|
||||||
@ -37,7 +49,6 @@ ts_library(
|
|||||||
"//packages/angular_devkit/schematics",
|
"//packages/angular_devkit/schematics",
|
||||||
"//packages/angular_devkit/schematics/tasks",
|
"//packages/angular_devkit/schematics/tasks",
|
||||||
"//packages/angular_devkit/schematics/tools",
|
"//packages/angular_devkit/schematics/tools",
|
||||||
"//packages/schematics/schematics",
|
|
||||||
"@npm//@types/inquirer",
|
"@npm//@types/inquirer",
|
||||||
"@npm//@types/minimist",
|
"@npm//@types/minimist",
|
||||||
"@npm//@types/node",
|
"@npm//@types/node",
|
||||||
@ -66,3 +77,13 @@ jasmine_node_test(
|
|||||||
name = "schematics_cli_test",
|
name = "schematics_cli_test",
|
||||||
srcs = [":schematics_cli_test_lib"],
|
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",
|
||||||
|
)
|
||||||
|
@ -26,7 +26,7 @@ import * as minimist from 'minimist';
|
|||||||
* and show usage.
|
* and show usage.
|
||||||
*
|
*
|
||||||
* In the case where a collection name isn't part of the argument, the default is to use the
|
* In the case where a collection name isn't part of the argument, the default is to use the
|
||||||
* schematics package (@schematics/schematics) as the collection.
|
* schematics package (@angular-devkit/schematics-cli) as the collection.
|
||||||
*
|
*
|
||||||
* This logic is entirely up to the tooling.
|
* This logic is entirely up to the tooling.
|
||||||
*
|
*
|
||||||
@ -34,7 +34,7 @@ import * as minimist from 'minimist';
|
|||||||
* @return {{collection: string, schematic: (string)}}
|
* @return {{collection: string, schematic: (string)}}
|
||||||
*/
|
*/
|
||||||
function parseSchematicName(str: string | null): { collection: string, schematic: string | null } {
|
function parseSchematicName(str: string | null): { collection: string, schematic: string | null } {
|
||||||
let collection = '@schematics/schematics';
|
let collection = '@angular-devkit/schematics-cli';
|
||||||
|
|
||||||
let schematic = str;
|
let schematic = str;
|
||||||
if (schematic && schematic.indexOf(':') != -1) {
|
if (schematic && schematic.indexOf(':') != -1) {
|
||||||
@ -328,7 +328,7 @@ function getUsage(): string {
|
|||||||
--force Force overwriting files that would otherwise be an error.
|
--force Force overwriting files that would otherwise be an error.
|
||||||
|
|
||||||
--list-schematics List all schematics from the collection, by name. A collection name
|
--list-schematics List all schematics from the collection, by name. A collection name
|
||||||
should be suffixed by a colon. Example: '@schematics/schematics:'.
|
should be suffixed by a colon. Example: '@angular-devkit/schematics-cli:'.
|
||||||
|
|
||||||
--no-interactive Disables interactive input prompts.
|
--no-interactive Disables interactive input prompts.
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
"code generation",
|
"code generation",
|
||||||
"schematics"
|
"schematics"
|
||||||
],
|
],
|
||||||
|
"schematics": "./collection.json",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-devkit/core": "0.0.0",
|
"@angular-devkit/core": "0.0.0",
|
||||||
"@angular-devkit/schematics": "0.0.0",
|
"@angular-devkit/schematics": "0.0.0",
|
||||||
"@schematics/schematics": "0.0.0",
|
|
||||||
"ansi-colors": "4.1.1",
|
"ansi-colors": "4.1.1",
|
||||||
"inquirer": "8.0.0",
|
"inquirer": "8.0.0",
|
||||||
"minimist": "1.2.5",
|
"minimist": "1.2.5",
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
# 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.io/license
|
|
||||||
|
|
||||||
load("//tools:defaults.bzl", "ts_library")
|
|
||||||
load("//tools:ts_json_schema.bzl", "ts_json_schema")
|
|
||||||
|
|
||||||
licenses(["notice"]) # MIT
|
|
||||||
|
|
||||||
package(default_visibility = ["//visibility:public"])
|
|
||||||
|
|
||||||
ts_library(
|
|
||||||
name = "schematics",
|
|
||||||
srcs = glob(
|
|
||||||
include = ["**/*.ts"],
|
|
||||||
exclude = [
|
|
||||||
"**/*_spec.ts",
|
|
||||||
"**/*_benchmark.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/schematics/schematics:blank/schema.ts",
|
|
||||||
"//packages/schematics/schematics:schematic/schema.ts",
|
|
||||||
# @external_end
|
|
||||||
],
|
|
||||||
data = glob(
|
|
||||||
include = [
|
|
||||||
"collection.json",
|
|
||||||
"package.json",
|
|
||||||
"blank/schema.json",
|
|
||||||
"blank/project-files/**/*",
|
|
||||||
"blank/schematic-files/**/*",
|
|
||||||
"schematic/schema.json",
|
|
||||||
"schematic/files/**/*",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
module_name = "@schematics/schematics",
|
|
||||||
deps = [
|
|
||||||
"//packages/angular_devkit/core",
|
|
||||||
"//packages/angular_devkit/schematics",
|
|
||||||
"//packages/angular_devkit/schematics/tasks",
|
|
||||||
"@npm//@types/node",
|
|
||||||
"@npm//rxjs",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
ts_json_schema(
|
|
||||||
name = "blank_schema",
|
|
||||||
src = "blank/schema.json",
|
|
||||||
)
|
|
||||||
|
|
||||||
ts_json_schema(
|
|
||||||
name = "schematic_schema",
|
|
||||||
src = "schematic/schema.json",
|
|
||||||
)
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@schematics/schematics",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"description": "Schematics specific to Angular",
|
|
||||||
"experimental": true,
|
|
||||||
"keywords": [
|
|
||||||
"blueprints",
|
|
||||||
"code generation",
|
|
||||||
"schematics",
|
|
||||||
"schematic"
|
|
||||||
],
|
|
||||||
"schematics": "./collection.json",
|
|
||||||
"dependencies": {
|
|
||||||
"@angular-devkit/core": "0.0.0",
|
|
||||||
"@angular-devkit/schematics": "0.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -65,8 +65,9 @@
|
|||||||
"etc/cli.angular.io/**/*",
|
"etc/cli.angular.io/**/*",
|
||||||
"**/node_modules/**/*",
|
"**/node_modules/**/*",
|
||||||
"**/third_party/**/*",
|
"**/third_party/**/*",
|
||||||
"packages/schematics/*/*/*files/**/*",
|
"packages/angular_devkit/schematics_cli/*/files/**/*",
|
||||||
"packages/angular_devkit/*/test/**/*",
|
"packages/angular_devkit/*/test/**/*",
|
||||||
|
"packages/schematics/*/*/*files/**/*",
|
||||||
"tests/**/*",
|
"tests/**/*",
|
||||||
"tools/**/*",
|
"tools/**/*",
|
||||||
"integration/**/*",
|
"integration/**/*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user