Skip to content

Commit 2449571

Browse files
devversionmmalerba
authored andcommitted
refactor(schematics): group ng-generate schematics in folder (#13794)
* Similarly to the CDK schematics, schematics that can be (ng-)`generated` should be grouped into its own directory. This cleans up the schematics folder and makes it clear where each schematic lives. * Removes a tslint ignore comment in a schematic test.
1 parent fb98ab7 commit 2449571

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+26
-26
lines changed

src/lib/schematics/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ load("//tools:defaults.bzl", "jasmine_node_test")
77

88
filegroup(
99
name = "schematics_assets",
10-
srcs = glob(["**/files/**/*", "**/*.json"]),
10+
srcs = glob(["ng-generate/*/files/**/*", "**/*.json"]),
1111
)
1212

1313
ts_library(
1414
name = "schematics",
1515
module_name = "@angular/material/schematics",
1616
srcs = glob(["**/*.ts"], exclude=[
17-
"**/files/**/*.ts",
1817
"**/*.spec.ts",
19-
"ng-update/test-cases/**/*",
18+
"ng-update/test-cases/**/*.ts",
19+
"ng-generate/*/files/**/*.ts",
2020
]),
2121
deps = [
2222
"//src/cdk/schematics",
@@ -49,7 +49,7 @@ jasmine_node_test(
4949

5050
ts_library(
5151
name = "schematics_test_sources",
52-
srcs = glob(["**/*.spec.ts"], exclude=["**/files/**/*.spec.ts"]),
52+
srcs = glob(["**/*.spec.ts"], exclude=["ng-generate/*/files/**/*.spec.ts"]),
5353
deps = [
5454
":schematics",
5555
"//src/cdk/schematics",

src/lib/schematics/collection.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,36 @@
1818
// Create a dashboard component
1919
"dashboard": {
2020
"description": "Create a card-based dashboard component",
21-
"factory": "./dashboard/index",
22-
"schema": "./dashboard/schema.json",
21+
"factory": "./ng-generate/dashboard/index",
22+
"schema": "./ng-generate/dashboard/schema.json",
2323
"aliases": ["material-dashboard"]
2424
},
2525
// Creates a table component
2626
"table": {
2727
"description": "Create a component that displays data with a data-table",
28-
"factory": "./table/index",
29-
"schema": "./table/schema.json",
28+
"factory": "./ng-generate/table/index",
29+
"schema": "./ng-generate/table/schema.json",
3030
"aliases": ["material-table"]
3131
},
3232
// Creates toolbar and navigation components
3333
"nav": {
3434
"description": "Create a component with a responsive sidenav for navigation",
35-
"factory": "./nav/index",
36-
"schema": "./nav/schema.json",
35+
"factory": "./ng-generate/nav/index",
36+
"schema": "./ng-generate/nav/schema.json",
3737
"aliases": ["material-nav", "materialNav"]
3838
},
3939
// Create a file tree component
4040
"tree": {
4141
"description": "Create a file tree component.",
42-
"factory": "./tree/index",
43-
"schema": "./tree/schema.json",
42+
"factory": "./ng-generate/tree/index",
43+
"schema": "./ng-generate/tree/schema.json",
4444
"aliases": ["material-tree"]
4545
},
4646
// Creates a address form component
4747
"addressForm": {
4848
"description": "Create a component with a address form",
49-
"factory": "./address-form/index",
50-
"schema": "./address-form/schema.json",
49+
"factory": "./ng-generate/address-form/index",
50+
"schema": "./ng-generate/address-form/schema.json",
5151
"aliases": ["address-form", "material-address-form", "material-addressForm"]
5252
}
5353
}

src/lib/schematics/address-form/index.spec.ts renamed to src/lib/schematics/ng-generate/address-form/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Material address-form schematic', () => {
1212
};
1313

1414
beforeEach(() => {
15-
runner = new SchematicTestRunner('schematics', require.resolve('../collection.json'));
15+
runner = new SchematicTestRunner('schematics', require.resolve('../../collection.json'));
1616
});
1717

1818
it('should create address-form files and add them to module', () => {

0 commit comments

Comments
 (0)