@ethlete/cdk 5.0.0-next.2 → 5.0.0-next.21
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/CHANGELOG.md +93 -20
- package/fesm2022/ethlete-cdk.mjs +2621 -2205
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/generators/migrate-to-v5/color-themes.js +86 -4
- package/package.json +15 -16
- package/types/ethlete-cdk.d.ts +223 -175
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import { logger, readJson, visitNotIgnoredFiles, writeJson } from '@nx/devkit';
|
|
2
|
+
const TEMPLATE_REPLACEMENTS = [
|
|
3
|
+
['[etProvideTheme]', '[etProvideColor]'],
|
|
4
|
+
['etProvideTheme', 'etProvideColor'],
|
|
5
|
+
['[etProvideAltTheme]', '[etProvideAltColor]'],
|
|
6
|
+
['etProvideAltTheme', 'etProvideAltColor'],
|
|
7
|
+
['[etColorThemed]', '[etColored]'],
|
|
8
|
+
['etColorThemed', 'etColored'],
|
|
9
|
+
['[etSurfaceThemed]', '[etSurfaced]'],
|
|
10
|
+
['etSurfaceThemed', 'etSurfaced'],
|
|
11
|
+
['[theme]=', '[color]='],
|
|
12
|
+
['[altTheme]=', '[altColor]='],
|
|
13
|
+
['et-theme-alt--', 'et-color-alt--'],
|
|
14
|
+
['et-theme--', 'et-color--'],
|
|
15
|
+
];
|
|
16
|
+
const CSS_REPLACEMENTS = [
|
|
17
|
+
['.et-color-themed', '.et-colored'],
|
|
18
|
+
['.et-surface-themed', '.et-surfaced'],
|
|
19
|
+
['.et-theme--', '.et-color--'],
|
|
20
|
+
['.et-theme-alt--', '.et-color-alt--'],
|
|
21
|
+
];
|
|
2
22
|
// Theming-related exports that moved from @ethlete/theming and @ethlete/cdk to @ethlete/core
|
|
3
23
|
const THEMING_EXPORTS = new Set([
|
|
4
24
|
'ProvideThemeDirective',
|
|
@@ -20,6 +40,44 @@ export default async function migrateColorThemes(tree) {
|
|
|
20
40
|
let importsMoved = 0;
|
|
21
41
|
let importsMerged = 0;
|
|
22
42
|
let packagesRemoved = 0;
|
|
43
|
+
// Migrate HTML template files
|
|
44
|
+
visitNotIgnoredFiles(tree, '', (filePath) => {
|
|
45
|
+
if (!filePath.endsWith('.html')) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const content = tree.read(filePath, 'utf-8');
|
|
49
|
+
if (!content) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let modified = content;
|
|
53
|
+
for (const [oldStr, newStr] of TEMPLATE_REPLACEMENTS) {
|
|
54
|
+
modified = modified.replaceAll(oldStr, newStr);
|
|
55
|
+
}
|
|
56
|
+
if (modified !== content) {
|
|
57
|
+
tree.write(filePath, modified);
|
|
58
|
+
filesModified++;
|
|
59
|
+
console.log(` ✓ ${filePath}`);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// Migrate CSS/SCSS files
|
|
63
|
+
visitNotIgnoredFiles(tree, '', (filePath) => {
|
|
64
|
+
if (!filePath.endsWith('.css') && !filePath.endsWith('.scss')) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const content = tree.read(filePath, 'utf-8');
|
|
68
|
+
if (!content) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
let modified = content;
|
|
72
|
+
for (const [oldStr, newStr] of CSS_REPLACEMENTS) {
|
|
73
|
+
modified = modified.replaceAll(oldStr, newStr);
|
|
74
|
+
}
|
|
75
|
+
if (modified !== content) {
|
|
76
|
+
tree.write(filePath, modified);
|
|
77
|
+
filesModified++;
|
|
78
|
+
console.log(` ✓ ${filePath}`);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
23
81
|
// Migrate TypeScript files
|
|
24
82
|
visitNotIgnoredFiles(tree, '', (filePath) => {
|
|
25
83
|
if (!filePath.endsWith('.ts')) {
|
|
@@ -29,14 +87,38 @@ export default async function migrateColorThemes(tree) {
|
|
|
29
87
|
if (!content) {
|
|
30
88
|
return;
|
|
31
89
|
}
|
|
32
|
-
// Check if file contains provideThemes or imports from @ethlete/theming or @ethlete/cdk
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
90
|
+
// Check if file contains provideThemes or imports from @ethlete/theming or @ethlete/cdk,
|
|
91
|
+
// or any template/CSS strings that need replacing
|
|
92
|
+
const needsImportMigration = content.includes('provideThemes') || content.includes('@ethlete/theming') || content.includes('@ethlete/cdk');
|
|
93
|
+
const needsTemplateMigration = TEMPLATE_REPLACEMENTS.some(([oldStr]) => content.includes(oldStr));
|
|
94
|
+
const needsCssMigration = CSS_REPLACEMENTS.some(([oldStr]) => content.includes(oldStr));
|
|
95
|
+
if (!needsImportMigration && !needsTemplateMigration && !needsCssMigration) {
|
|
36
96
|
return;
|
|
37
97
|
}
|
|
38
98
|
let modified = content;
|
|
39
99
|
let fileChanges = 0;
|
|
100
|
+
// Apply template replacements (covers inline templates and class usages)
|
|
101
|
+
if (needsTemplateMigration) {
|
|
102
|
+
for (const [oldStr, newStr] of TEMPLATE_REPLACEMENTS) {
|
|
103
|
+
modified = modified.replaceAll(oldStr, newStr);
|
|
104
|
+
}
|
|
105
|
+
fileChanges++;
|
|
106
|
+
}
|
|
107
|
+
// Apply CSS replacements (covers inline styles)
|
|
108
|
+
if (needsCssMigration) {
|
|
109
|
+
for (const [oldStr, newStr] of CSS_REPLACEMENTS) {
|
|
110
|
+
modified = modified.replaceAll(oldStr, newStr);
|
|
111
|
+
}
|
|
112
|
+
fileChanges++;
|
|
113
|
+
}
|
|
114
|
+
if (!needsImportMigration) {
|
|
115
|
+
if (modified !== content) {
|
|
116
|
+
tree.write(filePath, modified);
|
|
117
|
+
filesModified++;
|
|
118
|
+
console.log(` ✓ ${filePath} (${fileChanges} change${fileChanges !== 1 ? 's' : ''})`);
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
40
122
|
// Replace provideThemes with provideColorThemes
|
|
41
123
|
const beforeProvideThemesCount = (modified.match(/\bprovideThemes\b/g) || []).length;
|
|
42
124
|
modified = modified.replace(/\bprovideThemes\b/g, 'provideColorThemes');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/cdk",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -14,28 +14,27 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@analogjs/vite-plugin-angular": "2.
|
|
18
|
-
"@angular/
|
|
19
|
-
"@angular/
|
|
20
|
-
"@angular/
|
|
21
|
-
"@angular/
|
|
22
|
-
"@angular/
|
|
23
|
-
"@angular/
|
|
24
|
-
"@
|
|
25
|
-
"@ethlete/
|
|
26
|
-
"@ethlete/
|
|
27
|
-
"@ethlete/types": "^2.0.0-next.0",
|
|
17
|
+
"@analogjs/vite-plugin-angular": "2.6.2",
|
|
18
|
+
"@angular/cdk": "22.0.3",
|
|
19
|
+
"@angular/common": "22.0.5",
|
|
20
|
+
"@angular/core": "22.0.5",
|
|
21
|
+
"@angular/forms": "22.0.5",
|
|
22
|
+
"@angular/platform-browser": "22.0.5",
|
|
23
|
+
"@angular/router": "22.0.5",
|
|
24
|
+
"@ethlete/core": "^5.0.0-beta.11",
|
|
25
|
+
"@ethlete/query": "^6.0.0-beta.8",
|
|
26
|
+
"@ethlete/types": "^2.0.0-beta.4",
|
|
28
27
|
"@floating-ui/dom": "1.7.6",
|
|
29
|
-
"@nx/devkit": "
|
|
30
|
-
"@nx/vite": "22.5.4",
|
|
28
|
+
"@nx/devkit": "23.1.0-beta.7",
|
|
31
29
|
"date-fns": "4.1.0",
|
|
32
30
|
"rxjs": "7.8.2",
|
|
33
|
-
"typescript": "
|
|
34
|
-
"vite": "
|
|
31
|
+
"typescript": "6.0.3",
|
|
32
|
+
"vite": "8.0.13"
|
|
35
33
|
},
|
|
36
34
|
"generators": "./generators/generators.json",
|
|
37
35
|
"module": "fesm2022/ethlete-cdk.mjs",
|
|
38
36
|
"typings": "types/ethlete-cdk.d.ts",
|
|
37
|
+
"type": "module",
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"tslib": "^2.3.0"
|
|
41
40
|
}
|