create-snappy 0.0.4 → 0.0.5

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/package.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "create-snappy",
3
- "version": "0.0.4",
4
- "description": "The official installer for the SNAPPY stack.",
5
- "main": "scripts/create-snappy/cli.js",
6
- "bin": {
7
- "create-snappy": "./scripts/create-snappy/cli.js"
8
- },
9
- "type": "module",
10
- "dependencies": {
11
- "commander": "^14.0.3",
12
- "ora": "^5.4.1",
13
- "picocolors": "^1.1.1",
14
- "prompts": "^2.4.2"
15
- },
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "scripts": {
20
- "test": "echo \"Error: no test specified\" && exit 1"
21
- }
22
- }
1
+ {
2
+ "name": "create-snappy",
3
+ "version": "0.0.5",
4
+ "description": "The official installer for the SNAPPY stack.",
5
+ "main": "scripts/create-snappy/cli.js",
6
+ "bin": {
7
+ "create-snappy": "./scripts/create-snappy/cli.js"
8
+ },
9
+ "type": "module",
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "dependencies": {
14
+ "commander": "^14.0.3",
15
+ "ora": "^5.4.1",
16
+ "picocolors": "^1.1.1",
17
+ "prompts": "^2.4.2"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ }
22
+ }
@@ -195,13 +195,17 @@ async function main() {
195
195
  .name('create-snappy')
196
196
  .description('The official installer for the SNAPPY stack. (Private Access Required)')
197
197
  .argument('[project-name]', 'Name of the project directory')
198
- .option('-t, --template <name>', 'Template to use (portfolio)', 'portfolio')
199
- .option('--login', 'Authenticate with GitHub to access private templates')
198
+ .option('-t, --template <type>', 'Template to use (e.g., portfolio)')
199
+ .option('--login', 'Login with GitHub')
200
200
  .option('--guided', 'Force guided setup for environment variables')
201
+ .option('--license <key>', 'SNAPPY License Key')
202
+ .option('--name <name>', 'Project name')
203
+ .option('--description <desc>', 'Project description')
204
+ .option('--author <name>', 'Author name')
201
205
  .parse(process.argv)
202
206
 
203
207
  const options = program.opts()
204
- let providedName = program.args[0]
208
+ let providedName = options.name || program.args[0]
205
209
 
206
210
  if (options.login) {
207
211
  try {
@@ -232,19 +236,23 @@ async function main() {
232
236
  })
233
237
  }
234
238
 
235
- questions.push({
236
- type: 'text',
237
- name: 'projectDescription',
238
- message: 'Project description?',
239
- initial: 'A fresh SNAPPY app',
240
- })
239
+ if (!options.description) {
240
+ questions.push({
241
+ type: 'text',
242
+ name: 'projectDescription',
243
+ message: 'Project description?',
244
+ initial: 'A fresh SNAPPY app',
245
+ })
246
+ }
241
247
 
242
- questions.push({
243
- type: 'text',
244
- name: 'authorName',
245
- message: 'Author name?',
246
- initial: savedConfig.authorName || 'Wicky',
247
- })
248
+ if (!options.author) {
249
+ questions.push({
250
+ type: 'text',
251
+ name: 'authorName',
252
+ message: 'Author name?',
253
+ initial: savedConfig.authorName || 'Wicky',
254
+ })
255
+ }
248
256
 
249
257
  if (!options.template) {
250
258
  questions.push({
@@ -258,12 +266,14 @@ async function main() {
258
266
  })
259
267
  }
260
268
 
261
- questions.push({
262
- type: 'password',
263
- name: 'snappyLicenseKey',
264
- message: 'SNAPPY License Key (leave blank for trial)?',
265
- initial: savedConfig.snappyLicenseKey || '',
266
- })
269
+ if (!options.license) {
270
+ questions.push({
271
+ type: 'password',
272
+ name: 'snappyLicenseKey',
273
+ message: 'SNAPPY License Key (leave blank for trial)?',
274
+ initial: savedConfig.snappyLicenseKey || '',
275
+ })
276
+ }
267
277
 
268
278
  // Guided Setup: (Cloudflare R2 is now automated via Snappy Core)
269
279
  const needsGuided = false;
@@ -278,8 +288,8 @@ async function main() {
278
288
  // Merge responses with saved config
279
289
  const config = {
280
290
  ...savedConfig,
281
- authorName: response.authorName || savedConfig.authorName,
282
- snappyLicenseKey: response.snappyLicenseKey || savedConfig.snappyLicenseKey,
291
+ authorName: options.author || response.authorName || savedConfig.authorName,
292
+ snappyLicenseKey: options.license || response.snappyLicenseKey || savedConfig.snappyLicenseKey,
283
293
  }
284
294
 
285
295
  // Save if it was a guided session or forced
@@ -288,7 +298,7 @@ async function main() {
288
298
  }
289
299
 
290
300
  const projectName = providedName || response.projectName
291
- const projectDescription = response.projectDescription
301
+ const projectDescription = options.description || response.projectDescription
292
302
  const authorName = config.authorName
293
303
  const selectedTemplate = options.template || response.template || 'portfolio'
294
304