create-lve 0.4.30 → 0.4.32

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
@@ -87,7 +87,6 @@ a:focus-visible {
87
87
  `
88
88
 
89
89
  const vitePlusDeps = (isUno) => ({
90
- dependencies: isUno ? { '@unocss/reset': 'latest' } : undefined,
91
90
  devDependencies: isUno ? { unocss: 'latest' } : undefined,
92
91
  overrides: {
93
92
  vite: 'npm:@voidzero-dev/vite-plus-core@latest',
@@ -109,12 +108,12 @@ const CSS_STRATEGIES = {
109
108
  unocss: {
110
109
  pluginImport: "import UnoCSS from 'unocss/vite'\n",
111
110
  pluginCode: 'UnoCSS(), ',
112
- entryImport: "import '@unocss/reset/tailwind.css'\nimport 'virtual:uno.css'\n",
111
+ entryImport: "import 'virtual:uno.css'\n",
113
112
  async setup(ctx) {
114
113
  const unoConfig = `
115
114
  import {
116
115
  defineConfig,
117
- presetWind3,
116
+ presetWind4,
118
117
  transformerCompileClass,
119
118
  type SourceCodeTransformer,
120
119
  } from 'unocss'
@@ -124,7 +123,7 @@ declare const process: { env: { NODE_ENV: string } }
124
123
  const isBuild = process.env.NODE_ENV === 'production'
125
124
 
126
125
  export default defineConfig({
127
- presets: [presetWind3()],
126
+ presets: [presetWind4()],
128
127
  transformers: (isBuild
129
128
  ? [
130
129
  {
@@ -174,8 +173,8 @@ export default defineConfig({
174
173
  } catch {}
175
174
  }
176
175
 
177
- const stylePath = path.join(ctx.targetDir, 'src/style.css')
178
- if (fs.existsSync(stylePath)) await fs.remove(stylePath)
176
+ // UnoCSS 不需要 style.css,utilities 通过 virtual:uno.css 注入
177
+ // BASE_STYLE 已在 applyProjectTransform 中写入,此处保留
179
178
  },
180
179
  },
181
180
  tailwind: {
@@ -285,7 +284,8 @@ async function applyProjectTransform(ctx) {
285
284
 
286
285
  const stylePath = path.join(targetDir, 'src/style.css')
287
286
  await fs.ensureDir(path.dirname(stylePath))
288
- await fs.writeFile(stylePath, `@import 'tailwindcss';\n\n${BASE_STYLE}\n`)
287
+ const styleContent = isUno ? `${BASE_STYLE}\n` : `@import 'tailwindcss';\n\n${BASE_STYLE}\n`
288
+ await fs.writeFile(stylePath, styleContent)
289
289
 
290
290
  await strategy.setup(ctx)
291
291
  }
package/index.js CHANGED
@@ -55,7 +55,7 @@ async function main() {
55
55
  shouldOverwrite = await p.confirm({ message: `目录已存在,是否清空?`, initialValue: false })
56
56
  if (p.isCancel(shouldOverwrite)) onCancel()
57
57
  }
58
- project = { path: name, framework: 'react', cssEngine: 'tailwind', shouldOverwrite }
58
+ project = { path: name, framework: 'vue', cssEngine: 'unocss', shouldOverwrite }
59
59
  } else {
60
60
  // 交互模式
61
61
  project = await p.group(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "bin": {
5
5
  "create-lve": "index.js"
6
6
  },
@@ -31,12 +31,14 @@ export default defineConfig({
31
31
  output: {
32
32
  manualChunks(id) {
33
33
  if (!id.includes('node_modules')) return
34
- if (id.includes('react') && !id.includes('react-router')) return 'vendor-react'
35
- if (id.includes('react-dom')) return 'vendor-react-dom'
36
- if (id.includes('react-router')) return 'vendor-router'
34
+ const pkg = id.match(/node_modules\/(?:@[^/]+\/)?([^/]+)/)?.[1]
35
+ if (pkg === 'react') return 'vendor-react'
36
+ if (pkg === 'react-dom') return 'vendor-react-dom'
37
+ if (pkg === 'react-router' || pkg === 'react-router-dom')
38
+ return 'vendor-router'
37
39
  if (id.includes('@tanstack')) return 'vendor-query'
38
- if (id.includes('zustand')) return 'vendor-state'
39
- if (id.includes('jotai')) return 'vendor-atom'
40
+ if (pkg === 'zustand') return 'vendor-state'
41
+ if (pkg === 'jotai') return 'vendor-atom'
40
42
  return 'vendor'
41
43
  },
42
44
  },