Skip to content

Commit f6e1fd8

Browse files
committed
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`.
1 parent 8185558 commit f6e1fd8

38 files changed

+39
-104
lines changed

‎.monorepo.json

-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@
156156
"name": "Angular Schematics",
157157
"section": "Schematics",
158158
"snapshotRepo": "angular/schematics-angular-builds"
159-
},
160-
"@schematics/schematics": {
161-
"name": "Schematics Schematics",
162-
"section": "Schematics",
163-
"snapshotRepo": "angular/schematics-schematics-builds"
164159
}
165160
}
166161
}

‎CONTRIBUTING.md

-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ The following is the list of supported scopes:
224224
* **@angular-devkit/schematics-cli**
225225
* **@ngtools/webpack**
226226
* **@schematics/angular**
227-
* **@schematics/schematics**
228227
229228
230229
### Subject

‎README.md

-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ This is a monorepo which contains many tools and packages:
196196
|---|---|---|---|
197197
**Angular PWA Schematics** | [`@angular/pwa`](https://npmjs.com/package/@angular/pwa) | [![latest](https://img.shields.io/npm/v/%40angular%2Fpwa/latest.svg)](https://npmjs.com/package/@angular/pwa) | [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-pwa-builds)
198198
**Angular Schematics** | [`@schematics/angular`](https://npmjs.com/package/@schematics/angular) | [![latest](https://img.shields.io/npm/v/%40schematics%2Fangular/latest.svg)](https://npmjs.com/package/@schematics/angular) | [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/schematics-angular-builds)
199-
**Schematics Schematics** | [`@schematics/schematics`](https://npmjs.com/package/@schematics/schematics) | [![latest](https://img.shields.io/npm/v/%40schematics%2Fschematics/latest.svg)](https://npmjs.com/package/@schematics/schematics) | [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/schematics-schematics-builds)
200199

201200
#### Misc
202201

‎packages/angular/cli/models/analytics.ts

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const analyticsPackageSafelist = [
4747
/^@angular-devkit\//,
4848
/^@ngtools\//,
4949
'@schematics/angular',
50-
'@schematics/schematics',
5150
];
5251

5352
export function isPackageNameSafeForAnalytics(name: string): boolean {

‎packages/angular_devkit/schematics_cli/BUILD.bazel

+33-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
22
load("//tools:defaults.bzl", "ts_library")
3+
load("//tools:ts_json_schema.bzl", "ts_json_schema")
34

45
# Copyright Google Inc. All Rights Reserved.
56
#
@@ -10,24 +11,35 @@ licenses(["notice"])
1011
package(default_visibility = ["//visibility:public"])
1112

1213
# @angular-devkit/schematics-cli
13-
1414
ts_library(
1515
name = "schematics_cli",
1616
srcs = glob(
17-
include = ["bin/**/*.ts"],
18-
exclude = [
19-
"bin/**/*_spec.ts",
20-
"bin/**/*_benchmark.ts",
21-
],
22-
),
23-
# The attribute below is needed in g3 to turn off strict typechecking
24-
# strict_checks = False,
25-
data = glob(
26-
include = ["**/*.json"],
17+
include = ["**/*.ts"],
2718
exclude = [
19+
"**/*_spec.ts",
20+
"schematic/files/**",
21+
"blank/project-files/**",
22+
"blank/schematic-files/**",
2823
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
2924
"node_modules/**",
3025
],
26+
) + [
27+
# @external_begin
28+
# These files are generated from the JSON schema
29+
"//packages/angular_devkit/schematics_cli:blank/schema.ts",
30+
"//packages/angular_devkit/schematics_cli:schematic/schema.ts",
31+
# @external_end
32+
],
33+
data = glob(
34+
include = [
35+
"collection.json",
36+
"package.json",
37+
"blank/schema.json",
38+
"blank/project-files/**/*",
39+
"blank/schematic-files/**/*",
40+
"schematic/schema.json",
41+
"schematic/files/**/*",
42+
],
3143
),
3244
module_name = "@angular-devkit/schematics-cli",
3345
module_root = "bin/schematics.d.ts",
@@ -37,7 +49,6 @@ ts_library(
3749
"//packages/angular_devkit/schematics",
3850
"//packages/angular_devkit/schematics/tasks",
3951
"//packages/angular_devkit/schematics/tools",
40-
"//packages/schematics/schematics",
4152
"@npm//@types/inquirer",
4253
"@npm//@types/minimist",
4354
"@npm//@types/node",
@@ -66,3 +77,13 @@ jasmine_node_test(
6677
name = "schematics_cli_test",
6778
srcs = [":schematics_cli_test_lib"],
6879
)
80+
81+
ts_json_schema(
82+
name = "blank_schema",
83+
src = "blank/schema.json",
84+
)
85+
86+
ts_json_schema(
87+
name = "schematic_schema",
88+
src = "schematic/schema.json",
89+
)

‎packages/angular_devkit/schematics_cli/bin/schematics.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ import * as minimist from 'minimist';
2626
* and show usage.
2727
*
2828
* In the case where a collection name isn't part of the argument, the default is to use the
29-
* schematics package (@schematics/schematics) as the collection.
29+
* schematics package (@angular-devkit/schematics-cli) as the collection.
3030
*
3131
* This logic is entirely up to the tooling.
3232
*
3333
* @param str The argument to parse.
3434
* @return {{collection: string, schematic: (string)}}
3535
*/
3636
function parseSchematicName(str: string | null): { collection: string, schematic: string | null } {
37-
let collection = '@schematics/schematics';
37+
let collection = '@angular-devkit/schematics-cli';
3838

3939
let schematic = str;
4040
if (schematic && schematic.indexOf(':') != -1) {
@@ -328,7 +328,7 @@ function getUsage(): string {
328328
--force Force overwriting files that would otherwise be an error.
329329
330330
--list-schematics List all schematics from the collection, by name. A collection name
331-
should be suffixed by a colon. Example: '@schematics/schematics:'.
331+
should be suffixed by a colon. Example: '@angular-devkit/schematics-cli:'.
332332
333333
--no-interactive Disables interactive input prompts.
334334

‎packages/angular_devkit/schematics_cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"code generation",
1515
"schematics"
1616
],
17+
"schematics": "./collection.json",
1718
"dependencies": {
1819
"@angular-devkit/core": "0.0.0",
1920
"@angular-devkit/schematics": "0.0.0",
20-
"@schematics/schematics": "0.0.0",
2121
"ansi-colors": "4.1.1",
2222
"inquirer": "8.0.0",
2323
"minimist": "1.2.5",

‎packages/schematics/schematics/BUILD.bazel

-62
This file was deleted.

‎packages/schematics/schematics/package.json

-17
This file was deleted.

‎tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@
6565
"etc/cli.angular.io/**/*",
6666
"**/node_modules/**/*",
6767
"**/third_party/**/*",
68-
"packages/schematics/*/*/*files/**/*",
68+
"packages/angular_devkit/schematics_cli/*/files/**/*",
6969
"packages/angular_devkit/*/test/**/*",
70+
"packages/schematics/*/*/*files/**/*",
7071
"tests/**/*",
7172
"tools/**/*",
7273
"integration/**/*",

0 commit comments

Comments
 (0)