create-lve 0.3.9 → 0.3.11
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/index.js +8 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { execSync } from 'node:child_process'
|
|
|
8
8
|
import { __dirname, applyProjectTransform, cleanupTemplate, installDependencies } from './config.js'
|
|
9
9
|
|
|
10
10
|
async function main() {
|
|
11
|
+
process.stdout.write('\u001b[3J\u001b[2J\u001b[1J')
|
|
11
12
|
console.clear()
|
|
12
13
|
const logo = `
|
|
13
14
|
${pc.cyan('█ █ █ █▀▀▀')}
|
|
@@ -29,21 +30,24 @@ async function main() {
|
|
|
29
30
|
if (value.match(/[<>:"|?*]/)) return '路径包含非法字符'
|
|
30
31
|
},
|
|
31
32
|
}),
|
|
33
|
+
|
|
32
34
|
shouldOverwrite: ({ results }) => {
|
|
33
35
|
const targetDir = path.resolve(process.cwd(), results.path)
|
|
34
36
|
if (fs.existsSync(targetDir) && fs.readdirSync(targetDir).length > 0) {
|
|
35
37
|
return p.confirm({ message: `目录已存在,是否清空?`, initialValue: false })
|
|
36
38
|
}
|
|
37
39
|
},
|
|
40
|
+
|
|
38
41
|
framework: () =>
|
|
39
42
|
p.select({
|
|
40
43
|
message: '选择框架',
|
|
41
44
|
options: [
|
|
42
|
-
{ value: 'react', label: 'React 19', hint: '
|
|
43
|
-
{ value: 'vue', label: 'Vue 3', hint: '
|
|
44
|
-
{ value: 'next', label: 'Next.js 16', hint: '
|
|
45
|
+
{ value: 'react', label: 'React 19', hint: '' },
|
|
46
|
+
{ value: 'vue', label: 'Vue 3', hint: '' },
|
|
47
|
+
{ value: 'next', label: 'Next.js 16', hint: '' },
|
|
45
48
|
],
|
|
46
49
|
}),
|
|
50
|
+
|
|
47
51
|
cssEngine: ({ results }) =>
|
|
48
52
|
results.framework === 'next'
|
|
49
53
|
? p.note('Next.js 已内置 Tailwind,无需选择')
|
|
@@ -54,6 +58,7 @@ async function main() {
|
|
|
54
58
|
{ value: 'unocss', label: 'UnoCSS' },
|
|
55
59
|
],
|
|
56
60
|
}),
|
|
61
|
+
|
|
57
62
|
install: () => p.confirm({ message: '是否现在自动安装依赖?', initialValue: true }),
|
|
58
63
|
},
|
|
59
64
|
{
|