Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(schematics): make v6 migration work #10853

Merged
merged 1 commit into from Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,13 @@
<a name="6.0.0-rc.11"></a>
# [6.0.0-rc.11](https://github.com/angular/material2/compare/6.0.0-rc.5...6.0.0-rc.11) (2018-04-13)


### Bug Fixes

* **schematics:** Fix a number of issues with ng-update schematic for v5 -> v6 migration



<a name="6.0.0-rc.5"></a>
# [6.0.0-rc.5](https://github.com/angular/material2/compare/6.0.0-rc.4...6.0.0-rc.5) (2018-04-13)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -20,7 +20,7 @@
"docs": "gulp docs",
"api": "gulp api-docs"
},
"version": "6.0.0-rc.5",
"version": "6.0.0-rc.11",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it going from rc.5 to rc.11?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is because this was published to NPM as rc.11 already, and this is an after-the-fact update

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep; it's not yet possible to test ng update without publishing to npm

"license": "MIT",
"engines": {
"node": ">= 5.4.1"
Expand Down
7 changes: 7 additions & 0 deletions src/cdk/package.json
Expand Up @@ -29,5 +29,12 @@
"dependencies": {
"tslib": "^1.7.1"
},
"ng-update": {
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-moment-adapter"
]
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion src/lib/package.json
Expand Up @@ -31,7 +31,7 @@
},
"schematics": "./schematics/collection.json",
"ng-update": {
"migrations": "schematics/migration.json",
"migrations": "./schematics/migration.json",
"packageGroup": [
"@angular/material",
"@angular/cdk",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/schematics/BUILD.bazel
Expand Up @@ -16,6 +16,6 @@ npm_package(
name = "npm_package",
srcs = [
":collection.json",
] + glob(["**/files/**/*", "**/data/**/*", "**/schema.json"]),
] + glob(["**/files/**/*", "**/data/**/*", "**/schema.json", "**/migration.json"]),
deps = [":schematics"],
)
16 changes: 0 additions & 16 deletions src/lib/schematics/collection.json
Expand Up @@ -10,22 +10,6 @@
"aliases": ["material-shell"]
},

// Group of schematics used to update Angular CDK and Angular Material.
"ng-update": {
"description": "Updates API usage for the most recent major version of Angular CDK and Angular Material",
"factory": "./update/update"
},
"ng-post-update": {
"description": "Performs cleanup after ng-update.",
"factory": "./update/update#postUpdate",
"private": true
},
"ng-post-post-update": {
"description": "Logs completion message for ng-update after ng-post-update.",
"factory": "./update/update#postPostUpdate",
"private": true
},

// Create a dashboard component
"materialDashboard": {
"description": "Create a card-based dashboard component",
Expand Down
11 changes: 11 additions & 0 deletions src/lib/schematics/migration.json
Expand Up @@ -4,7 +4,18 @@
// Update from v5 to v6
"migration-01": {
"version": "6",
"description": "Updates Angular Material from v5 to v6",
"factory": "./update/update"
},
"ng-post-update": {
"description": "Performs cleanup after ng-update.",
"factory": "./update/update#postUpdate",
"private": true
},
"ng-post-post-update": {
"description": "Logs completion message for ng-update after ng-post-update.",
"factory": "./update/update#postPostUpdate",
"private": true
}
}
}
2 changes: 1 addition & 1 deletion src/lib/schematics/update/update.ts
Expand Up @@ -59,7 +59,7 @@ export default function(): Rule {
}, {
silent: false,
ignoreErrors: true,
tsConfigPath: './tsconfig.json',
tsConfigPath: './src/tsconfig.json',
}), [downgradeTask]);

// Upgrade @angular/material back to 6.x.
Expand Down
7 changes: 7 additions & 0 deletions src/material-moment-adapter/package.json
Expand Up @@ -22,5 +22,12 @@
},
"dependencies": {
"tslib": "^1.7.1"
},
"ng-update": {
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-moment-adapter"
]
}
}
2 changes: 1 addition & 1 deletion tools/gulp/tasks/material-release.ts
Expand Up @@ -32,7 +32,7 @@ const allScssGlob = join(buildConfig.packagesDir, '**/*.scss');
const schematicsGlobs = [
// File templates and schemas are copied as-is from source.
join(schematicsDir, '**/+(data|files)/**/*'),
join(schematicsDir, '**/+(schema|collection).json'),
join(schematicsDir, '**/+(schema|collection|migration).json'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@jelbourn jelbourn Apr 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch. Done.


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