@@ -20,10 +20,13 @@ import {
2020} from '@nx/devkit' ;
2121
2222import {
23- ThemeBorderRadius ,
23+ type ThemeBorderRadius ,
24+ ThemeBorderRadiuses ,
2425 ThemeConfig ,
25- ThemePrimaryColor ,
26+ type ThemePrimaryColor ,
27+ ThemePrimaryColors ,
2628 ThemeStyle ,
29+ ThemeStyles ,
2730} from '@qwik-ui/utils' ;
2831import { bgRgb , bold , cyan , green , red } from 'ansis' ;
2932import { execSync } from 'child_process' ;
@@ -101,7 +104,7 @@ async function handleInit() {
101104 . option ( 'style' , {
102105 description : 'Theme style' ,
103106 type : 'string' ,
104- choices : [ ThemeStyle . SIMPLE , ThemeStyle . BRUTALIST , ThemeStyle . NEUMORPHIC ] ,
107+ choices : [ ThemeStyles . SIMPLE , ThemeStyles . BRUTALIST , ThemeStyles . NEUMORPHIC ] ,
105108 } )
106109 . option ( 'e2e' , {
107110 description : 'Install styled packages tagged as e2e for tests' ,
@@ -217,21 +220,21 @@ async function handleInit() {
217220 }
218221
219222 if ( ! shouldCustomize ) {
220- config . style ||= ThemeStyle . SIMPLE ;
221- config . primaryColor ||= ThemePrimaryColor . CYAN600 ;
222- config . borderRadius ||= ThemeBorderRadius [ 'BORDER-RADIUS-0' ] ;
223+ config . style ||= ThemeStyles . SIMPLE ;
224+ config . primaryColor ||= ThemePrimaryColors . CYAN600 ;
225+ config . borderRadius ||= ThemeBorderRadiuses [ 'BORDER-RADIUS-0' ] ;
223226 } else {
224227 if ( ! config . style ) {
225228 config . style = cancelable (
226229 await select ( {
227230 message : cyan ( 'Choose a style for your theme' ) ,
228231
229232 options : [
230- { label : 'Simple' , value : ThemeStyle . SIMPLE } ,
231- { label : 'Brutalist' , value : ThemeStyle . BRUTALIST } ,
232- { label : 'Neumorphic' , value : ThemeStyle . NEUMORPHIC } ,
233+ { label : 'Simple' , value : ThemeStyles . SIMPLE } ,
234+ { label : 'Brutalist' , value : ThemeStyles . BRUTALIST } ,
235+ { label : 'Neumorphic' , value : ThemeStyles . NEUMORPHIC } ,
233236 ] ,
234- initialValue : ThemeStyle . SIMPLE ,
237+ initialValue : ThemeStyles . SIMPLE as ThemeStyle ,
235238 } ) ,
236239 ) ;
237240 }
@@ -240,51 +243,51 @@ async function handleInit() {
240243 config . primaryColor = cancelable (
241244 await select ( {
242245 message : cyan ( 'Choose a primary color' ) ,
243- initialValue : ThemePrimaryColor . CYAN600 as string ,
246+ initialValue : ThemePrimaryColors . CYAN600 as string ,
244247 options : [
245248 {
246249 label : bold `${ bgRgb ( 220 , 38 , 38 ) ` ` } ${ capitalizeFirstLetter ( 'Red' ) } ` ,
247- hint : ThemePrimaryColor . RED600 ,
248- value : ThemePrimaryColor . RED600 ,
250+ hint : ThemePrimaryColors . RED600 ,
251+ value : ThemePrimaryColors . RED600 ,
249252 } ,
250253 {
251254 label : bold `${ bgRgb ( 234 , 88 , 12 ) ` ` } ${ capitalizeFirstLetter ( 'Orange' ) } ` ,
252- hint : ThemePrimaryColor . ORANGE600 ,
253- value : ThemePrimaryColor . ORANGE600 ,
255+ hint : ThemePrimaryColors . ORANGE600 ,
256+ value : ThemePrimaryColors . ORANGE600 ,
254257 } ,
255258 {
256259 label : bold `${ bgRgb ( 250 , 204 , 21 ) ` ` } ${ capitalizeFirstLetter (
257260 'Yellow' ,
258261 ) } `,
259- hint : ThemePrimaryColor . YELLOW400 ,
260- value : ThemePrimaryColor . YELLOW400 ,
262+ hint : ThemePrimaryColors . YELLOW400 ,
263+ value : ThemePrimaryColors . YELLOW400 ,
261264 } ,
262265 {
263266 label : bold `${ bgRgb ( 22 , 163 , 74 ) ` ` } ${ capitalizeFirstLetter ( 'Green' ) } ` ,
264- hint : ThemePrimaryColor . GREEN600 ,
265- value : ThemePrimaryColor . GREEN600 ,
267+ hint : ThemePrimaryColors . GREEN600 ,
268+ value : ThemePrimaryColors . GREEN600 ,
266269 } ,
267270 {
268271 label : bold `${ bgRgb ( 6 , 182 , 212 ) ` ` } ${ capitalizeFirstLetter ( 'Cyan' ) } ` ,
269- hint : ThemePrimaryColor . CYAN600 ,
270- value : ThemePrimaryColor . CYAN600 ,
272+ hint : ThemePrimaryColors . CYAN600 ,
273+ value : ThemePrimaryColors . CYAN600 ,
271274 } ,
272275 {
273276 label : bold `${ bgRgb ( 37 , 99 , 235 ) ` ` } ${ capitalizeFirstLetter ( 'Blue' ) } ` ,
274- hint : ThemePrimaryColor . BLUE600 ,
275- value : ThemePrimaryColor . BLUE600 ,
277+ hint : ThemePrimaryColors . BLUE600 ,
278+ value : ThemePrimaryColors . BLUE600 ,
276279 } ,
277280 {
278281 label : bold `${ bgRgb ( 147 , 51 , 234 ) ` ` } ${ capitalizeFirstLetter (
279282 'Purple' ,
280283 ) } `,
281- hint : ThemePrimaryColor . PURPLE600 ,
282- value : ThemePrimaryColor . PURPLE600 ,
284+ hint : ThemePrimaryColors . PURPLE600 ,
285+ value : ThemePrimaryColors . PURPLE600 ,
283286 } ,
284287 {
285288 label : bold `${ bgRgb ( 219 , 39 , 119 ) ` ` } ${ capitalizeFirstLetter ( 'Pink' ) } ` ,
286- hint : ThemePrimaryColor . PINK600 ,
287- value : ThemePrimaryColor . PINK600 ,
289+ hint : ThemePrimaryColors . PINK600 ,
290+ value : ThemePrimaryColors . PINK600 ,
288291 } ,
289292 ] ,
290293 } ) ,
@@ -303,7 +306,7 @@ async function handleInit() {
303306 { label : '0.75' , value : 'border-radius-dot-75' } ,
304307 { label : '1' , value : 'border-radius-1' } ,
305308 ] ,
306- initialValue : 'border-radius-0' ,
309+ initialValue : 'border-radius-0' as ThemeBorderRadius ,
307310 } ) ,
308311 ) ;
309312 }
@@ -370,7 +373,7 @@ async function installNxIfNeeded() {
370373 try {
371374 let contents = readFileSync ( ignorePath , 'utf-8' ) ;
372375 if ( ! contents . includes ( '.nx/cache' ) ) {
373- contents = [ contents , '' , '.nx/cache' ] . join ( '\n' ) ;
376+ contents = [ contents , '' , '.nx/cache' , '.nx/workspace-data' ] . join ( '\n' ) ;
374377 writeFileSync ( ignorePath , contents , 'utf-8' ) ;
375378 }
376379 } catch {
0 commit comments