@skyux/packages 15.0.0-alpha.2 → 15.0.0-alpha.4
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.
- package/migrations.json +12 -17
- package/package.json +65 -68
- package/src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic.d.ts +9 -0
- package/src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic.js +102 -0
- package/src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic.js.map +1 -0
- package/src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic.d.ts +6 -0
- package/src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic.js +71 -0
- package/src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic.js.map +1 -0
- package/src/schematics/rules/convert-grid-to-data-grid/convert-grid-to-data-grid.js +250 -15
- package/src/schematics/rules/convert-grid-to-data-grid/convert-grid-to-data-grid.js.map +1 -1
- package/src/schematics/rules/convert-page-summary-to-page-header/convert-page-summary-to-page-header.js +1 -1
- package/src/schematics/rules/convert-progress-indicator-wizard-to-tab-wizard/convert-progress-indicator-wizard-to-tab-wizard.js +1 -1
- package/src/schematics/utility/template.d.ts +1 -0
- package/src/schematics/utility/template.js +12 -0
- package/src/schematics/utility/template.js.map +1 -1
- package/src/schematics/utility/typescript/ng-ast.d.ts +1 -1
- package/src/schematics/utility/typescript/ng-ast.js +2 -1
- package/src/schematics/utility/typescript/ng-ast.js.map +1 -1
- package/src/schematics/utility/typescript/remove-class-reference.d.ts +15 -0
- package/src/schematics/utility/typescript/remove-class-reference.js +67 -0
- package/src/schematics/utility/typescript/remove-class-reference.js.map +1 -0
- package/src/version.js +1 -1
- package/src/polyfills.js +0 -6
- package/src/schematics/migrations/update-14/remove-dragula/remove-dragula.d.ts +0 -5
- package/src/schematics/migrations/update-14/remove-dragula/remove-dragula.js +0 -98
- package/src/schematics/migrations/update-14/remove-dragula/remove-dragula.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/replace-deprecated-css-vars-and-classes.d.ts +0 -23
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/replace-deprecated-css-vars-and-classes.js +0 -106
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/replace-deprecated-css-vars-and-classes.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style-group.d.ts +0 -8
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style-group.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style-group.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style.d.ts +0 -10
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-style.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-styles.d.ts +0 -6
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-styles.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-styles.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token-group.d.ts +0 -7
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token-group.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token-group.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token.d.ts +0 -9
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-token.js.map +0 -1
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-tokens.d.ts +0 -6
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-tokens.js +0 -3
- package/src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/types/public-api-tokens.js.map +0 -1
- package/src/schematics/migrations/update-14/uninstall-prettier-schematics/uninstall-prettier-schematics.d.ts +0 -2
- package/src/schematics/migrations/update-14/uninstall-prettier-schematics/uninstall-prettier-schematics.js +0 -8
- package/src/schematics/migrations/update-14/uninstall-prettier-schematics/uninstall-prettier-schematics.js.map +0 -1
package/migrations.json
CHANGED
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schematics": {
|
|
3
3
|
"noop": {
|
|
4
|
-
"version": "15.0.0-alpha.
|
|
4
|
+
"version": "15.0.0-alpha.4",
|
|
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.
|
|
9
|
+
"version": "15.0.0-alpha.4",
|
|
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": "
|
|
14
|
+
"version": "15.0.0-alpha.4",
|
|
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": "
|
|
19
|
+
"version": "15.0.0-alpha.4",
|
|
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
|
-
"
|
|
24
|
-
"version": "
|
|
25
|
-
"factory": "./src/schematics/migrations/
|
|
26
|
-
"description": "
|
|
23
|
+
"migrate-dragula-polyfill": {
|
|
24
|
+
"version": "15.0.0-alpha.4",
|
|
25
|
+
"factory": "./src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic",
|
|
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
|
-
"remove-
|
|
29
|
-
"version": "
|
|
30
|
-
"factory": "./src/schematics/migrations/update-
|
|
31
|
-
"description": "Remove
|
|
32
|
-
},
|
|
33
|
-
"replace-deprecated-css-vars-and-classes": {
|
|
34
|
-
"version": "14.0.0",
|
|
35
|
-
"factory": "./src/schematics/migrations/update-14/replace-deprecated-css-vars-and-classes/replace-deprecated-css-vars-and-classes",
|
|
36
|
-
"description": "Replace known CSS classes and custom properties in HTML, TypeScript/JavaScript, and CSS/SCSS files"
|
|
28
|
+
"remove-timepicker-retain-invalid-values": {
|
|
29
|
+
"version": "15.0.0-alpha.4",
|
|
30
|
+
"factory": "./src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic",
|
|
31
|
+
"description": "Remove the skyTimepickerRetainInvalidValues input from timepicker inputs since retaining invalid values is now the default behavior."
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/packages",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.4",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"description": "Handles the `ng update` command for SKY UX component libraries.",
|
|
6
6
|
"keywords": [
|
|
@@ -23,9 +23,6 @@
|
|
|
23
23
|
},
|
|
24
24
|
"./package.json": {
|
|
25
25
|
"default": "./package.json"
|
|
26
|
-
},
|
|
27
|
-
"./polyfills": {
|
|
28
|
-
"default": "./src/polyfills.js"
|
|
29
26
|
}
|
|
30
27
|
},
|
|
31
28
|
"schematics": "./collection.json",
|
|
@@ -35,71 +32,71 @@
|
|
|
35
32
|
"ng-update": {
|
|
36
33
|
"migrations": "./migrations.json",
|
|
37
34
|
"packageGroup": {
|
|
38
|
-
"@skyux/packages": "15.0.0-alpha.
|
|
35
|
+
"@skyux/packages": "15.0.0-alpha.4",
|
|
39
36
|
"@blackbaud/angular-tree-component": "^1.0.0",
|
|
40
|
-
"@skyux-sdk/eslint-schematics": "15.0.0-alpha.
|
|
41
|
-
"@skyux-sdk/stylelint-schematics": "15.0.0-alpha.
|
|
42
|
-
"@skyux-sdk/testing": "15.0.0-alpha.
|
|
43
|
-
"@skyux-sdk/testing-schematics": "15.0.0-alpha.
|
|
44
|
-
"@skyux/a11y": "15.0.0-alpha.
|
|
45
|
-
"@skyux/action-bars": "15.0.0-alpha.
|
|
46
|
-
"@skyux/ag-grid": "15.0.0-alpha.
|
|
47
|
-
"@skyux/angular-tree-component": "15.0.0-alpha.
|
|
48
|
-
"@skyux/animations": "15.0.0-alpha.
|
|
49
|
-
"@skyux/assets": "15.0.0-alpha.
|
|
50
|
-
"@skyux/autonumeric": "15.0.0-alpha.
|
|
51
|
-
"@skyux/avatar": "15.0.0-alpha.
|
|
52
|
-
"@skyux/charts": "15.0.0-alpha.
|
|
53
|
-
"@skyux/code-examples": "15.0.0-alpha.
|
|
54
|
-
"@skyux/colorpicker": "15.0.0-alpha.
|
|
55
|
-
"@skyux/config": "15.0.0-alpha.
|
|
56
|
-
"@skyux/core": "15.0.0-alpha.
|
|
57
|
-
"@skyux/data-grid": "15.0.0-alpha.
|
|
58
|
-
"@skyux/data-manager": "15.0.0-alpha.
|
|
59
|
-
"@skyux/datetime": "15.0.0-alpha.
|
|
60
|
-
"@skyux/docs-tools": "15.0.0-alpha.
|
|
61
|
-
"@skyux/errors": "15.0.0-alpha.
|
|
62
|
-
"@skyux/filter-bar": "15.0.0-alpha.
|
|
63
|
-
"@skyux/flyout": "15.0.0-alpha.
|
|
64
|
-
"@skyux/forms": "15.0.0-alpha.
|
|
65
|
-
"@skyux/grids": "15.0.0-alpha.
|
|
66
|
-
"@skyux/help-inline": "15.0.0-alpha.
|
|
67
|
-
"@skyux/i18n": "15.0.0-alpha.
|
|
68
|
-
"@skyux/icon": "15.0.0-alpha.
|
|
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",
|
|
69
66
|
"@skyux/icons": "^11.2.0",
|
|
70
|
-
"@skyux/indicators": "15.0.0-alpha.
|
|
71
|
-
"@skyux/inline-form": "15.0.0-alpha.
|
|
72
|
-
"@skyux/layout": "15.0.0-alpha.
|
|
73
|
-
"@skyux/list-builder": "15.0.0-alpha.
|
|
74
|
-
"@skyux/list-builder-common": "15.0.0-alpha.
|
|
75
|
-
"@skyux/list-builder-view-checklist": "15.0.0-alpha.
|
|
76
|
-
"@skyux/list-builder-view-grids": "15.0.0-alpha.
|
|
77
|
-
"@skyux/lists": "15.0.0-alpha.
|
|
78
|
-
"@skyux/lookup": "15.0.0-alpha.
|
|
79
|
-
"@skyux/manifest": "15.0.0-alpha.
|
|
80
|
-
"@skyux/modals": "15.0.0-alpha.
|
|
81
|
-
"@skyux/navbar": "15.0.0-alpha.
|
|
82
|
-
"@skyux/pages": "15.0.0-alpha.
|
|
83
|
-
"@skyux/phone-field": "15.0.0-alpha.
|
|
84
|
-
"@skyux/popovers": "15.0.0-alpha.
|
|
85
|
-
"@skyux/progress-indicator": "15.0.0-alpha.
|
|
86
|
-
"@skyux/router": "15.0.0-alpha.
|
|
87
|
-
"@skyux/select-field": "15.0.0-alpha.
|
|
88
|
-
"@skyux/split-view": "15.0.0-alpha.
|
|
89
|
-
"@skyux/tabs": "15.0.0-alpha.
|
|
90
|
-
"@skyux/text-editor": "15.0.0-alpha.
|
|
91
|
-
"@skyux/theme": "15.0.0-alpha.
|
|
92
|
-
"@skyux/tiles": "15.0.0-alpha.
|
|
93
|
-
"@skyux/toast": "15.0.0-alpha.
|
|
94
|
-
"@skyux/validation": "15.0.0-alpha.
|
|
95
|
-
"ag-grid-angular": "^
|
|
96
|
-
"ag-grid-community": "^
|
|
97
|
-
"ag-grid-enterprise": "^
|
|
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",
|
|
94
|
+
"ag-grid-enterprise": "^36.0.2",
|
|
98
95
|
"autonumeric": "^4.10.10",
|
|
99
|
-
"eslint-config-skyux": "15.0.0-alpha.
|
|
100
|
-
"skyux-eslint": "15.0.0-alpha.
|
|
101
|
-
"skyux-stylelint": "15.0.0-alpha.
|
|
102
|
-
"stylelint-config-skyux": "15.0.0-alpha.
|
|
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"
|
|
103
100
|
}
|
|
104
101
|
},
|
|
105
102
|
"peerDependencies": {
|
|
@@ -108,13 +105,13 @@
|
|
|
108
105
|
"typescript": "^6.0.3"
|
|
109
106
|
},
|
|
110
107
|
"dependencies": {
|
|
111
|
-
"@blackbaud/skyux-design-tokens": "7.0.0-alpha.
|
|
108
|
+
"@blackbaud/skyux-design-tokens": "7.0.0-alpha.1",
|
|
112
109
|
"fs-extra": "11.3.6",
|
|
113
110
|
"jsonc-parser": "3.3.1",
|
|
114
111
|
"parse5": "7.3.0",
|
|
115
112
|
"tslib": "^2.8.1"
|
|
116
113
|
},
|
|
117
|
-
"sideEffects":
|
|
114
|
+
"sideEffects": false,
|
|
118
115
|
"main": "./src/index.js",
|
|
119
116
|
"types": "./src/index.d.ts",
|
|
120
117
|
"type": "commonjs"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Removes the \`@skyux/packages/polyfills\` entry from every project's build
|
|
4
|
+
* and test options and their configurations. When Dragula is still installed
|
|
5
|
+
* (directly or transitively) — or when its usage cannot be determined — the
|
|
6
|
+
* entry is replaced with a local copy of the polyfill so those consumers keep
|
|
7
|
+
* working without depending on \`@skyux/packages/polyfills\`.
|
|
8
|
+
*/
|
|
9
|
+
export default function migrateDragulaPolyfill(): Rule;
|
package/src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateDragulaPolyfill;
|
|
4
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
5
|
+
const workspace_1 = require("../../../utility/workspace");
|
|
6
|
+
const PACKAGES_POLYFILL = '@skyux/packages/polyfills';
|
|
7
|
+
const LOCAL_POLYFILL_FILENAME = 'dragula-polyfill.js';
|
|
8
|
+
const LOCAL_POLYFILL_CONTENT = `'use strict';
|
|
9
|
+
|
|
10
|
+
// Fix for crossvent \`global is not defined\` error. The crossvent library is used by Dragula,
|
|
11
|
+
// which in turn is used by some third-party libraries.
|
|
12
|
+
// https://github.com/bevacqua/dragula/issues/602
|
|
13
|
+
window.global = window;
|
|
14
|
+
`;
|
|
15
|
+
/**
|
|
16
|
+
* Removes the \`@skyux/packages/polyfills\` entry from every project's build
|
|
17
|
+
* and test options and their configurations. When Dragula is still installed
|
|
18
|
+
* (directly or transitively) — or when its usage cannot be determined — the
|
|
19
|
+
* entry is replaced with a local copy of the polyfill so those consumers keep
|
|
20
|
+
* working without depending on \`@skyux/packages/polyfills\`.
|
|
21
|
+
*/
|
|
22
|
+
function migrateDragulaPolyfill() {
|
|
23
|
+
return (tree, context) => {
|
|
24
|
+
const dragulaNeeded = isDragulaNeeded(tree, context);
|
|
25
|
+
return (0, utility_1.updateWorkspace)((workspace) => {
|
|
26
|
+
for (const project of workspace.projects.values()) {
|
|
27
|
+
migrateProjectPolyfills(tree, project, dragulaNeeded);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Migrates the \`@skyux/packages/polyfills\` entry out of a single project's
|
|
34
|
+
* build and test options and every configuration of each.
|
|
35
|
+
*/
|
|
36
|
+
function migrateProjectPolyfills(tree, project, dragulaNeeded) {
|
|
37
|
+
const localPolyfillPath = `${(0, workspace_1.getSourceRoot)(project)}/${LOCAL_POLYFILL_FILENAME}`;
|
|
38
|
+
// Polyfills can be set on the target options and overridden per configuration.
|
|
39
|
+
const optionSets = ['build', 'test'].flatMap((targetName) => {
|
|
40
|
+
const target = project.targets.get(targetName);
|
|
41
|
+
return [target?.options, ...Object.values(target?.configurations ?? {})];
|
|
42
|
+
});
|
|
43
|
+
for (const options of optionSets) {
|
|
44
|
+
const polyfills = options?.['polyfills'];
|
|
45
|
+
if (!Array.isArray(polyfills)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const index = polyfills.indexOf(PACKAGES_POLYFILL);
|
|
49
|
+
if (index === -1) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (dragulaNeeded) {
|
|
53
|
+
if (!tree.exists(localPolyfillPath)) {
|
|
54
|
+
tree.create(localPolyfillPath, LOCAL_POLYFILL_CONTENT);
|
|
55
|
+
}
|
|
56
|
+
polyfills.splice(index, 1, localPolyfillPath);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
polyfills.splice(index, 1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Determines whether the local polyfill shim should be retained. Returns \`true\`
|
|
65
|
+
* when Dragula is installed, and — conservatively — also when its usage cannot
|
|
66
|
+
* be determined (missing, malformed, or unsupported \`package-lock.json\`), so a
|
|
67
|
+
* broken \`@skyux/packages/polyfills\` reference is never left behind.
|
|
68
|
+
*/
|
|
69
|
+
function isDragulaNeeded(tree, context) {
|
|
70
|
+
const buffer = tree.read('package-lock.json');
|
|
71
|
+
if (!buffer) {
|
|
72
|
+
context.logger.warn('A "package-lock.json" file was not found; retaining a local copy of ' +
|
|
73
|
+
`"${PACKAGES_POLYFILL}" because Dragula usage could not be determined.`);
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
let lockFile;
|
|
77
|
+
try {
|
|
78
|
+
lockFile = JSON.parse(buffer.toString());
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
context.logger.warn('The "package-lock.json" file could not be parsed; retaining a local ' +
|
|
82
|
+
`copy of "${PACKAGES_POLYFILL}" because Dragula usage could not be ` +
|
|
83
|
+
'determined.');
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (!lockFile.packages) {
|
|
87
|
+
context.logger.warn('The "package-lock.json" file uses an unsupported lockfile version; ' +
|
|
88
|
+
`retaining a local copy of "${PACKAGES_POLYFILL}" because Dragula ` +
|
|
89
|
+
'usage could not be determined.');
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return isDragulaInstalled(lockFile.packages);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Determines whether Dragula is installed anywhere in the dependency tree by
|
|
96
|
+
* checking every package path recorded in the lockfile.
|
|
97
|
+
*/
|
|
98
|
+
function isDragulaInstalled(packages) {
|
|
99
|
+
return Object.keys(packages).some((packagePath) => packagePath === 'node_modules/dragula' ||
|
|
100
|
+
packagePath.endsWith('/node_modules/dragula'));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=migrate-dragula-polyfill.schematic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-dragula-polyfill.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/all/migrate-dragula-polyfill/migrate-dragula-polyfill.schematic.ts"],"names":[],"mappings":";;AAyBA,yCAUC;AAlCD,yDAGqC;AAErC,0DAA2D;AAE3D,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AACtD,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AACtD,MAAM,sBAAsB,GAAG;;;;;;CAM9B,CAAC;AAEF;;;;;;GAMG;AACH,SAAwB,sBAAsB;IAC5C,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE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AI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC/B,CAAC,WAAW,EAAE,EAAE,CACd,WAAW,KAAK,sBAAsB;QACtC,WAAW,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
5
|
+
const template_1 = require("../../../utility/template");
|
|
6
|
+
const ng_ast_1 = require("../../../utility/typescript/ng-ast");
|
|
7
|
+
const visit_project_files_1 = require("../../../utility/visit-project-files");
|
|
8
|
+
// parse5 lowercases attribute names.
|
|
9
|
+
const RETAIN_ATTRIBUTES = [
|
|
10
|
+
'skytimepickerretaininvalidvalues',
|
|
11
|
+
'[skytimepickerretaininvalidvalues]',
|
|
12
|
+
];
|
|
13
|
+
function isElement(node) {
|
|
14
|
+
return 'tagName' in node;
|
|
15
|
+
}
|
|
16
|
+
function removeRetainAttributes(content, offset, recorder) {
|
|
17
|
+
const nodeQueue = [(0, template_1.parseTemplate)(content)];
|
|
18
|
+
while (nodeQueue.length) {
|
|
19
|
+
const node = nodeQueue.shift();
|
|
20
|
+
if (isElement(node)) {
|
|
21
|
+
node.attrs
|
|
22
|
+
.filter((attr) => RETAIN_ATTRIBUTES.includes(attr.name))
|
|
23
|
+
.forEach((attr) => {
|
|
24
|
+
const location = node.sourceCodeLocation.attrs[attr.name];
|
|
25
|
+
// Also remove the whitespace preceding the attribute.
|
|
26
|
+
let start = location.startOffset;
|
|
27
|
+
while (/\s/.test(content.charAt(start - 1))) {
|
|
28
|
+
start--;
|
|
29
|
+
}
|
|
30
|
+
recorder.remove(offset + start, location.endOffset - start);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if ((0, template_1.isParentNode)(node)) {
|
|
34
|
+
nodeQueue.push(...node.childNodes);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function updateSourceFiles(tree) {
|
|
39
|
+
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
40
|
+
workspace.projects.forEach((project) => {
|
|
41
|
+
(0, visit_project_files_1.visitProjectFiles)(tree, project.sourceRoot || project.root, (filePath) => {
|
|
42
|
+
if (filePath.endsWith('.html') || filePath.endsWith('.ts')) {
|
|
43
|
+
const content = tree.readText(filePath);
|
|
44
|
+
if (!content.toLowerCase().includes('skytimepickerretaininvalidvalues')) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const recorder = tree.beginUpdate(filePath);
|
|
48
|
+
if (filePath.endsWith('.html')) {
|
|
49
|
+
removeRetainAttributes(content, 0, recorder);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const templates = (0, ng_ast_1.getInlineTemplates)((0, ng_ast_1.parseSourceFile)(tree, filePath));
|
|
53
|
+
templates.forEach((template) => {
|
|
54
|
+
removeRetainAttributes(content.substring(template.start, template.end), template.start, recorder);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
tree.commitUpdate(recorder);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove the `skyTimepickerRetainInvalidValues` input from timepicker inputs
|
|
64
|
+
* since retaining invalid values is now the default and only behavior.
|
|
65
|
+
*/
|
|
66
|
+
function default_1() {
|
|
67
|
+
return async (tree) => {
|
|
68
|
+
await updateSourceFiles(tree);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=remove-timepicker-retain-invalid-values.schematic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-timepicker-retain-invalid-values.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-15/remove-timepicker-retain-invalid-values/remove-timepicker-retain-invalid-values.schematic.ts"],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