create-lve 0.5.2 → 0.5.3

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.
Files changed (3) hide show
  1. package/config.js +5 -1
  2. package/index.js +5 -5
  3. package/package.json +1 -1
package/config.js CHANGED
@@ -94,13 +94,17 @@ const vitePlusDeps = (isUno) => ({
94
94
  },
95
95
  })
96
96
 
97
+ const reactDeps = (isUno) => ({
98
+ devDependencies: isUno ? { unocss: 'latest' } : undefined,
99
+ })
100
+
97
101
  const FRAMEWORK_CONFIG = {
98
102
  next: {
99
103
  deps: (isUno) => ({
100
104
  devDependencies: isUno ? { unocss: 'latest' } : { tailwindcss: 'latest' },
101
105
  }),
102
106
  },
103
- react: { deps: vitePlusDeps },
107
+ react: { deps: reactDeps },
104
108
  vue: { deps: vitePlusDeps },
105
109
  }
106
110
 
package/index.js CHANGED
@@ -111,20 +111,20 @@ async function main() {
111
111
  templateDir: path.resolve(__dirname, `template-${project.framework}`),
112
112
  isNext: project.framework === 'next',
113
113
  isUno: project.cssEngine === 'unocss',
114
- pkgManager: project.framework === 'next' ? 'pnpm' : 'vp',
115
- devCmd: project.framework === 'next' ? 'pnpm dev' : 'vp dev',
116
- fmtCmd: project.framework === 'next' ? 'pnpm fmt' : 'vp fmt',
114
+ pkgManager: project.framework === 'next' ? 'pnpm' : project.framework === 'vue' ? 'vp' : 'pnpm',
115
+ devCmd: project.framework === 'next' ? 'pnpm dev' : project.framework === 'vue' ? 'vp dev' : 'pnpm dev',
116
+ fmtCmd: project.framework === 'next' ? 'pnpm fmt' : project.framework === 'vue' ? 'vp fmt' : 'pnpm fmt',
117
117
  }
118
118
 
119
119
  const s = p.spinner()
120
120
 
121
- if (!ctx.isNext) {
121
+ if (project.framework === 'vue') {
122
122
  try {
123
123
  execSync('vp --version', { stdio: 'ignore' })
124
124
  } catch {
125
125
  p.log.error(pc.red('未检测到 VitePlus (vp) 环境'))
126
126
  p.note(
127
- pc.white(`React/Vue 模板依赖 vp 工具链:\n${pc.cyan('https://viteplus.dev/guide')}`),
127
+ pc.white(`Vue 模板依赖 vp 工具链:\n${pc.cyan('https://viteplus.dev/guide')}`),
128
128
  '环境缺失',
129
129
  )
130
130
  process.exit(1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "bin": {
5
5
  "create-lve": "index.js"
6
6
  },