@skyux/packages 7.0.0-beta.8 → 7.0.0
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/package.json +54 -54
- package/src/schematics/migrations/migration-collection.json +21 -1
- package/src/schematics/migrations/update-7/add-autonumeric-dependency.d.ts +2 -0
- package/src/schematics/migrations/update-7/add-autonumeric-dependency.js +11 -0
- package/src/schematics/migrations/update-7/add-autonumeric-dependency.js.map +1 -0
- package/src/schematics/migrations/update-7/add-axe-core-dependency.d.ts +2 -0
- package/src/schematics/migrations/update-7/add-axe-core-dependency.js +11 -0
- package/src/schematics/migrations/update-7/add-axe-core-dependency.js.map +1 -0
- package/src/schematics/migrations/update-7/add-compat-stylesheets.js +27 -0
- package/src/schematics/migrations/update-7/add-compat-stylesheets.js.map +1 -1
- package/src/schematics/migrations/update-7/add-moment-dependency.js +4 -15
- package/src/schematics/migrations/update-7/add-moment-dependency.js.map +1 -1
- package/src/schematics/migrations/update-7/ag-grid-28.schematic.d.ts +12 -0
- package/src/schematics/migrations/update-7/ag-grid-28.schematic.js +201 -0
- package/src/schematics/migrations/update-7/ag-grid-28.schematic.js.map +1 -0
- package/src/schematics/migrations/update-7/fix-imports.d.ts +2 -0
- package/src/schematics/migrations/update-7/fix-imports.js +172 -0
- package/src/schematics/migrations/update-7/fix-imports.js.map +1 -0
- package/src/schematics/migrations/update-7/fix-scss-imports.js +3 -3
- package/src/schematics/migrations/update-7/fix-scss-imports.js.map +1 -1
- package/src/schematics/rules/ensure-peers-installed.d.ts +15 -0
- package/src/schematics/rules/ensure-peers-installed.js +38 -0
- package/src/schematics/rules/ensure-peers-installed.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/packages",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"description": "Handles the `ng update` command for SKY UX component libraries.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,66 +27,66 @@
|
|
|
27
27
|
"@blackbaud/skyux-lib-code-block": "^7.0.0-beta.0",
|
|
28
28
|
"@blackbaud/skyux-lib-media": "^7.0.0-beta.0",
|
|
29
29
|
"@blackbaud/skyux-lib-stache": "^7.0.0-beta.0",
|
|
30
|
-
"@skyux-sdk/prettier-schematics": "7.0.0
|
|
31
|
-
"@skyux-sdk/testing": "7.0.0
|
|
32
|
-
"@skyux/a11y": "7.0.0
|
|
33
|
-
"@skyux/action-bars": "7.0.0
|
|
34
|
-
"@skyux/ag-grid": "7.0.0
|
|
35
|
-
"@skyux/angular-tree-component": "7.0.0
|
|
36
|
-
"@skyux/animations": "7.0.0
|
|
37
|
-
"@skyux/assets": "7.0.0
|
|
38
|
-
"@skyux/autonumeric": "7.0.0
|
|
39
|
-
"@skyux/avatar": "7.0.0
|
|
40
|
-
"@skyux/colorpicker": "7.0.0
|
|
41
|
-
"@skyux/config": "7.0.0
|
|
42
|
-
"@skyux/core": "7.0.0
|
|
43
|
-
"@skyux/data-manager": "7.0.0
|
|
44
|
-
"@skyux/datetime": "7.0.0
|
|
30
|
+
"@skyux-sdk/prettier-schematics": "7.0.0",
|
|
31
|
+
"@skyux-sdk/testing": "7.0.0",
|
|
32
|
+
"@skyux/a11y": "7.0.0",
|
|
33
|
+
"@skyux/action-bars": "7.0.0",
|
|
34
|
+
"@skyux/ag-grid": "7.0.0",
|
|
35
|
+
"@skyux/angular-tree-component": "7.0.0",
|
|
36
|
+
"@skyux/animations": "7.0.0",
|
|
37
|
+
"@skyux/assets": "7.0.0",
|
|
38
|
+
"@skyux/autonumeric": "7.0.0",
|
|
39
|
+
"@skyux/avatar": "7.0.0",
|
|
40
|
+
"@skyux/colorpicker": "7.0.0",
|
|
41
|
+
"@skyux/config": "7.0.0",
|
|
42
|
+
"@skyux/core": "7.0.0",
|
|
43
|
+
"@skyux/data-manager": "7.0.0",
|
|
44
|
+
"@skyux/datetime": "7.0.0",
|
|
45
45
|
"@skyux/docs-tools": "^7.0.0-beta.0",
|
|
46
|
-
"@skyux/errors": "7.0.0
|
|
47
|
-
"@skyux/flyout": "7.0.0
|
|
48
|
-
"@skyux/forms": "7.0.0
|
|
49
|
-
"@skyux/grids": "7.0.0
|
|
50
|
-
"@skyux/http": "7.0.0
|
|
51
|
-
"@skyux/i18n": "7.0.0
|
|
46
|
+
"@skyux/errors": "7.0.0",
|
|
47
|
+
"@skyux/flyout": "7.0.0",
|
|
48
|
+
"@skyux/forms": "7.0.0",
|
|
49
|
+
"@skyux/grids": "7.0.0",
|
|
50
|
+
"@skyux/http": "7.0.0",
|
|
51
|
+
"@skyux/i18n": "7.0.0",
|
|
52
52
|
"@skyux/icons": "^5.1.1",
|
|
53
|
-
"@skyux/indicators": "7.0.0
|
|
54
|
-
"@skyux/inline-form": "7.0.0
|
|
55
|
-
"@skyux/layout": "7.0.0
|
|
56
|
-
"@skyux/list-builder": "7.0.0
|
|
57
|
-
"@skyux/list-builder-common": "7.0.0
|
|
58
|
-
"@skyux/list-builder-view-checklist": "7.0.0
|
|
59
|
-
"@skyux/list-builder-view-grids": "7.0.0
|
|
60
|
-
"@skyux/lists": "7.0.0
|
|
61
|
-
"@skyux/lookup": "7.0.0
|
|
62
|
-
"@skyux/modals": "7.0.0
|
|
63
|
-
"@skyux/navbar": "7.0.0
|
|
64
|
-
"@skyux/omnibar-interop": "7.0.0
|
|
65
|
-
"@skyux/pages": "7.0.0
|
|
66
|
-
"@skyux/phone-field": "7.0.0
|
|
67
|
-
"@skyux/popovers": "7.0.0
|
|
68
|
-
"@skyux/progress-indicator": "7.0.0
|
|
69
|
-
"@skyux/router": "7.0.0
|
|
70
|
-
"@skyux/select-field": "7.0.0
|
|
71
|
-
"@skyux/split-view": "7.0.0
|
|
72
|
-
"@skyux/tabs": "7.0.0
|
|
73
|
-
"@skyux/text-editor": "7.0.0
|
|
74
|
-
"@skyux/theme": "7.0.0
|
|
75
|
-
"@skyux/tiles": "7.0.0
|
|
76
|
-
"@skyux/toast": "7.0.0
|
|
77
|
-
"@skyux/validation": "7.0.0
|
|
78
|
-
"ag-grid-angular": "^
|
|
79
|
-
"ag-grid-community": "^
|
|
80
|
-
"ag-grid-enterprise": "^
|
|
53
|
+
"@skyux/indicators": "7.0.0",
|
|
54
|
+
"@skyux/inline-form": "7.0.0",
|
|
55
|
+
"@skyux/layout": "7.0.0",
|
|
56
|
+
"@skyux/list-builder": "7.0.0",
|
|
57
|
+
"@skyux/list-builder-common": "7.0.0",
|
|
58
|
+
"@skyux/list-builder-view-checklist": "7.0.0",
|
|
59
|
+
"@skyux/list-builder-view-grids": "7.0.0",
|
|
60
|
+
"@skyux/lists": "7.0.0",
|
|
61
|
+
"@skyux/lookup": "7.0.0",
|
|
62
|
+
"@skyux/modals": "7.0.0",
|
|
63
|
+
"@skyux/navbar": "7.0.0",
|
|
64
|
+
"@skyux/omnibar-interop": "7.0.0",
|
|
65
|
+
"@skyux/pages": "7.0.0",
|
|
66
|
+
"@skyux/phone-field": "7.0.0",
|
|
67
|
+
"@skyux/popovers": "7.0.0",
|
|
68
|
+
"@skyux/progress-indicator": "7.0.0",
|
|
69
|
+
"@skyux/router": "7.0.0",
|
|
70
|
+
"@skyux/select-field": "7.0.0",
|
|
71
|
+
"@skyux/split-view": "7.0.0",
|
|
72
|
+
"@skyux/tabs": "7.0.0",
|
|
73
|
+
"@skyux/text-editor": "7.0.0",
|
|
74
|
+
"@skyux/theme": "7.0.0",
|
|
75
|
+
"@skyux/tiles": "7.0.0",
|
|
76
|
+
"@skyux/toast": "7.0.0",
|
|
77
|
+
"@skyux/validation": "7.0.0",
|
|
78
|
+
"ag-grid-angular": "^28.2.1",
|
|
79
|
+
"ag-grid-community": "^28.2.1",
|
|
80
|
+
"ag-grid-enterprise": "^28.2.1"
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@angular/cli": "^14.2.
|
|
84
|
+
"@angular/cli": "^14.2.10"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"fs-extra": "10.
|
|
88
|
-
"jsonc-parser": "3.
|
|
87
|
+
"fs-extra": "10.1.0",
|
|
88
|
+
"jsonc-parser": "3.2.0"
|
|
89
89
|
},
|
|
90
90
|
"main": "./src/index.js",
|
|
91
|
-
"
|
|
91
|
+
"types": "./src/index.d.ts"
|
|
92
92
|
}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schematics": {
|
|
3
3
|
"noop": {
|
|
4
|
-
"version": "7.0.0
|
|
4
|
+
"version": "7.0.0",
|
|
5
5
|
"factory": "./noop/noop.schematic",
|
|
6
6
|
"description": "Update all SKY UX component packages"
|
|
7
7
|
},
|
|
8
|
+
"ag-grid-28": {
|
|
9
|
+
"version": "7.0.0-beta.0",
|
|
10
|
+
"factory": "./update-7/ag-grid-28.schematic",
|
|
11
|
+
"description": "Update ag-grid to version 28"
|
|
12
|
+
},
|
|
13
|
+
"add-autonumeric-dependency": {
|
|
14
|
+
"version": "7.0.0-beta.0",
|
|
15
|
+
"factory": "./update-7/add-autonumeric-dependency",
|
|
16
|
+
"description": "Add autonumeric as a dependency since @skyux/autonumeric@7 references autonumeric as a peer."
|
|
17
|
+
},
|
|
18
|
+
"add-axe-core-dependency": {
|
|
19
|
+
"version": "7.0.0-beta.0",
|
|
20
|
+
"factory": "./update-7/add-axe-core-dependency",
|
|
21
|
+
"description": "Add axe-core as a dependency since @skyux-sdk/testing@7 references axe-core as a peer."
|
|
22
|
+
},
|
|
8
23
|
"add-moment-dependency": {
|
|
9
24
|
"version": "7.0.0-beta.0",
|
|
10
25
|
"factory": "./update-7/add-moment-dependency",
|
|
@@ -24,6 +39,11 @@
|
|
|
24
39
|
"version": "7.0.0-beta.0",
|
|
25
40
|
"factory": "./update-7/fix-scss-imports",
|
|
26
41
|
"description": "Fix SCSS imports"
|
|
42
|
+
},
|
|
43
|
+
"fix-imports": {
|
|
44
|
+
"version": "7.0.0-beta.0",
|
|
45
|
+
"factory": "./update-7/fix-imports",
|
|
46
|
+
"description": "Fix import and export statements where the file case does not match the filesystem, and fix or warn about core-js imports"
|
|
27
47
|
}
|
|
28
48
|
}
|
|
29
49
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
4
|
+
const ensure_peers_installed_1 = require("../../rules/ensure-peers-installed");
|
|
5
|
+
function default_1() {
|
|
6
|
+
return (0, ensure_peers_installed_1.ensurePeersInstalled)('@skyux/autonumeric', [
|
|
7
|
+
{ name: 'autonumeric', version: '4.6.0', type: dependencies_1.NodeDependencyType.Default },
|
|
8
|
+
]);
|
|
9
|
+
}
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
//# sourceMappingURL=add-autonumeric-dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-autonumeric-dependency.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-autonumeric-dependency.ts"],"names":[],"mappings":";;AACA,2EAA8E;AAE9E,+EAA0E;AAE1E;IACE,OAAO,IAAA,6CAAoB,EAAC,oBAAoB,EAAE;QAChD,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,iCAAkB,CAAC,OAAO,EAAE;KAC5E,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
4
|
+
const ensure_peers_installed_1 = require("../../rules/ensure-peers-installed");
|
|
5
|
+
function default_1() {
|
|
6
|
+
return (0, ensure_peers_installed_1.ensurePeersInstalled)('@skyux-sdk/testing', [
|
|
7
|
+
{ name: 'axe-core', version: '3.5.6', type: dependencies_1.NodeDependencyType.Dev },
|
|
8
|
+
]);
|
|
9
|
+
}
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
//# sourceMappingURL=add-axe-core-dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-axe-core-dependency.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-axe-core-dependency.ts"],"names":[],"mappings":";;AACA,2EAA8E;AAE9E,+EAA0E;AAE1E;IACE,OAAO,IAAA,6CAAoB,EAAC,oBAAoB,EAAE;QAChD,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,iCAAkB,CAAC,GAAG,EAAE;KACrE,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC"}
|
|
@@ -24,6 +24,33 @@ The preset bottom margin has been removed from alert components. To implement th
|
|
|
24
24
|
},
|
|
25
25
|
],
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
name: '@skyux/layout',
|
|
29
|
+
components: [
|
|
30
|
+
{
|
|
31
|
+
name: 'description list',
|
|
32
|
+
styles: [
|
|
33
|
+
{
|
|
34
|
+
css: `
|
|
35
|
+
.sky-description-list-vertical-mode .sky-description-list-content:last-child {
|
|
36
|
+
margin-bottom: 15px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sky-theme-modern .sky-description-list-vertical-mode .sky-description-list-content:last-child {
|
|
40
|
+
margin-bottom: 20px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:root {
|
|
44
|
+
--sky-compat-description-list-margin-bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
instructions: `
|
|
48
|
+
The preset bottom margin has been removed from description list components in horizontal and vertical modes in default theme and vertical mode in modern. To implement the newly-recommended spacing, add the \`sky-margin-stacked-lg\` CSS class to each \`sky-description-list\` component in your application, then remove this block.`,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
27
54
|
],
|
|
28
55
|
};
|
|
29
56
|
function getProjectSourcePath(projectDefinition) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-compat-stylesheets.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-compat-stylesheets.ts"],"names":[],"mappings":";;AACA,2DAA+D;AAE/D,6CAAsD;AACtD,uDAAwE;AAExE,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAExD,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE;QACT;YACE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;EAGjB;4BACY,YAAY,EAAE;sOAC0M;yBACzN;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,SAAS,oBAAoB,CAAC,iBAAoC;IAChE,wBAAwB;IACxB,IAAI,iBAAiB,CAAC,UAAU,EAAE;QAChC,OAAO,GAAG,iBAAiB,CAAC,UAAU,MAAM,CAAC;KAC9C;SAAM;QACL,OAAO,GAAG,iBAAiB,CAAC,IAAI,UAAU,CAAC;KAC5C;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;KACtB,OAAO,CAAC,OAAO,CAAC,kCAAkC,EAAE,SAAS,CAAC;GAChE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CAAC,SAG1B;IACC,IAAI,QAAQ,GAAG,iBAAiB,CAC9B,cAAc,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAC7C,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,MAAM,EAAE;QACpC,QAAQ,I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AoB,CAAC,iBAAiB,CAAC,CAAC;oBAC3D,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;iBACjD;aACF;SACF;QAED,IAAI,MAAM,EAAE;YACV,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;SACxC;QAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AArBD,4BAqBC"}
|
|
1
|
+
{"version":3,"file":"add-compat-stylesheets.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-compat-stylesheets.ts"],"names":[],"mappings":";;AACA,2DAA+D;AAE/D,6CAAsD;AACtD,uDAAwE;AAExE,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAExD,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE;QACT;YACE,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;EAGjB;4BACY,YAAY,EAAE;sOAC0M;yBACzN;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,eAAe;YACrB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE;wBACN;4BACE,GAAG,EAAE;;;;;;;;;;;;CAYlB;4BACa,YAAY,EAAE;0UAC8S;yBAC7T;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,SAAS,oBAAoB,CAAC,iBAAoC;IAChE,wBAAwB;IACxB,IAAI,iBAAiB,CAAC,UAAU,EAAE;QAChC,OAAO,GAAG,iBAAiB,CAAC,UAAU,MAAM,CAAC;KAC9C;SAAM;QACL,OAAO,GAAG,iBAAiB,CAAC,IAAI,UAAU,CAAC;KAC5C;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,OAAO,IAAI,GAAG,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E,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC/C,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;YAChE,IAAI,iBAAiB,CAAC,UAAU,CAAC,WAAW,KAAK,aAAa,EAAE;gBAC9D,IAAI,MAAM,EAAE;oBACV,MAAM,UAAU,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;oBAC3D,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;iBACjD;aACF;SACF;QAED,IAAI,MAAM,EAAE;YACV,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;SACxC;QAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AArBD,4BAqBC"}
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
4
3
|
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
5
|
-
const
|
|
4
|
+
const ensure_peers_installed_1 = require("../../rules/ensure-peers-installed");
|
|
6
5
|
function default_1() {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
!packageJson.devDependencies?.moment) {
|
|
11
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
12
|
-
(0, dependencies_1.addPackageJsonDependency)(tree, {
|
|
13
|
-
type: dependencies_1.NodeDependencyType.Default,
|
|
14
|
-
name: 'moment',
|
|
15
|
-
version: '2.29.4',
|
|
16
|
-
overwrite: false,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
6
|
+
return (0, ensure_peers_installed_1.ensurePeersInstalled)('@skyux/datetime', [
|
|
7
|
+
{ name: 'moment', version: '2.29.4', type: dependencies_1.NodeDependencyType.Default },
|
|
8
|
+
]);
|
|
20
9
|
}
|
|
21
10
|
exports.default = default_1;
|
|
22
11
|
//# sourceMappingURL=add-moment-dependency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-moment-dependency.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-moment-dependency.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"add-moment-dependency.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/add-moment-dependency.ts"],"names":[],"mappings":";;AACA,2EAA8E;AAE9E,+EAA0E;AAE1E;IACE,OAAO,IAAA,6CAAoB,EAAC,iBAAiB,EAAE;QAC7C,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,iCAAkB,CAAC,OAAO,EAAE;KACxE,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare const UPDATE_TO_VERSION = "28.2.1";
|
|
3
|
+
/**
|
|
4
|
+
* Upgrade to AG Grid 28 and address three breaking changes:
|
|
5
|
+
*
|
|
6
|
+
* - No longer support `@ag-grid-community/all-modules` -- just use the package
|
|
7
|
+
* - Remove `AgGridModule.withComponents` in module import
|
|
8
|
+
* - Column API renamed getSecondaryColumns / setSecondaryColumns
|
|
9
|
+
*
|
|
10
|
+
* Also advise against mixing modules and packages.
|
|
11
|
+
*/
|
|
12
|
+
export default function (): Rule;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UPDATE_TO_VERSION = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
6
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
7
|
+
const workspace_1 = require("../../utility/workspace");
|
|
8
|
+
exports.UPDATE_TO_VERSION = '28.2.1';
|
|
9
|
+
const ANY_MODULE = '@ag-grid-community/';
|
|
10
|
+
const ENT_MODULE = '@ag-grid-enterprise/';
|
|
11
|
+
const AG_GRID = 'ag-grid-community';
|
|
12
|
+
const AG_GRID_ENT = 'ag-grid-enterprise';
|
|
13
|
+
const withComponents = 'AgGridModule.withComponents';
|
|
14
|
+
const forRoot = 'AgGridModule.withComponents';
|
|
15
|
+
/**
|
|
16
|
+
* Check package.json for AG Grid dependencies.
|
|
17
|
+
*/
|
|
18
|
+
function readDependencies(tree) {
|
|
19
|
+
const agGridAllModules = (0, dependencies_1.getPackageJsonDependency)(tree, `${ANY_MODULE}all-modules`);
|
|
20
|
+
const agGridDependency = (0, dependencies_1.getPackageJsonDependency)(tree, AG_GRID);
|
|
21
|
+
const agGridAllModulesEnt = (0, dependencies_1.getPackageJsonDependency)(tree, `${ENT_MODULE}all-modules`);
|
|
22
|
+
const agGridDependencyEnt = (0, dependencies_1.getPackageJsonDependency)(tree, AG_GRID_ENT);
|
|
23
|
+
return {
|
|
24
|
+
agGridAllModules,
|
|
25
|
+
agGridDependency,
|
|
26
|
+
agGridAllModulesEnt,
|
|
27
|
+
agGridDependencyEnt,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Remove `@ag-grid-community/all-modules` and `@ag-grid-enterprise/all-modules` from package.json.
|
|
32
|
+
*/
|
|
33
|
+
function swapModulesWithPackageDependencies() {
|
|
34
|
+
return (tree, context) => {
|
|
35
|
+
const { agGridAllModules, agGridDependency, agGridAllModulesEnt, agGridDependencyEnt, } = readDependencies(tree);
|
|
36
|
+
// AG Grid is not installed, so we don't need to do anything.
|
|
37
|
+
if (!agGridAllModules &&
|
|
38
|
+
!agGridDependency &&
|
|
39
|
+
!agGridAllModulesEnt &&
|
|
40
|
+
!agGridDependencyEnt) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
let type = dependencies_1.NodeDependencyType.Default;
|
|
44
|
+
const overwrite = true;
|
|
45
|
+
const version = exports.UPDATE_TO_VERSION;
|
|
46
|
+
// Determine if there are any community packages that need to be updated.
|
|
47
|
+
if (!agGridDependency && agGridAllModules) {
|
|
48
|
+
type = agGridAllModules.type;
|
|
49
|
+
[AG_GRID, 'ag-grid-angular'].forEach((name) => {
|
|
50
|
+
(0, dependencies_1.addPackageJsonDependency)(tree, { name, overwrite, type, version });
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (agGridAllModules) {
|
|
54
|
+
(0, dependencies_1.removePackageJsonDependency)(tree, `${ANY_MODULE}all-modules`);
|
|
55
|
+
(0, dependencies_1.removePackageJsonDependency)(tree, `${ANY_MODULE}angular`);
|
|
56
|
+
}
|
|
57
|
+
// Determine if there are any enterprise packages that need to be updated.
|
|
58
|
+
if (!agGridDependencyEnt && agGridAllModulesEnt) {
|
|
59
|
+
type = agGridAllModulesEnt.type;
|
|
60
|
+
(0, dependencies_1.addPackageJsonDependency)(tree, {
|
|
61
|
+
name: AG_GRID_ENT,
|
|
62
|
+
overwrite,
|
|
63
|
+
type,
|
|
64
|
+
version,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (agGridAllModulesEnt) {
|
|
68
|
+
(0, dependencies_1.removePackageJsonDependency)(tree, `${ENT_MODULE}all-modules`);
|
|
69
|
+
}
|
|
70
|
+
// Install the new packages.
|
|
71
|
+
if (agGridAllModules || agGridAllModulesEnt) {
|
|
72
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Replace `@ag-grid-community/all-modules` with `ag-grid-community`/`ag-grid-angular`,
|
|
78
|
+
* and replace `@ag-grid-enterprise/all-modules` with `ag-grid-enterprise`.
|
|
79
|
+
*/
|
|
80
|
+
function swapModulesWithPackageInCode(updatedContent, agGridAllModules, agGridAllModulesEnt) {
|
|
81
|
+
// Replace `@ag-grid-community/all-modules` with `ag-grid-community`
|
|
82
|
+
if (agGridAllModules && updatedContent.includes(`${ANY_MODULE}all-modules`)) {
|
|
83
|
+
updatedContent = updatedContent.replace(/@ag-grid-community\/all-modules/g, AG_GRID);
|
|
84
|
+
}
|
|
85
|
+
// Replace `@ag-grid-enterprise/all-modules` with `ag-grid-enterprise`
|
|
86
|
+
if (agGridAllModulesEnt &&
|
|
87
|
+
updatedContent.includes(`${ENT_MODULE}all-modules`)) {
|
|
88
|
+
updatedContent = updatedContent.replace(/@ag-grid-enterprise\/all-modules/g, AG_GRID_ENT);
|
|
89
|
+
}
|
|
90
|
+
// Replace `@ag-grid-community/angular` with `ag-grid-angular`
|
|
91
|
+
if (agGridAllModules && updatedContent.includes(`${ANY_MODULE}angular`)) {
|
|
92
|
+
updatedContent = updatedContent.replace(/@ag-grid-community\/angular/g, 'ag-grid-angular');
|
|
93
|
+
}
|
|
94
|
+
return updatedContent;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Remove `AgGridModule.withComponents` and `AgGridModule.forRoot` in module imports.
|
|
98
|
+
*/
|
|
99
|
+
function removeWithComponentsStaticImportsCall(filePath, updatedContent) {
|
|
100
|
+
[withComponents, forRoot].forEach((staticModule) => {
|
|
101
|
+
if ((filePath.endsWith('module.ts') || filePath.endsWith('spec.ts')) &&
|
|
102
|
+
updatedContent.includes(staticModule)) {
|
|
103
|
+
let pos;
|
|
104
|
+
while ((pos = updatedContent.indexOf(staticModule)) !== -1) {
|
|
105
|
+
// Find closing parenthesis after `AgGridModule.withComponents`
|
|
106
|
+
const end = updatedContent.indexOf(')', pos);
|
|
107
|
+
// Leave `AgGridModule`, drop `.withComponents` and `.forRoot`.
|
|
108
|
+
updatedContent = [
|
|
109
|
+
updatedContent.substring(0, pos + 12),
|
|
110
|
+
updatedContent.substring(end + 1),
|
|
111
|
+
].join('');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return updatedContent;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Column API renamed getSecondaryColumns / setSecondaryColumns to getSecondaryPivotColumns / setSecondaryPivotColumns.
|
|
119
|
+
*/
|
|
120
|
+
function renameColumnApiFunctionsInCode(updatedContent) {
|
|
121
|
+
if (updatedContent.includes(AG_GRID) &&
|
|
122
|
+
updatedContent.includes('etSecondaryColumns(')) {
|
|
123
|
+
updatedContent = updatedContent.replace(/(?<=columnApi\s*)\.(get|set)SecondaryColumns\(/g, (_, x) => `.${x}PivotResultColumns(`);
|
|
124
|
+
}
|
|
125
|
+
return updatedContent;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Grid option renamed suppressCellSelection to suppressCellFocus.
|
|
129
|
+
*/
|
|
130
|
+
function renameSuppressCellSelectionGridOptionInCode(updatedContent) {
|
|
131
|
+
if (updatedContent.includes(AG_GRID) &&
|
|
132
|
+
updatedContent.match(/gridOptions/i) &&
|
|
133
|
+
updatedContent.includes('suppressCellSelection')) {
|
|
134
|
+
updatedContent = updatedContent.replace(/\bsuppressCellSelection\b/g, 'suppressCellFocus');
|
|
135
|
+
}
|
|
136
|
+
return updatedContent;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Visit all files and apply the changes.
|
|
140
|
+
*/
|
|
141
|
+
function updateSourceFiles() {
|
|
142
|
+
return async (tree, context) => {
|
|
143
|
+
const warned = [];
|
|
144
|
+
function warnOnce(message) {
|
|
145
|
+
if (!warned.includes(message)) {
|
|
146
|
+
warned.push(message);
|
|
147
|
+
context.logger.warn(message);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const { agGridAllModules, agGridDependency, agGridAllModulesEnt, agGridDependencyEnt, } = readDependencies(tree);
|
|
151
|
+
// AG Grid is not installed, so we don't need to do anything.
|
|
152
|
+
if (!agGridAllModules &&
|
|
153
|
+
!agGridDependency &&
|
|
154
|
+
!agGridAllModulesEnt &&
|
|
155
|
+
!agGridDependencyEnt) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const { workspace } = await (0, workspace_1.getWorkspace)(tree);
|
|
159
|
+
workspace.projects.forEach((project) => {
|
|
160
|
+
tree
|
|
161
|
+
.getDir(project.sourceRoot || project.root)
|
|
162
|
+
.visit((filePath) => {
|
|
163
|
+
// If the file is not a TypeScript file, we can skip it.
|
|
164
|
+
if (!filePath.endsWith('.ts')) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const content = tree.readText(filePath);
|
|
168
|
+
let updatedContent = content;
|
|
169
|
+
// Prompt the user to moderate the use of AG Grid modules
|
|
170
|
+
if (updatedContent.includes(ANY_MODULE) ||
|
|
171
|
+
updatedContent.includes(ENT_MODULE)) {
|
|
172
|
+
warnOnce(`\n
|
|
173
|
+
AG Grid recommends not mixing module and package imports.
|
|
174
|
+
https://ag-grid.com/angular-data-grid/modules/\n\n`);
|
|
175
|
+
}
|
|
176
|
+
updatedContent = swapModulesWithPackageInCode(updatedContent, agGridAllModules, agGridAllModulesEnt);
|
|
177
|
+
updatedContent = removeWithComponentsStaticImportsCall(filePath, updatedContent);
|
|
178
|
+
updatedContent = renameColumnApiFunctionsInCode(updatedContent);
|
|
179
|
+
updatedContent =
|
|
180
|
+
renameSuppressCellSelectionGridOptionInCode(updatedContent);
|
|
181
|
+
if (updatedContent !== content) {
|
|
182
|
+
tree.overwrite(filePath, updatedContent);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Upgrade to AG Grid 28 and address three breaking changes:
|
|
190
|
+
*
|
|
191
|
+
* - No longer support `@ag-grid-community/all-modules` -- just use the package
|
|
192
|
+
* - Remove `AgGridModule.withComponents` in module import
|
|
193
|
+
* - Column API renamed getSecondaryColumns / setSecondaryColumns
|
|
194
|
+
*
|
|
195
|
+
* Also advise against mixing modules and packages.
|
|
196
|
+
*/
|
|
197
|
+
function default_1() {
|
|
198
|
+
return (0, schematics_1.chain)([updateSourceFiles(), swapModulesWithPackageDependencies()]);
|
|
199
|
+
}
|
|
200
|
+
exports.default = default_1;
|
|
201
|
+
//# sourceMappingURL=ag-grid-28.schematic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ag-grid-28.schematic.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/ag-grid-28.schematic.ts"],"names":[],"mappings":";;;AACA,2DAKoC;AACpC,4DAA0E;AAC1E,2EAMkD;AAElD,uDAAuD;AAE1C,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,UAAU,GAAG,qBAAqB,CAAC;AACzC,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,MAAM,OAAO,GAAG,6BAA6B,CAAC;AAE9C;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,gBAAgB,GAAG,IAAA,uCAAwB,EAC/C,IAAI,EACJ,GAAG,UAAU,aAAa,CAC3B,CAAC;IACF,MAAM,gBAAgB,GAAG,IAAA,uCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,mBAAmB,GAAG,IAAA,uCAAwB,EAClD,IAAI,EACJ,GAAG,UAAU,aAAa,CAC3B,CAAC;IACF,MAAM,mBAAmB,GAAG,IAAA,uCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACxE,OAAO;QACL,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,mBAAmB;KACpB,C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,CAAC,cAAc,CAAC,CAAC;gBAE9D,IAAI,cAAc,KAAK,OAAO,EAAE;oBAC9B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;iBAC1C;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,iBAAiB,EAAE,EAAE,kCAAkC,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAFD,4BAEC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
5
|
+
const path_1 = require("@angular-devkit/core/src/virtual-fs/path");
|
|
6
|
+
const ts = tslib_1.__importStar(require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
7
|
+
const workspace_1 = require("../../utility/workspace");
|
|
8
|
+
// Obfuscate the import statement regexp to avoid flagging by the missing peer dependency check.
|
|
9
|
+
const CORE_JS_UNNECESSARY = /imp[o]rt \{[^}]+} from 'core-js';\r?\n/;
|
|
10
|
+
const CORE_JS_OBJECT_VALUES = /imp[o]rt values from 'core-js\/features\/object\/values';\r?\n/;
|
|
11
|
+
const CORE_JS_OBJECT_VALUES_REQUIRE = `require('core-js/library/fn/object/values')`;
|
|
12
|
+
function findChangesForLocalImports(localModulePaths, filePath, tree, context) {
|
|
13
|
+
const transformers = [];
|
|
14
|
+
localModulePaths.forEach((modulePath) => {
|
|
15
|
+
const endsWithSlash = !!modulePath.match(/[/\\]$/);
|
|
16
|
+
const normalizedModulePath = endsWithSlash
|
|
17
|
+
? (0, core_1.normalize)(modulePath)
|
|
18
|
+
: (0, core_1.normalize)(modulePath + '.ts');
|
|
19
|
+
const absolutePath = (0, path_1.resolve)((0, core_1.dirname)(filePath), normalizedModulePath);
|
|
20
|
+
context.logger.debug(`Looking for local module ${modulePath} at ${absolutePath}...`);
|
|
21
|
+
const pathFragments = (0, core_1.split)(absolutePath).slice(1);
|
|
22
|
+
const newPath = [];
|
|
23
|
+
let dir = tree.root;
|
|
24
|
+
// Walk the path fragments and check if the case is correct. This approach works on both case-sensitive and case-insensitive file systems.
|
|
25
|
+
for (let i = 0; i < pathFragments.length; i++) {
|
|
26
|
+
const pathFragment = pathFragments[i];
|
|
27
|
+
if (pathFragment.endsWith('.ts')) {
|
|
28
|
+
if (dir.subfiles.includes(pathFragment)) {
|
|
29
|
+
// File exists. We're done.
|
|
30
|
+
newPath.push(pathFragment.replace(/\.ts$/, ''));
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
// File does not exist. Try to find a file with the same name but different casing.
|
|
34
|
+
const matchingFile = dir.subfiles.find((subFile) => subFile.toLowerCase() === pathFragment.toLowerCase());
|
|
35
|
+
if (matchingFile) {
|
|
36
|
+
// Found a matching file. Use it.
|
|
37
|
+
newPath.push(matchingFile.replace(/\.ts$/, ''));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (dir.subdirs.includes(pathFragment)) {
|
|
43
|
+
// Sub dir exists. Continue.
|
|
44
|
+
dir = dir.dir(pathFragment);
|
|
45
|
+
newPath.push(pathFragment);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// Dir does not exist. Try to find a dir with the same name but different casing.
|
|
49
|
+
const matchingDir = dir.subdirs.find((subdir) => subdir.toLowerCase() === pathFragment.toLowerCase());
|
|
50
|
+
if (matchingDir) {
|
|
51
|
+
// Found a matching dir. Use it.
|
|
52
|
+
dir = dir.dir(matchingDir);
|
|
53
|
+
newPath.push(matchingDir);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Nothing found. Can't fix this.
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const newPathAbsolute = (0, core_1.join)(tree.root.path, ...newPath);
|
|
61
|
+
let newPathRelative = `${(0, path_1.relative)((0, core_1.dirname)(filePath), newPathAbsolute)}`;
|
|
62
|
+
if (!newPathRelative.startsWith('.')) {
|
|
63
|
+
newPathRelative = `./${newPathRelative}`;
|
|
64
|
+
}
|
|
65
|
+
if (endsWithSlash) {
|
|
66
|
+
newPathRelative = `${newPathRelative}/`;
|
|
67
|
+
}
|
|
68
|
+
if (newPathRelative !== modulePath) {
|
|
69
|
+
context.logger.debug(`Updating ${filePath} :: ${modulePath} -> ${newPathRelative}`);
|
|
70
|
+
transformers.push({
|
|
71
|
+
find: modulePath,
|
|
72
|
+
replace: newPathRelative,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return transformers;
|
|
77
|
+
}
|
|
78
|
+
function findChangesForCoreJs(sourceFile, coreJsImportDeclarations, context, filePath, fileContent) {
|
|
79
|
+
const transformers = [];
|
|
80
|
+
context.logger.debug(`Updating core-js imports in ${filePath}...`);
|
|
81
|
+
// Remove core-js imports that are not necessary.
|
|
82
|
+
const coreJsUnnecessaryImport = `${CORE_JS_UNNECESSARY.exec(fileContent)?.[0]}`;
|
|
83
|
+
if (coreJsUnnecessaryImport !== 'undefined') {
|
|
84
|
+
transformers.push({
|
|
85
|
+
find: coreJsUnnecessaryImport,
|
|
86
|
+
replace: '',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Replace direct import from core-js/features/object/values with Object.values in some very specific cases.
|
|
90
|
+
const coreJsObjectValuesImport = `${CORE_JS_OBJECT_VALUES.exec(fileContent)?.[0]}`;
|
|
91
|
+
if (coreJsObjectValuesImport !== 'undefined') {
|
|
92
|
+
transformers.push({
|
|
93
|
+
find: coreJsObjectValuesImport,
|
|
94
|
+
replace: '',
|
|
95
|
+
});
|
|
96
|
+
transformers.push({
|
|
97
|
+
find: 'values: values,',
|
|
98
|
+
replace: 'values: Object.values,',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (fileContent.includes(CORE_JS_OBJECT_VALUES_REQUIRE)) {
|
|
102
|
+
transformers.push({
|
|
103
|
+
find: CORE_JS_OBJECT_VALUES_REQUIRE,
|
|
104
|
+
replace: 'Object.values',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// Comment out polyfill core-js imports like `'core-js/es6';` or `'core-js/es7/reflect';`.
|
|
108
|
+
coreJsImportDeclarations
|
|
109
|
+
.filter((importDeclaration) => !importDeclaration.importClause)
|
|
110
|
+
.forEach((importDeclaration) => {
|
|
111
|
+
const importCode = fileContent.substring(importDeclaration.getStart(sourceFile, false), importDeclaration.getEnd());
|
|
112
|
+
transformers.push({
|
|
113
|
+
find: importCode,
|
|
114
|
+
replace: `// ${importCode}`,
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
return transformers;
|
|
118
|
+
}
|
|
119
|
+
function updateTypescriptImportsAndExports(filePath, tree, context) {
|
|
120
|
+
const fileContent = tree.read(filePath)?.toString();
|
|
121
|
+
if (!fileContent) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
context.logger.debug(`Checking imports and exports in ${filePath}...`);
|
|
125
|
+
const source = ts.createSourceFile(filePath, fileContent, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);
|
|
126
|
+
// Get all import declarations
|
|
127
|
+
const importDeclarations = source.statements.filter((statement) => statement.kind === ts.SyntaxKind.ImportDeclaration);
|
|
128
|
+
// Get all export declarations
|
|
129
|
+
const exportDeclarations = source.statements.filter((statement) => statement.kind === ts.SyntaxKind.ExportDeclaration &&
|
|
130
|
+
statement.moduleSpecifier);
|
|
131
|
+
const transformers = [];
|
|
132
|
+
// Just local module targets, without quotes
|
|
133
|
+
const localModulePaths = [...importDeclarations, ...exportDeclarations]
|
|
134
|
+
.map((declaration) => `${declaration.moduleSpecifier?.getText(source)}`)
|
|
135
|
+
.map((moduleSpecifier) => moduleSpecifier.replace(/['"]/g, ''))
|
|
136
|
+
.filter((moduleSpecifier) => moduleSpecifier.startsWith('.'));
|
|
137
|
+
if (localModulePaths.length > 0) {
|
|
138
|
+
transformers.push(...findChangesForLocalImports(localModulePaths, filePath, tree, context));
|
|
139
|
+
}
|
|
140
|
+
const coreJsImportDeclarations = importDeclarations.filter((declaration) => {
|
|
141
|
+
const moduleSpecifier = `${declaration.moduleSpecifier?.getText(source)}`.replace(/['"]/g, '');
|
|
142
|
+
return moduleSpecifier.startsWith('core-js');
|
|
143
|
+
});
|
|
144
|
+
if (coreJsImportDeclarations.length > 0) {
|
|
145
|
+
transformers.push(...findChangesForCoreJs(source, coreJsImportDeclarations, context, filePath, fileContent));
|
|
146
|
+
}
|
|
147
|
+
if (transformers.length > 0) {
|
|
148
|
+
let newContent = fileContent;
|
|
149
|
+
transformers.forEach((transformer) => {
|
|
150
|
+
newContent = newContent.replace(transformer.find, transformer.replace);
|
|
151
|
+
});
|
|
152
|
+
tree.overwrite(filePath, newContent);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async function visitTypescriptFiles(tree, context) {
|
|
156
|
+
const { workspace } = await (0, workspace_1.getWorkspace)(tree);
|
|
157
|
+
workspace.projects.forEach((project, projectName) => {
|
|
158
|
+
context.logger.debug(`Looking for typescript files in project ${projectName}...`);
|
|
159
|
+
tree.getDir(project.sourceRoot || project.root).visit((filePath) => {
|
|
160
|
+
if (filePath.endsWith('.ts') && !filePath.includes('node_modules')) {
|
|
161
|
+
updateTypescriptImportsAndExports(filePath, tree, context);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function default_1() {
|
|
167
|
+
return async (tree, context) => {
|
|
168
|
+
await visitTypescriptFiles(tree, context);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
exports.default = default_1;
|
|
172
|
+
//# sourceMappingURL=fix-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-imports.js","sourceRo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AAC;AACL,CAAC;AAED;IACE,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,MAAM,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAJD,4BAIC"}
|
|
@@ -7,11 +7,11 @@ const workspace_1 = require("../../utility/workspace");
|
|
|
7
7
|
* Replaces any @blackbaud/skyux-design-tokens imports with their @skyux/theme equivalents.
|
|
8
8
|
*/
|
|
9
9
|
function replaceDesignTokensImports(contents) {
|
|
10
|
-
const matches = contents.matchAll(/@import\s+['"]?node_modules
|
|
10
|
+
const matches = contents.matchAll(/@import\s+['"]?[~]?(?:(?:\.|\/)+)?(?:node_modules\/)?@blackbaud\/skyux-design-tokens\/scss\/_?(mixins|variables)(?:\.scss)?['"]?;?\s+/g);
|
|
11
11
|
for (const match of matches) {
|
|
12
12
|
const importPath = match[0];
|
|
13
13
|
const importType = match[1]; // mixins or variables
|
|
14
|
-
const replacementTemplate = new RegExp(`@import\\s+['"]?node_modules
|
|
14
|
+
const replacementTemplate = new RegExp(`@import\\s+['"]?[~]?(?:(?:\\.|\\/)+)?(?:node_modules\\/)?@skyux\\/theme\\/scss\\/_?${importType}(?:\\.scss)?['"]?;?`);
|
|
15
15
|
// If the equivalent default import is already found, just remove the design tokens import.
|
|
16
16
|
if (replacementTemplate.test(contents)) {
|
|
17
17
|
contents = contents.replace(importPath, '');
|
|
@@ -27,7 +27,7 @@ function replaceDesignTokensImports(contents) {
|
|
|
27
27
|
* this created a circular reference, hence the fix.)
|
|
28
28
|
*/
|
|
29
29
|
function addVariablesScssImports(contents) {
|
|
30
|
-
const matches = contents.matchAll(/@import\s+['"]?node_modules
|
|
30
|
+
const matches = contents.matchAll(/@import\s+['"]?[~]?(?:(?:\.|\/)+)?(?:node_modules\/)?@skyux\/theme\/scss\/(_compat\/|themes\/modern\/_compat\/)?_?mixins(?:\.scss)?['"]?;?/g);
|
|
31
31
|
for (const match of matches) {
|
|
32
32
|
const mixinsImport = match[0];
|
|
33
33
|
const variablesImport = mixinsImport.replace('mixins', 'variables');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-scss-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/fix-scss-imports.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,6CAAsD;AACtD,uDAAuD;AAEvD;;GAEG;AACH,SAAS,0BAA0B,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAC/B,
|
|
1
|
+
{"version":3,"file":"fix-scss-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/fix-scss-imports.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,6CAAsD;AACtD,uDAAuD;AAEvD;;GAEG;AACH,SAAS,0BAA0B,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAC/B,wIAAwI,CACzI,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB;QAEnD,MAAM,mBAAmB,GAAG,IAAI,MAAM,CACpC,sFAAsF,UAAU,qBAAqB,CACtH,CAAC;QAEF,2FAA2F;QAC3F,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACtC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC5C,SAAS;SACV;QAED,QAAQ,GAAG,QAAQ,CAAC,OAAO,CACzB,UAAU,EACV,2CAA2C,UAAU,MAAM,CAC5D,CAAC;KACH;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,QAAgB;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AAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB;IAChC,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,uBAAgB,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;QAEvE,IAAI,WAAW,CAAC,YAAY,EAAE;YAC5B,OAAO,WAAW,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;SACnE;QAED,IAAI,WAAW,CAAC,eAAe,EAAE;YAC/B,OAAO,WAAW,CAAC,eAAe,CAAC,gCAAgC,CAAC,CAAC;SACtE;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,cAAc,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,4BAEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import { NodeDependencyType } from '@schematics/angular/utility/dependencies';
|
|
3
|
+
declare type PackageDetails = {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
type: NodeDependencyType;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Ensures peer dependencies for a given package are installed on the client's workspace.
|
|
10
|
+
* If the client does not use the target package, this function is skipped.
|
|
11
|
+
* @param targetPackageName The name of the package that has peer dependencies.
|
|
12
|
+
* @param peers The target package's peer dependencies to install on the client's workspace.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ensurePeersInstalled(targetPackageName: string, peers: PackageDetails[]): Rule;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensurePeersInstalled = void 0;
|
|
4
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
6
|
+
const tree_1 = require("../utility/tree");
|
|
7
|
+
function installPackages(packages) {
|
|
8
|
+
return (tree, context) => {
|
|
9
|
+
for (const details of packages) {
|
|
10
|
+
// Remove the package (if it exists) so we can ensure it's added to the appropriate section.
|
|
11
|
+
(0, dependencies_1.removePackageJsonDependency)(tree, details.name, '/package.json');
|
|
12
|
+
(0, dependencies_1.addPackageJsonDependency)(tree, {
|
|
13
|
+
type: details.type,
|
|
14
|
+
name: details.name,
|
|
15
|
+
version: details.version,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Ensures peer dependencies for a given package are installed on the client's workspace.
|
|
23
|
+
* If the client does not use the target package, this function is skipped.
|
|
24
|
+
* @param targetPackageName The name of the package that has peer dependencies.
|
|
25
|
+
* @param peers The target package's peer dependencies to install on the client's workspace.
|
|
26
|
+
*/
|
|
27
|
+
function ensurePeersInstalled(targetPackageName, peers) {
|
|
28
|
+
return (tree) => {
|
|
29
|
+
const packageJson = JSON.parse((0, tree_1.readRequiredFile)(tree, '/package.json'));
|
|
30
|
+
const dependencies = {
|
|
31
|
+
...(packageJson.dependencies || {}),
|
|
32
|
+
...(packageJson.devDependencies || {}),
|
|
33
|
+
};
|
|
34
|
+
return dependencies[targetPackageName] ? installPackages(peers) : undefined;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.ensurePeersInstalled = ensurePeersInstalled;
|
|
38
|
+
//# sourceMappingURL=ensure-peers-installed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-peers-installed.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/ensure-peers-installed.ts"],"names":[],"mappings":";;;AACA,4DAA0E;AAC1E,2EAIkD;AAElD,0CAAmD;AAQnD,SAAS,eAAe,CAAC,QAA0B;IACjD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,4FAA4F;YAC5F,IAAA,0CAA2B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YACjE,IAAA,uCAAwB,EAAC,IAAI,EAAE;gBAC7B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC,CAAC;SACJ;QAED,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAClC,iBAAyB,EACzB,KAAuB;IAEvB,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,WAAW,GAGb,IAAI,CAAC,KAAK,CAAC,IAAA,uBAAgB,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;QAExD,MAAM,YAAY,GAA2B;YAC3C,GAAG,CAAC,WAAW,CAAC,YAAY,IAAI,EAAE,CAAC;YACnC,GAAG,CAAC,WAAW,CAAC,eAAe,IAAI,EAAE,CAAC;SACvC,CAAC;QAEF,OAAO,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,CAAC,CAAC;AACJ,CAAC;AAjBD,oDAiBC"}
|