create-lve 0.4.8 → 0.4.10

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/config.js CHANGED
@@ -74,7 +74,12 @@ const CSS_STRATEGIES = {
74
74
  entryImport: "import '@unocss/reset/tailwind.css'\nimport 'virtual:uno.css'\n",
75
75
  async setup(ctx) {
76
76
  const unoConfig = `
77
- import { defineConfig, presetWind3, transformerCompileClass, SourceCodeTransformer } from 'unocss'
77
+ import {
78
+ defineConfig,
79
+ presetWind3,
80
+ transformerCompileClass,
81
+ type SourceCodeTransformer,
82
+ } from 'unocss'
78
83
  import { createHash } from 'node:crypto'
79
84
 
80
85
  declare const process: { env: { NODE_ENV: string } }
@@ -115,8 +120,22 @@ export default defineConfig({
115
120
  ]
116
121
  : []) as SourceCodeTransformer[],
117
122
  })
123
+
118
124
  `.trim()
119
125
  await fs.writeFile(path.join(ctx.targetDir, 'uno.config.ts'), unoConfig + '\n')
126
+
127
+ const tsconfigPath = path.join(ctx.targetDir, 'tsconfig.node.json')
128
+ if (fs.existsSync(tsconfigPath)) {
129
+ try {
130
+ let content = await fs.readFile(tsconfigPath, 'utf-8')
131
+
132
+ if (content.includes('/* UNO_CONFIG */')) {
133
+ content = content.replace('/* UNO_CONFIG */', ', "uno.config.ts"')
134
+ await fs.writeFile(tsconfigPath, content)
135
+ }
136
+ } catch {}
137
+ }
138
+
120
139
  const stylePath = path.join(ctx.targetDir, 'src/style.css')
121
140
  if (fs.existsSync(stylePath)) await fs.remove(stylePath)
122
141
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "bin": {
5
5
  "create-lve": "index.js"
6
6
  },
@@ -20,5 +20,8 @@
20
20
  "erasableSyntaxOnly": true,
21
21
  "noFallthroughCasesInSwitch": true
22
22
  },
23
- "include": ["vite.config.ts"]
23
+ "include": [
24
+ "vite.config.ts"
25
+ /* UNO_CONFIG */
26
+ ]
24
27
  }