@@ -7,15 +7,16 @@ import { createSignal } from "@solid-cli/reactivity";
77import * as p from "@clack/prompts" ;
88import color from "picocolors" ;
99import { cancelable } from "@solid-cli/ui" ;
10- import { PluginOptions } from "@chialab/esbuild-plugin-meta-url" ;
1110import { flushQueue } from "@solid-cli/utils/updates" ;
11+ import { PluginOptions } from "@solid-cli/utils/transform" ;
1212
1313// All the integrations/packages that we support
1414export type Supported = keyof typeof integrations ;
1515
1616export type IntegrationsValue = {
1717 pluginOptions ?: PluginOptions ;
1818 installs : string [ ] ;
19+ installsDev ?: string [ ] ;
1920 additionalConfig ?: ( ) => Promise < void > ;
2021 postInstall ?: ( ) => Promise < void > ;
2122} ;
@@ -24,7 +25,7 @@ export type Integrations = Record<Supported, IntegrationsValue>;
2425
2526export const [ rootFile , setRootFile ] = createSignal < string | undefined > ( undefined ) ;
2627
27- export const integrations = {
28+ export const integrations : Record < string , IntegrationsValue > = {
2829 "tailwind" : {
2930 installs : [ "tailwindcss" , "postcss" , "autoprefixer" ] ,
3031 postInstall : async ( ) => {
@@ -79,7 +80,8 @@ export const integrations = {
7980 isDefault : true ,
8081 options : { } ,
8182 } ,
82- installs : [ "unocss" ] ,
83+ installs : [ "" ] ,
84+ installsDev : [ "unocss" ] ,
8385 additionalConfig : async ( ) => {
8486 const path = rootFile ( ) ;
8587 if ( ! path ) return ;
@@ -110,7 +112,8 @@ export const integrations = {
110112 } ,
111113 } ,
112114 "vitest" : {
113- installs : [
115+ installs : [ ] ,
116+ installsDev : [
114117 "vitest" ,
115118 "jsdom" ,
116119 "@solidjs/testing-library" ,
@@ -119,7 +122,7 @@ export const integrations = {
119122 ] ,
120123 additionalConfig : async ( ) => {
121124 try {
122- p . log . info ( "Adding test script to package.json" ) ;
125+ p . log . info ( "Adding test script to package.json" ) ;
123126 const packageJsonString = await readFile ( "package.json" , "utf8" ) ;
124127 const packageJson = JSON . parse ( packageJsonString ) ;
125128 if ( ! / \b v i t e s t \b / . test ( packageJson . scripts . test || "" ) ) {
@@ -128,7 +131,7 @@ export const integrations = {
128131 }
129132 const hasTs = fileExists ( "tsconfig.json" ) ;
130133 if ( hasTs ) {
131- p . log . info ( "Adding testing types to tsconfig.json" ) ;
134+ p . log . info ( "Adding testing types to tsconfig.json" ) ;
132135 const tsConfigString = await readFile ( "tsconfig.json" , "utf8" ) ;
133136 const tsConfig = JSON . parse ( tsConfigString ) ;
134137 if ( ! tsConfig . compilerOptions ) {
@@ -145,8 +148,8 @@ export const integrations = {
145148 ( suffix ) => ! fileExists ( `vite.config.${ suffix } ` ) && ! fileExists ( `vitest.config.${ suffix } ` ) ,
146149 )
147150 ) {
148- const suffix = hasTs ? "ts" : "mjs" ;
149- p . log . info ( `Adding vitest.config.${ suffix } ` ) ;
151+ const suffix = hasTs ? "ts" : "mjs" ;
152+ p . log . info ( `Adding vitest.config.${ suffix } ` ) ;
150153 await writeFile (
151154 `vitest.config.${ suffix } ` ,
152155 `import solid from "vite-plugin-solid";
0 commit comments