@skyux/packages 9.0.0-alpha.4 → 9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/packages",
3
- "version": "9.0.0-alpha.4",
3
+ "version": "9.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": [
@@ -37,54 +37,54 @@
37
37
  "ng-update": {
38
38
  "migrations": "./src/schematics/migrations/migration-collection.json",
39
39
  "packageGroup": {
40
- "@skyux-sdk/eslint-config": "9.0.0-alpha.4",
41
- "@skyux-sdk/prettier-schematics": "9.0.0-alpha.4",
42
- "@skyux-sdk/testing": "9.0.0-alpha.4",
43
- "@skyux/a11y": "9.0.0-alpha.4",
44
- "@skyux/action-bars": "9.0.0-alpha.4",
45
- "@skyux/ag-grid": "9.0.0-alpha.4",
46
- "@skyux/angular-tree-component": "9.0.0-alpha.4",
47
- "@skyux/animations": "9.0.0-alpha.4",
48
- "@skyux/assets": "9.0.0-alpha.4",
49
- "@skyux/autonumeric": "9.0.0-alpha.4",
50
- "@skyux/avatar": "9.0.0-alpha.4",
51
- "@skyux/colorpicker": "9.0.0-alpha.4",
52
- "@skyux/config": "9.0.0-alpha.4",
53
- "@skyux/core": "9.0.0-alpha.4",
54
- "@skyux/data-manager": "9.0.0-alpha.4",
55
- "@skyux/datetime": "9.0.0-alpha.4",
56
- "@skyux/errors": "9.0.0-alpha.4",
57
- "@skyux/flyout": "9.0.0-alpha.4",
58
- "@skyux/forms": "9.0.0-alpha.4",
59
- "@skyux/grids": "9.0.0-alpha.4",
60
- "@skyux/http": "9.0.0-alpha.4",
61
- "@skyux/i18n": "9.0.0-alpha.4",
40
+ "@skyux-sdk/eslint-config": "9.0.0-alpha.6",
41
+ "@skyux-sdk/prettier-schematics": "9.0.0-alpha.6",
42
+ "@skyux-sdk/testing": "9.0.0-alpha.6",
43
+ "@skyux/a11y": "9.0.0-alpha.6",
44
+ "@skyux/action-bars": "9.0.0-alpha.6",
45
+ "@skyux/ag-grid": "9.0.0-alpha.6",
46
+ "@skyux/angular-tree-component": "9.0.0-alpha.6",
47
+ "@skyux/animations": "9.0.0-alpha.6",
48
+ "@skyux/assets": "9.0.0-alpha.6",
49
+ "@skyux/autonumeric": "9.0.0-alpha.6",
50
+ "@skyux/avatar": "9.0.0-alpha.6",
51
+ "@skyux/colorpicker": "9.0.0-alpha.6",
52
+ "@skyux/config": "9.0.0-alpha.6",
53
+ "@skyux/core": "9.0.0-alpha.6",
54
+ "@skyux/data-manager": "9.0.0-alpha.6",
55
+ "@skyux/datetime": "9.0.0-alpha.6",
56
+ "@skyux/errors": "9.0.0-alpha.6",
57
+ "@skyux/flyout": "9.0.0-alpha.6",
58
+ "@skyux/forms": "9.0.0-alpha.6",
59
+ "@skyux/grids": "9.0.0-alpha.6",
60
+ "@skyux/http": "9.0.0-alpha.6",
61
+ "@skyux/i18n": "9.0.0-alpha.6",
62
62
  "@skyux/icons": "^6.0.0",
63
- "@skyux/indicators": "9.0.0-alpha.4",
64
- "@skyux/inline-form": "9.0.0-alpha.4",
65
- "@skyux/layout": "9.0.0-alpha.4",
66
- "@skyux/list-builder": "9.0.0-alpha.4",
67
- "@skyux/list-builder-common": "9.0.0-alpha.4",
68
- "@skyux/list-builder-view-checklist": "9.0.0-alpha.4",
69
- "@skyux/list-builder-view-grids": "9.0.0-alpha.4",
70
- "@skyux/lists": "9.0.0-alpha.4",
71
- "@skyux/lookup": "9.0.0-alpha.4",
72
- "@skyux/modals": "9.0.0-alpha.4",
73
- "@skyux/navbar": "9.0.0-alpha.4",
74
- "@skyux/omnibar-interop": "9.0.0-alpha.4",
75
- "@skyux/pages": "9.0.0-alpha.4",
76
- "@skyux/phone-field": "9.0.0-alpha.4",
77
- "@skyux/popovers": "9.0.0-alpha.4",
78
- "@skyux/progress-indicator": "9.0.0-alpha.4",
79
- "@skyux/router": "9.0.0-alpha.4",
80
- "@skyux/select-field": "9.0.0-alpha.4",
81
- "@skyux/split-view": "9.0.0-alpha.4",
82
- "@skyux/tabs": "9.0.0-alpha.4",
83
- "@skyux/text-editor": "9.0.0-alpha.4",
84
- "@skyux/theme": "9.0.0-alpha.4",
85
- "@skyux/tiles": "9.0.0-alpha.4",
86
- "@skyux/toast": "9.0.0-alpha.4",
87
- "@skyux/validation": "9.0.0-alpha.4",
63
+ "@skyux/indicators": "9.0.0-alpha.6",
64
+ "@skyux/inline-form": "9.0.0-alpha.6",
65
+ "@skyux/layout": "9.0.0-alpha.6",
66
+ "@skyux/list-builder": "9.0.0-alpha.6",
67
+ "@skyux/list-builder-common": "9.0.0-alpha.6",
68
+ "@skyux/list-builder-view-checklist": "9.0.0-alpha.6",
69
+ "@skyux/list-builder-view-grids": "9.0.0-alpha.6",
70
+ "@skyux/lists": "9.0.0-alpha.6",
71
+ "@skyux/lookup": "9.0.0-alpha.6",
72
+ "@skyux/modals": "9.0.0-alpha.6",
73
+ "@skyux/navbar": "9.0.0-alpha.6",
74
+ "@skyux/omnibar-interop": "9.0.0-alpha.6",
75
+ "@skyux/pages": "9.0.0-alpha.6",
76
+ "@skyux/phone-field": "9.0.0-alpha.6",
77
+ "@skyux/popovers": "9.0.0-alpha.6",
78
+ "@skyux/progress-indicator": "9.0.0-alpha.6",
79
+ "@skyux/router": "9.0.0-alpha.6",
80
+ "@skyux/select-field": "9.0.0-alpha.6",
81
+ "@skyux/split-view": "9.0.0-alpha.6",
82
+ "@skyux/tabs": "9.0.0-alpha.6",
83
+ "@skyux/text-editor": "9.0.0-alpha.6",
84
+ "@skyux/theme": "9.0.0-alpha.6",
85
+ "@skyux/tiles": "9.0.0-alpha.6",
86
+ "@skyux/toast": "9.0.0-alpha.6",
87
+ "@skyux/validation": "9.0.0-alpha.6",
88
88
  "ag-grid-angular": "^29.3.5",
89
89
  "ag-grid-community": "^29.3.5",
90
90
  "ag-grid-enterprise": "^29.3.5"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schematics": {
3
3
  "noop": {
4
- "version": "9.0.0-alpha.4",
4
+ "version": "9.0.0-alpha.6",
5
5
  "factory": "./noop/noop.schematic",
6
6
  "description": "Update all SKY UX component packages"
7
7
  },
@@ -14,6 +14,11 @@
14
14
  "version": "9.0.0-0",
15
15
  "factory": "./update-9/add-forms-popovers-peer-dependency/add-forms-popovers-peer-dependency.schematic",
16
16
  "description": "Add @skyux/popovers peer dependency for @skyux/forms"
17
+ },
18
+ "ag-grid-29": {
19
+ "version": "9.0.0-0",
20
+ "factory": "./update-9/ag-grid-29/ag-grid-29.schematic",
21
+ "description": "Apply changes to support AG Grid 29"
17
22
  }
18
23
  }
19
24
  }
@@ -0,0 +1,12 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ * Upgrade to AG Grid 29 and address breaking changes:
4
+ *
5
+ * - Introduce IRowNode in some cases replacing RowNode
6
+ * - Replace `selectThisNode` with `setSelected`
7
+ * - Replace `columnApi.setColumnState` with `columnApi.applyColumnState`
8
+ * - Replace `column.isLockVisible()` with `column.getColDef().lockVisible`
9
+ * - Do not import AG Grid theme CSS files in angular.json
10
+ *
11
+ */
12
+ export default function (): Rule;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const typescript_1 = tslib_1.__importDefault(require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript"));
6
+ const utility_1 = require("@schematics/angular/utility");
7
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
8
+ const change_1 = require("@schematics/angular/utility/change");
9
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
10
+ const AG_GRID = 'ag-grid-community';
11
+ const AG_GRID_ENT = 'ag-grid-enterprise';
12
+ /**
13
+ * Check package.json for AG Grid dependencies.
14
+ */
15
+ function readDependencies(tree) {
16
+ const agGridDependency = (0, dependencies_1.getPackageJsonDependency)(tree, AG_GRID);
17
+ const agGridDependencyEnt = (0, dependencies_1.getPackageJsonDependency)(tree, AG_GRID_ENT);
18
+ return {
19
+ agGridDependency,
20
+ agGridDependencyEnt,
21
+ };
22
+ }
23
+ /**
24
+ * Do not import AG Grid themes in angular.json.
25
+ */
26
+ function removeAgGridCssFiles() {
27
+ return async (tree) => {
28
+ const workspace = await (0, utility_1.readWorkspace)(tree);
29
+ workspace.projects.forEach((project, projectName) => {
30
+ const build = project.targets.get('build');
31
+ if (build) {
32
+ build.options ??= {};
33
+ build.options['styles'] ??= [];
34
+ build.options['styles'] = build.options['styles'].filter((cssFile) => !cssFile.startsWith('ag-grid-community/dist/styles/'));
35
+ if (!build.options['styles'].includes('node_modules/@skyux/ag-grid/css/sky-ag-grid.css')) {
36
+ build.options['styles'].push('node_modules/@skyux/ag-grid/css/sky-ag-grid.css');
37
+ }
38
+ project.targets.set('build', build);
39
+ workspace.projects.set(projectName, project);
40
+ }
41
+ });
42
+ await (0, utility_1.writeWorkspace)(tree, workspace);
43
+ };
44
+ }
45
+ function switchToRenamedMethods(filePath, content, changes) {
46
+ const renames = new Map([
47
+ ['selectThisNode', 'setSelected'],
48
+ ['columnApi.setColumnState', 'columnApi.applyColumnState'],
49
+ ['column.isLockVisible()', 'column.getColDef().lockVisible'],
50
+ ]);
51
+ renames.forEach((toText, fromText) => {
52
+ let pos = content.indexOf(fromText);
53
+ while (pos > -1) {
54
+ changes.push(new change_1.ReplaceChange(filePath, pos, fromText, toText));
55
+ pos = content.indexOf(fromText, pos + 1);
56
+ }
57
+ });
58
+ }
59
+ function switchToRowNodeInterface(filePath, content, changes) {
60
+ let pos = content.indexOf(': RowNode');
61
+ if (pos > -1) {
62
+ const source = typescript_1.default.createSourceFile(filePath, content, typescript_1.default.ScriptTarget.Latest, true, typescript_1.default.ScriptKind.TS);
63
+ if (!(0, ast_utils_1.isImported)(source, 'IRowNode', 'ag-grid-community')) {
64
+ changes.push((0, ast_utils_1.insertImport)(source, content, 'IRowNode', 'ag-grid-community'));
65
+ }
66
+ while (pos > -1) {
67
+ // Not accessing a RowNode static property.
68
+ if (content.charAt(pos + 9) !== '.') {
69
+ changes.push(new change_1.ReplaceChange(filePath, pos, ': RowNode', ': IRowNode'));
70
+ }
71
+ pos = content.indexOf(': RowNode', pos + 1);
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * Visit all files and apply the changes.
77
+ */
78
+ function updateSourceFiles() {
79
+ return async (tree) => {
80
+ const workspace = await (0, utility_1.readWorkspace)(tree);
81
+ workspace.projects.forEach((project) => {
82
+ tree
83
+ .getDir(project.sourceRoot || project.root)
84
+ .visit((filePath) => {
85
+ // If the file is not a TypeScript file, we can skip it.
86
+ if (!filePath.endsWith('.ts')) {
87
+ return;
88
+ }
89
+ const content = tree.readText(filePath);
90
+ const changes = [];
91
+ switchToRenamedMethods(filePath, content, changes);
92
+ switchToRowNodeInterface(filePath, content, changes);
93
+ const recorder = tree.beginUpdate(filePath);
94
+ (0, change_1.applyToUpdateRecorder)(recorder, changes);
95
+ tree.commitUpdate(recorder);
96
+ });
97
+ });
98
+ };
99
+ }
100
+ /**
101
+ * Upgrade to AG Grid 29 and address breaking changes:
102
+ *
103
+ * - Introduce IRowNode in some cases replacing RowNode
104
+ * - Replace `selectThisNode` with `setSelected`
105
+ * - Replace `columnApi.setColumnState` with `columnApi.applyColumnState`
106
+ * - Replace `column.isLockVisible()` with `column.getColDef().lockVisible`
107
+ * - Do not import AG Grid theme CSS files in angular.json
108
+ *
109
+ */
110
+ function default_1() {
111
+ return async (tree) => {
112
+ const { agGridDependency, agGridDependencyEnt } = readDependencies(tree);
113
+ // AG Grid is not installed, so we don't need to do anything.
114
+ if (!agGridDependency && !agGridDependencyEnt) {
115
+ return;
116
+ }
117
+ return (0, schematics_1.chain)([updateSourceFiles(), removeAgGridCssFiles()]);
118
+ };
119
+ }
120
+ exports.default = default_1;
121
+ //# sourceMappingURL=ag-grid-29.schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ag-grid-29.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-9/ag-grid-29/ag-grid-29.schematic.ts"],"names":[],"mappings":";;;AACA,2DAA+D;AAC/D,wIAAgG;AAChG,yDAA4E;AAC5E,qEAG+C;AAC/C,+DAI4C;AAC5C,2EAAoF;AAEpF,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEzC;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,gBAAgB,GAAG,IAAA,uCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,mBAAmB,GAAG,IAAA,uCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACxE,OAAO;QACL,gBAAgB;QAChB,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,OAAO,KAAK,EAAE,IAAU,EAAiB,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAa,EAAC,IAAI,CAAC,CAAC;QAC5C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;YAClD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,OAAO,KAAK,EAA2C,CAAC;gBAC9D,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAc,CAAC;gBAC3C,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAc,CAAC,MAAM,CACpE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,gCAAgC,CAAC,CACnE,CAA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