@ethlete/core 5.0.0-next.2 → 5.0.0-next.20

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.
@@ -0,0 +1,402 @@
1
+ import { formatFiles, logger, visitNotIgnoredFiles } from '@nx/devkit';
2
+ import { Project, SyntaxKind } from 'ts-morph';
3
+ export default async function generate(tree, schema) {
4
+ logger.log('\nšŸ”„ Starting Tailwind 4 surface theme generator...\n');
5
+ const themesPath = schema.themesPath || 'src/surface-themes.ts';
6
+ const outputPath = schema.outputPath || 'src/styles/generated-tailwind-surface-themes.css';
7
+ const prefix = schema.prefix || 'et';
8
+ // The runtime prefix drives the theme-swap CSS variables (--<runtimePrefix>-surface-*)
9
+ // and selectors (.<runtimePrefix>-surface--<name>). It defaults to `prefix` so existing
10
+ // consumers who only ever passed one prefix see no change in output.
11
+ const runtimePrefix = schema.runtimePrefix || prefix;
12
+ if (!tree.exists(themesPath)) {
13
+ logger.error(`āŒ Surface themes file not found at: ${themesPath}`);
14
+ logger.log(`\nPlease specify the correct path using --themesPath option.`);
15
+ logger.log(`Example: nx g @ethlete/core:tailwind-4-surface-theme --themesPath=src/app/surface-themes.ts\n`);
16
+ return;
17
+ }
18
+ logger.log(`šŸ“ Reading surface themes from: ${themesPath}`);
19
+ const themesContent = tree.read(themesPath, 'utf-8');
20
+ if (!themesContent) {
21
+ logger.error('āŒ Failed to read surface themes file');
22
+ return;
23
+ }
24
+ let themes;
25
+ try {
26
+ themes = extractSurfaceThemesFromContent(themesContent, themesPath);
27
+ logger.log(`āœ… Found ${themes.length} surface theme(s)`);
28
+ }
29
+ catch (error) {
30
+ logger.error('āŒ Failed to parse surface themes file');
31
+ logger.error(` ${error instanceof Error ? error.message : String(error)}`);
32
+ logger.log('\nThe surface themes file must export themes as:');
33
+ logger.log(' export const SURFACE_THEMES = [...] satisfies SurfaceTheme[];\n');
34
+ return;
35
+ }
36
+ try {
37
+ validateSurfaceThemeConfiguration(themes);
38
+ }
39
+ catch (error) {
40
+ logger.error('āŒ Surface theme configuration error');
41
+ logger.error(` ${error instanceof Error ? error.message : String(error)}`);
42
+ return;
43
+ }
44
+ logger.log('\nšŸŽØ Generating Tailwind surface theme CSS...');
45
+ const css = generateSurfaceThemeCss(themes, prefix, runtimePrefix, schema);
46
+ tree.write(outputPath, css);
47
+ logger.log(`āœ… Generated Tailwind surface themes at: ${outputPath}`);
48
+ // Generate the `EthleteSurfaceThemeNameRegistry` augmentation, so `etProvideSurface` (and
49
+ // anything else that accepts a `RegisteredSurfaceThemeName`) is checked/autocompleted
50
+ // against this app's actual surface theme names, instead of a plain `string`.
51
+ const typesOutputPath = schema.typesOutputPath || outputPath.replace(/\.css$/, '.d.ts');
52
+ const typesDts = generateSurfaceThemeNameTypes(themes, schema);
53
+ tree.write(typesOutputPath, typesDts);
54
+ logger.log(`āœ… Generated surface theme name types at: ${typesOutputPath}`);
55
+ const mainStylesFiles = findMainStylesFile(tree);
56
+ if (mainStylesFiles.length > 0) {
57
+ logger.log('\nšŸ“ Found potential main styles files:');
58
+ mainStylesFiles.forEach((file) => logger.log(` - ${file}`));
59
+ logger.log('\nāš ļø Please manually import the generated themes:');
60
+ logger.log(` @import './${outputPath.replace('src/styles/', '')}';`);
61
+ }
62
+ if (!schema.skipFormat) {
63
+ await formatFiles(tree);
64
+ }
65
+ logger.log('\nāœ… Generation completed successfully!\n');
66
+ }
67
+ //#endregion
68
+ //#region Parsing
69
+ function extractSurfaceThemesFromContent(content, filePath) {
70
+ const project = new Project({
71
+ useInMemoryFileSystem: true,
72
+ compilerOptions: {
73
+ target: 99,
74
+ module: 99,
75
+ },
76
+ });
77
+ const sourceFile = project.createSourceFile(filePath, content);
78
+ const themes = [];
79
+ const exportedDeclarations = sourceFile.getVariableDeclarations().filter((decl) => {
80
+ const statement = decl.getVariableStatement();
81
+ return statement?.isExported();
82
+ });
83
+ const themesArray = exportedDeclarations.find((decl) => {
84
+ const name = decl.getName();
85
+ return name === 'SURFACE_THEMES' || name === 'surfaceThemes';
86
+ });
87
+ if (!themesArray) {
88
+ throw new Error('Could not find SURFACE_THEMES or surfaceThemes export');
89
+ }
90
+ let initializer = themesArray.getInitializer();
91
+ if (!initializer) {
92
+ throw new Error('SURFACE_THEMES export has no initializer');
93
+ }
94
+ // Handle 'satisfies X'/'as const' wrappers, in either order: [array] satisfies Type[],
95
+ // [array] as const, or both combined.
96
+ while (initializer.isKind(SyntaxKind.SatisfiesExpression) || initializer.isKind(SyntaxKind.AsExpression)) {
97
+ initializer = initializer.getExpression();
98
+ }
99
+ if (!initializer.isKind(SyntaxKind.ArrayLiteralExpression)) {
100
+ throw new Error('SURFACE_THEMES export must be an array literal');
101
+ }
102
+ const elements = initializer.getElements();
103
+ for (const element of elements) {
104
+ if (element.isKind(SyntaxKind.Identifier)) {
105
+ const name = element.getText();
106
+ const themeDecl = exportedDeclarations.find((decl) => decl.getName() === name);
107
+ if (!themeDecl) {
108
+ logger.warn(`āš ļø Could not find declaration for surface theme: ${name}`);
109
+ continue;
110
+ }
111
+ let themeObj = themeDecl.getInitializer();
112
+ if (!themeObj) {
113
+ logger.warn(`āš ļø Surface theme ${name} has no initializer`);
114
+ continue;
115
+ }
116
+ // Handle 'as const' and 'satisfies X' wrappers on individual theme objects, in
117
+ // either order (e.g. `{...} satisfies SurfaceTheme`, `{...} as const`, or both).
118
+ while (themeObj.isKind(SyntaxKind.AsExpression) || themeObj.isKind(SyntaxKind.SatisfiesExpression)) {
119
+ themeObj = themeObj.getExpression();
120
+ }
121
+ if (!themeObj.isKind(SyntaxKind.ObjectLiteralExpression)) {
122
+ logger.warn(`āš ļø Surface theme ${name} is not an object literal`);
123
+ continue;
124
+ }
125
+ try {
126
+ const theme = parseSurfaceThemeObject(themeObj);
127
+ themes.push(theme);
128
+ }
129
+ catch (error) {
130
+ logger.warn(`āš ļø Failed to parse surface theme ${name}: ${error instanceof Error ? error.message : String(error)}`);
131
+ }
132
+ }
133
+ }
134
+ if (themes.length === 0) {
135
+ throw new Error('No valid surface themes found in SURFACE_THEMES array');
136
+ }
137
+ return themes;
138
+ }
139
+ function parseSurfaceThemeObject(obj) {
140
+ const properties = obj.getProperties();
141
+ const theme = {};
142
+ const STRING_PROPS = ['name', 'background', 'color', 'colorMuted', 'colorSubtle', 'border'];
143
+ for (const prop of properties) {
144
+ if (!prop.isKind(SyntaxKind.PropertyAssignment)) {
145
+ continue;
146
+ }
147
+ const propName = prop.getName();
148
+ const initializer = prop.getInitializer();
149
+ if (!initializer) {
150
+ continue;
151
+ }
152
+ if (propName === 'isDefault') {
153
+ if (initializer.isKind(SyntaxKind.TrueKeyword)) {
154
+ theme.isDefault = true;
155
+ }
156
+ continue;
157
+ }
158
+ if (propName === 'interactionColor' && initializer.isKind(SyntaxKind.ObjectLiteralExpression)) {
159
+ const interactionProps = initializer.getProperties();
160
+ const interactionColor = {};
161
+ for (const iProp of interactionProps) {
162
+ if (!iProp.isKind(SyntaxKind.PropertyAssignment))
163
+ continue;
164
+ const iPropName = iProp.getName();
165
+ const iInit = iProp.getInitializer();
166
+ if (iInit?.isKind(SyntaxKind.StringLiteral)) {
167
+ interactionColor[iPropName] = iInit.getLiteralValue();
168
+ }
169
+ }
170
+ if (interactionColor.default &&
171
+ interactionColor.hover &&
172
+ interactionColor.focus &&
173
+ interactionColor.active &&
174
+ interactionColor.disabled) {
175
+ theme.interactionColor = interactionColor;
176
+ }
177
+ continue;
178
+ }
179
+ if (propName === 'elevation') {
180
+ if (initializer.isKind(SyntaxKind.NumericLiteral)) {
181
+ theme.elevation = Number(initializer.getLiteralValue());
182
+ }
183
+ continue;
184
+ }
185
+ if (propName === 'type' && initializer.isKind(SyntaxKind.StringLiteral)) {
186
+ theme.type = initializer.getLiteralValue();
187
+ continue;
188
+ }
189
+ if (STRING_PROPS.includes(propName) && initializer.isKind(SyntaxKind.StringLiteral)) {
190
+ theme[propName] = initializer.getLiteralValue();
191
+ }
192
+ }
193
+ if (!theme.name ||
194
+ !theme.type ||
195
+ theme.elevation === undefined ||
196
+ !theme.background ||
197
+ !theme.color ||
198
+ !theme.colorMuted ||
199
+ !theme.colorSubtle ||
200
+ !theme.border) {
201
+ throw new Error('SurfaceTheme must have name, type, elevation, background, color, colorMuted, colorSubtle, and border properties');
202
+ }
203
+ return theme;
204
+ }
205
+ function validateSurfaceThemeConfiguration(themes) {
206
+ const defaultThemes = themes.filter((t) => t.isDefault);
207
+ if (defaultThemes.length === 0) {
208
+ throw new Error('No default surface theme found. Each type (light/dark) must have exactly one theme with isDefault: true');
209
+ }
210
+ const types = new Set(themes.map((t) => t.type));
211
+ for (const type of types) {
212
+ const defaultsForType = defaultThemes.filter((t) => t.type === type);
213
+ if (defaultsForType.length === 0) {
214
+ throw new Error(`No default surface theme found for type '${type}'. Add isDefault: true to one '${type}' theme`);
215
+ }
216
+ if (defaultsForType.length > 1) {
217
+ throw new Error(`Multiple default surface themes found for type '${type}': ${defaultsForType.map((t) => t.name).join(', ')}. Only one theme per type can have isDefault: true`);
218
+ }
219
+ }
220
+ }
221
+ //#endregion
222
+ //#region CSS Generation
223
+ function createCssSurfaceName(name) {
224
+ return name
225
+ .toLowerCase()
226
+ .replace(/\s+/g, '-')
227
+ .replace(/[^a-z0-9-]/g, '');
228
+ }
229
+ function generateSurfaceThemeNameTypes(themes, schema) {
230
+ const themesPath = schema.themesPath || 'src/surface-themes.ts';
231
+ const outputPath = schema.outputPath || 'src/styles/generated-tailwind-surface-themes.css';
232
+ const typesOutputPath = schema.typesOutputPath || outputPath.replace(/\.css$/, '.d.ts');
233
+ const names = themes.map((theme) => `'${theme.name}'`).join(' | ');
234
+ return `/*
235
+ * Auto-generated by @ethlete/core:tailwind-4-surface-theme
236
+ * DO NOT EDIT THIS FILE MANUALLY
237
+ *
238
+ * Regenerate by running:
239
+ * nx g @ethlete/core:tailwind-4-surface-theme --themesPath=${themesPath}${schema.outputPath ? ` --outputPath=${outputPath}` : ''}${schema.typesOutputPath ? ` --typesOutputPath=${typesOutputPath}` : ''}${schema.prefix && schema.prefix !== 'et' ? ` --prefix=${schema.prefix}` : ''}
240
+ */
241
+
242
+ declare module '@ethlete/core' {
243
+ interface EthleteSurfaceThemeNameRegistry {
244
+ name: ${names};
245
+ }
246
+ }
247
+
248
+ export {};
249
+ `;
250
+ }
251
+ function generateSurfaceThemeCss(themes, utilityPrefix, runtimePrefix, schema) {
252
+ const tailwindVars = [];
253
+ const themeVars = [];
254
+ const themesPath = schema.themesPath || 'src/surface-themes.ts';
255
+ const outputPath = schema.outputPath || 'src/styles/generated-tailwind-surface-themes.css';
256
+ const header = `/*
257
+ * Auto-generated Tailwind 4 surface theme colors from @ethlete/core
258
+ * DO NOT EDIT THIS FILE MANUALLY
259
+ *
260
+ * Generated from your surface theme definitions
261
+ * This file can be regenerated by running:
262
+ * nx g @ethlete/core:tailwind-4-surface-theme --themesPath=${themesPath}${schema.outputPath ? ` --outputPath=${outputPath}` : ''}${schema.prefix && schema.prefix !== 'et' ? ` --prefix=${schema.prefix}` : ''}${schema.runtimePrefix && schema.runtimePrefix !== schema.prefix ? ` --runtimePrefix=${schema.runtimePrefix}` : ''}
263
+ */
264
+
265
+ `;
266
+ const defaultThemes = themes.filter((t) => t.isDefault);
267
+ const regularThemes = themes.filter((t) => !t.isDefault);
268
+ // Static Tailwind @theme block — one color set per surface theme
269
+ for (const theme of themes) {
270
+ const name = createCssSurfaceName(theme.name);
271
+ tailwindVars.push(` /* ${theme.name} surface */`);
272
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-bg: rgb(${theme.background});`);
273
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}: rgb(${theme.color});`);
274
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-muted: rgb(${theme.colorMuted});`);
275
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-subtle: rgb(${theme.colorSubtle});`);
276
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-border: rgb(${theme.border});`);
277
+ if (theme.interactionColor) {
278
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-interaction: rgb(${theme.interactionColor.default});`);
279
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-interaction-hover: rgb(${theme.interactionColor.hover});`);
280
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-interaction-focus: rgb(${theme.interactionColor.focus});`);
281
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-interaction-active: rgb(${theme.interactionColor.active});`);
282
+ tailwindVars.push(` --color-${utilityPrefix}-surface-${name}-interaction-disabled: rgb(${theme.interactionColor.disabled});`);
283
+ }
284
+ tailwindVars.push('');
285
+ }
286
+ // Dynamic surface colors (reference runtime CSS variables)
287
+ tailwindVars.push(' /* Dynamic surface colors (references runtime CSS variables) */');
288
+ tailwindVars.push(` --color-${utilityPrefix}-surface-bg: rgb(var(--${runtimePrefix}-surface-background));`);
289
+ tailwindVars.push(` --color-${utilityPrefix}-surface: rgb(var(--${runtimePrefix}-surface-color));`);
290
+ tailwindVars.push(` --color-${utilityPrefix}-surface-muted: rgb(var(--${runtimePrefix}-surface-color-muted));`);
291
+ tailwindVars.push(` --color-${utilityPrefix}-surface-subtle: rgb(var(--${runtimePrefix}-surface-color-subtle));`);
292
+ tailwindVars.push(` --color-${utilityPrefix}-surface-border: rgb(var(--${runtimePrefix}-surface-border));`);
293
+ // Dynamic interaction colors (reference runtime CSS variables)
294
+ tailwindVars.push(` --color-${utilityPrefix}-surface-interaction: rgb(var(--${runtimePrefix}-surface-interaction));`);
295
+ tailwindVars.push(` --color-${utilityPrefix}-surface-interaction-hover: rgb(var(--${runtimePrefix}-surface-interaction-hover));`);
296
+ tailwindVars.push(` --color-${utilityPrefix}-surface-interaction-focus: rgb(var(--${runtimePrefix}-surface-interaction-focus));`);
297
+ tailwindVars.push(` --color-${utilityPrefix}-surface-interaction-active: rgb(var(--${runtimePrefix}-surface-interaction-active));`);
298
+ tailwindVars.push(` --color-${utilityPrefix}-surface-interaction-disabled: rgb(var(--${runtimePrefix}-surface-interaction-disabled));`);
299
+ // Runtime CSS — theme selector classes
300
+ for (const theme of themes) {
301
+ const name = createCssSurfaceName(theme.name);
302
+ const isDefault = theme.isDefault;
303
+ if (isDefault) {
304
+ const selectors = [`.${runtimePrefix}-surface--default-${theme.type}`, `.${runtimePrefix}-surface--${name}`];
305
+ themeVars.push(`${selectors.join(', ')} {`);
306
+ }
307
+ else {
308
+ themeVars.push(`.${runtimePrefix}-surface--${name} {`);
309
+ }
310
+ pushSurfaceVars(themeVars, runtimePrefix, theme, ' ');
311
+ themeVars.push('}\n');
312
+ }
313
+ // Media query defaults — apply surface vars to :root based on prefers-color-scheme
314
+ const defaultLight = themes.find((t) => t.isDefault && t.type === 'light');
315
+ const defaultDark = themes.find((t) => t.isDefault && t.type === 'dark');
316
+ if (defaultLight) {
317
+ themeVars.push(`@media (prefers-color-scheme: light) {`);
318
+ themeVars.push(` :root {`);
319
+ pushSurfaceVars(themeVars, runtimePrefix, defaultLight, ' ');
320
+ themeVars.push(` }`);
321
+ themeVars.push(`}\n`);
322
+ }
323
+ if (defaultDark) {
324
+ themeVars.push(`@media (prefers-color-scheme: dark) {`);
325
+ themeVars.push(` :root {`);
326
+ pushSurfaceVars(themeVars, runtimePrefix, defaultDark, ' ');
327
+ themeVars.push(` }`);
328
+ themeVars.push(`}\n`);
329
+ }
330
+ // Convenience var aliases — available on any element with a surface class or :root (via media queries)
331
+ const aliasBlock = `/* Convenience aliases (rgb + solid variants) */
332
+ @layer base {
333
+ :root, :where([class*="${runtimePrefix}-surface--"]) {
334
+ --${runtimePrefix}-surface-background-rgb: var(--${runtimePrefix}-surface-background);
335
+ --${runtimePrefix}-surface-background-solid: rgb(var(--${runtimePrefix}-surface-background-rgb));
336
+
337
+ --${runtimePrefix}-surface-color-rgb: var(--${runtimePrefix}-surface-color);
338
+ --${runtimePrefix}-surface-color-solid: rgb(var(--${runtimePrefix}-surface-color-rgb));
339
+
340
+ --${runtimePrefix}-surface-color-muted-rgb: var(--${runtimePrefix}-surface-color-muted);
341
+ --${runtimePrefix}-surface-color-muted-solid: rgb(var(--${runtimePrefix}-surface-color-muted-rgb));
342
+
343
+ --${runtimePrefix}-surface-color-subtle-rgb: var(--${runtimePrefix}-surface-color-subtle);
344
+ --${runtimePrefix}-surface-color-subtle-solid: rgb(var(--${runtimePrefix}-surface-color-subtle-rgb));
345
+
346
+ --${runtimePrefix}-surface-border-rgb: var(--${runtimePrefix}-surface-border);
347
+ --${runtimePrefix}-surface-border-solid: rgb(var(--${runtimePrefix}-surface-border-rgb));
348
+
349
+ --${runtimePrefix}-surface-interaction-rgb: var(--${runtimePrefix}-surface-interaction);
350
+ --${runtimePrefix}-surface-interaction-solid: rgb(var(--${runtimePrefix}-surface-interaction-rgb));
351
+
352
+ --${runtimePrefix}-surface-interaction-hover-rgb: var(--${runtimePrefix}-surface-interaction-hover);
353
+ --${runtimePrefix}-surface-interaction-hover-solid: rgb(var(--${runtimePrefix}-surface-interaction-hover-rgb));
354
+
355
+ --${runtimePrefix}-surface-interaction-focus-rgb: var(--${runtimePrefix}-surface-interaction-focus);
356
+ --${runtimePrefix}-surface-interaction-focus-solid: rgb(var(--${runtimePrefix}-surface-interaction-focus-rgb));
357
+
358
+ --${runtimePrefix}-surface-interaction-active-rgb: var(--${runtimePrefix}-surface-interaction-active);
359
+ --${runtimePrefix}-surface-interaction-active-solid: rgb(var(--${runtimePrefix}-surface-interaction-active-rgb));
360
+
361
+ --${runtimePrefix}-surface-interaction-disabled-rgb: var(--${runtimePrefix}-surface-interaction-disabled);
362
+ --${runtimePrefix}-surface-interaction-disabled-solid: rgb(var(--${runtimePrefix}-surface-interaction-disabled-rgb));
363
+ }
364
+ }
365
+ `;
366
+ return `${header}@theme {
367
+ ${tailwindVars.join('\n')}
368
+ }
369
+
370
+ @layer base {
371
+ ${themeVars.join('\n')}
372
+ }
373
+
374
+ ${aliasBlock}`;
375
+ }
376
+ function pushSurfaceVars(vars, runtimePrefix, theme, indent) {
377
+ vars.push(`${indent}--${runtimePrefix}-surface-background: ${theme.background};`);
378
+ vars.push(`${indent}--${runtimePrefix}-surface-color: ${theme.color};`);
379
+ vars.push(`${indent}--${runtimePrefix}-surface-color-muted: ${theme.colorMuted};`);
380
+ vars.push(`${indent}--${runtimePrefix}-surface-color-subtle: ${theme.colorSubtle};`);
381
+ vars.push(`${indent}--${runtimePrefix}-surface-border: ${theme.border};`);
382
+ vars.push(`${indent}--${runtimePrefix}-surface-type: ${theme.type};`);
383
+ vars.push(`${indent}--${runtimePrefix}-surface-elevation: ${theme.elevation};`);
384
+ if (theme.interactionColor) {
385
+ vars.push(`${indent}--${runtimePrefix}-surface-interaction: ${theme.interactionColor.default};`);
386
+ vars.push(`${indent}--${runtimePrefix}-surface-interaction-hover: ${theme.interactionColor.hover};`);
387
+ vars.push(`${indent}--${runtimePrefix}-surface-interaction-focus: ${theme.interactionColor.focus};`);
388
+ vars.push(`${indent}--${runtimePrefix}-surface-interaction-active: ${theme.interactionColor.active};`);
389
+ vars.push(`${indent}--${runtimePrefix}-surface-interaction-disabled: ${theme.interactionColor.disabled};`);
390
+ }
391
+ }
392
+ function findMainStylesFile(tree) {
393
+ const potentialFiles = [];
394
+ visitNotIgnoredFiles(tree, '', (path) => {
395
+ if (path.match(/styles\.(css|scss)$/) && !path.includes('node_modules') && !path.includes('dist')) {
396
+ potentialFiles.push(path);
397
+ }
398
+ });
399
+ return potentialFiles;
400
+ }
401
+ //#endregion
402
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "tailwind-4-surface-theme",
4
+ "title": "Tailwind 4 Surface Theming Generator",
5
+ "description": "Generates Tailwind 4 compatible CSS from your Ethlete surface theme definitions",
6
+ "type": "object",
7
+ "properties": {
8
+ "themesPath": {
9
+ "type": "string",
10
+ "description": "Path to your surface themes file (relative to workspace root)",
11
+ "default": "src/surface-themes.ts",
12
+ "x-prompt": "Where is your surface themes file located?"
13
+ },
14
+ "outputPath": {
15
+ "type": "string",
16
+ "description": "Where to output the generated Tailwind surface themes CSS",
17
+ "default": "src/styles/generated-tailwind-surface-themes.css",
18
+ "x-prompt": "Where should the generated CSS be saved?"
19
+ },
20
+ "typesOutputPath": {
21
+ "type": "string",
22
+ "description": "Where to output the generated `EthleteSurfaceThemeNameRegistry` augmentation (a .d.ts that narrows `etProvideSurface` and other surface-theme-name APIs to your actual surface theme names). Defaults to `outputPath` with its extension swapped to `.d.ts`."
23
+ },
24
+ "prefix": {
25
+ "type": "string",
26
+ "description": "Prefix for Tailwind utility surface variable names (e.g., 'et' creates --color-et-surface-*, usable as bg-et-surface)",
27
+ "default": "et"
28
+ },
29
+ "runtimePrefix": {
30
+ "type": "string",
31
+ "description": "Prefix for the runtime theme-swap mechanism: the CSS custom properties (--<runtimePrefix>-surface-*) and selectors (.<runtimePrefix>-surface--<name>) that ProvideSurfaceDirective (etProvideSurface) toggles between. Defaults to the same value as 'prefix'. Set this separately when your Tailwind utility prefix needs to differ from your runtime theme-switching prefix."
32
+ },
33
+ "skipFormat": {
34
+ "type": "boolean",
35
+ "description": "Skip formatting files after generation",
36
+ "default": false
37
+ }
38
+ },
39
+ "required": []
40
+ }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "5.0.0-next.2",
3
+ "version": "5.0.0-next.20",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@analogjs/vite-plugin-angular": "2.3.1",
8
- "@angular/cdk": "21.2.1",
9
- "@angular/common": "21.2.1",
10
- "@angular/core": "21.2.1",
11
- "@angular/forms": "21.2.1",
12
- "@angular/platform-browser": "21.2.1",
13
- "@angular/router": "21.2.1",
14
- "@ethlete/types": "^2.0.0-next.0",
7
+ "@analogjs/vite-plugin-angular": "2.6.2",
8
+ "@angular/cdk": "22.0.3",
9
+ "@angular/common": "22.0.5",
10
+ "@angular/core": "22.0.5",
11
+ "@angular/forms": "22.0.5",
12
+ "@angular/platform-browser": "22.0.5",
13
+ "@angular/router": "22.0.5",
14
+ "@ethlete/types": "^2.0.0-beta.4",
15
15
  "@floating-ui/dom": "1.7.6",
16
- "@nx/devkit": "22.5.4",
17
- "@nx/vite": "22.5.4",
16
+ "@nx/devkit": "23.1.0-beta.7",
17
+ "@nx/vite": "23.1.0-beta.7",
18
18
  "rxjs": "7.8.2",
19
19
  "ts-morph": "21.0.1",
20
- "typescript": "5.9.3",
21
- "vite": "^7.0.0"
20
+ "typescript": "6.0.3",
21
+ "vite": "8.0.13"
22
22
  },
23
23
  "generators": "./generators/generators.json",
24
24
  "module": "fesm2022/ethlete-core.mjs",
@@ -32,6 +32,7 @@
32
32
  "default": "./fesm2022/ethlete-core.mjs"
33
33
  }
34
34
  },
35
+ "type": "module",
35
36
  "dependencies": {
36
37
  "tslib": "^2.3.0"
37
38
  }