create-blitzpack 0.1.13 → 0.1.15

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.
Files changed (3) hide show
  1. package/README.md +10 -1
  2. package/dist/index.js +98 -26
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,7 +24,16 @@ pnpm create blitzpack [project-name] [options]
24
24
  - **Web**: Next.js 16 + React 19 + Tailwind CSS v4 + shadcn/ui
25
25
  - **API**: Fastify 5 + Prisma 7 + PostgreSQL + Better Auth
26
26
  - **Monorepo**: Turborepo + pnpm workspaces
27
- - **Production-ready**: Auth, admin dashboard, logging, validation, testing, Docker
27
+ - **Production-ready app stack**: Auth, admin dashboard, logging, validation, testing
28
+ - **Optional deployment assets**: Dockerfiles + production compose + CD workflow
29
+
30
+ ## Setup Profiles
31
+
32
+ The scaffold wizard supports three profiles:
33
+
34
+ - **Recommended**: All app features plus Docker deployment assets and CD workflow.
35
+ - **Platform-First**: All app features, without deployment assets.
36
+ - **Custom**: Pick app features and deployment options independently.
28
37
 
29
38
  ## Requirements
30
39
 
package/dist/index.js CHANGED
@@ -155,7 +155,7 @@ var REPLACEABLE_FILES = [
155
155
  "README.md"
156
156
  ];
157
157
  var DEFAULT_DESCRIPTION = "A full-stack TypeScript monorepo built with Blitzpack";
158
- var OPTIONAL_FEATURES = [
158
+ var APP_FEATURES = [
159
159
  {
160
160
  key: "testing",
161
161
  name: "Testing",
@@ -172,6 +172,18 @@ var OPTIONAL_FEATURES = [
172
172
  description: "S3 storage, upload routes, file components"
173
173
  }
174
174
  ];
175
+ var DEPLOYMENT_FEATURES = [
176
+ {
177
+ key: "dockerDeploy",
178
+ name: "Docker Deployment",
179
+ description: "Dockerfiles for API/Web and production Docker Compose"
180
+ },
181
+ {
182
+ key: "ciCd",
183
+ name: "CD Workflow",
184
+ description: "GitHub Actions workflow to build and publish Docker images"
185
+ }
186
+ ];
175
187
  var FEATURE_EXCLUSIONS = {
176
188
  testing: [
177
189
  "vitest.workspace.ts",
@@ -212,7 +224,14 @@ var FEATURE_EXCLUSIONS = {
212
224
  "apps/web/src/hooks/api/use-uploads.ts",
213
225
  "packages/ui/src/file-upload-input.tsx",
214
226
  "packages/types/src/upload.ts"
215
- ]
227
+ ],
228
+ dockerDeploy: [
229
+ "apps/api/.dockerignore",
230
+ "apps/api/Dockerfile",
231
+ "apps/web/Dockerfile",
232
+ "deploy/docker"
233
+ ],
234
+ ciCd: [".github/workflows/cd.yml"]
216
235
  };
217
236
 
218
237
  // src/utils.ts
@@ -391,16 +410,21 @@ async function promptFeatureSelection() {
391
410
  {
392
411
  type: "select",
393
412
  name: "setupType",
394
- message: "Setup type:",
413
+ message: "Project profile:",
395
414
  choices: [
396
415
  {
397
416
  title: "Recommended",
398
- description: "all features included",
417
+ description: "all app features + Docker deploy assets + CD workflow",
399
418
  value: "recommended"
400
419
  },
401
420
  {
402
- title: "Customize",
403
- description: "choose features",
421
+ title: "Platform-First",
422
+ description: "all app features, no deployment assets",
423
+ value: "platform"
424
+ },
425
+ {
426
+ title: "Custom",
427
+ description: "choose app and deployment features",
404
428
  value: "customize"
405
429
  }
406
430
  ],
@@ -420,21 +444,56 @@ async function promptFeatureSelection() {
420
444
  return {
421
445
  testing: true,
422
446
  admin: true,
423
- uploads: true
447
+ uploads: true,
448
+ dockerDeploy: true,
449
+ ciCd: true
424
450
  };
425
451
  }
426
- const featureChoices = OPTIONAL_FEATURES.map((feature) => ({
452
+ if (setupType === "platform") {
453
+ return {
454
+ testing: true,
455
+ admin: true,
456
+ uploads: true,
457
+ dockerDeploy: false,
458
+ ciCd: false
459
+ };
460
+ }
461
+ const appFeatureChoices = APP_FEATURES.map((feature) => ({
462
+ title: feature.name,
463
+ description: feature.description,
464
+ value: feature.key,
465
+ selected: true
466
+ }));
467
+ const { selectedAppFeatures } = await prompts(
468
+ {
469
+ type: "multiselect",
470
+ name: "selectedAppFeatures",
471
+ message: "Select app features:",
472
+ choices: appFeatureChoices,
473
+ hint: "- Space to toggle, Enter to confirm",
474
+ instructions: false
475
+ },
476
+ {
477
+ onCancel: () => {
478
+ cancelled = true;
479
+ }
480
+ }
481
+ );
482
+ if (cancelled) {
483
+ return null;
484
+ }
485
+ const deploymentFeatureChoices = DEPLOYMENT_FEATURES.map((feature) => ({
427
486
  title: feature.name,
428
487
  description: feature.description,
429
488
  value: feature.key,
430
489
  selected: false
431
490
  }));
432
- const { selectedFeatures } = await prompts(
491
+ const { selectedDeploymentFeatures } = await prompts(
433
492
  {
434
493
  type: "multiselect",
435
- name: "selectedFeatures",
436
- message: "Select features to include:",
437
- choices: featureChoices,
494
+ name: "selectedDeploymentFeatures",
495
+ message: "Select deployment options (optional):",
496
+ choices: deploymentFeatureChoices,
438
497
  hint: "- Space to toggle, Enter to confirm",
439
498
  instructions: false
440
499
  },
@@ -447,11 +506,24 @@ async function promptFeatureSelection() {
447
506
  if (cancelled) {
448
507
  return null;
449
508
  }
450
- const selected = selectedFeatures || [];
509
+ const selectedApp = selectedAppFeatures || [];
510
+ const selectedDeployment = selectedDeploymentFeatures || [];
511
+ const includesCiCd = selectedDeployment.includes("ciCd");
512
+ const includesDockerDeploy = selectedDeployment.includes("dockerDeploy") || includesCiCd;
513
+ if (includesCiCd && !selectedDeployment.includes("dockerDeploy")) {
514
+ console.log();
515
+ console.log(
516
+ chalk3.dim(
517
+ " \u2139 CD workflow requires Docker deployment assets, enabling both."
518
+ )
519
+ );
520
+ }
451
521
  return {
452
- testing: selected.includes("testing"),
453
- admin: selected.includes("admin"),
454
- uploads: selected.includes("uploads")
522
+ testing: selectedApp.includes("testing"),
523
+ admin: selectedApp.includes("admin"),
524
+ uploads: selectedApp.includes("uploads"),
525
+ dockerDeploy: includesDockerDeploy,
526
+ ciCd: includesCiCd
455
527
  };
456
528
  }
457
529
  async function promptAutomaticSetup() {
@@ -472,7 +544,7 @@ async function promptAutomaticSetup() {
472
544
  const { runSetup } = await prompts({
473
545
  type: "confirm",
474
546
  name: "runSetup",
475
- message: "Run initial setup now? (docker compose + database migrations)",
547
+ message: "Run local setup now? (start PostgreSQL with Docker + run migrations)",
476
548
  initial: true
477
549
  });
478
550
  return runSetup || false;
@@ -483,13 +555,7 @@ import fs from "fs-extra";
483
555
  import { downloadTemplate } from "giget";
484
556
  import path2 from "path";
485
557
  var GITHUB_REPO = "github:CarboxyDev/blitzpack";
486
- var POST_DOWNLOAD_EXCLUDES = [
487
- "create-blitzpack",
488
- ".github",
489
- "apps/marketing",
490
- "Dockerfile",
491
- "docker-compose.prod.yml"
492
- ];
558
+ var POST_DOWNLOAD_EXCLUDES = ["create-blitzpack", "apps/marketing"];
493
559
  function getFeatureExclusions(features) {
494
560
  const exclusions = [];
495
561
  for (const [key, enabled] of Object.entries(features)) {
@@ -767,8 +833,8 @@ async function transformForNoTesting(targetDir) {
767
833
 
768
834
  // src/commands/create.ts
769
835
  var ENV_FILES = [
770
- { from: "apps/web/.env.local.example", to: "apps/web/.env.local" },
771
- { from: "apps/api/.env.local.example", to: "apps/api/.env.local" }
836
+ { from: "apps/web/.env.example", to: "apps/web/.env.local" },
837
+ { from: "apps/api/.env.example", to: "apps/api/.env.local" }
772
838
  ];
773
839
  async function copyEnvFiles(targetDir) {
774
840
  for (const { from, to } of ENV_FILES) {
@@ -814,6 +880,12 @@ function printDryRun(options) {
814
880
  console.log(
815
881
  ` ${featureStatus(options.features.uploads)} File Uploads ${chalk4.dim("(S3 storage, upload routes)")}`
816
882
  );
883
+ console.log(
884
+ ` ${featureStatus(options.features.dockerDeploy)} Docker Deployment ${chalk4.dim("(API/Web Dockerfiles, production compose)")}`
885
+ );
886
+ console.log(
887
+ ` ${featureStatus(options.features.ciCd)} CD Workflow ${chalk4.dim("(GitHub Actions image build/push)")}`
888
+ );
817
889
  console.log();
818
890
  console.log(chalk4.bold(" Would run:"));
819
891
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-blitzpack",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Create a new Blitzpack project - full-stack TypeScript monorepo with Next.js and Fastify",
5
5
  "type": "module",
6
6
  "bin": {