@skyux/packages 15.0.0-alpha.4 → 15.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/migrations.json +21 -6
  2. package/package.json +66 -66
  3. package/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.d.ts +2 -0
  4. package/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.js +140 -0
  5. package/src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic.js.map +1 -0
  6. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.d.ts +7 -0
  7. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.js +59 -0
  8. package/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.js.map +1 -0
  9. package/src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-testing-imports.schematic.d.ts +8 -0
  10. package/src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-testing-imports.schematic.js +58 -0
  11. package/src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-testing-imports.schematic.js.map +1 -0
  12. package/src/schematics/rules/convert-grid-to-data-grid/convert-grid-to-data-grid.js +1 -1
  13. package/src/schematics/rules/convert-page-summary-to-page-header/convert-page-summary-to-page-header.js +1 -1
  14. package/src/schematics/rules/convert-progress-indicator-wizard-to-tab-wizard/convert-progress-indicator-wizard-to-tab-wizard.js +1 -1
  15. package/src/schematics/utility/typescript/combine-imports.d.ts +7 -0
  16. package/src/schematics/utility/typescript/combine-imports.js +52 -0
  17. package/src/schematics/utility/typescript/combine-imports.js.map +1 -0
  18. package/src/schematics/utility/typescript/imports.d.ts +25 -0
  19. package/src/schematics/utility/typescript/imports.js +59 -0
  20. package/src/schematics/utility/typescript/imports.js.map +1 -0
  21. package/src/schematics/utility/typescript/remove-import.js +39 -25
  22. package/src/schematics/utility/typescript/remove-import.js.map +1 -1
  23. package/src/schematics/utility/typescript/swap-imported-class.js +74 -32
  24. package/src/schematics/utility/typescript/swap-imported-class.js.map +1 -1
  25. package/src/version.js +1 -1
package/migrations.json CHANGED
@@ -1,34 +1,49 @@
1
1
  {
2
2
  "schematics": {
3
3
  "noop": {
4
- "version": "15.0.0-alpha.4",
4
+ "version": "15.0.0-alpha.6",
5
5
  "factory": "./src/schematics/migrations/all/noop/noop.schematic",
6
6
  "description": "Update all SKY UX component packages"
7
7
  },
8
8
  "i18n-resources-module": {
9
- "version": "15.0.0-alpha.4",
9
+ "version": "15.0.0-alpha.6",
10
10
  "factory": "./src/schematics/migrations/all/i18n-resources-module/i18n-resources-module.schematic",
11
11
  "description": "Regenerate i18n resources modules for libraries."
12
12
  },
13
13
  "remove-old-compat-stylesheets": {
14
- "version": "15.0.0-alpha.4",
14
+ "version": "15.0.0-alpha.6",
15
15
  "factory": "./src/schematics/migrations/all/remove-old-compat-stylesheets/remove-old-compat-stylesheets.schematic",
16
16
  "description": "Remove backward compatible stylesheets for older versions of SKY UX."
17
17
  },
18
18
  "workspace-check": {
19
- "version": "15.0.0-alpha.4",
19
+ "version": "15.0.0-alpha.6",
20
20
  "factory": "./src/schematics/migrations/all/workspace-check/workspace-check.schematic",
21
21
  "description": "Log warnings if the workspace is not configured correctly."
22
22
  },
23
23
  "migrate-dragula-polyfill": {
24
- "version": "15.0.0-alpha.4",
24
+ "version": "15.0.0-alpha.6",
25
25
  "factory": "./src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic",
26
26
  "description": "Remove the @skyux/packages/polyfills entry from project config, replacing it with a local copy when Dragula is still installed."
27
27
  },
28
28
  "remove-timepicker-retain-invalid-values": {
29
- "version": "15.0.0-alpha.4",
29
+ "version": "15.0.0-alpha.6",
30
30
  "factory": "./src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic",
31
31
  "description": "Remove the skyTimepickerRetainInvalidValues input from timepicker inputs since retaining invalid values is now the default behavior."
32
+ },
33
+ "add-compat-stylesheets": {
34
+ "version": "15.0.0-alpha.6",
35
+ "factory": "./src/schematics/migrations/update-15/add-compat-stylesheets/add-compat-stylesheet.schematic",
36
+ "description": "Add a backwards-compatible stylesheet with styles that have been removed from components in SKY UX 15."
37
+ },
38
+ "migrate-sdk-testing-imports": {
39
+ "version": "15.0.0-alpha.6",
40
+ "factory": "./src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-testing-imports.schematic",
41
+ "description": "Move SkyAppTestUtility, SkyAppTestUtilityDomEventOptions, and SkyBy imports from the deprecated @skyux-sdk/testing package to @skyux/core/testing."
42
+ },
43
+ "legacy-i18n-services": {
44
+ "version": "15.0.0-alpha.6",
45
+ "factory": "./src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic",
46
+ "description": "Replace SkyAppResourcesService and SkyLibResourcesService with their legacy equivalents since the originals now emit whenever the locale changes."
32
47
  }
33
48
  }
34
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/packages",
3
- "version": "15.0.0-alpha.4",
3
+ "version": "15.0.0-alpha.6",
4
4
  "author": "Blackbaud, Inc.",
5
5
  "description": "Handles the `ng update` command for SKY UX component libraries.",
6
6
  "keywords": [
@@ -32,80 +32,80 @@
32
32
  "ng-update": {
33
33
  "migrations": "./migrations.json",
34
34
  "packageGroup": {
35
- "@skyux/packages": "15.0.0-alpha.4",
35
+ "@skyux/packages": "15.0.0-alpha.6",
36
36
  "@blackbaud/angular-tree-component": "^1.0.0",
37
- "@skyux-sdk/eslint-schematics": "15.0.0-alpha.4",
38
- "@skyux-sdk/stylelint-schematics": "15.0.0-alpha.4",
39
- "@skyux-sdk/testing": "15.0.0-alpha.4",
40
- "@skyux-sdk/testing-schematics": "15.0.0-alpha.4",
41
- "@skyux/a11y": "15.0.0-alpha.4",
42
- "@skyux/action-bars": "15.0.0-alpha.4",
43
- "@skyux/ag-grid": "15.0.0-alpha.4",
44
- "@skyux/angular-tree-component": "15.0.0-alpha.4",
45
- "@skyux/animations": "15.0.0-alpha.4",
46
- "@skyux/assets": "15.0.0-alpha.4",
47
- "@skyux/autonumeric": "15.0.0-alpha.4",
48
- "@skyux/avatar": "15.0.0-alpha.4",
49
- "@skyux/charts": "15.0.0-alpha.4",
50
- "@skyux/code-examples": "15.0.0-alpha.4",
51
- "@skyux/colorpicker": "15.0.0-alpha.4",
52
- "@skyux/config": "15.0.0-alpha.4",
53
- "@skyux/core": "15.0.0-alpha.4",
54
- "@skyux/data-grid": "15.0.0-alpha.4",
55
- "@skyux/data-manager": "15.0.0-alpha.4",
56
- "@skyux/datetime": "15.0.0-alpha.4",
57
- "@skyux/docs-tools": "15.0.0-alpha.4",
58
- "@skyux/errors": "15.0.0-alpha.4",
59
- "@skyux/filter-bar": "15.0.0-alpha.4",
60
- "@skyux/flyout": "15.0.0-alpha.4",
61
- "@skyux/forms": "15.0.0-alpha.4",
62
- "@skyux/grids": "15.0.0-alpha.4",
63
- "@skyux/help-inline": "15.0.0-alpha.4",
64
- "@skyux/i18n": "15.0.0-alpha.4",
65
- "@skyux/icon": "15.0.0-alpha.4",
66
- "@skyux/icons": "^11.2.0",
67
- "@skyux/indicators": "15.0.0-alpha.4",
68
- "@skyux/inline-form": "15.0.0-alpha.4",
69
- "@skyux/layout": "15.0.0-alpha.4",
70
- "@skyux/list-builder": "15.0.0-alpha.4",
71
- "@skyux/list-builder-common": "15.0.0-alpha.4",
72
- "@skyux/list-builder-view-checklist": "15.0.0-alpha.4",
73
- "@skyux/list-builder-view-grids": "15.0.0-alpha.4",
74
- "@skyux/lists": "15.0.0-alpha.4",
75
- "@skyux/lookup": "15.0.0-alpha.4",
76
- "@skyux/manifest": "15.0.0-alpha.4",
77
- "@skyux/modals": "15.0.0-alpha.4",
78
- "@skyux/navbar": "15.0.0-alpha.4",
79
- "@skyux/pages": "15.0.0-alpha.4",
80
- "@skyux/phone-field": "15.0.0-alpha.4",
81
- "@skyux/popovers": "15.0.0-alpha.4",
82
- "@skyux/progress-indicator": "15.0.0-alpha.4",
83
- "@skyux/router": "15.0.0-alpha.4",
84
- "@skyux/select-field": "15.0.0-alpha.4",
85
- "@skyux/split-view": "15.0.0-alpha.4",
86
- "@skyux/tabs": "15.0.0-alpha.4",
87
- "@skyux/text-editor": "15.0.0-alpha.4",
88
- "@skyux/theme": "15.0.0-alpha.4",
89
- "@skyux/tiles": "15.0.0-alpha.4",
90
- "@skyux/toast": "15.0.0-alpha.4",
91
- "@skyux/validation": "15.0.0-alpha.4",
92
- "ag-grid-angular": "^36.0.2",
93
- "ag-grid-community": "^36.0.2",
37
+ "@skyux-sdk/eslint-schematics": "15.0.0-alpha.6",
38
+ "@skyux-sdk/stylelint-schematics": "15.0.0-alpha.6",
39
+ "@skyux-sdk/testing": "15.0.0-alpha.6",
40
+ "@skyux-sdk/testing-schematics": "15.0.0-alpha.6",
41
+ "@skyux-sdk/vitest": "15.0.0-alpha.6",
42
+ "@skyux/a11y": "15.0.0-alpha.6",
43
+ "@skyux/action-bars": "15.0.0-alpha.6",
44
+ "@skyux/ag-grid": "15.0.0-alpha.6",
45
+ "@skyux/angular-tree-component": "15.0.0-alpha.6",
46
+ "@skyux/animations": "15.0.0-alpha.6",
47
+ "@skyux/assets": "15.0.0-alpha.6",
48
+ "@skyux/autonumeric": "15.0.0-alpha.6",
49
+ "@skyux/avatar": "15.0.0-alpha.6",
50
+ "@skyux/charts": "15.0.0-alpha.6",
51
+ "@skyux/code-examples": "15.0.0-alpha.6",
52
+ "@skyux/colorpicker": "15.0.0-alpha.6",
53
+ "@skyux/config": "15.0.0-alpha.6",
54
+ "@skyux/core": "15.0.0-alpha.6",
55
+ "@skyux/data-grid": "15.0.0-alpha.6",
56
+ "@skyux/data-manager": "15.0.0-alpha.6",
57
+ "@skyux/datetime": "15.0.0-alpha.6",
58
+ "@skyux/docs-tools": "15.0.0-alpha.6",
59
+ "@skyux/errors": "15.0.0-alpha.6",
60
+ "@skyux/filter-bar": "15.0.0-alpha.6",
61
+ "@skyux/flyout": "15.0.0-alpha.6",
62
+ "@skyux/forms": "15.0.0-alpha.6",
63
+ "@skyux/grids": "15.0.0-alpha.6",
64
+ "@skyux/help-inline": "15.0.0-alpha.6",
65
+ "@skyux/i18n": "15.0.0-alpha.6",
66
+ "@skyux/icon": "15.0.0-alpha.6",
67
+ "@skyux/icons": "^11.4.0",
68
+ "@skyux/indicators": "15.0.0-alpha.6",
69
+ "@skyux/inline-form": "15.0.0-alpha.6",
70
+ "@skyux/layout": "15.0.0-alpha.6",
71
+ "@skyux/list-builder": "15.0.0-alpha.6",
72
+ "@skyux/list-builder-common": "15.0.0-alpha.6",
73
+ "@skyux/list-builder-view-checklist": "15.0.0-alpha.6",
74
+ "@skyux/list-builder-view-grids": "15.0.0-alpha.6",
75
+ "@skyux/lists": "15.0.0-alpha.6",
76
+ "@skyux/lookup": "15.0.0-alpha.6",
77
+ "@skyux/manifest": "15.0.0-alpha.6",
78
+ "@skyux/modals": "15.0.0-alpha.6",
79
+ "@skyux/navbar": "15.0.0-alpha.6",
80
+ "@skyux/pages": "15.0.0-alpha.6",
81
+ "@skyux/phone-field": "15.0.0-alpha.6",
82
+ "@skyux/popovers": "15.0.0-alpha.6",
83
+ "@skyux/progress-indicator": "15.0.0-alpha.6",
84
+ "@skyux/router": "15.0.0-alpha.6",
85
+ "@skyux/split-view": "15.0.0-alpha.6",
86
+ "@skyux/tabs": "15.0.0-alpha.6",
87
+ "@skyux/text-editor": "15.0.0-alpha.6",
88
+ "@skyux/theme": "15.0.0-alpha.6",
89
+ "@skyux/tiles": "15.0.0-alpha.6",
90
+ "@skyux/toast": "15.0.0-alpha.6",
91
+ "@skyux/validation": "15.0.0-alpha.6",
92
+ "ag-grid-angular": "^36.1.0",
93
+ "ag-grid-community": "^36.1.0",
94
94
  "ag-grid-enterprise": "^36.0.2",
95
95
  "autonumeric": "^4.10.10",
96
- "eslint-config-skyux": "15.0.0-alpha.4",
97
- "skyux-eslint": "15.0.0-alpha.4",
98
- "skyux-stylelint": "15.0.0-alpha.4",
99
- "stylelint-config-skyux": "15.0.0-alpha.4"
96
+ "eslint-config-skyux": "15.0.0-alpha.6",
97
+ "skyux-eslint": "15.0.0-alpha.6",
98
+ "skyux-stylelint": "15.0.0-alpha.6",
99
+ "stylelint-config-skyux": "15.0.0-alpha.6"
100
100
  }
101
101
  },
102
102
  "peerDependencies": {
103
- "@angular/cli": "^22.0.6",
104
- "@angular/core": "^22.0.6",
103
+ "@angular/cli": "^22.1.4",
104
+ "@angular/core": "^22.1.2",
105
105
  "typescript": "^6.0.3"
106
106
  },
107
107
  "dependencies": {
108
- "@blackbaud/skyux-design-tokens": "7.0.0-alpha.1",
108
+ "@blackbaud/skyux-design-tokens": "7.0.0-alpha.3",
109
109
  "fs-extra": "11.3.6",
110
110
  "jsonc-parser": "3.3.1",
111
111
  "parse5": "7.3.0",
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export default function (): Rule;
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const utility_1 = require("@schematics/angular/utility");
6
+ const workspace_1 = require("@schematics/angular/utility/workspace");
7
+ const version_1 = require("../../../../version");
8
+ const tree_1 = require("../../../utility/tree");
9
+ const workspace_2 = require("../../../utility/workspace");
10
+ const COMPAT_CSS_FILE_NAME = `skyux${version_1.VERSION.major}-compat.css`;
11
+ const compatStyles = {
12
+ libraries: [
13
+ {
14
+ name: '@skyux/theme',
15
+ components: [
16
+ {
17
+ name: 'button',
18
+ styles: [
19
+ {
20
+ css: `
21
+ :root {
22
+ --sky-compat-btn-disabled-pointer-events: none;
23
+ }
24
+ `,
25
+ instructions: `
26
+ Pointer events are no longer disabled on elements with the "sky-btn-disabled" class or the "disabled" attribute. To address this change, remove this block of code, then either add the "disabled" attribute to the element (preferred) or update any click and keyboard handlers to ignore interaction while the element is disabled.`,
27
+ },
28
+ ],
29
+ },
30
+ ],
31
+ },
32
+ ],
33
+ };
34
+ function getProjectAppPath(project) {
35
+ return `${(0, workspace_2.getSourceRoot)(project)}/app`;
36
+ }
37
+ function buildCommentBlock(message) {
38
+ return `/${'*'.repeat(79)}
39
+ * ${message.replace(/(?![^\n]{1,75}$)([^\n]{1,75})\s/g, '$1\n * ')}
40
+ ${'*'.repeat(79)}/`;
41
+ }
42
+ function buildComponentCss(component) {
43
+ let contents = buildCommentBlock(`COMPONENT: ${component.name.toUpperCase()}`);
44
+ for (const style of component.styles) {
45
+ contents += `
46
+
47
+ ${buildCommentBlock(style.instructions.trim())}
48
+
49
+ ${style.css.trim()}
50
+ `;
51
+ }
52
+ return contents;
53
+ }
54
+ function writeStylesheet(sourceRoot, contents) {
55
+ const filePath = `${sourceRoot}/${COMPAT_CSS_FILE_NAME}`;
56
+ return (tree) => {
57
+ if (tree.exists(filePath)) {
58
+ tree.overwrite(filePath, contents);
59
+ }
60
+ else {
61
+ tree.create(filePath, contents);
62
+ }
63
+ };
64
+ }
65
+ function addStylesheetToStylesArray(styles, filePath) {
66
+ if (styles && !styles.includes(filePath)) {
67
+ styles.push(filePath);
68
+ }
69
+ }
70
+ function addStylesheetToWorkspace() {
71
+ return () => (0, utility_1.updateWorkspace)((workspace) => {
72
+ for (const project of workspace.projects.values()) {
73
+ for (const targetName of ['build', 'test']) {
74
+ if (project.extensions['projectType'] === 'application') {
75
+ const target = project.targets.get(targetName);
76
+ const sourceRoot = getProjectAppPath(project);
77
+ const filePath = `${sourceRoot}/${COMPAT_CSS_FILE_NAME}`;
78
+ /* istanbul ignore else */
79
+ if (target && target.options) {
80
+ target.options['styles'] ??= [];
81
+ addStylesheetToStylesArray(target.options['styles'], filePath);
82
+ // A configuration's `styles` array replaces (rather than
83
+ // merges with) the target's base `styles` array, so any
84
+ // configuration that already declares its own `styles` needs
85
+ // the compatibility stylesheet appended too.
86
+ for (const configuration of Object.values(target.configurations ?? {})) {
87
+ addStylesheetToStylesArray(configuration?.['styles'], filePath);
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ });
94
+ }
95
+ function getCompatStyles(tree) {
96
+ let contents = '';
97
+ const packageJson = JSON.parse((0, tree_1.readRequiredFile)(tree, '/package.json'));
98
+ for (const library of compatStyles.libraries) {
99
+ if (packageJson.dependencies?.[library.name] ||
100
+ packageJson.devDependencies?.[library.name]) {
101
+ for (const component of library.components) {
102
+ contents += `
103
+ ${buildComponentCss(component)}`;
104
+ }
105
+ }
106
+ }
107
+ return contents
108
+ ? `${buildCommentBlock(`TODO: The following component libraries introduced visual breaking ` +
109
+ `changes in SKY UX ${version_1.VERSION.major}. Each block of CSS reintroduces ` +
110
+ `the styles that were changed or removed for backward compatibility. ` +
111
+ `You will need to do the following before migrating to the next major ` +
112
+ `version of SKY UX:
113
+ - Address each of the changes by following the instructions
114
+ in each block of CSS, then remove the block.
115
+ - Delete this file after all blocks have been addressed.
116
+ - Remove each occurrence of this file in your project's
117
+ angular.json file.`)}
118
+ ${contents}`
119
+ : undefined;
120
+ }
121
+ function default_1() {
122
+ return async (tree) => {
123
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
124
+ const styles = getCompatStyles(tree);
125
+ const rules = [];
126
+ for (const [, projectDefinition] of workspace.projects.entries()) {
127
+ if (projectDefinition.extensions['projectType'] === 'application') {
128
+ if (styles) {
129
+ const sourcePath = getProjectAppPath(projectDefinition);
130
+ rules.push(writeStylesheet(sourcePath, styles));
131
+ }
132
+ }
133
+ }
134
+ if (styles) {
135
+ rules.push(addStylesheetToWorkspace());
136
+ }
137
+ return (0, schematics_1.chain)(rules);
138
+ };
139
+ }
140
+ //# sourceMappingURL=add-compat-stylesheet.schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-compat-stylesheet.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/add-compat-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AAC;QAC3C,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,KAAK,GAAW,EAAE,CAAC;QAEzB,KAAK,MAAM,CAAC,EAAE,iBAAiB,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACjE,IAAI,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,EAAE,CAAC;gBAClE,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,UAAU,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;oBACxD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;gBAClD,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Replaces the resources services with their "legacy" equivalents, which emit
4
+ * once and complete. The original services now emit again whenever the locale
5
+ * changes.
6
+ */
7
+ export default function (): Rule;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const tslib_1 = require("tslib");
5
+ const workspace_1 = require("@schematics/angular/utility/workspace");
6
+ const typescript_1 = tslib_1.__importDefault(require("typescript"));
7
+ const ng_ast_1 = require("../../../utility/typescript/ng-ast");
8
+ const swap_imported_class_1 = require("../../../utility/typescript/swap-imported-class");
9
+ const visit_project_files_1 = require("../../../utility/visit-project-files");
10
+ const MODULE_NAME = '@skyux/i18n';
11
+ const CLASS_NAMES = {
12
+ SkyAppResourcesService: 'SkyAppResourcesLegacyService',
13
+ SkyLibResourcesService: 'SkyLibResourcesLegacyService',
14
+ };
15
+ /**
16
+ * Whether the reference is the `SkyLibResourcesService.addResources()` static
17
+ * call. Only the observables returned by the instance methods changed, so
18
+ * static calls -- which generated resources modules rely on -- are left alone.
19
+ */
20
+ function isStaticAddResourcesReference(node) {
21
+ const parent = node.parent;
22
+ return (typescript_1.default.isPropertyAccessExpression(parent) &&
23
+ parent.expression === node &&
24
+ parent.name.text === 'addResources');
25
+ }
26
+ async function updateSourceFiles(tree) {
27
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
28
+ workspace.projects.forEach((project) => {
29
+ (0, visit_project_files_1.visitProjectFiles)(tree, project.sourceRoot || project.root, (filePath) => {
30
+ if (!filePath.endsWith('.ts')) {
31
+ return;
32
+ }
33
+ const content = tree.readText(filePath);
34
+ if (!Object.keys(CLASS_NAMES).some((name) => content.includes(name))) {
35
+ return;
36
+ }
37
+ const recorder = tree.beginUpdate(filePath);
38
+ (0, swap_imported_class_1.swapImportedClass)(recorder, filePath, (0, ng_ast_1.parseSourceFile)(tree, filePath), [
39
+ {
40
+ classNames: CLASS_NAMES,
41
+ moduleName: MODULE_NAME,
42
+ filter: (node) => !isStaticAddResourcesReference(node),
43
+ },
44
+ ]);
45
+ tree.commitUpdate(recorder);
46
+ });
47
+ });
48
+ }
49
+ /**
50
+ * Replaces the resources services with their "legacy" equivalents, which emit
51
+ * once and complete. The original services now emit again whenever the locale
52
+ * changes.
53
+ */
54
+ function default_1() {
55
+ return async (tree) => {
56
+ await updateSourceFiles(tree);
57
+ };
58
+ }
59
+ //# sourceMappingURL=legacy-i18n-services.schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-i18n-services.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/legacy-i18n-services/legacy-i18n-services.schematic.ts"],"names":[],"mappings":";;AAkEA,4BAIC;;AArED,qEAAqE;AAErE,oEAA4B;AAE5B,+DAAqE;AACrE,yFAAoF;AACpF,8EAAyE;AAEzE,MA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EAAE,WAAW;oBACvB,MAAM,EAAE,CAAC,IAAI,EAAW,EAAE,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC;iBAChE;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH;IACE,OAAO,KAAK,EAAE,IAAU,EAAiB,EAAE;QACzC,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Moves `SkyAppTestUtility`, `SkyAppTestUtilityDomEventOptions`, and `SkyBy`
4
+ * imports from the deprecated `@skyux-sdk/testing` package to
5
+ * `@skyux/core/testing`, and drops the deprecated dependency once nothing else
6
+ * in the workspace imports it.
7
+ */
8
+ export default function (): Rule;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
5
+ const workspace_1 = require("@schematics/angular/utility/workspace");
6
+ const dependencies_2 = require("../../../utility/dependencies");
7
+ const combine_imports_1 = require("../../../utility/typescript/combine-imports");
8
+ const ng_ast_1 = require("../../../utility/typescript/ng-ast");
9
+ const swap_imported_class_1 = require("../../../utility/typescript/swap-imported-class");
10
+ const visit_project_files_1 = require("../../../utility/visit-project-files");
11
+ const workspace_2 = require("../../../utility/workspace");
12
+ const DEPRECATED_PACKAGE = '@skyux-sdk/testing';
13
+ const SUPPORTED_PACKAGE = '@skyux/core/testing';
14
+ const SWAP_OPTIONS = [
15
+ {
16
+ classNames: {
17
+ SkyAppTestUtility: 'SkyAppTestUtility',
18
+ SkyAppTestUtilityDomEventOptions: 'SkyAppTestUtilityDomEventOptions',
19
+ SkyBy: 'SkyBy',
20
+ },
21
+ moduleName: { old: DEPRECATED_PACKAGE, new: SUPPORTED_PACKAGE },
22
+ },
23
+ ];
24
+ function migrateFile(tree, filePath) {
25
+ if (!tree.readText(filePath).includes(DEPRECATED_PACKAGE)) {
26
+ return;
27
+ }
28
+ const swapRecorder = tree.beginUpdate(filePath);
29
+ (0, swap_imported_class_1.swapImportedClass)(swapRecorder, filePath, (0, ng_ast_1.parseSourceFile)(tree, filePath), SWAP_OPTIONS);
30
+ tree.commitUpdate(swapRecorder);
31
+ // Runs against the swapped file so the moved imports are merged with any
32
+ // that the file already had.
33
+ const combineRecorder = tree.beginUpdate(filePath);
34
+ (0, combine_imports_1.combineImports)(combineRecorder, (0, ng_ast_1.parseSourceFile)(tree, filePath), SUPPORTED_PACKAGE);
35
+ tree.commitUpdate(combineRecorder);
36
+ }
37
+ /**
38
+ * Moves `SkyAppTestUtility`, `SkyAppTestUtilityDomEventOptions`, and `SkyBy`
39
+ * imports from the deprecated `@skyux-sdk/testing` package to
40
+ * `@skyux/core/testing`, and drops the deprecated dependency once nothing else
41
+ * in the workspace imports it.
42
+ */
43
+ function default_1() {
44
+ return async (tree) => {
45
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
46
+ for (const project of workspace.projects.values()) {
47
+ (0, visit_project_files_1.visitProjectFiles)(tree, (0, workspace_2.getSourceRoot)(project), (filePath) => {
48
+ if (filePath.endsWith('.ts') && !filePath.endsWith('.d.ts')) {
49
+ migrateFile(tree, filePath);
50
+ }
51
+ });
52
+ }
53
+ if (!(await (0, dependencies_2.isPackageUsed)(tree, DEPRECATED_PACKAGE))) {
54
+ (0, dependencies_1.removePackageJsonDependency)(tree, DEPRECATED_PACKAGE);
55
+ }
56
+ };
57
+ }
58
+ //# sourceMappingURL=migrate-sdk-testing-imports.schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-sdk-testing-imports.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/migrate-sdk-testing-imports/migrate-sdk-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AAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAE3C,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAClD,IAAA,uCAAiB,EAAC,IAAI,EAAE,IAAA,yBAAa,EAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE;gBAC3D,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC5D,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,4BAAa,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC;YACrD,IAAA,0CAA2B,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACxD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -535,7 +535,7 @@ function convertGridToDataGrid(projectPath) {
535
535
  },
536
536
  () => {
537
537
  if (anyConverted) {
538
- return (0, utility_1.addDependency)('@skyux/data-grid', `15.0.0-alpha.4`, {
538
+ return (0, utility_1.addDependency)('@skyux/data-grid', `15.0.0-alpha.6`, {
539
539
  existing: utility_1.ExistingBehavior.Skip,
540
540
  });
541
541
  }
@@ -198,7 +198,7 @@ function convertPageSummaryToPageHeader(projectPath) {
198
198
  }
199
199
  });
200
200
  },
201
- (0, utility_1.addDependency)('@skyux/pages', `15.0.0-alpha.4`, {
201
+ (0, utility_1.addDependency)('@skyux/pages', `15.0.0-alpha.6`, {
202
202
  existing: utility_1.ExistingBehavior.Skip,
203
203
  }),
204
204
  ]);
@@ -296,7 +296,7 @@ function convertProgressIndicatorWizardToTabWizard(options) {
296
296
  });
297
297
  }
298
298
  },
299
- (0, utility_1.addDependency)('@skyux/tabs', `15.0.0-alpha.4`, {
299
+ (0, utility_1.addDependency)('@skyux/tabs', `15.0.0-alpha.6`, {
300
300
  existing: utility_1.ExistingBehavior.Skip,
301
301
  }),
302
302
  ]);
@@ -0,0 +1,7 @@
1
+ import { UpdateRecorder } from '@angular-devkit/schematics';
2
+ import ts from 'typescript';
3
+ /**
4
+ * Merges every named import of `moduleName` into the first such declaration,
5
+ * dropping specifiers that are imported more than once.
6
+ */
7
+ export declare function combineImports(recorder: UpdateRecorder, sourceFile: ts.SourceFile, moduleName: string): void;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.combineImports = combineImports;
4
+ const imports_1 = require("./imports");
5
+ function getCombinedSpecifiers(declarations, isTypeOnly) {
6
+ const seen = new Map();
7
+ const combined = [];
8
+ for (const declaration of declarations) {
9
+ for (const specifier of declaration.specifiers) {
10
+ const specifierIsTypeOnly = declaration.importClause.isTypeOnly || specifier.isTypeOnly;
11
+ const text = (0, imports_1.getSpecifierText)(specifier, !isTypeOnly && declaration.importClause.isTypeOnly);
12
+ const existing = seen.get(specifier.name.text);
13
+ if (!existing) {
14
+ seen.set(specifier.name.text, {
15
+ index: combined.length,
16
+ isTypeOnly: specifierIsTypeOnly,
17
+ });
18
+ combined.push(text);
19
+ }
20
+ else if (existing.isTypeOnly && !specifierIsTypeOnly) {
21
+ // A value import of the same name wins, otherwise merging would leave
22
+ // the name usable only as a type.
23
+ combined[existing.index] = text;
24
+ existing.isTypeOnly = false;
25
+ }
26
+ }
27
+ }
28
+ return combined;
29
+ }
30
+ /**
31
+ * Merges every named import of `moduleName` into the first such declaration,
32
+ * dropping specifiers that are imported more than once.
33
+ */
34
+ function combineImports(recorder, sourceFile, moduleName) {
35
+ // Declarations with a default binding are left alone; the merged clause only
36
+ // carries named specifiers, so folding one in would drop its default.
37
+ const declarations = (0, imports_1.getNamedImportDeclarations)(sourceFile, moduleName).filter(({ importClause }) => !importClause.name);
38
+ if (declarations.length < 2) {
39
+ return;
40
+ }
41
+ const [first, ...rest] = declarations;
42
+ // The merged declaration can only stay `import type` if every source was.
43
+ const isTypeOnly = declarations.every(({ importClause }) => importClause.isTypeOnly);
44
+ const specifiers = getCombinedSpecifiers(declarations, isTypeOnly);
45
+ const start = first.importClause.getStart(sourceFile);
46
+ recorder.remove(start, first.importClause.getEnd() - start);
47
+ recorder.insertRight(start, `${isTypeOnly ? 'type ' : ''}{ ${specifiers.join(', ')} }`);
48
+ for (const { declaration } of rest) {
49
+ (0, imports_1.removeStatement)(recorder, sourceFile, declaration);
50
+ }
51
+ }
52
+ //# sourceMappingURL=combine-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/combine-imports.ts"],"names":[],"mappings":";;AAmDA,wCAmCC;AAnFD,uCAKmB;AAEnB,SAAS,qBAAqB,CAC5B,YAAsC,EACtC,UAAmB;IAEnB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkD,CAAC;IACvE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,KAAK,MAAM,SAAS,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC;YAC/C,MAAM,mBAAmB,GACvB,WAAW,CAAC,YAAY,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC;YAE9D,MAAM,IAAI,GAAG,IAAA,0BAAgB,EAC3B,SAAS,EACT,CAAC,UAAU,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,CACnD,CAAC;YAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE/C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;oBAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM;oBACtB,UAAU,EAA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AC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAC3D,CAAC;IAEF,KAAK,MAAM,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;QACnC,IAAA,yBAAe,EAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { UpdateRecorder } from '@angular-devkit/schematics';
2
+ import ts from 'typescript';
3
+ export interface NamedImportDeclaration {
4
+ declaration: ts.ImportDeclaration;
5
+ importClause: ts.ImportClause;
6
+ namedBindings: ts.NamedImports;
7
+ specifiers: readonly ts.ImportSpecifier[];
8
+ }
9
+ /**
10
+ * Returns every `import { ... } from '<moduleName>'` declaration in the file.
11
+ * Namespace and default-only imports are skipped since they have no specifiers
12
+ * to operate on.
13
+ */
14
+ export declare function getNamedImportDeclarations(sourceFile: ts.SourceFile, moduleName: string): NamedImportDeclaration[];
15
+ /**
16
+ * Returns the text of a specifier, moving the declaration's `type` modifier
17
+ * onto the specifier so it survives being merged into a value import.
18
+ */
19
+ export declare function getSpecifierText(specifier: ts.ImportSpecifier, isTypeOnly: boolean): string;
20
+ export declare function replaceNode(recorder: UpdateRecorder, sourceFile: ts.SourceFile, node: ts.Node, text: string): void;
21
+ /**
22
+ * Removes a statement along with the rest of the line it ends on, so deleting
23
+ * an import doesn't leave a blank line behind.
24
+ */
25
+ export declare function removeStatement(recorder: UpdateRecorder, sourceFile: ts.SourceFile, node: ts.Node): void;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNamedImportDeclarations = getNamedImportDeclarations;
4
+ exports.getSpecifierText = getSpecifierText;
5
+ exports.replaceNode = replaceNode;
6
+ exports.removeStatement = removeStatement;
7
+ const tslib_1 = require("tslib");
8
+ const typescript_1 = tslib_1.__importDefault(require("typescript"));
9
+ /**
10
+ * Returns every `import { ... } from '<moduleName>'` declaration in the file.
11
+ * Namespace and default-only imports are skipped since they have no specifiers
12
+ * to operate on.
13
+ */
14
+ function getNamedImportDeclarations(sourceFile, moduleName) {
15
+ const declarations = [];
16
+ for (const statement of sourceFile.statements) {
17
+ if (!typescript_1.default.isImportDeclaration(statement) ||
18
+ !typescript_1.default.isStringLiteral(statement.moduleSpecifier) ||
19
+ statement.moduleSpecifier.text !== moduleName) {
20
+ continue;
21
+ }
22
+ const importClause = statement.importClause;
23
+ const namedBindings = importClause?.namedBindings;
24
+ if (!importClause || !namedBindings || !typescript_1.default.isNamedImports(namedBindings)) {
25
+ continue;
26
+ }
27
+ declarations.push({
28
+ declaration: statement,
29
+ importClause,
30
+ namedBindings,
31
+ specifiers: namedBindings.elements,
32
+ });
33
+ }
34
+ return declarations;
35
+ }
36
+ /**
37
+ * Returns the text of a specifier, moving the declaration's `type` modifier
38
+ * onto the specifier so it survives being merged into a value import.
39
+ */
40
+ function getSpecifierText(specifier, isTypeOnly) {
41
+ const text = specifier.getText();
42
+ return isTypeOnly && !specifier.isTypeOnly ? `type ${text}` : text;
43
+ }
44
+ function replaceNode(recorder, sourceFile, node, text) {
45
+ const start = node.getStart(sourceFile);
46
+ recorder.remove(start, node.getEnd() - start);
47
+ recorder.insertRight(start, text);
48
+ }
49
+ /**
50
+ * Removes a statement along with the rest of the line it ends on, so deleting
51
+ * an import doesn't leave a blank line behind.
52
+ */
53
+ function removeStatement(recorder, sourceFile, node) {
54
+ const start = node.getStart(sourceFile);
55
+ const end = node.getEnd();
56
+ const trailing = /^[^\S\n]*\n?/.exec(sourceFile.text.substring(end));
57
+ recorder.remove(start, end - start + (trailing ? trailing[0].length : 0));
58
+ }
59
+ //# sourceMappingURL=imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/imports.ts"],"names":[],"mappings":";;AAeA,gEA+BC;AAMD,4CAOC;AAED,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,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;IAC9C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAC7B,QAAwB,EACxB,UAAyB,EACzB,IAAa;IAEb,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAErE,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC"}
@@ -1,32 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeImport = removeImport;
4
- const tslib_1 = require("tslib");
5
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
6
- const typescript_1 = tslib_1.__importDefault(require("typescript"));
4
+ const imports_1 = require("./imports");
5
+ /**
6
+ * Removes specifiers from a named import, consuming the separating comma so the
7
+ * remaining specifiers stay well-formed. Contiguous specifiers are removed as a
8
+ * single range to keep the edits from overlapping.
9
+ */
10
+ function removeSpecifiers(recorder, sourceFile, specifiers, isRemoved) {
11
+ for (let first = 0; first < specifiers.length; first++) {
12
+ if (!isRemoved(specifiers[first])) {
13
+ continue;
14
+ }
15
+ let last = first;
16
+ while (last + 1 < specifiers.length && isRemoved(specifiers[last + 1])) {
17
+ last++;
18
+ }
19
+ // A run takes the comma that precedes it or, when it starts the list, the
20
+ // comma that follows it. At least one specifier is retained here, so there
21
+ // is always a neighbor on one side.
22
+ const [start, end] = first > 0
23
+ ? [specifiers[first - 1].getEnd(), specifiers[last].getEnd()]
24
+ : [
25
+ specifiers[first].getStart(sourceFile),
26
+ specifiers[last + 1].getStart(sourceFile),
27
+ ];
28
+ recorder.remove(start, end - start);
29
+ first = last;
30
+ }
31
+ }
7
32
  function removeImport(recorder, sourceFile, options) {
8
- const importDeclarations = (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.SyntaxKind.ImportDeclaration).filter((node) => typescript_1.default.isImportDeclaration(node) &&
9
- typescript_1.default.isStringLiteral(node.moduleSpecifier) &&
10
- node.moduleSpecifier.text === options.moduleName);
11
- if (importDeclarations) {
12
- for (const importDeclaration of importDeclarations) {
13
- const importSpecifiers = (0, ast_utils_1.findNodes)(importDeclaration, (node) => typescript_1.default.isImportSpecifier(node));
14
- const classMatches = importSpecifiers.filter((importSpecifier) => options.classNames.includes(importSpecifier.name.text));
15
- const otherMatches = importSpecifiers.filter((importSpecifier) => !options.classNames.includes(importSpecifier.getText()));
16
- if (classMatches.length > 0) {
17
- if (otherMatches.length > 0) {
18
- classMatches.forEach((importSpecifier) => {
19
- const importStart = importSpecifier.getStart(sourceFile);
20
- const importWidth = importSpecifier.getWidth(sourceFile);
21
- recorder.remove(importStart, importWidth + 1);
22
- });
23
- }
24
- else {
25
- const importStart = importDeclaration.getStart(sourceFile);
26
- const importWidth = importDeclaration.getWidth(sourceFile);
27
- recorder.remove(importStart, importWidth);
28
- }
29
- }
33
+ for (const { declaration, specifiers } of (0, imports_1.getNamedImportDeclarations)(sourceFile, options.moduleName)) {
34
+ const isRemoved = (specifier) => options.classNames.includes(specifier.name.text);
35
+ const removedCount = specifiers.filter(isRemoved).length;
36
+ if (removedCount === 0) {
37
+ continue;
38
+ }
39
+ if (removedCount === specifiers.length) {
40
+ (0, imports_1.removeStatement)(recorder, sourceFile, declaration);
41
+ }
42
+ else {
43
+ removeSpecifiers(recorder, sourceFile, specifiers, isRemoved);
30
44
  }
31
45
  }
32
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"remove-import.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/remove-import.ts"],"names":[],"mappings":";;AASA,oCA2CC;;AAnDD,qEAAkE;AAClE,oEAA4B;AAO5B,SAAgB,YAAY,CAC1B,QAAwB,EACxB,UAAyB,EACzB,OAA4B;IAE5B,MAAM,kBAAkB,GAAG,IAAA,qBAAS,EAClC,UAAU,EACV,oBAAE,CAAC,UAAU,CAAC,iBAAiB,CAChC,CAAC,MAAM,CACN,CAAC,IAAI,EAAgC,EAAE,CACrC,oBAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC;QAC5B,oBAAE,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC;QACxC,IAAI,CAAC,eAAe,CAAC,IAAI,KAAK,OAAO,CAAC,UAAU,CACnD,CAAC;IAEF,IAAI,kBAAkB,EAAE,CAAC;QACvB,KAAK,MAAM,iBAAiB,IAAI,kBAAkB,EAAE,CAAC;YACnD,MAAM,gBAAgB,GAAG,IAAA,qBAAS,EAChC,iBAAiB,EACjB,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CACrC,CAAC;YACF,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,EAAE,CAC/D,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CACvD,CAAC;YACF,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAC1C,CAAC,eAAe,EAAE,EAAE,CAClB,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAC1D,CAAC;YACF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,YAAY,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;wBACvC,MAAM,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;wBACzD,MAAM,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;wBACzD,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;oBAChD,CAAC,CAAC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACN,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;oBAC3D,MAAM,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;oBAC3D,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"remove-import.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/remove-import.ts"],"names":[],"mappings":";;AAgDA,oCAwBC;AArED,uCAAwE;AAOxE;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,QAAwB,EACxB,UAAyB,EACzB,UAAyC,EACzC,SAAqD;IAErD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAClC,SAAS;QACX,CAAC;QAED,IAAI,IAAI,GAAG,KAAK,CAAC;QAEjB,OAAO,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,IAAI,EAAE,CAAC;QACT,CAAC;QAED,0EAA0E;QAC1E,2EAA2E;QAC3E,oCAAoC;QACpC,MAAM,CAAC,KAAK,EAAE,G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ports.swapImportedClass = swapImportedClass;
4
4
  const tslib_1 = require("tslib");
5
5
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
6
- const change_1 = require("@schematics/angular/utility/change");
7
6
  const eol_1 = require("@schematics/angular/utility/eol");
8
7
  const typescript_1 = tslib_1.__importDefault(require("typescript"));
9
8
  const ng_ast_1 = require("./ng-ast");
@@ -11,6 +10,43 @@ const remove_import_1 = require("./remove-import");
11
10
  function findReferences(sourceFile, className) {
12
11
  return (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.SyntaxKind.Identifier).filter((node) => typescript_1.default.isIdentifier(node) && node.text === className);
13
12
  }
13
+ function getNamespaceImportNames(sourceFile) {
14
+ return (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.SyntaxKind.ImportDeclaration).flatMap((node) => {
15
+ if (!typescript_1.default.isImportDeclaration(node)) {
16
+ return [];
17
+ }
18
+ const clause = node.importClause;
19
+ const bindings = clause?.namedBindings;
20
+ return clause && bindings && typescript_1.default.isNamespaceImport(bindings)
21
+ ? [bindings.name.text]
22
+ : [];
23
+ });
24
+ }
25
+ function getLeftmostIdentifier(node) {
26
+ let current = node;
27
+ while (typescript_1.default.isPropertyAccessExpression(current) ||
28
+ typescript_1.default.isQualifiedName(current)) {
29
+ current = typescript_1.default.isPropertyAccessExpression(current)
30
+ ? current.expression
31
+ : current.left;
32
+ }
33
+ return typescript_1.default.isIdentifier(current) ? current : undefined;
34
+ }
35
+ function isNamespaceQualifiedReference(reference, namespaceNames) {
36
+ const parent = reference.parent;
37
+ // Value position, e.g. `namespace.SkyThing`; type position, e.g.
38
+ // `let thing: namespace.SkyThing`.
39
+ const qualifier = typescript_1.default.isPropertyAccessExpression(parent) && parent.name === reference
40
+ ? parent.expression
41
+ : typescript_1.default.isQualifiedName(parent) && parent.right === reference
42
+ ? parent.left
43
+ : undefined;
44
+ if (!qualifier) {
45
+ return false;
46
+ }
47
+ const namespace = getLeftmostIdentifier(qualifier);
48
+ return !!namespace && namespaceNames.includes(namespace.text);
49
+ }
14
50
  function swapReference(recorder, reference, newClassName) {
15
51
  const start = reference.getStart();
16
52
  recorder.remove(start, reference.getWidth());
@@ -35,13 +71,20 @@ function swapImportedClass(recorder, filePath, sourceFile, options) {
35
71
  return;
36
72
  }
37
73
  const endOfImports = (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.SyntaxKind.ImportDeclaration).reduce((max, node) => Math.max(max, node.getEnd()), 0);
74
+ const namespaceImportNames = getNamespaceImportNames(sourceFile);
75
+ // `insertImport` reads the original AST, so inserts are batched per module
76
+ // and applied once below. Applying them as they are found would emit a
77
+ // separate import statement for every class name.
78
+ const addImports = {};
38
79
  const removeImports = {};
39
80
  applicableOptions.forEach(({ classNames, moduleName, filter }) => {
40
81
  const oldModuleName = getModuleName(moduleName, 'old');
41
82
  const newModuleName = getModuleName(moduleName, 'new');
42
83
  Object.entries(classNames).forEach(([oldClassName, newClassName]) => {
43
84
  const referencesInCode = findReferences(sourceFile, oldClassName).filter((reference) => reference.getStart() > endOfImports);
44
- const referencesFiltered = referencesInCode.filter(filter ?? (() => true));
85
+ const referencesInCodeWithoutNamespaces = referencesInCode.filter((reference) => !isNamespaceQualifiedReference(reference, namespaceImportNames));
86
+ const referencesFiltered = referencesInCode.filter((reference) => (filter ?? (() => true))(reference) &&
87
+ !isNamespaceQualifiedReference(reference, namespaceImportNames));
45
88
  const newClassNameString = Array.isArray(newClassName)
46
89
  ? newClassName.join(', ')
47
90
  : newClassName;
@@ -49,36 +92,29 @@ function swapImportedClass(recorder, filePath, sourceFile, options) {
49
92
  swapReference(recorder, reference, newClassNameString);
50
93
  });
51
94
  if (referencesFiltered.length > 0) {
52
- const allReferencesToBeReplaced = referencesFiltered.length === referencesInCode.length;
95
+ const allReferencesToBeReplaced = referencesFiltered.length ===
96
+ referencesInCodeWithoutNamespaces.length;
53
97
  const newClassNameArray = Array.isArray(newClassName)
54
98
  ? newClassName
55
99
  : [newClassName];
56
100
  const missingClassNames = newClassNameArray.filter((name) => !(0, ng_ast_1.isImportedFromPackage)(sourceFile, name, newModuleName));
57
- if (missingClassNames.length > 0) {
58
- const missingClassNameString = missingClassNames.join(', ');
59
- if (allReferencesToBeReplaced) {
60
- if (oldModuleName === newModuleName) {
61
- const referencesInImport = findReferences(sourceFile, oldClassName).filter((reference) => reference.getEnd() <= endOfImports);
62
- if (referencesInImport.length !== 1) {
63
- throw new Error(`Expected exactly one import for ${oldClassName} from ${oldModuleName}, found ${referencesInImport.length}.`);
64
- }
65
- swapReference(recorder, referencesInImport[0], missingClassNameString);
66
- }
67
- else {
68
- const change = (0, ast_utils_1.insertImport)(sourceFile, filePath, missingClassNameString, newModuleName);
69
- shiftLineBreakForInsertedImport(change, eol);
70
- (0, change_1.applyToUpdateRecorder)(recorder, [change]);
71
- removeImports[oldModuleName] ??= [];
72
- removeImports[oldModuleName].push(oldClassName);
73
- }
74
- }
75
- else {
76
- (0, change_1.applyToUpdateRecorder)(recorder, [
77
- (0, ast_utils_1.insertImport)(sourceFile, filePath, missingClassNameString, newModuleName),
78
- ]);
101
+ // Staying within the same module is a rename, so the existing import
102
+ // specifier is edited in place rather than added and removed.
103
+ const isRename = missingClassNames.length > 0 &&
104
+ allReferencesToBeReplaced &&
105
+ oldModuleName === newModuleName;
106
+ if (isRename) {
107
+ const referencesInImport = findReferences(sourceFile, oldClassName).filter((reference) => reference.getEnd() <= endOfImports);
108
+ if (referencesInImport.length !== 1) {
109
+ throw new Error(`Expected exactly one import for ${oldClassName} from ${oldModuleName}, found ${referencesInImport.length}.`);
79
110
  }
111
+ swapReference(recorder, referencesInImport[0], missingClassNames.join(', '));
80
112
  }
81
113
  else {
114
+ if (missingClassNames.length > 0) {
115
+ addImports[newModuleName] ??= [];
116
+ addImports[newModuleName].push(...missingClassNames.filter((name) => !addImports[newModuleName].includes(name)));
117
+ }
82
118
  if (allReferencesToBeReplaced) {
83
119
  removeImports[oldModuleName] ??= [];
84
120
  removeImports[oldModuleName].push(oldClassName);
@@ -87,12 +123,18 @@ function swapImportedClass(recorder, filePath, sourceFile, options) {
87
123
  }
88
124
  });
89
125
  });
90
- const removeImportEntries = Object.entries(removeImports);
91
- if (removeImportEntries.length > 0) {
92
- removeImportEntries.forEach(([moduleName, classNames]) => (0, remove_import_1.removeImport)(recorder, sourceFile, {
93
- classNames,
94
- moduleName,
95
- }));
96
- }
126
+ Object.entries(addImports).forEach(([moduleName, classNames]) => {
127
+ const change = (0, ast_utils_1.insertImport)(sourceFile, filePath, classNames.join(', '), moduleName);
128
+ shiftLineBreakForInsertedImport(change, eol);
129
+ // `insertRight` rather than `applyToUpdateRecorder`'s `insertLeft`: the
130
+ // import lands at the end of the import block, which is also where a fully
131
+ // removed import declaration ends, and only a right-side insert survives
132
+ // that removal.
133
+ recorder.insertRight(change.pos, change.toAdd);
134
+ });
135
+ Object.entries(removeImports).forEach(([moduleName, classNames]) => (0, remove_import_1.removeImport)(recorder, sourceFile, {
136
+ classNames,
137
+ moduleName,
138
+ }));
97
139
  }
98
140
  //# sourceMappingURL=swap-imported-class.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap-imported-class.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/swap-imported-class.ts"],"names":[],"mappings":";;AAwDA,8CA8GC;;AArKD,qEAAgF;AAChF,+DAG4C;AAC5C,yDAAyD;AACzD,oEAA4B;AAE5B,qCAAiD;AACjD,mDAA+C;AAQ/C,SAAS,cAAc,CACrB,UAAyB,EACzB,SAAiB;IAEjB,OAAO,IAAA,qBAAS,EAAC,UAAU,EAAE,oBAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAC3D,CAAC,IAAI,EAAyB,EAAE,CAC9B,oBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CACnD,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CACpB,QAAwB,EACxB,SAAwB,EACxB,YAAoB;IAEpB,MAAM,KAAK,GA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AAsB,EACtB,aAAa,CACE,CAAC;4BAClB,+BAA+B,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;4BAC7C,IAAA,8BAAqB,EAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;4BAC1C,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;4BACpC,aAAa,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;wBAClD,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAA,8BAAqB,EAAC,QAAQ,EAAE;4BAC9B,IAAA,wBAAY,EACV,UAAU,EACV,QAAQ,EACR,sBAAsB,EACtB,aAAa,CACd;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,IAAI,yBAAyB,EAAE,CAAC;wBAC9B,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;wBACpC,aAAa,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBAClD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1D,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,CACvD,IAAA,4BAAY,EAAC,QAAQ,EAAE,UAAU,EAAE;YACjC,UAAU;YACV,UAAU;SACX,CAAC,CACH,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"swap-imported-class.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/utility/typescript/swap-imported-class.ts"],"names":[],"mappings":";;AA6GA,8CA8HC;;AA1OD,qEAAgF;AAEhF,yDAAyD;AACzD,oEAA4B;AAE5B,qCAAiD;AACjD,m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a,CAAC,CAAC,IAAI,CAC5B,GAAG,iBAAiB,CAAC,MAAM,CACzB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CACpD,CACF,CAAC;oBACJ,CAAC;oBAED,IAAI,yBAAyB,EAAE,CAAC;wBAC9B,aAAa,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;wBACpC,aAAa,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBAClD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAA,wBAAY,EACzB,UAAU,EACV,QAAQ,EACR,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EACrB,UAAU,CACK,CAAC;QAClB,+BAA+B,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE7C,wEAAwE;QACxE,2EAA2E;QAC3E,yEAAyE;QACzE,gBAAgB;QAChB,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,CACjE,IAAA,4BAAY,EAAC,QAAQ,EAAE,UAAU,EAAE;QACjC,UAAU;QACV,UAAU;KACX,CAAC,CACH,CAAC;AACJ,CAAC"}
package/src/version.js CHANGED
@@ -19,5 +19,5 @@ exports.Version = Version;
19
19
  /**
20
20
  * Represents the version of @skyux/core.
21
21
  */
22
- exports.VERSION = new Version('15.0.0-alpha.4');
22
+ exports.VERSION = new Version('15.0.0-alpha.6');
23
23
  //# sourceMappingURL=version.js.map