File tree Expand file tree Collapse file tree 2 files changed +69
-51
lines changed Expand file tree Collapse file tree 2 files changed +69
-51
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,82 @@ import createVueQuestions from '../../questions/vue/createVueQuestions'
3
3
import initialLog from '../create-vue-next/initialLog'
4
4
import installDeps from '../create-vue-next/install'
5
5
import copyTemplate from '../create-vue-next/copyTemplate'
6
+ import packageJson from "../../../../package.json"
7
+ import options from '../../utils/vue/options'
6
8
async function createProject ( ) {
7
9
await initialLog ( )
8
10
await createVueQuestions ( )
9
11
await copyTemplate ( )
10
12
await installDeps ( ) ;
11
13
}
12
-
13
14
export default async function createVueNext ( ) {
14
15
program
16
+ . name ( packageJson . name )
17
+ . arguments ( '<project-name>' )
18
+ . version ( packageJson . version )
15
19
. description ( `Create Vue Next. The Next Generation Vue Scaffolding Tool ⚡` )
16
- . action ( async ( ) => {
17
- createProject ( )
20
+ . action ( ( name : string ) => {
21
+ options . name = name . trim ( )
18
22
} )
23
+ . option (
24
+ '--ts, --typescript' ,
25
+ `
26
+
27
+
28
+ Initialize as a TypeScript project.
29
+ `
30
+ )
31
+ . option (
32
+ '--js, --javascript' ,
33
+ `
34
+
35
+
36
+ Initialize as a JavaScript project.
37
+ `
38
+ )
39
+ . option (
40
+ '--tailwind' ,
41
+ `
42
+
43
+
44
+ Initialize with Tailwind CSS config. (default)
45
+ `
46
+ )
47
+ . option (
48
+ '--eslint' ,
49
+ `
50
+
51
+ Initialize with eslint config.
52
+ `
53
+ )
54
+ . option (
55
+ '--use-npm' ,
56
+ `
57
+
58
+ Explicitly tell the CLI to bootstrap the application using npm
59
+ `
60
+ )
61
+ . option (
62
+ '--use-pnpm' ,
63
+ `
64
+
65
+ Explicitly tell the CLI to bootstrap the application using pnpm
66
+ `
67
+ )
68
+ . option (
69
+ '--use-yarn' ,
70
+ `
71
+
72
+ Explicitly tell the CLI to bootstrap the application using Yarn
73
+ `
74
+ )
75
+ . option (
76
+ '--use-bun' ,
77
+ `
78
+
79
+ Explicitly tell the CLI to bootstrap the application using Bun
80
+ `
81
+ )
82
+ . allowUnknownOption ( )
83
+ . parse ( process . argv ) ;
19
84
}
Original file line number Diff line number Diff line change 1
1
import { Command } from 'commander'
2
2
const program = new Command ( )
3
3
4
- export default program
5
-
6
-
7
- // const program = new Commander.Command(packageJson.name)
8
- // .description(packageJson.description)
9
- // .arguments('<project-directory>')
10
- // .option(
11
- // '--ts', '--typescript',
12
- // 'Initialize as a TypeScript project'
13
- // )
14
- // .option(
15
- // '--js', '--javascript',
16
- // 'Initialize as a JavaScript project'
17
- // )
18
- // .option(
19
- // '--tw', '--tailwind',
20
- // 'Initialize as a Tailwind project'
21
- // )
22
- // .option(
23
- // '--router', '--vue-router',
24
- // 'Initialize with Vue Router'
25
- // )
26
- // .option(
27
- // '--use-npm',
28
- // 'BootStrap project with npm'
29
- // )
30
- // .option(
31
- // '--use-pnpm',
32
- // 'BootStrap project with yarn'
33
- // )
34
- // .option(
35
- // '--use-pnpm',
36
- // 'BootStrap project with pnpm'
37
- // )
38
- // .option(
39
- // '--use-bun',
40
- // 'BootStrap project with bun'
41
- // )
42
- // .option(
43
- // '--reset-preferences',
44
- // `
45
- // Explicitly tell the CLI to reset any stored preferences
46
- // `
47
- // )
48
- // .allowUnknownOption()
49
- // .parse(process.argv);
50
-
51
- // export default program
4
+ export default program
You can’t perform that action at this time.
0 commit comments