create-snappy 0.0.2 ā 0.0.4
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 +1 -1
- package/scripts/create-snappy/cli.js +6 -61
package/package.json
CHANGED
|
@@ -265,46 +265,8 @@ async function main() {
|
|
|
265
265
|
initial: savedConfig.snappyLicenseKey || '',
|
|
266
266
|
})
|
|
267
267
|
|
|
268
|
-
// Guided Setup
|
|
269
|
-
const needsGuided =
|
|
270
|
-
|
|
271
|
-
if (needsGuided) {
|
|
272
|
-
console.log(pc.yellow('\nš ļø Guided Setup: Please enter your infrastructure details.'))
|
|
273
|
-
console.log(pc.gray('These will be saved to ~/.snappy/config.json for future use.\n'))
|
|
274
|
-
|
|
275
|
-
questions.push(
|
|
276
|
-
{
|
|
277
|
-
type: 'text',
|
|
278
|
-
name: 's3Bucket',
|
|
279
|
-
message: 'R2/S3 Bucket Name?',
|
|
280
|
-
initial: savedConfig.s3Bucket || 'snappy-production',
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
type: 'text',
|
|
284
|
-
name: 's3Region',
|
|
285
|
-
message: 'R2/S3 Region?',
|
|
286
|
-
initial: savedConfig.s3Region || 'auto',
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
type: 'text',
|
|
290
|
-
name: 's3Endpoint',
|
|
291
|
-
message: 'R2/S3 Endpoint URL?',
|
|
292
|
-
initial: savedConfig.s3Endpoint || '',
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
type: 'password',
|
|
296
|
-
name: 's3AccessKey',
|
|
297
|
-
message: 'R2/S3 Access Key ID?',
|
|
298
|
-
initial: savedConfig.s3AccessKey || '',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
type: 'password',
|
|
302
|
-
name: 's3SecretKey',
|
|
303
|
-
message: 'R2/S3 Secret Access Key?',
|
|
304
|
-
initial: savedConfig.s3SecretKey || '',
|
|
305
|
-
},
|
|
306
|
-
)
|
|
307
|
-
}
|
|
268
|
+
// Guided Setup: (Cloudflare R2 is now automated via Snappy Core)
|
|
269
|
+
const needsGuided = false;
|
|
308
270
|
|
|
309
271
|
const response = await prompts(questions, {
|
|
310
272
|
onCancel: () => {
|
|
@@ -318,11 +280,6 @@ async function main() {
|
|
|
318
280
|
...savedConfig,
|
|
319
281
|
authorName: response.authorName || savedConfig.authorName,
|
|
320
282
|
snappyLicenseKey: response.snappyLicenseKey || savedConfig.snappyLicenseKey,
|
|
321
|
-
s3Bucket: response.s3Bucket || savedConfig.s3Bucket,
|
|
322
|
-
s3Region: response.s3Region || savedConfig.s3Region,
|
|
323
|
-
s3Endpoint: response.s3Endpoint || savedConfig.s3Endpoint,
|
|
324
|
-
s3AccessKey: response.s3AccessKey || savedConfig.s3AccessKey,
|
|
325
|
-
s3SecretKey: response.s3SecretKey || savedConfig.s3SecretKey,
|
|
326
283
|
}
|
|
327
284
|
|
|
328
285
|
// Save if it was a guided session or forced
|
|
@@ -449,7 +406,7 @@ async function main() {
|
|
|
449
406
|
|
|
450
407
|
// Update @snappy-stack/core to latest
|
|
451
408
|
if (pkg.dependencies['@snappy-stack/core']) {
|
|
452
|
-
pkg.dependencies['@snappy-stack/core'] = '^0.1.
|
|
409
|
+
pkg.dependencies['@snappy-stack/core'] = '^0.1.11';
|
|
453
410
|
}
|
|
454
411
|
|
|
455
412
|
// Fix all @lexical/* sub-dependencies
|
|
@@ -487,29 +444,17 @@ async function main() {
|
|
|
487
444
|
// 3. Configure .env
|
|
488
445
|
console.log('\nš ļø Configuring environment variables...')
|
|
489
446
|
|
|
490
|
-
const
|
|
491
|
-
const finalS3Endpoint = config.s3Endpoint
|
|
492
|
-
const finalS3AccessKey = config.s3AccessKey
|
|
493
|
-
const finalS3SecretKey = config.s3SecretKey
|
|
494
|
-
const finalS3Region = config.s3Region
|
|
447
|
+
const finalLicenseToken = config.snappyLicenseKey;
|
|
495
448
|
|
|
496
449
|
const payloadSecret = crypto.randomBytes(32).toString('hex')
|
|
497
450
|
|
|
498
|
-
|
|
451
|
+
let envContent = `# SNAPPY STACK - Zero-Config Environment
|
|
499
452
|
SNAPPY_LICENSE_TOKEN="${finalLicenseToken || ''}"
|
|
500
|
-
SNAPPY_API_URL
|
|
453
|
+
# SNAPPY_API_URL is hardcoded in @snappy-stack/core
|
|
501
454
|
|
|
502
455
|
# Payload CMS
|
|
503
456
|
PAYLOAD_SECRET="${payloadSecret}"
|
|
504
457
|
PUBLIC_FRONTEND_URL="http://localhost:3000"
|
|
505
|
-
|
|
506
|
-
# R2 Storage Configuration (Isolated via SNAPPY)
|
|
507
|
-
S3_BUCKET="${finalS3Bucket}"
|
|
508
|
-
NEXT_PUBLIC_S3_BUCKET="${finalS3Bucket}"
|
|
509
|
-
S3_REGION="${finalS3Region}"
|
|
510
|
-
S3_ENDPOINT="${finalS3Endpoint}"
|
|
511
|
-
S3_ACCESS_KEY_ID="${finalS3AccessKey}"
|
|
512
|
-
S3_SECRET_ACCESS_KEY="${finalS3SecretKey}"
|
|
513
458
|
`
|
|
514
459
|
fs.writeFileSync(path.join(targetDir, '.env'), envContent)
|
|
515
460
|
console.log(pc.green('ā
.env generated.\n'))
|