create-blitzpack 0.1.12 → 0.1.14
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/dist/index.js +54 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -170,6 +170,11 @@ var OPTIONAL_FEATURES = [
|
|
|
170
170
|
key: "uploads",
|
|
171
171
|
name: "File Uploads",
|
|
172
172
|
description: "S3 storage, upload routes, file components"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
key: "deployment",
|
|
176
|
+
name: "Deployment",
|
|
177
|
+
description: "Dockerfile, CI/CD workflows, production configs"
|
|
173
178
|
}
|
|
174
179
|
];
|
|
175
180
|
var FEATURE_EXCLUSIONS = {
|
|
@@ -212,7 +217,8 @@ var FEATURE_EXCLUSIONS = {
|
|
|
212
217
|
"apps/web/src/hooks/api/use-uploads.ts",
|
|
213
218
|
"packages/ui/src/file-upload-input.tsx",
|
|
214
219
|
"packages/types/src/upload.ts"
|
|
215
|
-
]
|
|
220
|
+
],
|
|
221
|
+
deployment: ["Dockerfile", "Dockerfile.web", "docker-compose.prod.yml", ".github"]
|
|
216
222
|
};
|
|
217
223
|
|
|
218
224
|
// src/utils.ts
|
|
@@ -386,17 +392,55 @@ async function getProjectOptions(providedName, flags = {}) {
|
|
|
386
392
|
};
|
|
387
393
|
}
|
|
388
394
|
async function promptFeatureSelection() {
|
|
395
|
+
let cancelled = false;
|
|
396
|
+
const { setupType } = await prompts(
|
|
397
|
+
{
|
|
398
|
+
type: "select",
|
|
399
|
+
name: "setupType",
|
|
400
|
+
message: "Setup type:",
|
|
401
|
+
choices: [
|
|
402
|
+
{
|
|
403
|
+
title: "Recommended",
|
|
404
|
+
description: "all features included",
|
|
405
|
+
value: "recommended"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
title: "Customize",
|
|
409
|
+
description: "choose features",
|
|
410
|
+
value: "customize"
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
initial: 0,
|
|
414
|
+
hint: "- Use arrow-keys, Enter to submit"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
onCancel: () => {
|
|
418
|
+
cancelled = true;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
if (cancelled) {
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
425
|
+
if (setupType === "recommended") {
|
|
426
|
+
return {
|
|
427
|
+
testing: true,
|
|
428
|
+
admin: true,
|
|
429
|
+
uploads: true,
|
|
430
|
+
deployment: true
|
|
431
|
+
};
|
|
432
|
+
}
|
|
389
433
|
const featureChoices = OPTIONAL_FEATURES.map((feature) => ({
|
|
390
|
-
title:
|
|
434
|
+
title: feature.name,
|
|
435
|
+
description: feature.description,
|
|
391
436
|
value: feature.key,
|
|
392
|
-
selected:
|
|
437
|
+
selected: false
|
|
393
438
|
}));
|
|
394
|
-
let cancelled = false;
|
|
395
439
|
const { selectedFeatures } = await prompts(
|
|
396
440
|
{
|
|
397
441
|
type: "multiselect",
|
|
398
442
|
name: "selectedFeatures",
|
|
399
|
-
message: "
|
|
443
|
+
message: "Select features to include:",
|
|
400
444
|
choices: featureChoices,
|
|
401
445
|
hint: "- Space to toggle, Enter to confirm",
|
|
402
446
|
instructions: false
|
|
@@ -414,7 +458,8 @@ async function promptFeatureSelection() {
|
|
|
414
458
|
return {
|
|
415
459
|
testing: selected.includes("testing"),
|
|
416
460
|
admin: selected.includes("admin"),
|
|
417
|
-
uploads: selected.includes("uploads")
|
|
461
|
+
uploads: selected.includes("uploads"),
|
|
462
|
+
deployment: selected.includes("deployment")
|
|
418
463
|
};
|
|
419
464
|
}
|
|
420
465
|
async function promptAutomaticSetup() {
|
|
@@ -446,13 +491,7 @@ import fs from "fs-extra";
|
|
|
446
491
|
import { downloadTemplate } from "giget";
|
|
447
492
|
import path2 from "path";
|
|
448
493
|
var GITHUB_REPO = "github:CarboxyDev/blitzpack";
|
|
449
|
-
var POST_DOWNLOAD_EXCLUDES = [
|
|
450
|
-
"create-blitzpack",
|
|
451
|
-
".github",
|
|
452
|
-
"apps/marketing",
|
|
453
|
-
"Dockerfile",
|
|
454
|
-
"docker-compose.prod.yml"
|
|
455
|
-
];
|
|
494
|
+
var POST_DOWNLOAD_EXCLUDES = ["create-blitzpack", "apps/marketing"];
|
|
456
495
|
function getFeatureExclusions(features) {
|
|
457
496
|
const exclusions = [];
|
|
458
497
|
for (const [key, enabled] of Object.entries(features)) {
|
|
@@ -730,8 +769,8 @@ async function transformForNoTesting(targetDir) {
|
|
|
730
769
|
|
|
731
770
|
// src/commands/create.ts
|
|
732
771
|
var ENV_FILES = [
|
|
733
|
-
{ from: "apps/web/.env.
|
|
734
|
-
{ from: "apps/api/.env.
|
|
772
|
+
{ from: "apps/web/.env.example", to: "apps/web/.env.local" },
|
|
773
|
+
{ from: "apps/api/.env.example", to: "apps/api/.env.local" }
|
|
735
774
|
];
|
|
736
775
|
async function copyEnvFiles(targetDir) {
|
|
737
776
|
for (const { from, to } of ENV_FILES) {
|