@skyux/packages 8.0.0-alpha.6 → 8.0.0-alpha.7
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/collection.json +4 -4
- package/package.json +48 -48
- package/src/polyfills.js +2 -2
- package/src/schematics/migrations/migration-collection.json +2 -2
- package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.d.ts +5 -1
- package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.js +68 -48
- package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.js.map +1 -1
- package/src/schematics/ng-add/ng-add.schematic.d.ts +2 -1
- package/src/schematics/ng-add/ng-add.schematic.js +5 -3
- package/src/schematics/ng-add/ng-add.schematic.js.map +1 -1
- package/src/schematics/ng-add/schema.d.ts +9 -0
- package/src/schematics/ng-add/schema.js +3 -0
- package/src/schematics/ng-add/schema.js.map +1 -0
- package/src/schematics/ng-add/schema.json +13 -1
- package/src/schematics/ng-generate/polyfills/polyfills.schematic.d.ts +6 -0
- package/src/schematics/ng-generate/polyfills/polyfills.schematic.js +16 -0
- package/src/schematics/ng-generate/polyfills/polyfills.schematic.js.map +1 -0
- package/src/schematics/ng-generate/polyfills/schema.d.ts +9 -0
- package/src/schematics/ng-generate/polyfills/schema.js +3 -0
- package/src/schematics/ng-generate/polyfills/schema.js.map +1 -0
- package/src/schematics/ng-generate/polyfills/schema.json +13 -0
- package/src/schematics/rules/add-polyfills-config.d.ts +4 -1
- package/src/schematics/rules/add-polyfills-config.js +36 -21
- package/src/schematics/rules/add-polyfills-config.js.map +1 -1
- package/src/schematics/rules/apply-skyux-stylesheets-to-workspace.d.ts +1 -1
- package/src/schematics/rules/apply-skyux-stylesheets-to-workspace.js +18 -15
- package/src/schematics/rules/apply-skyux-stylesheets-to-workspace.js.map +1 -1
- package/src/schematics/rules/ensure-peers-installed.d.ts +1 -1
- package/src/schematics/testing/tree.d.ts +5 -0
- package/src/schematics/testing/tree.js +12 -0
- package/src/schematics/testing/tree.js.map +1 -0
- package/src/schematics/utility/json-file.d.ts +2 -2
- package/src/schematics/utility/json-file.js +3 -3
- package/src/schematics/utility/json-file.js.map +1 -1
- package/src/schematics/utility/workspace.d.ts +14 -6
- package/src/schematics/utility/workspace.js +20 -4
- package/src/schematics/utility/workspace.js.map +1 -1
- package/src/polyfills.d.ts +0 -0
- package/src/polyfills.js.map +0 -1
- package/src/schematics/migrations/update-8/update-polyfill/schema.json +0 -7
- package/src/schematics/rules/replace-typescript-imports.d.ts +0 -9
- package/src/schematics/rules/replace-typescript-imports.js +0 -32
- package/src/schematics/rules/replace-typescript-imports.js.map +0 -1
package/collection.json
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"factory": "./src/schematics/ng-add/ng-add.schematic",
|
|
7
7
|
"schema": "./src/schematics/ng-add/schema.json"
|
|
8
8
|
},
|
|
9
|
-
"
|
|
10
|
-
"description": "
|
|
11
|
-
"factory": "./src/schematics/
|
|
12
|
-
"schema": "./src/schematics/
|
|
9
|
+
"polyfills": {
|
|
10
|
+
"description": "Add @skyux/packages/polyfills to project config.",
|
|
11
|
+
"factory": "./src/schematics/ng-generate/polyfills/polyfills.schematic",
|
|
12
|
+
"schema": "./src/schematics/ng-generate/polyfills/schema.json"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/packages",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.7",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"description": "Handles the `ng update` command for SKY UX component libraries.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,61 +37,61 @@
|
|
|
37
37
|
"ng-update": {
|
|
38
38
|
"migrations": "./src/schematics/migrations/migration-collection.json",
|
|
39
39
|
"packageGroup": {
|
|
40
|
-
"@skyux-sdk/prettier-schematics": "8.0.0-alpha.
|
|
41
|
-
"@skyux-sdk/testing": "8.0.0-alpha.
|
|
42
|
-
"@skyux/a11y": "8.0.0-alpha.
|
|
43
|
-
"@skyux/action-bars": "8.0.0-alpha.
|
|
44
|
-
"@skyux/ag-grid": "8.0.0-alpha.
|
|
45
|
-
"@skyux/angular-tree-component": "8.0.0-alpha.
|
|
46
|
-
"@skyux/animations": "8.0.0-alpha.
|
|
47
|
-
"@skyux/assets": "8.0.0-alpha.
|
|
48
|
-
"@skyux/autonumeric": "8.0.0-alpha.
|
|
49
|
-
"@skyux/avatar": "8.0.0-alpha.
|
|
50
|
-
"@skyux/colorpicker": "8.0.0-alpha.
|
|
51
|
-
"@skyux/config": "8.0.0-alpha.
|
|
52
|
-
"@skyux/core": "8.0.0-alpha.
|
|
53
|
-
"@skyux/data-manager": "8.0.0-alpha.
|
|
54
|
-
"@skyux/datetime": "8.0.0-alpha.
|
|
40
|
+
"@skyux-sdk/prettier-schematics": "8.0.0-alpha.7",
|
|
41
|
+
"@skyux-sdk/testing": "8.0.0-alpha.7",
|
|
42
|
+
"@skyux/a11y": "8.0.0-alpha.7",
|
|
43
|
+
"@skyux/action-bars": "8.0.0-alpha.7",
|
|
44
|
+
"@skyux/ag-grid": "8.0.0-alpha.7",
|
|
45
|
+
"@skyux/angular-tree-component": "8.0.0-alpha.7",
|
|
46
|
+
"@skyux/animations": "8.0.0-alpha.7",
|
|
47
|
+
"@skyux/assets": "8.0.0-alpha.7",
|
|
48
|
+
"@skyux/autonumeric": "8.0.0-alpha.7",
|
|
49
|
+
"@skyux/avatar": "8.0.0-alpha.7",
|
|
50
|
+
"@skyux/colorpicker": "8.0.0-alpha.7",
|
|
51
|
+
"@skyux/config": "8.0.0-alpha.7",
|
|
52
|
+
"@skyux/core": "8.0.0-alpha.7",
|
|
53
|
+
"@skyux/data-manager": "8.0.0-alpha.7",
|
|
54
|
+
"@skyux/datetime": "8.0.0-alpha.7",
|
|
55
55
|
"@skyux/docs-tools": "^7.0.0",
|
|
56
|
-
"@skyux/errors": "8.0.0-alpha.
|
|
57
|
-
"@skyux/flyout": "8.0.0-alpha.
|
|
58
|
-
"@skyux/forms": "8.0.0-alpha.
|
|
59
|
-
"@skyux/grids": "8.0.0-alpha.
|
|
60
|
-
"@skyux/http": "8.0.0-alpha.
|
|
61
|
-
"@skyux/i18n": "8.0.0-alpha.
|
|
56
|
+
"@skyux/errors": "8.0.0-alpha.7",
|
|
57
|
+
"@skyux/flyout": "8.0.0-alpha.7",
|
|
58
|
+
"@skyux/forms": "8.0.0-alpha.7",
|
|
59
|
+
"@skyux/grids": "8.0.0-alpha.7",
|
|
60
|
+
"@skyux/http": "8.0.0-alpha.7",
|
|
61
|
+
"@skyux/i18n": "8.0.0-alpha.7",
|
|
62
62
|
"@skyux/icons": "^5.2.0",
|
|
63
|
-
"@skyux/indicators": "8.0.0-alpha.
|
|
64
|
-
"@skyux/inline-form": "8.0.0-alpha.
|
|
65
|
-
"@skyux/layout": "8.0.0-alpha.
|
|
66
|
-
"@skyux/list-builder": "8.0.0-alpha.
|
|
67
|
-
"@skyux/list-builder-common": "8.0.0-alpha.
|
|
68
|
-
"@skyux/list-builder-view-checklist": "8.0.0-alpha.
|
|
69
|
-
"@skyux/list-builder-view-grids": "8.0.0-alpha.
|
|
70
|
-
"@skyux/lists": "8.0.0-alpha.
|
|
71
|
-
"@skyux/lookup": "8.0.0-alpha.
|
|
72
|
-
"@skyux/modals": "8.0.0-alpha.
|
|
73
|
-
"@skyux/navbar": "8.0.0-alpha.
|
|
74
|
-
"@skyux/omnibar-interop": "8.0.0-alpha.
|
|
75
|
-
"@skyux/pages": "8.0.0-alpha.
|
|
76
|
-
"@skyux/phone-field": "8.0.0-alpha.
|
|
77
|
-
"@skyux/popovers": "8.0.0-alpha.
|
|
78
|
-
"@skyux/progress-indicator": "8.0.0-alpha.
|
|
79
|
-
"@skyux/router": "8.0.0-alpha.
|
|
80
|
-
"@skyux/select-field": "8.0.0-alpha.
|
|
81
|
-
"@skyux/split-view": "8.0.0-alpha.
|
|
82
|
-
"@skyux/tabs": "8.0.0-alpha.
|
|
83
|
-
"@skyux/text-editor": "8.0.0-alpha.
|
|
84
|
-
"@skyux/theme": "8.0.0-alpha.
|
|
85
|
-
"@skyux/tiles": "8.0.0-alpha.
|
|
86
|
-
"@skyux/toast": "8.0.0-alpha.
|
|
87
|
-
"@skyux/validation": "8.0.0-alpha.
|
|
63
|
+
"@skyux/indicators": "8.0.0-alpha.7",
|
|
64
|
+
"@skyux/inline-form": "8.0.0-alpha.7",
|
|
65
|
+
"@skyux/layout": "8.0.0-alpha.7",
|
|
66
|
+
"@skyux/list-builder": "8.0.0-alpha.7",
|
|
67
|
+
"@skyux/list-builder-common": "8.0.0-alpha.7",
|
|
68
|
+
"@skyux/list-builder-view-checklist": "8.0.0-alpha.7",
|
|
69
|
+
"@skyux/list-builder-view-grids": "8.0.0-alpha.7",
|
|
70
|
+
"@skyux/lists": "8.0.0-alpha.7",
|
|
71
|
+
"@skyux/lookup": "8.0.0-alpha.7",
|
|
72
|
+
"@skyux/modals": "8.0.0-alpha.7",
|
|
73
|
+
"@skyux/navbar": "8.0.0-alpha.7",
|
|
74
|
+
"@skyux/omnibar-interop": "8.0.0-alpha.7",
|
|
75
|
+
"@skyux/pages": "8.0.0-alpha.7",
|
|
76
|
+
"@skyux/phone-field": "8.0.0-alpha.7",
|
|
77
|
+
"@skyux/popovers": "8.0.0-alpha.7",
|
|
78
|
+
"@skyux/progress-indicator": "8.0.0-alpha.7",
|
|
79
|
+
"@skyux/router": "8.0.0-alpha.7",
|
|
80
|
+
"@skyux/select-field": "8.0.0-alpha.7",
|
|
81
|
+
"@skyux/split-view": "8.0.0-alpha.7",
|
|
82
|
+
"@skyux/tabs": "8.0.0-alpha.7",
|
|
83
|
+
"@skyux/text-editor": "8.0.0-alpha.7",
|
|
84
|
+
"@skyux/theme": "8.0.0-alpha.7",
|
|
85
|
+
"@skyux/tiles": "8.0.0-alpha.7",
|
|
86
|
+
"@skyux/toast": "8.0.0-alpha.7",
|
|
87
|
+
"@skyux/validation": "8.0.0-alpha.7",
|
|
88
88
|
"ag-grid-angular": "^28.2.1",
|
|
89
89
|
"ag-grid-community": "^28.2.1",
|
|
90
90
|
"ag-grid-enterprise": "^28.2.1"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@angular/cli": "^15.1
|
|
94
|
+
"@angular/cli": "^15.2.1"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"fs-extra": "10.1.0",
|
package/src/polyfills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
2
3
|
// Fix for crossvent `global is not defined` error. The crossvent library is used by Dragula,
|
|
3
4
|
// which in turn is used by multiple SKY UX components.
|
|
4
5
|
// https://github.com/bevacqua/dragula/issues/602
|
|
5
6
|
window.global = window;
|
|
6
|
-
//# sourceMappingURL=polyfills.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schematics": {
|
|
3
3
|
"noop": {
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.7",
|
|
5
5
|
"factory": "./noop/noop.schematic",
|
|
6
6
|
"description": "Update all SKY UX component packages"
|
|
7
7
|
},
|
|
8
8
|
"update-polyfill": {
|
|
9
9
|
"version": "8.0.0-alpha.0",
|
|
10
|
-
"factory": "./update-8/update-polyfill/update-polyfill.schematic
|
|
10
|
+
"factory": "./update-8/update-polyfill/update-polyfill.schematic",
|
|
11
11
|
"description": "Remove code from polyfills.ts/test.ts and add @skyux/packages/polyfills to workspace config."
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Removes SKY UX specific polyfills from 'src/polyfills.ts' and 'src/test.ts' files.
|
|
4
|
+
* Adds '@skyux/packages/polyfills' to the affected project's configuration.
|
|
5
|
+
*/
|
|
6
|
+
export default function updatePolyfillSchematic(): Rule;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatePolyfillSchematic = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
5
|
const ts = tslib_1.__importStar(require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
@@ -8,63 +7,84 @@ const add_polyfills_config_1 = require("../../../rules/add-polyfills-config");
|
|
|
8
7
|
const workspace_1 = require("../../../utility/workspace");
|
|
9
8
|
const polyfillBlockStart = `* SKY UX POLYFILLS - DO NOT MODIFY THIS SECTION`;
|
|
10
9
|
const polyfillBlockEnd = `* END SKY UX POLYFILLS`;
|
|
11
|
-
function removePolyfillCode() {
|
|
10
|
+
function removePolyfillCode(projectName, project) {
|
|
12
11
|
return async (tree) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
12
|
+
const targetsToUpdate = [];
|
|
13
|
+
// Check each target for 'polyfills' configuration.
|
|
14
|
+
for (const [targetName, target] of project.targets.entries()) {
|
|
15
|
+
const polyfillsFile = target.options?.polyfills;
|
|
16
|
+
if (!polyfillsFile) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const path = `${project.root}${polyfillsFile}`;
|
|
20
|
+
if (tree.exists(path)) {
|
|
21
|
+
const contents = tree.readText(path).replace(/\r\n/g, `\n`);
|
|
22
|
+
const polyfillBlockStartIndex = contents.indexOf(polyfillBlockStart);
|
|
23
|
+
const polyfillBlockEndIndex = contents.indexOf(polyfillBlockEnd);
|
|
24
|
+
if (polyfillBlockStartIndex !== -1 && polyfillBlockEndIndex !== -1) {
|
|
25
|
+
const changeStart = contents.lastIndexOf(`/*`, polyfillBlockStartIndex);
|
|
26
|
+
const changeEnd = contents.indexOf(`*/`, polyfillBlockEndIndex) + 2;
|
|
27
|
+
const change = tree.beginUpdate(path);
|
|
28
|
+
change.remove(changeStart, changeEnd - changeStart);
|
|
29
|
+
tree.commitUpdate(change);
|
|
30
|
+
targetsToUpdate.push(targetName);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const sourceFile = ts.createSourceFile(path, contents, ts.ScriptTarget.Latest, true);
|
|
34
|
+
// Find the expression that assigns the global property to the window object.
|
|
35
|
+
const expression = sourceFile.statements.find((node) => {
|
|
36
|
+
if (ts.isExpressionStatement(node)) {
|
|
37
|
+
const expression = node.expression;
|
|
38
|
+
if (ts.isBinaryExpression(expression)) {
|
|
39
|
+
const left = expression.left;
|
|
40
|
+
if (ts.isPropertyAccessExpression(left)) {
|
|
41
|
+
let leftExpression = left.expression;
|
|
42
|
+
if (ts.isParenthesizedExpression(leftExpression)) {
|
|
43
|
+
leftExpression = leftExpression.expression;
|
|
44
|
+
}
|
|
45
|
+
if (ts.isAsExpression(leftExpression) &&
|
|
46
|
+
ts.isIdentifier(leftExpression.expression) &&
|
|
47
|
+
leftExpression.expression.text === 'window' &&
|
|
48
|
+
left.name.text === 'global') {
|
|
49
|
+
const right = expression.right;
|
|
50
|
+
if (ts.isIdentifier(right) && right.text === 'window') {
|
|
51
|
+
return true;
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
|
-
return false;
|
|
54
|
-
});
|
|
55
|
-
if (expression) {
|
|
56
|
-
const change = tree.beginUpdate(path);
|
|
57
|
-
change.remove(expression.pos, expression.end - expression.pos);
|
|
58
|
-
tree.commitUpdate(change);
|
|
59
56
|
}
|
|
57
|
+
return false;
|
|
58
|
+
});
|
|
59
|
+
if (expression) {
|
|
60
|
+
const change = tree.beginUpdate(path);
|
|
61
|
+
change.remove(expression.pos, expression.end - expression.pos);
|
|
62
|
+
tree.commitUpdate(change);
|
|
63
|
+
targetsToUpdate.push(targetName);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Only update the project config if our polyfill was found in the
|
|
69
|
+
// polyfill.ts/test.ts files.
|
|
70
|
+
if (targetsToUpdate.length > 0) {
|
|
71
|
+
return (0, add_polyfills_config_1.addPolyfillsConfig)(projectName, targetsToUpdate);
|
|
72
|
+
}
|
|
64
73
|
};
|
|
65
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Removes SKY UX specific polyfills from 'src/polyfills.ts' and 'src/test.ts' files.
|
|
77
|
+
* Adds '@skyux/packages/polyfills' to the affected project's configuration.
|
|
78
|
+
*/
|
|
66
79
|
function updatePolyfillSchematic() {
|
|
67
|
-
return
|
|
80
|
+
return async (tree) => {
|
|
81
|
+
const { workspace } = await (0, workspace_1.getWorkspace)(tree);
|
|
82
|
+
const rules = [];
|
|
83
|
+
for (const [projectName, project] of workspace.projects.entries()) {
|
|
84
|
+
rules.push(removePolyfillCode(projectName, project));
|
|
85
|
+
}
|
|
86
|
+
return (0, schematics_1.chain)(rules);
|
|
87
|
+
};
|
|
68
88
|
}
|
|
69
|
-
exports.
|
|
89
|
+
exports.default = updatePolyfillSchematic;
|
|
70
90
|
//# sourceMappingURL=update-polyfill.schematic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-polyfill.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-polyfill.schematic.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/packages/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.ts"],"names":[],"mappings":";;;AACA,2DAAyD;AACzD,2HAAqG;AAErG,8EAAyE;AACzE,0DAA0D;AAE1D,MAAM,kBAAkB,GAAG,iDAAiD,CAAC;AAC7E,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAElD,SAAS,kBAAkB,CACzB,WAAmB,EACnB,OAA0B;IAE1B,OAAO,KAAK,EAAE,IAAI,EAAwB,EAAE;QAC1C,MAAM,eAAe,GAAa,EAAE,CAAC;QAErC,mDAAmD;QACnD,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;YAC5D,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC;YAEhD,IAAI,CAAC,aAAa,EAAE;gBAClB,SAAS;aACV;YAED,MAAM,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,aAAa,EAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAC5D,MAAM,uBAAuB,GAAG,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBACrE,MAAM,qBAAqB,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;gBACjE,IAAI,uBAAuB,KAAK,CAAC,CAAC,IAAI,qBAAqB,KAAK,CAAC,CAAC,E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,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAXD,0CAWC"}
|
|
@@ -9,6 +9,7 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
|
9
9
|
const add_polyfills_config_1 = require("../rules/add-polyfills-config");
|
|
10
10
|
const apply_skyux_stylesheets_to_workspace_1 = require("../rules/apply-skyux-stylesheets-to-workspace");
|
|
11
11
|
const install_angular_cdk_1 = require("../rules/install-angular-cdk");
|
|
12
|
+
const workspace_1 = require("../utility/workspace");
|
|
12
13
|
function installEssentialSkyUxPackages(skyuxVersion) {
|
|
13
14
|
return async (tree) => {
|
|
14
15
|
const packageNames = [
|
|
@@ -27,16 +28,17 @@ function installEssentialSkyUxPackages(skyuxVersion) {
|
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
function ngAdd() {
|
|
31
|
+
function ngAdd(options) {
|
|
31
32
|
return async (tree, context) => {
|
|
33
|
+
const { projectName } = await (0, workspace_1.getRequiredProject)(tree, options.project);
|
|
32
34
|
// Get the currently installed version of SKY UX.
|
|
33
35
|
const { version: skyuxVersion } = fs_extra_1.default.readJsonSync((0, core_1.normalize)(`${__dirname}/../../../package.json`));
|
|
34
36
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
35
37
|
return (0, schematics_1.chain)([
|
|
36
38
|
installEssentialSkyUxPackages(skyuxVersion),
|
|
37
39
|
(0, install_angular_cdk_1.installAngularCdk)(),
|
|
38
|
-
(0, add_polyfills_config_1.addPolyfillsConfig)(),
|
|
39
|
-
(0, apply_skyux_stylesheets_to_workspace_1.applySkyuxStylesheetsToWorkspace)(),
|
|
40
|
+
(0, add_polyfills_config_1.addPolyfillsConfig)(projectName, ['build', 'test']),
|
|
41
|
+
(0, apply_skyux_stylesheets_to_workspace_1.applySkyuxStylesheetsToWorkspace)(projectName),
|
|
40
42
|
]);
|
|
41
43
|
};
|
|
42
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-add.schematic.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/ng-add/ng-add.schematic.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2DAAyD;AACzD,4DAA0E;AAC1E,2EAGkD;AAElD,gEAA0B;AAE1B,wEAAmE;AACnE,wGAAiG;AACjG,sEAAiE;
|
|
1
|
+
{"version":3,"file":"ng-add.schematic.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/ng-add/ng-add.schematic.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2DAAyD;AACzD,4DAA0E;AAC1E,2EAGkD;AAElD,gEAA0B;AAE1B,wEAAmE;AACnE,wGAAiG;AACjG,sEAAiE;AACjE,oDAA0D;AAI1D,SAAS,6BAA6B,CAAC,YAAoB;IACzD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,YAAY,GAAG;YACnB,eAAe;YACf,aAAa;YACb,aAAa;YACb,cAAc;SACf,CAAC;QAEF,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;YACtC,IAAA,uCAAwB,EAAC,IAAI,EAAE;gBAC7B,IAAI,EAAE,iCAAkB,CAAC,OAAO;gBAChC,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,IAAI,YAAY,EAAE;gBAC3B,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAwB,KAAK,CAAC,OAAe;IAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAC7B,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,8BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAExE,iDAAiD;QACjD,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,kBAAE,CAAC,YAAY,CAC/C,IAAA,gBAAS,EAAC,GAAG,SAAS,wBAAwB,CAAC,CAChD,CAAC;QAEF,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAE9C,OAAO,IAAA,kBAAK,EAAC;YACX,6BAA6B,CAAC,YAAY,CAAC;YAC3C,IAAA,uCAAiB,GAAE;YACnB,IAAA,yCAAkB,EAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClD,IAAA,uEAAgC,EAAC,WAAW,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAlBD,wBAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
+
const add_polyfills_config_1 = require("../../rules/add-polyfills-config");
|
|
5
|
+
const workspace_1 = require("../../utility/workspace");
|
|
6
|
+
/**
|
|
7
|
+
* Adds '@skyux/packages/polyfills' to a project's configuration.
|
|
8
|
+
*/
|
|
9
|
+
function generatePolyfills(options) {
|
|
10
|
+
return async (tree) => {
|
|
11
|
+
const { projectName } = await (0, workspace_1.getRequiredProject)(tree, options.project);
|
|
12
|
+
return (0, schematics_1.chain)([(0, add_polyfills_config_1.addPolyfillsConfig)(projectName, ['build', 'test'])]);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.default = generatePolyfills;
|
|
16
|
+
//# sourceMappingURL=polyfills.schematic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyfills.schematic.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/ng-generate/polyfills/polyfills.schematic.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AAEzD,2EAAsE;AACtE,uDAA6D;AAI7D;;GAEG;AACH,SAAwB,iBAAiB,CAAC,OAAe;IACvD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,8BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAExE,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,yCAAkB,EAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;AACJ,CAAC;AAND,oCAMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/ng-generate/polyfills/schema.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Adds '@skyux/packages/polyfills' to the given targets' configuration.
|
|
4
|
+
*/
|
|
5
|
+
export declare function addPolyfillsConfig(projectName: string, targetNames: string[]): Rule;
|
|
@@ -2,33 +2,48 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addPolyfillsConfig = void 0;
|
|
4
4
|
const workspace_1 = require("../utility/workspace");
|
|
5
|
+
// List of approved builders the polyfill can be added to.
|
|
5
6
|
const polyfillsBuilders = [
|
|
6
7
|
'@angular-devkit/build-angular:browser',
|
|
7
8
|
'@angular-devkit/build-angular:karma',
|
|
8
9
|
'@blackbaud-internal/skyux-angular-builders:browser',
|
|
9
10
|
'@blackbaud-internal/skyux-angular-builders:karma',
|
|
10
11
|
];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Adds '@skyux/packages/polyfills' to the given targets' configuration.
|
|
14
|
+
*/
|
|
15
|
+
function addPolyfillsConfig(projectName, targetNames) {
|
|
16
|
+
return (_tree, context) => (0, workspace_1.updateWorkspace)((workspace) => {
|
|
17
|
+
const project = workspace.projects.get(projectName);
|
|
18
|
+
/* istanbul ignore next */
|
|
19
|
+
if (!project) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
for (const targetName of targetNames) {
|
|
23
|
+
const target = project.targets.get(targetName);
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
if (!target) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Abort if builder is not approved.
|
|
29
|
+
if (!polyfillsBuilders.includes(target.builder)) {
|
|
30
|
+
context.logger.warn(`Could not add polyfills to the '${projectName}' project's '${targetName}' target because it does not use an approved builder. (wanted one of ${polyfillsBuilders.join(' | ')})`);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!target.options?.polyfills) {
|
|
34
|
+
target.options = {
|
|
35
|
+
...(target.options || {}),
|
|
36
|
+
polyfills: [],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else if (typeof target.options.polyfills === 'string') {
|
|
40
|
+
target.options.polyfills = [target.options.polyfills];
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(target.options.polyfills) &&
|
|
43
|
+
!target.options.polyfills.includes('@skyux/packages/polyfills')) {
|
|
44
|
+
target.options.polyfills.push('@skyux/packages/polyfills');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
32
47
|
});
|
|
33
48
|
}
|
|
34
49
|
exports.addPolyfillsConfig = addPolyfillsConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-polyfills-config.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/add-polyfills-config.ts"],"names":[],"mappings":";;;AAEA,oDAAuD;AAEvD,MAAM,iBAAiB,GAAG;IACxB,uCAAuC;IACvC,qCAAqC;IACrC,oDAAoD;IACpD,kDAAkD;CACnD,CAAC;AAEF,SAAgB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"add-polyfills-config.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/add-polyfills-config.ts"],"names":[],"mappings":";;;AAEA,oDAAuD;AAEvD,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG;IACxB,uCAAuC;IACvC,qCAAqC;IACrC,oDAAoD;IACpD,kDAAkD;CACnD,CAAC;AAEF;;GAEG;AACH,SAAgB,kBAAkB,CAChC,WAAmB,EACnB,WAAqB;IAErB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CACxB,IAAA,2BAAe,EAAC,CAAC,SAAS,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEpD,0BAA0B;QAC1B,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;SACR;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE/C,0BAA0B;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO;aACR;YAED,oCAAoC;YACpC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;gBAC/C,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,mCAAmC,WAAW,gBAAgB,UAAU,wEAAwE,iBAAiB,CAAC,IAAI,CACpK,KAAK,CACN,GAAG,CACL,CAAC;gBACF,SAAS;aACV;YAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE;gBAC9B,MAAM,CAAC,OAAO,GAAG;oBACf,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;oBACzB,SAAS,EAAE,EAAE;iBACd,CAAC;aACH;iBAAM,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACvD,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aACvD;YACD,IACE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;gBACvC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAC/D;gBACA,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;aAC5D;SACF;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AA/CD,gDA+CC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function applySkyuxStylesheetsToWorkspace(): Rule;
|
|
2
|
+
export declare function applySkyuxStylesheetsToWorkspace(projectName: string): Rule;
|
|
@@ -3,21 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applySkyuxStylesheetsToWorkspace = void 0;
|
|
4
4
|
const theme_1 = require("../utility/theme");
|
|
5
5
|
const workspace_1 = require("../utility/workspace");
|
|
6
|
-
function applySkyuxStylesheetsToWorkspace() {
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
function applySkyuxStylesheetsToWorkspace(projectName) {
|
|
7
|
+
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
8
|
+
const project = workspace.projects.get(projectName);
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
if (!project) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
for (const targetName of ['build', 'test']) {
|
|
14
|
+
// Ignore build target for libraries.
|
|
15
|
+
if (targetName === 'build' &&
|
|
16
|
+
project.extensions.projectType === 'library') {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
// Add SKY UX stylesheets array to target.
|
|
20
|
+
const target = project.targets.get(targetName);
|
|
21
|
+
/*istanbul ignore else*/
|
|
22
|
+
if (target && target.options) {
|
|
23
|
+
target.options.styles = (0, theme_1.ensureSkyuxStylesheets)(target.options.styles);
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-skyux-stylesheets-to-workspace.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/apply-skyux-stylesheets-to-workspace.ts"],"names":[],"mappings":";;;AAEA,4CAA0D;AAC1D,oDAAuD;AAEvD,SAAgB,gCAAgC;
|
|
1
|
+
{"version":3,"file":"apply-skyux-stylesheets-to-workspace.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/apply-skyux-stylesheets-to-workspace.ts"],"names":[],"mappings":";;;AAEA,4CAA0D;AAC1D,oDAAuD;AAEvD,SAAgB,gCAAgC,CAAC,WAAmB;IAClE,OAAO,IAAA,2BAAe,EAAC,CAAC,SAAS,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEpD,0BAA0B;QAC1B,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO;SACR;QAED,KAAK,MAAM,UAAU,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;YAC1C,qCAAqC;YACrC,IACE,UAAU,KAAK,OAAO;gBACtB,OAAO,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAC5C;gBACA,SAAS;aACV;YAED,0CAA0C;YAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAE/C,wBAAwB;YACxB,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE;gBAC5B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,IAAA,8BAAsB,EAC5C,MAAM,CAAC,OAAO,CAAC,MAAkB,CAClC,CAAC;aACH;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA7BD,4EA6BC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readJson = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Returns JSON contents with a typeof 'any'.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
function readJson(tree, filePath) {
|
|
9
|
+
return tree.readJson(filePath);
|
|
10
|
+
}
|
|
11
|
+
exports.readJson = readJson;
|
|
12
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/testing/tree.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,8DAA8D;AAC9D,SAAgB,QAAQ,CAAC,IAAkB,EAAE,QAAgB;IAC3D,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAFD,4BAEC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { JsonValue } from '@angular-devkit/core';
|
|
6
6
|
import { Tree } from '@angular-devkit/schematics';
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type InsertionIndex = (properties: string[]) => number;
|
|
8
|
+
export type JsonPath = (string | number)[];
|
|
9
9
|
/**
|
|
10
10
|
* Handles JSONC files (JSON files that include comments).
|
|
11
11
|
* @internal
|
|
@@ -8,6 +8,9 @@ const jsonc_parser_1 = require("jsonc-parser");
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
class JsonFile {
|
|
11
|
+
#jsonAst;
|
|
12
|
+
#host;
|
|
13
|
+
#path;
|
|
11
14
|
constructor(host, path) {
|
|
12
15
|
this.#host = host;
|
|
13
16
|
this.#path = path;
|
|
@@ -19,9 +22,6 @@ class JsonFile {
|
|
|
19
22
|
throw new Error(`Could not read '${path}'.`);
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
|
-
#jsonAst;
|
|
23
|
-
#host;
|
|
24
|
-
#path;
|
|
25
25
|
get(jsonPath) {
|
|
26
26
|
const jsonAstNode = this.#getJsonAst();
|
|
27
27
|
if (!jsonAstNode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-file.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/utility/json-file.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAS1B,+CASsB;AAKtB;;;GAGG;AACH,MAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"json-file.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/utility/json-file.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAS1B,+CASsB;AAKtB;;;GAGG;AACH,MAAa,QAAQ;IAGnB,QAAQ,CAAmB;IAE3B,KAAK,CAAO;IACZ,KAAK,CAAS;IAEd,YAAY,IAAU,EAAE,IAAY;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;SAClC;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,CAAC;SA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AAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,QAAkB;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;YACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;SAClC;IACH,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;SACtB;QAED,MAAM,MAAM,GAAiB,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAA,wBAAS,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9C,kBAAkB,EAAE,IAAI;SACzB,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,oBACE,IAAI,CAAC,KACP,yBAAyB,IAAA,kCAAmB,EAC1C,KAAK,CACN,iBAAiB,MAAM,GAAG,CAC5B,CAAC;SACH;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAzFD,4BAyFC"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProjectDefinition, WorkspaceDefinition, WorkspaceHost } from '@angular-devkit/core/src/workspace';
|
|
2
2
|
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the workspace host and project config (angular.json).
|
|
5
5
|
*/
|
|
6
6
|
export declare function getWorkspace(tree: Tree): Promise<{
|
|
7
|
-
host:
|
|
8
|
-
workspace:
|
|
7
|
+
host: WorkspaceHost;
|
|
8
|
+
workspace: WorkspaceDefinition;
|
|
9
9
|
}>;
|
|
10
|
-
export declare function getProject(workspace:
|
|
11
|
-
project:
|
|
10
|
+
export declare function getProject(workspace: WorkspaceDefinition, projectName: string): Promise<{
|
|
11
|
+
project: ProjectDefinition;
|
|
12
12
|
projectName: string;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* Allows updates to the Angular project config (angular.json).
|
|
16
16
|
*/
|
|
17
|
-
export declare function updateWorkspace(updater: (workspace:
|
|
17
|
+
export declare function updateWorkspace(updater: (workspace: WorkspaceDefinition) => void | Promise<void>): Rule;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the project definition corresponding to the provided name, or throws an
|
|
20
|
+
* error if the project is not found.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getRequiredProject(tree: Tree, projectName: string | undefined): Promise<{
|
|
23
|
+
projectName: string;
|
|
24
|
+
project: ProjectDefinition;
|
|
25
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateWorkspace = exports.getProject = exports.getWorkspace = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.getRequiredProject = exports.updateWorkspace = exports.getProject = exports.getWorkspace = void 0;
|
|
4
|
+
const workspace_1 = require("@angular-devkit/core/src/workspace");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const tree_1 = require("./tree");
|
|
7
7
|
/**
|
|
@@ -32,7 +32,7 @@ function createHost(tree) {
|
|
|
32
32
|
*/
|
|
33
33
|
async function getWorkspace(tree) {
|
|
34
34
|
const host = createHost(tree);
|
|
35
|
-
const { workspace } = await
|
|
35
|
+
const { workspace } = await (0, workspace_1.readWorkspace)('/', host);
|
|
36
36
|
return { host, workspace };
|
|
37
37
|
}
|
|
38
38
|
exports.getWorkspace = getWorkspace;
|
|
@@ -53,8 +53,24 @@ function updateWorkspace(updater) {
|
|
|
53
53
|
// Send the workspace to the callback to allow it to be modified.
|
|
54
54
|
await updater(workspace);
|
|
55
55
|
// Update the workspace config with any changes.
|
|
56
|
-
await
|
|
56
|
+
await (0, workspace_1.writeWorkspace)(workspace, host);
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
exports.updateWorkspace = updateWorkspace;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the project definition corresponding to the provided name, or throws an
|
|
62
|
+
* error if the project is not found.
|
|
63
|
+
*/
|
|
64
|
+
async function getRequiredProject(tree, projectName) {
|
|
65
|
+
if (!projectName) {
|
|
66
|
+
throw new Error('A project name is required.');
|
|
67
|
+
}
|
|
68
|
+
const { workspace } = await getWorkspace(tree);
|
|
69
|
+
const project = workspace.projects.get(projectName);
|
|
70
|
+
if (!project) {
|
|
71
|
+
throw new Error(`The project '${projectName}' was not found in the workspace configuration.`);
|
|
72
|
+
}
|
|
73
|
+
return { projectName, project };
|
|
74
|
+
}
|
|
75
|
+
exports.getRequiredProject = getRequiredProject;
|
|
60
76
|
//# sourceMappingURL=workspace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/utility/workspace.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/utility/workspace.ts"],"names":[],"mappings":";;;AAAA,kEAM4C;AAC5C,2DAA6E;AAE7E,iCAA0C;AAE1C;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAU;IAC5B,OAAO;QACL,0BAA0B;QAC1B,KAAK,CAAC,QAAQ,CAAC,IAAY;YACzB,OAAO,IAAA,uBAAgB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QACD,0BAA0B;QAC1B,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAAY;YACxC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,C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C;IACxC,CAAC,CAAC;AACJ,CAAC;AAZD,0CAYC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CACtC,IAAU,EACV,WAA+B;IAE/B,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,gBAAgB,WAAW,iDAAiD,CAC7E,CAAC;KACH;IAED,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAClC,CAAC;AAlBD,gDAkBC"}
|
package/src/polyfills.d.ts
DELETED
|
File without changes
|
package/src/polyfills.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../../../../libs/components/packages/src/polyfills.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,uDAAuD;AACvD,iDAAiD;AAChD,MAAc,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
/**
|
|
3
|
-
* Calls a replacer function on every import statement of every TypeScript file in the tree.
|
|
4
|
-
* If changes are made to the import statements, you may call the `beforeFileUpdate` callback
|
|
5
|
-
* to make any changes to the file's contents before the file is updated on the file system.
|
|
6
|
-
* @param importStatementReplacer Returns the updated import statement.
|
|
7
|
-
* @param beforeFileUpdate Returns the updated file contents.
|
|
8
|
-
*/
|
|
9
|
-
export declare function replaceTypeScriptImports(importStatementReplacer: (importStatement: string, importPath: string, fileContents: string) => string, beforeFileUpdate?: (fileContents: string) => string): Rule;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replaceTypeScriptImports = void 0;
|
|
4
|
-
const core_1 = require("@angular-devkit/core");
|
|
5
|
-
const tree_1 = require("../utility/tree");
|
|
6
|
-
/**
|
|
7
|
-
* Calls a replacer function on every import statement of every TypeScript file in the tree.
|
|
8
|
-
* If changes are made to the import statements, you may call the `beforeFileUpdate` callback
|
|
9
|
-
* to make any changes to the file's contents before the file is updated on the file system.
|
|
10
|
-
* @param importStatementReplacer Returns the updated import statement.
|
|
11
|
-
* @param beforeFileUpdate Returns the updated file contents.
|
|
12
|
-
*/
|
|
13
|
-
function replaceTypeScriptImports(importStatementReplacer, beforeFileUpdate = (content) => content) {
|
|
14
|
-
return (tree) => {
|
|
15
|
-
const visitor = (filePath) => {
|
|
16
|
-
const extension = (0, core_1.extname)(filePath);
|
|
17
|
-
if (extension === '.ts') {
|
|
18
|
-
const contents = (0, tree_1.readRequiredFile)(tree, filePath);
|
|
19
|
-
const migratedContents = contents.replace(/import +{?[\w,\s]+}? +from +['"](.*)['"];?/g, (importStatement, importPath) => {
|
|
20
|
-
return importStatementReplacer(importStatement, importPath, contents);
|
|
21
|
-
});
|
|
22
|
-
if (contents !== migratedContents) {
|
|
23
|
-
tree.overwrite(filePath, beforeFileUpdate(migratedContents));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
tree.getDir('projects').visit(visitor);
|
|
28
|
-
tree.getDir('src').visit(visitor);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
exports.replaceTypeScriptImports = replaceTypeScriptImports;
|
|
32
|
-
//# sourceMappingURL=replace-typescript-imports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-typescript-imports.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/replace-typescript-imports.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAG/C,0CAAmD;AAEnD;;;;;;GAMG;AACH,SAAgB,wBAAwB,CACtC,uBAIW,EACX,mBAAqD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO;IAEzE,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,OAAO,GAAgB,CAAC,QAAQ,EAAE,EAAE;YACxC,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,SAAS,KAAK,KAAK,EAAE;gBACvB,MAAM,QAAQ,GAAG,IAAA,uBAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAElD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CACvC,6CAA6C,EAC7C,CAAC,eAAe,EAAE,UAAU,EAAE,EAAE;oBAC9B,OAAO,uBAAuB,CAC5B,eAAe,EACf,UAAU,EACV,QAAQ,CACT,CAAC;gBACJ,CAAC,CACF,CAAC;gBAEF,IAAI,QAAQ,KAAK,gBAAgB,EAAE;oBACjC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC;iBAC9D;aACF;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC;AAlCD,4DAkCC"}
|