@skyux/packages 8.0.0-alpha.1 → 8.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/collection.json +5 -0
  2. package/package.json +58 -49
  3. package/src/polyfills.d.ts +0 -0
  4. package/src/polyfills.js +2 -0
  5. package/src/polyfills.js.map +1 -0
  6. package/src/schematics/migrations/migration-collection.json +5 -40
  7. package/src/schematics/migrations/update-8/update-polyfill/schema.json +7 -0
  8. package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.d.ts +2 -0
  9. package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.js +70 -0
  10. package/src/schematics/migrations/update-8/update-polyfill/update-polyfill.schematic.js.map +1 -0
  11. package/src/schematics/ng-add/ng-add.schematic.js +2 -2
  12. package/src/schematics/ng-add/ng-add.schematic.js.map +1 -1
  13. package/src/schematics/rules/add-polyfills-config.d.ts +2 -0
  14. package/src/schematics/rules/add-polyfills-config.js +35 -0
  15. package/src/schematics/rules/add-polyfills-config.js.map +1 -0
  16. package/src/schematics/migrations/update-7/add-autonumeric-dependency.d.ts +0 -2
  17. package/src/schematics/migrations/update-7/add-autonumeric-dependency.js +0 -11
  18. package/src/schematics/migrations/update-7/add-autonumeric-dependency.js.map +0 -1
  19. package/src/schematics/migrations/update-7/add-axe-core-dependency.d.ts +0 -2
  20. package/src/schematics/migrations/update-7/add-axe-core-dependency.js +0 -11
  21. package/src/schematics/migrations/update-7/add-axe-core-dependency.js.map +0 -1
  22. package/src/schematics/migrations/update-7/add-compat-stylesheets.d.ts +0 -2
  23. package/src/schematics/migrations/update-7/add-compat-stylesheets.js +0 -156
  24. package/src/schematics/migrations/update-7/add-compat-stylesheets.js.map +0 -1
  25. package/src/schematics/migrations/update-7/add-moment-dependency.d.ts +0 -2
  26. package/src/schematics/migrations/update-7/add-moment-dependency.js +0 -11
  27. package/src/schematics/migrations/update-7/add-moment-dependency.js.map +0 -1
  28. package/src/schematics/migrations/update-7/ag-grid-28.schematic.d.ts +0 -12
  29. package/src/schematics/migrations/update-7/ag-grid-28.schematic.js +0 -201
  30. package/src/schematics/migrations/update-7/ag-grid-28.schematic.js.map +0 -1
  31. package/src/schematics/migrations/update-7/fix-imports.d.ts +0 -2
  32. package/src/schematics/migrations/update-7/fix-imports.js +0 -172
  33. package/src/schematics/migrations/update-7/fix-imports.js.map +0 -1
  34. package/src/schematics/migrations/update-7/fix-scss-imports.d.ts +0 -2
  35. package/src/schematics/migrations/update-7/fix-scss-imports.js +0 -77
  36. package/src/schematics/migrations/update-7/fix-scss-imports.js.map +0 -1
  37. package/src/schematics/migrations/update-7/rename-mutation-observer-service.d.ts +0 -2
  38. package/src/schematics/migrations/update-7/rename-mutation-observer-service.js +0 -27
  39. package/src/schematics/migrations/update-7/rename-mutation-observer-service.js.map +0 -1
  40. package/src/schematics/rules/add-crossvent-fix.d.ts +0 -2
  41. package/src/schematics/rules/add-crossvent-fix.js +0 -58
  42. package/src/schematics/rules/add-crossvent-fix.js.map +0 -1
  43. package/src/schematics/rules/files/add-crossvent-fix/test.ts.template +0 -17
@@ -1,201 +0,0 @@
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
@@ -1 +0,0 @@
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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AC,QAAQ,CAAC,UAAU,CAAC;oBACnC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnC;oBACA,QAAQ,CACN;;6DAE+C,CAChD,CAAC;iBACH;gBAED,cAAc,GAAG,4BAA4B,CAC3C,cAAc,EACd,gBAAgB,EAChB,mBAAmB,CACpB,CAAC;gBACF,cAAc,GAAG,qCAAqC,CACpD,QAAQ,EACR,cAAc,CACf,CAAC;gBACF,cAAc,GAAG,8BAA8B,CAAC,cAAc,CAAC,CAAC;gBAChE,cAAc;oBACZ,2CAA2C,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"}
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (): Rule;
@@ -1,172 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/fix-imports.ts"],"names":[],"mappings":";;;AAAA,+CAA6E;AAC7E,mEAA6E;AAE7E,2HAAqG;AAErG,uDAAuD;AAEvD,gGAAgG;AAChG,MAAM,mBAAmB,GAAG,wCAAwC,CAAC;AACrE,MAAM,qBAAqB,GACzB,gEAAgE,CAAC;AACnE,MAAM,6BAA6B,GAAG,6CAA6C,CAAC;AAEpF,SAAS,0BAA0B,CACjC,gBAA0B,EAC1B,QAAc,EACd,IAAU,EACV,OAAyB;IAEzB,MAAM,YAAY,GAAwC,EAAE,CAAC;IAC7D,gBAAgB,CAAC,OAAO,CAAC,CAAC,UAAkB,EAAE,EAAE;QAC9C,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,oBAAoB,GAAG,aAAa;YACxC,CAAC,CAAC,IAAA,gBAAS,EAAC,UAAU,CAAC;YACvB,CAAC,CAAC,IAAA,gBAAS,EAAC,UAAU,GAAG,KAAK,CAAC,CAAC;QAClC,MAAM,YAAY,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC;QACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,4BAA4B,UAAU,OAAO,YAAY,KAAK,CAC/D,CAAC;QACF,MAAM,aAAa,GAAG,IAAA,YAAK,EAAC,YAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;QACpB,0IAA0I;QAC1I,KAAK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IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;gBAClE,iCAAiC,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;aAC5D;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;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"}
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (): Rule;
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const tree_1 = require("../../utility/tree");
5
- const workspace_1 = require("../../utility/workspace");
6
- /**
7
- * Replaces any @blackbaud/skyux-design-tokens imports with their @skyux/theme equivalents.
8
- */
9
- function replaceDesignTokensImports(contents) {
10
- const matches = contents.matchAll(/@import\s+['"]?[~]?(?:(?:\.|\/)+)?(?:node_modules\/)?@blackbaud\/skyux-design-tokens\/scss\/_?(mixins|variables)(?:\.scss)?['"]?;?\s+/g);
11
- for (const match of matches) {
12
- const importPath = match[0];
13
- const importType = match[1]; // mixins or variables
14
- const replacementTemplate = new RegExp(`@import\\s+['"]?[~]?(?:(?:\\.|\\/)+)?(?:node_modules\\/)?@skyux\\/theme\\/scss\\/_?${importType}(?:\\.scss)?['"]?;?`);
15
- // If the equivalent default import is already found, just remove the design tokens import.
16
- if (replacementTemplate.test(contents)) {
17
- contents = contents.replace(importPath, '');
18
- continue;
19
- }
20
- contents = contents.replace(importPath, `@import 'node_modules/@skyux/theme/scss/${importType}';\n`);
21
- }
22
- return contents;
23
- }
24
- /**
25
- * If a mixins import exists, add the variables import as well.
26
- * (In prior versions of SKY UX, the variables were exported from the mixins file, but
27
- * this created a circular reference, hence the fix.)
28
- */
29
- function addVariablesScssImports(contents) {
30
- const matches = contents.matchAll(/@import\s+['"]?[~]?(?:(?:\.|\/)+)?(?:node_modules\/)?@skyux\/theme\/scss\/(_compat\/|themes\/modern\/_compat\/)?_?mixins(?:\.scss)?['"]?;?/g);
31
- for (const match of matches) {
32
- const mixinsImport = match[0];
33
- const variablesImport = mixinsImport.replace('mixins', 'variables');
34
- if (!contents.includes(variablesImport)) {
35
- contents = contents.replace(mixinsImport, `${mixinsImport}\n${variablesImport}`);
36
- }
37
- }
38
- return contents;
39
- }
40
- function fixScssImports() {
41
- return async (tree) => {
42
- const { workspace } = await (0, workspace_1.getWorkspace)(tree);
43
- for (const [, projectDefinition] of workspace.projects.entries()) {
44
- tree.getDir(projectDefinition.root).visit((filePath) => {
45
- if (filePath.endsWith('.scss')) {
46
- const contents = (0, tree_1.readRequiredFile)(tree, filePath);
47
- let updatedContents = contents;
48
- updatedContents = replaceDesignTokensImports(updatedContents);
49
- updatedContents = addVariablesScssImports(updatedContents);
50
- if (updatedContents !== contents) {
51
- tree.overwrite(filePath, updatedContents);
52
- }
53
- }
54
- });
55
- }
56
- };
57
- }
58
- /**
59
- * Removes the local version of '@blackbaud/skyux-design-tokens' from package.json;
60
- */
61
- function removeDesignTokensPackage() {
62
- return (tree) => {
63
- const packageJson = JSON.parse((0, tree_1.readRequiredFile)(tree, 'package.json'));
64
- if (packageJson.dependencies) {
65
- delete packageJson.dependencies['@blackbaud/skyux-design-tokens'];
66
- }
67
- if (packageJson.devDependencies) {
68
- delete packageJson.devDependencies['@blackbaud/skyux-design-tokens'];
69
- }
70
- tree.overwrite('package.json', JSON.stringify(packageJson));
71
- };
72
- }
73
- function default_1() {
74
- return (0, schematics_1.chain)([fixScssImports(), removeDesignTokensPackage()]);
75
- }
76
- exports.default = default_1;
77
- //# sourceMappingURL=fix-scss-imports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-scss-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/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,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"}
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (): Rule;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tree_1 = require("../../utility/tree");
4
- const workspace_1 = require("../../utility/workspace");
5
- function default_1() {
6
- return async (tree) => {
7
- const { workspace } = await (0, workspace_1.getWorkspace)(tree);
8
- for (const [, projectDefinition] of workspace.projects.entries()) {
9
- tree.getDir(projectDefinition.root).visit((filePath) => {
10
- if (filePath.match(/\.ts$/)) {
11
- const contents = (0, tree_1.readRequiredFile)(tree, filePath);
12
- const hasOldImport = contents.match(/import\s+{(?!.*(SkyMutationObserverService))(?:\s|\w|,)+(MutationObserverService)(?:\s|\w|,)+}\s+from\s+(?:'|")@skyux\/core(?:'|")/g);
13
- if (hasOldImport) {
14
- const newContents = contents.replace(/(?:[^Sky](MutationObserverService))/g, (fragment, match1) => {
15
- return fragment.replace(match1, 'SkyMutationObserverService');
16
- });
17
- if (newContents !== contents) {
18
- tree.overwrite(filePath, newContents);
19
- }
20
- }
21
- }
22
- });
23
- }
24
- };
25
- }
26
- exports.default = default_1;
27
- //# sourceMappingURL=rename-mutation-observer-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rename-mutation-observer-service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/packages/src/schematics/migrations/update-7/rename-mutation-observer-service.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AACtD,uDAAuD;AAEvD;IACE,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC/C,KAAK,MAAM,CAAC,EAAE,iBAAiB,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE;YAChE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACrD,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;oBAC3B,MAAM,QAAQ,GAAG,IAAA,uBAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBAClD,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CACjC,qIAAqI,CACtI,CAAC;oBAEF,IAAI,YAAY,EAAE;wBAChB,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAClC,sCAAsC,EACtC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;4BACnB,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;wBAChE,CAAC,CACF,CAAC;wBAEF,IAAI,WAAW,KAAK,QAAQ,EAAE;4BAC5B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;yBACvC;qBACF;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;AACJ,CAAC;AA3BD,4BA2BC"}
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function addCrossventFix(): Rule;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addCrossventFix = void 0;
4
- const tslib_1 = require("tslib");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
- const tree_1 = require("../utility/tree");
8
- const workspace_1 = require("../utility/workspace");
9
- const CROSSVENT_FIX = '(window as any).global = window;';
10
- function addCrossventFix() {
11
- const testTs = fs_extra_1.default.readFileSync(`${__dirname}/files/add-crossvent-fix/test.ts.template`, 'utf8');
12
- return async (tree, context) => {
13
- const rules = [];
14
- const { workspace } = await (0, workspace_1.getWorkspace)(tree);
15
- workspace.projects.forEach((project, projectName) => {
16
- const testTarget = project.targets.get('test');
17
- /*istanbul ignore else*/
18
- if (testTarget) {
19
- if (testTarget.options && testTarget.options.main) {
20
- // Get the 'test.ts' entry point file path from the 'test' target.
21
- const filePath = testTarget.options.main.toString();
22
- const contents = (0, tree_1.readRequiredFile)(tree, filePath);
23
- if (contents.includes(CROSSVENT_FIX)) {
24
- context.logger.info('Fix for crossvent library already applied. Skipping.');
25
- return;
26
- }
27
- tree.overwrite(filePath, contents.replace(/(\/\/ First, initialize the Angular testing environment\.)/, (_, group) => {
28
- return `// Fix for crossvent "global is not defined" error. The crossvent library
29
- // is used by Dragula, which in turn is used by multiple SKY UX components.
30
- // See: https://github.com/bevacqua/dragula/issues/602
31
- ${CROSSVENT_FIX}
32
-
33
- ${group}`;
34
- }));
35
- }
36
- else {
37
- rules.push((tree) => {
38
- tree.create(`${project.sourceRoot}/test.ts`, testTs);
39
- }, (0, workspace_1.updateWorkspace)((workspace) => {
40
- const project = workspace.projects.get(projectName);
41
- if (project) {
42
- const testTarget = project.targets.get('test');
43
- if (testTarget) {
44
- testTarget.options = {
45
- ...testTarget.options,
46
- main: `${project.sourceRoot}/test.ts`,
47
- };
48
- }
49
- }
50
- }));
51
- }
52
- }
53
- });
54
- return (0, schematics_1.chain)(rules);
55
- };
56
- }
57
- exports.addCrossventFix = addCrossventFix;
58
- //# sourceMappingURL=add-crossvent-fix.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-crossvent-fix.js","sourceRoot":"","sources":["../../../../../../../libs/components/packages/src/schematics/rules/add-crossvent-fix.ts"],"names":[],"mappings":";;;;AAAA,2DAAyD;AAEzD,gEAA0B;AAE1B,0CAAmD;AACnD,oDAAqE;AAErE,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAEzD,SAAgB,eAAe;IAC7B,MAAM,MAAM,GAAG,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AAE;wBAC5B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;wBACpD,IAAI,OAAO,EAAE;4BACX,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;4BAC/C,IAAI,UAAU,EAAE;gCACd,UAAU,CAAC,OAAO,GAAG;oCACnB,GAAG,UAAU,CAAC,OAAO;oCACrB,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,UAAU;iCACtC,CAAC;6BACH;yBACF;oBACH,CAAC,CAAC,CACH,CAAC;iBACH;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AA9DD,0CA8DC"}
@@ -1,17 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
- import { getTestBed } from '@angular/core/testing';
3
- import {
4
- BrowserDynamicTestingModule,
5
- platformBrowserDynamicTesting,
6
- } from '@angular/platform-browser-dynamic/testing';
7
-
8
- // Fix for crossvent "global is not defined" error. The crossvent library
9
- // is used by Dragula, which in turn is used by multiple SKY UX components.
10
- // See: https://github.com/bevacqua/dragula/issues/602
11
- (window as any).global = window;
12
-
13
- // First, initialize the Angular testing environment.
14
- getTestBed().initTestEnvironment(
15
- BrowserDynamicTestingModule,
16
- platformBrowserDynamicTesting()
17
- );