@@ -51,84 +51,121 @@ const program = new Commander.Command(packageJson.name)
51
51
// https://www.npmjs.com/package/commander#action-handler
52
52
. action ( ( name ) => {
53
53
projectPath = name
54
+ console . log ( "projectPath" , projectPath ) ;
54
55
} )
56
+ // https://www.npmjs.com/package/commander#options
57
+ // --ts option
58
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
55
59
. option (
56
60
'--ts, --typescript' ,
57
61
`
58
62
59
63
Initialize as a TypeScript project. (default)
60
64
`
61
65
)
66
+ // https://www.npmjs.com/package/commander#options
67
+ // --js option
68
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
62
69
. option (
63
70
'--js, --javascript' ,
64
71
`
65
72
66
73
Initialize as a JavaScript project.
67
74
`
68
75
)
76
+ // https://www.npmjs.com/package/commander#options
77
+ // --tailwind option
78
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
69
79
. option (
70
80
'--tailwind' ,
71
81
`
72
82
73
83
Initialize with Tailwind CSS config. (default)
74
84
`
75
85
)
86
+ // https://www.npmjs.com/package/commander#options
87
+ // --eslint option
88
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
76
89
. option (
77
90
'--eslint' ,
78
91
`
79
92
80
93
Initialize with eslint config.
81
94
`
82
95
)
96
+ // https://www.npmjs.com/package/commander#options
97
+ // --app option
98
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
83
99
. option (
84
100
'--app' ,
85
101
`
86
102
87
103
Initialize as an App Router project.
88
104
`
89
105
)
106
+ // https://www.npmjs.com/package/commander#options
107
+ // --src-dir option
108
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
90
109
. option (
91
110
'--src-dir' ,
92
111
`
93
112
94
113
Initialize inside a \`src/\` directory.
95
114
`
96
115
)
116
+ // https://www.npmjs.com/package/commander#options
117
+ //--import-alias option
118
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
97
119
. option (
98
120
'--import-alias <alias-to-configure>' ,
99
121
`
100
122
101
123
Specify import alias to use (default "@/*").
102
124
`
103
125
)
126
+ // https://www.npmjs.com/package/commander#options
127
+ // --use-npm
128
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
104
129
. option (
105
130
'--use-npm' ,
106
131
`
107
132
108
133
Explicitly tell the CLI to bootstrap the application using npm
109
134
`
110
135
)
136
+ // https://www.npmjs.com/package/commander#options
137
+ // --use-pnpm
138
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
111
139
. option (
112
140
'--use-pnpm' ,
113
141
`
114
142
115
143
Explicitly tell the CLI to bootstrap the application using pnpm
116
144
`
117
145
)
146
+ // https://www.npmjs.com/package/commander#options
147
+ // --use-yarn
148
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
118
149
. option (
119
150
'--use-yarn' ,
120
151
`
121
152
122
153
Explicitly tell the CLI to bootstrap the application using Yarn
123
154
`
124
155
)
156
+ // https://www.npmjs.com/package/commander#options
157
+ // --use-bun
158
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
125
159
. option (
126
160
'--use-bun' ,
127
161
`
128
162
129
163
Explicitly tell the CLI to bootstrap the application using Bun
130
164
`
131
165
)
166
+ // https://www.npmjs.com/package/commander#options
167
+ // -e
168
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
132
169
. option (
133
170
'-e, --example [name]|[github-url]' ,
134
171
`
@@ -138,6 +175,9 @@ const program = new Commander.Command(packageJson.name)
138
175
any branch and/or subdirectory
139
176
`
140
177
)
178
+ // https://www.npmjs.com/package/commander#options
179
+ // --example-path <path-to-example>
180
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
141
181
. option (
142
182
'--example-path <path-to-example>' ,
143
183
`
@@ -148,6 +188,9 @@ const program = new Commander.Command(packageJson.name)
148
188
--example-path foo/bar
149
189
`
150
190
)
191
+ // https://www.npmjs.com/package/commander#options
192
+ // --example-path <path-to-example>
193
+ // https://github.com/vercel/next.js/tree/canary/packages/create-next-app#non-interactive
151
194
. option (
152
195
'--reset-preferences' ,
153
196
`
@@ -170,10 +213,14 @@ const packageManager = !!program.useNpm
170
213
171
214
async function run ( ) : Promise < void > {
172
215
216
+ console. log ( "program.resetPreferences:" , program . resetPreferences ) ;
217
+
173
218
// a Conf object creation with projectName.
174
219
// We do not know what Conf does yet and it is okay.
175
220
const conf = new Conf ( { projectName : 'create-next-app' } )
176
221
222
+ console . log ( "conf" , conf ) ;
223
+
177
224
// My first thought, where did the program come from?
178
225
// Let’s find out by looking outside the run() function.
179
226
// We skipped Conf class but the program variable cannot be skipped.
0 commit comments