@angular/material
Version:
Angular Material
68 lines • 2.81 kB
JavaScript
;
/**
* @license
* Copyright Google LLC 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
*/
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular/cdk/schematics");
const chalk_1 = require("chalk");
const path_1 = require("path");
const upgrade_data_1 = require("./upgrade-data");
/** List of additional upgrade rules for Angular Material. */
const upgradeRules = [
// Misc check rules
'check-class-names-misc',
'check-imports-misc',
'check-property-names-misc',
'check-template-misc',
'update-angular-material-imports',
// Class inheritance misc V6. NOTE: when adding new
// data to this rule, consider adding it to the generic
// property-names upgrade data.
['check-class-inheritance-misc', schematics_1.TargetVersion.V6],
// Ripple misc V7
['ripple-speed-factor-assignment', schematics_1.TargetVersion.V7],
['ripple-speed-factor-template', schematics_1.TargetVersion.V7],
];
/** List of absolute paths that refer to directories that contain the Material upgrade rules. */
const ruleDirectories = [
'misc-checks/',
'misc-ripples-v7/',
'package-imports-v8/',
].map(relativePath => path_1.join(__dirname, 'upgrade-rules/', relativePath));
/** TSLint upgrade configuration that will be passed to the CDK ng-update rule. */
const tslintUpgradeConfig = {
upgradeData: upgrade_data_1.materialUpgradeData,
extraRuleDirectories: ruleDirectories,
extraUpgradeRules: upgradeRules,
};
/** Entry point for the migration schematics with target of Angular Material v6 */
function updateToV6() {
return schematics_1.createUpgradeRule(schematics_1.TargetVersion.V6, tslintUpgradeConfig);
}
exports.updateToV6 = updateToV6;
/** Entry point for the migration schematics with target of Angular Material v7 */
function updateToV7() {
return schematics_1.createUpgradeRule(schematics_1.TargetVersion.V7, tslintUpgradeConfig);
}
exports.updateToV7 = updateToV7;
/** Entry point for the migration schematics with target of Angular Material v8 */
function updateToV8() {
return schematics_1.createUpgradeRule(schematics_1.TargetVersion.V8, tslintUpgradeConfig);
}
exports.updateToV8 = updateToV8;
/** Post-update schematic to be called when update is finished. */
function postUpdate() {
return () => {
console.log();
console.log(chalk_1.green(' ✓ Angular Material update complete'));
console.log();
console.log(chalk_1.yellow(' ⚠ Please check the output above for any issues that were detected ' +
'but could not be automatically fixed.'));
};
}
exports.postUpdate = postUpdate;
//# sourceMappingURL=index.js.map