index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. /**
  3. * @license
  4. * Copyright Google LLC All Rights Reserved.
  5. *
  6. * Use of this source code is governed by an MIT-style license that can be
  7. * found in the LICENSE file at https://angular.io/license
  8. */
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. const chalk_1 = require("chalk");
  11. const target_version_1 = require("../update-tool/target-version");
  12. const upgrade_data_1 = require("./upgrade-data");
  13. const upgrade_rules_1 = require("./upgrade-rules");
  14. /** Entry point for the migration schematics with target of Angular Material 6.0.0 */
  15. function updateToV6() {
  16. return upgrade_rules_1.createUpgradeRule(target_version_1.TargetVersion.V6, [], upgrade_data_1.cdkUpgradeData, onMigrationComplete);
  17. }
  18. exports.updateToV6 = updateToV6;
  19. /** Entry point for the migration schematics with target of Angular Material 7.0.0 */
  20. function updateToV7() {
  21. return upgrade_rules_1.createUpgradeRule(target_version_1.TargetVersion.V7, [], upgrade_data_1.cdkUpgradeData, onMigrationComplete);
  22. }
  23. exports.updateToV7 = updateToV7;
  24. /** Entry point for the migration schematics with target of Angular Material 8.0.0 */
  25. function updateToV8() {
  26. return upgrade_rules_1.createUpgradeRule(target_version_1.TargetVersion.V8, [], upgrade_data_1.cdkUpgradeData, onMigrationComplete);
  27. }
  28. exports.updateToV8 = updateToV8;
  29. /** Function that will be called when the migration completed. */
  30. function onMigrationComplete(targetVersion, hasFailures) {
  31. console.log();
  32. console.log(chalk_1.default.green(` ✓ Updated Angular CDK to ${targetVersion}`));
  33. console.log();
  34. if (hasFailures) {
  35. console.log(chalk_1.default.yellow(' ⚠ Some issues were detected but could not be fixed automatically. Please check the ' +
  36. 'output above and fix these issues manually.'));
  37. }
  38. }
  39. //# sourceMappingURL=index.js.map