Skip to content

Commit c9f5be6

Browse files
jelbournmmalerba
authored andcommitted
fix(schematics): make v6 migration work (#10853)
This includes: * Adding missing schema json to package * Add missing packageGroup entries to material, cdk, and moment-adapter * Move schematics for migration to the migrate-specific schema * Bump version to 6.0.0-rc.11
1 parent 189a0da commit c9f5be6

File tree

10 files changed

+40
-21
lines changed

10 files changed

+40
-21
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<a name="6.0.0-rc.11"></a>
2+
# [6.0.0-rc.11](https://github.com/angular/material2/compare/6.0.0-rc.5...6.0.0-rc.11) (2018-04-13)
3+
4+
5+
### Bug Fixes
6+
7+
* **schematics:** Fix a number of issues with ng-update schematic for v5 -> v6 migration
8+
9+
10+
111
<a name="6.0.0-rc.5"></a>
212
# [6.0.0-rc.5](https://github.com/angular/material2/compare/6.0.0-rc.4...6.0.0-rc.5) (2018-04-13)
313

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"docs": "gulp docs",
2121
"api": "gulp api-docs"
2222
},
23-
"version": "6.0.0-rc.5",
23+
"version": "6.0.0-rc.11",
2424
"license": "MIT",
2525
"engines": {
2626
"node": ">= 5.4.1"

src/cdk/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@
2929
"dependencies": {
3030
"tslib": "^1.7.1"
3131
},
32+
"ng-update": {
33+
"packageGroup": [
34+
"@angular/material",
35+
"@angular/cdk",
36+
"@angular/material-moment-adapter"
37+
]
38+
},
3239
"sideEffects": false
3340
}

src/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"schematics": "./schematics/collection.json",
3333
"ng-update": {
34-
"migrations": "schematics/migration.json",
34+
"migrations": "./schematics/migration.json",
3535
"packageGroup": [
3636
"@angular/material",
3737
"@angular/cdk",

src/lib/schematics/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ npm_package(
1616
name = "npm_package",
1717
srcs = [
1818
":collection.json",
19-
] + glob(["**/files/**/*", "**/data/**/*", "**/schema.json"]),
19+
] + glob(["**/files/**/*", "**/data/**/*", "**/schema.json", "**/migration.json"]),
2020
deps = [":schematics"],
2121
)

src/lib/schematics/collection.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,6 @@
1010
"aliases": ["material-shell"]
1111
},
1212

13-
// Group of schematics used to update Angular CDK and Angular Material.
14-
"ng-update": {
15-
"description": "Updates API usage for the most recent major version of Angular CDK and Angular Material",
16-
"factory": "./update/update"
17-
},
18-
"ng-post-update": {
19-
"description": "Performs cleanup after ng-update.",
20-
"factory": "./update/update#postUpdate",
21-
"private": true
22-
},
23-
"ng-post-post-update": {
24-
"description": "Logs completion message for ng-update after ng-post-update.",
25-
"factory": "./update/update#postPostUpdate",
26-
"private": true
27-
},
28-
2913
// Create a dashboard component
3014
"materialDashboard": {
3115
"description": "Create a card-based dashboard component",

src/lib/schematics/migration.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44
// Update from v5 to v6
55
"migration-01": {
66
"version": "6",
7+
"description": "Updates Angular Material from v5 to v6",
78
"factory": "./update/update"
9+
},
10+
"ng-post-update": {
11+
"description": "Performs cleanup after ng-update.",
12+
"factory": "./update/update#postUpdate",
13+
"private": true
14+
},
15+
"ng-post-post-update": {
16+
"description": "Logs completion message for ng-update after ng-post-update.",
17+
"factory": "./update/update#postPostUpdate",
18+
"private": true
819
}
920
}
1021
}

src/lib/schematics/update/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function(): Rule {
5959
}, {
6060
silent: false,
6161
ignoreErrors: true,
62-
tsConfigPath: './tsconfig.json',
62+
tsConfigPath: './src/tsconfig.json',
6363
}), [downgradeTask]);
6464

6565
// Upgrade @angular/material back to 6.x.

src/material-moment-adapter/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,12 @@
2222
},
2323
"dependencies": {
2424
"tslib": "^1.7.1"
25+
},
26+
"ng-update": {
27+
"packageGroup": [
28+
"@angular/material",
29+
"@angular/cdk",
30+
"@angular/material-moment-adapter"
31+
]
2532
}
2633
}

tools/gulp/tasks/material-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const allScssGlob = join(buildConfig.packagesDir, '**/*.scss');
3232
const schematicsGlobs = [
3333
// File templates and schemas are copied as-is from source.
3434
join(schematicsDir, '**/+(data|files)/**/*'),
35-
join(schematicsDir, '**/+(schema|collection).json'),
35+
join(schematicsDir, '**/+(schema|collection|migration).json'),
3636

3737
// JavaScript files compiled from the TypeScript sources.
3838
join(distDir, 'schematics', '**/*.js?(.map)'),

0 commit comments

Comments
 (0)