@donotdev/cli 0.0.17 → 0.0.19
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/dependencies-matrix.json +67 -60
- package/dist/bin/commands/coach.js +8177 -0
- package/dist/bin/commands/create-app.js +94 -145
- package/dist/bin/commands/create-project.js +98 -149
- package/dist/bin/commands/deploy.js +81 -59
- package/dist/bin/commands/doctor.js +243 -698
- package/dist/bin/commands/emu.js +2 -2
- package/dist/bin/commands/format.js +4 -1
- package/dist/bin/commands/get-demo.js +8351 -0
- package/dist/bin/commands/make-admin.js +773 -152
- package/dist/bin/commands/setup.js +519 -1711
- package/dist/bin/commands/staging.js +17852 -0
- package/dist/bin/commands/sync-secrets.js +2 -11
- package/dist/bin/commands/type-check.js +7733 -1713
- package/dist/bin/dndev.js +913 -182
- package/dist/bin/donotdev.js +913 -182
- package/dist/index.js +191 -211
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +147 -10
- package/templates/app-demo/src/App.tsx.example +7 -13
- package/templates/app-demo/src/config/app.ts.example +12 -48
- package/templates/app-demo/src/entities/product.ts.example +38 -0
- package/templates/app-demo/src/globals.css.example +5 -1
- package/templates/app-demo/src/main.tsx.example +13 -7
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +3 -77
- package/templates/app-demo/src/pages/PricingPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +17 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +16 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +112 -0
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +91 -0
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +14 -0
- package/templates/app-demo/tsconfig.json.example +1 -1
- package/templates/app-demo/vite.config.ts.example +23 -48
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/app/index.tsx.example +1 -1
- package/templates/app-vite/src/pages/HomePage.tsx.example +8 -10
- package/templates/overlay-firebase/env.fragment.example +1 -1
- package/templates/overlay-firebase/env.fragment.expo.example +1 -1
- package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-supabase/env.fragment.example +1 -1
- package/templates/overlay-supabase/env.fragment.expo.example +1 -1
- package/templates/overlay-supabase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-vercel/env.fragment.example +1 -1
- package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +15 -1
- package/templates/root-consumer/.claude/commands/build.md.example +24 -2
- package/templates/root-consumer/.claude/commands/design.md.example +17 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +17 -0
- package/templates/root-consumer/AI.md.example +54 -21
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +21 -6
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +16 -179
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +19 -21
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +14 -3
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +19 -2
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +35 -1
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +32 -0
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +1 -1
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +74 -6
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +37 -16
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +18 -18
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +119 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +1 -1
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +6 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +4 -5
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +2 -2
- package/dist/bin/commands/agent-setup.d.ts +0 -6
- package/dist/bin/commands/agent-setup.d.ts.map +0 -1
- package/dist/bin/commands/agent-setup.js.map +0 -1
- package/dist/bin/commands/build.d.ts +0 -11
- package/dist/bin/commands/build.d.ts.map +0 -1
- package/dist/bin/commands/build.js.map +0 -1
- package/dist/bin/commands/bump.d.ts +0 -11
- package/dist/bin/commands/bump.d.ts.map +0 -1
- package/dist/bin/commands/bump.js.map +0 -1
- package/dist/bin/commands/cacheout.d.ts +0 -11
- package/dist/bin/commands/cacheout.d.ts.map +0 -1
- package/dist/bin/commands/cacheout.js.map +0 -1
- package/dist/bin/commands/create-app.d.ts +0 -11
- package/dist/bin/commands/create-app.d.ts.map +0 -1
- package/dist/bin/commands/create-app.js.map +0 -1
- package/dist/bin/commands/create-project.d.ts +0 -11
- package/dist/bin/commands/create-project.d.ts.map +0 -1
- package/dist/bin/commands/create-project.js.map +0 -1
- package/dist/bin/commands/deploy.d.ts +0 -11
- package/dist/bin/commands/deploy.d.ts.map +0 -1
- package/dist/bin/commands/deploy.js.map +0 -1
- package/dist/bin/commands/dev.d.ts +0 -11
- package/dist/bin/commands/dev.d.ts.map +0 -1
- package/dist/bin/commands/dev.js.map +0 -1
- package/dist/bin/commands/doctor.d.ts +0 -6
- package/dist/bin/commands/doctor.d.ts.map +0 -1
- package/dist/bin/commands/doctor.js.map +0 -1
- package/dist/bin/commands/emu.d.ts +0 -11
- package/dist/bin/commands/emu.d.ts.map +0 -1
- package/dist/bin/commands/emu.js.map +0 -1
- package/dist/bin/commands/format.d.ts +0 -11
- package/dist/bin/commands/format.d.ts.map +0 -1
- package/dist/bin/commands/format.js.map +0 -1
- package/dist/bin/commands/make-admin.d.ts +0 -11
- package/dist/bin/commands/make-admin.d.ts.map +0 -1
- package/dist/bin/commands/make-admin.js.map +0 -1
- package/dist/bin/commands/preview.d.ts +0 -11
- package/dist/bin/commands/preview.d.ts.map +0 -1
- package/dist/bin/commands/preview.js.map +0 -1
- package/dist/bin/commands/setup.d.ts +0 -6
- package/dist/bin/commands/setup.d.ts.map +0 -1
- package/dist/bin/commands/setup.js.map +0 -1
- package/dist/bin/commands/sync-secrets.d.ts +0 -11
- package/dist/bin/commands/sync-secrets.d.ts.map +0 -1
- package/dist/bin/commands/sync-secrets.js.map +0 -1
- package/dist/bin/commands/type-check.d.ts +0 -14
- package/dist/bin/commands/type-check.d.ts.map +0 -1
- package/dist/bin/commands/type-check.js.map +0 -1
- package/dist/bin/commands/wai.d.ts +0 -11
- package/dist/bin/commands/wai.d.ts.map +0 -1
- package/dist/bin/commands/wai.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/templates/app-demo/src/components/ThemeToggle.tsx.example +0 -48
- package/templates/app-demo/src/pages/DetailPage.tsx.example +0 -103
- package/templates/app-demo/src/pages/FullPage.tsx.example +0 -142
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +0 -266
- package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +0 -20
- package/templates/functions-firebase/functions-firebase/README.md.example +0 -123
- package/templates/functions-firebase/functions-firebase/build.mjs.example +0 -5
- package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +0 -11
- package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -24
- package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +0 -10
- package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +0 -39
- package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +0 -17
- package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/README.md.example +0 -116
- package/templates/functions-vercel/functions-vercel/build.mjs.example +0 -52
- package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/vercel.json.example +0 -14
- package/templates/github/github/workflows/firebase-deploy.yml.example +0 -79
- /package/templates/functions-firebase/{functions-firebase/.env.example.example → .env.example} +0 -0
- /package/templates/functions-vercel/{functions-vercel/.env.example.example → .env.example} +0 -0
|
@@ -8475,34 +8475,67 @@ var APP_QUESTIONNAIRE = [
|
|
|
8475
8475
|
]
|
|
8476
8476
|
},
|
|
8477
8477
|
{
|
|
8478
|
-
id: "
|
|
8479
|
-
question: "
|
|
8480
|
-
type: "
|
|
8481
|
-
|
|
8478
|
+
id: "host",
|
|
8479
|
+
question: "Where will you host?",
|
|
8480
|
+
type: "select",
|
|
8481
|
+
condition: (answers) => answers.framework !== "expo",
|
|
8482
|
+
defaultValue: (answers) => {
|
|
8483
|
+
return answers.framework === "nextjs" ? "vercel" : "none";
|
|
8484
|
+
},
|
|
8485
|
+
choices: [
|
|
8486
|
+
{ title: "None \u2014 no hosting config", value: "none" },
|
|
8487
|
+
{ title: "Vercel \u2014 edge CDN + serverless", value: "vercel" },
|
|
8488
|
+
{ title: "Firebase Hosting \u2014 Google CDN", value: "firebase" }
|
|
8489
|
+
]
|
|
8490
|
+
},
|
|
8491
|
+
{
|
|
8492
|
+
id: "functions",
|
|
8493
|
+
question: "Serverless functions?",
|
|
8494
|
+
type: "select",
|
|
8495
|
+
defaultValue: "none",
|
|
8496
|
+
// Choices filtered dynamically based on host
|
|
8497
|
+
choices: [
|
|
8498
|
+
{ title: "None", value: "none" },
|
|
8499
|
+
{ title: "Vercel Functions \u2014 edge + node.js", value: "vercel" },
|
|
8500
|
+
{ title: "Firebase Functions \u2014 Google Cloud", value: "firebase" },
|
|
8501
|
+
{ title: "Supabase Edge Functions \u2014 Deno", value: "supabase" }
|
|
8502
|
+
],
|
|
8503
|
+
choicesFilter: (answers) => {
|
|
8504
|
+
const host = answers.host ?? "none";
|
|
8505
|
+
const framework = answers.framework;
|
|
8506
|
+
if (framework === "expo") return ["none", "firebase", "supabase"];
|
|
8507
|
+
if (host === "firebase") return ["none", "firebase"];
|
|
8508
|
+
if (host === "vercel") return ["none", "vercel", "supabase"];
|
|
8509
|
+
return ["none", "vercel", "firebase", "supabase"];
|
|
8510
|
+
}
|
|
8482
8511
|
},
|
|
8483
8512
|
{
|
|
8484
|
-
id: "
|
|
8485
|
-
question: "
|
|
8513
|
+
id: "backend",
|
|
8514
|
+
question: "Backend / BaaS provider?",
|
|
8486
8515
|
type: "select",
|
|
8487
|
-
dependsOn: "needsBackend",
|
|
8488
|
-
condition: (answers) => answers.needsBackend === true,
|
|
8489
8516
|
defaultValue: (answers) => {
|
|
8490
|
-
|
|
8517
|
+
if (answers.functions === "firebase") return "firebase";
|
|
8518
|
+
if (answers.functions === "supabase") return "supabase";
|
|
8519
|
+
return "none";
|
|
8491
8520
|
},
|
|
8492
8521
|
choices: [
|
|
8522
|
+
{ title: "None \u2014 frontend only", value: "none" },
|
|
8493
8523
|
{
|
|
8494
|
-
title: "Firebase \u2014
|
|
8524
|
+
title: "Firebase \u2014 Auth + Firestore + Storage",
|
|
8495
8525
|
value: "firebase"
|
|
8496
8526
|
},
|
|
8497
|
-
{
|
|
8498
|
-
title: "Vercel \u2014 Serverless functions (edge + node.js)",
|
|
8499
|
-
value: "vercel"
|
|
8500
|
-
},
|
|
8501
8527
|
{
|
|
8502
8528
|
title: "Supabase \u2014 Postgres + Auth + Storage",
|
|
8503
8529
|
value: "supabase"
|
|
8504
8530
|
}
|
|
8505
|
-
]
|
|
8531
|
+
],
|
|
8532
|
+
choicesFilter: (answers) => {
|
|
8533
|
+
const functions = answers.functions ?? "none";
|
|
8534
|
+
if (functions === "firebase") return ["none", "firebase"];
|
|
8535
|
+
if (functions === "supabase") return ["none", "supabase"];
|
|
8536
|
+
if (functions === "vercel") return ["none"];
|
|
8537
|
+
return ["none", "firebase", "supabase"];
|
|
8538
|
+
}
|
|
8506
8539
|
}
|
|
8507
8540
|
];
|
|
8508
8541
|
var PROJECT_QUESTIONNAIRE = [
|
|
@@ -8520,12 +8553,13 @@ var PROJECT_QUESTIONNAIRE = [
|
|
|
8520
8553
|
}
|
|
8521
8554
|
];
|
|
8522
8555
|
function aggregateRequirements(answers) {
|
|
8556
|
+
const hasBackend = answers.backend && answers.backend !== "none" || answers.functions && answers.functions !== "none";
|
|
8523
8557
|
const requirements = {
|
|
8524
8558
|
entities: [],
|
|
8525
8559
|
// Entities created in apps/<app>/entities/ (v1), root entities/ for v2
|
|
8526
8560
|
billing: true,
|
|
8527
8561
|
// Always on (useStripeBillingSafe handles missing package)
|
|
8528
|
-
backend:
|
|
8562
|
+
backend: hasBackend,
|
|
8529
8563
|
features: [],
|
|
8530
8564
|
template: "vite",
|
|
8531
8565
|
// Only Vite for now
|
|
@@ -8549,6 +8583,10 @@ async function runQuestionnaire(questions, initialAnswers, showWIP, askFor) {
|
|
|
8549
8583
|
if (!showWIP) {
|
|
8550
8584
|
choices = choices.filter((choice) => !choice.wip);
|
|
8551
8585
|
}
|
|
8586
|
+
if (question.choicesFilter) {
|
|
8587
|
+
const allowed = question.choicesFilter(answers);
|
|
8588
|
+
choices = choices.filter((c) => allowed.includes(c.value));
|
|
8589
|
+
}
|
|
8552
8590
|
if (choices.length === 0) continue;
|
|
8553
8591
|
answer = await askFor.selection(question.question, choices);
|
|
8554
8592
|
break;
|
|
@@ -8611,10 +8649,10 @@ function generateScripts(templateName, options) {
|
|
|
8611
8649
|
scripts.lint = "eslint .";
|
|
8612
8650
|
scripts["type-check"] = "tsc --noEmit";
|
|
8613
8651
|
} else if (templateName === "consumer-root") {
|
|
8614
|
-
scripts.dev = "
|
|
8652
|
+
scripts.dev = "dndev dev";
|
|
8615
8653
|
scripts.build = "turbo run build";
|
|
8616
8654
|
scripts.lint = "turbo run lint";
|
|
8617
|
-
scripts["type-check"] = "
|
|
8655
|
+
scripts["type-check"] = "dndev tc";
|
|
8618
8656
|
} else if (templateName.includes("functions")) {
|
|
8619
8657
|
scripts.build = "node build.mjs";
|
|
8620
8658
|
scripts["build:tsc"] = "tsc";
|
|
@@ -8625,9 +8663,9 @@ function generateScripts(templateName, options) {
|
|
|
8625
8663
|
scripts.dev = "vercel dev";
|
|
8626
8664
|
}
|
|
8627
8665
|
} else if (templateName === "demo") {
|
|
8628
|
-
scripts.dev = "
|
|
8629
|
-
scripts.build = "tsc --noEmit &&
|
|
8630
|
-
scripts.preview = "
|
|
8666
|
+
scripts.dev = "vite";
|
|
8667
|
+
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8668
|
+
scripts.preview = "vite preview";
|
|
8631
8669
|
scripts["type-check"] = "tsc --noEmit";
|
|
8632
8670
|
} else if (templateName === "entities") {
|
|
8633
8671
|
}
|
|
@@ -8749,120 +8787,22 @@ init_pathResolver();
|
|
|
8749
8787
|
|
|
8750
8788
|
// packages/tooling/src/scaffolding/scaffold-matrix.ts
|
|
8751
8789
|
init_utils();
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
overlay: null,
|
|
8758
|
-
deployConfig: null,
|
|
8759
|
-
functionsTemplate: null
|
|
8760
|
-
},
|
|
8761
|
-
{
|
|
8762
|
-
builder: "vite",
|
|
8763
|
-
backend: "firebase",
|
|
8764
|
-
baseTemplate: "app-vite",
|
|
8765
|
-
overlay: "overlay-firebase",
|
|
8766
|
-
deployConfig: "firebase",
|
|
8767
|
-
functionsTemplate: "functions-firebase"
|
|
8768
|
-
},
|
|
8769
|
-
{
|
|
8770
|
-
builder: "vite",
|
|
8771
|
-
backend: "supabase",
|
|
8772
|
-
baseTemplate: "app-vite",
|
|
8773
|
-
overlay: "overlay-supabase",
|
|
8774
|
-
deployConfig: "vercel-supabase",
|
|
8775
|
-
functionsTemplate: "functions-supabase"
|
|
8776
|
-
},
|
|
8777
|
-
{
|
|
8778
|
-
builder: "vite",
|
|
8779
|
-
backend: "vercel",
|
|
8780
|
-
baseTemplate: "app-vite",
|
|
8781
|
-
overlay: "overlay-vercel",
|
|
8782
|
-
deployConfig: "vercel-vercel",
|
|
8783
|
-
functionsTemplate: "functions-vercel"
|
|
8784
|
-
},
|
|
8785
|
-
{
|
|
8786
|
-
builder: "nextjs",
|
|
8787
|
-
backend: "none",
|
|
8788
|
-
baseTemplate: "app-next",
|
|
8789
|
-
overlay: null,
|
|
8790
|
-
deployConfig: null,
|
|
8791
|
-
functionsTemplate: null
|
|
8792
|
-
},
|
|
8793
|
-
{
|
|
8794
|
-
builder: "nextjs",
|
|
8795
|
-
backend: "firebase",
|
|
8796
|
-
baseTemplate: "app-next",
|
|
8797
|
-
overlay: "overlay-firebase",
|
|
8798
|
-
deployConfig: "firebase",
|
|
8799
|
-
functionsTemplate: "functions-firebase"
|
|
8800
|
-
},
|
|
8801
|
-
{
|
|
8802
|
-
builder: "nextjs",
|
|
8803
|
-
backend: "supabase",
|
|
8804
|
-
baseTemplate: "app-next",
|
|
8805
|
-
overlay: "overlay-supabase",
|
|
8806
|
-
deployConfig: "vercel-supabase",
|
|
8807
|
-
functionsTemplate: "functions-supabase"
|
|
8808
|
-
},
|
|
8809
|
-
{
|
|
8810
|
-
builder: "nextjs",
|
|
8811
|
-
backend: "vercel",
|
|
8812
|
-
baseTemplate: "app-next",
|
|
8813
|
-
overlay: "overlay-vercel",
|
|
8814
|
-
deployConfig: "vercel-vercel",
|
|
8815
|
-
functionsTemplate: "functions-vercel"
|
|
8816
|
-
},
|
|
8817
|
-
{
|
|
8818
|
-
builder: "expo",
|
|
8819
|
-
backend: "none",
|
|
8820
|
-
baseTemplate: "app-expo",
|
|
8821
|
-
overlay: null,
|
|
8822
|
-
deployConfig: null,
|
|
8823
|
-
functionsTemplate: null
|
|
8824
|
-
},
|
|
8825
|
-
{
|
|
8826
|
-
builder: "expo",
|
|
8827
|
-
backend: "firebase",
|
|
8828
|
-
baseTemplate: "app-expo",
|
|
8829
|
-
overlay: "overlay-firebase",
|
|
8830
|
-
deployConfig: null,
|
|
8831
|
-
functionsTemplate: "functions-firebase"
|
|
8832
|
-
},
|
|
8833
|
-
{
|
|
8834
|
-
builder: "expo",
|
|
8835
|
-
backend: "supabase",
|
|
8836
|
-
baseTemplate: "app-expo",
|
|
8837
|
-
overlay: "overlay-supabase",
|
|
8838
|
-
deployConfig: null,
|
|
8839
|
-
functionsTemplate: "functions-supabase"
|
|
8840
|
-
},
|
|
8841
|
-
{
|
|
8842
|
-
builder: "demo",
|
|
8843
|
-
backend: "none",
|
|
8844
|
-
baseTemplate: "app-demo",
|
|
8845
|
-
overlay: null,
|
|
8846
|
-
deployConfig: null,
|
|
8847
|
-
functionsTemplate: null
|
|
8848
|
-
}
|
|
8849
|
-
];
|
|
8850
|
-
function comboKey(builder, backend) {
|
|
8851
|
-
return `${builder}-${backend}`;
|
|
8790
|
+
function resolveDeployConfig(host, backend) {
|
|
8791
|
+
if (host === "none") return null;
|
|
8792
|
+
if (host === "firebase") return "firebase";
|
|
8793
|
+
if (backend === "supabase") return "vercel-supabase";
|
|
8794
|
+
return "vercel-vercel";
|
|
8852
8795
|
}
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
);
|
|
8864
|
-
}
|
|
8865
|
-
return row;
|
|
8796
|
+
function getScaffoldParts(builder, host, functions, backend) {
|
|
8797
|
+
const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : `app-${builder}`;
|
|
8798
|
+
return {
|
|
8799
|
+
builder,
|
|
8800
|
+
backend,
|
|
8801
|
+
baseTemplate,
|
|
8802
|
+
overlay: backend !== "none" ? `overlay-${backend}` : null,
|
|
8803
|
+
deployConfig: resolveDeployConfig(host, backend),
|
|
8804
|
+
functionsTemplate: functions !== "none" ? `functions-${functions}` : null
|
|
8805
|
+
};
|
|
8866
8806
|
}
|
|
8867
8807
|
|
|
8868
8808
|
// packages/tooling/src/scaffolding/create-app.ts
|
|
@@ -8902,11 +8842,15 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8902
8842
|
input: askForInput
|
|
8903
8843
|
});
|
|
8904
8844
|
const requirements = aggregateRequirements(answers);
|
|
8905
|
-
const
|
|
8845
|
+
const framework = answers.framework || "vite";
|
|
8846
|
+
const host2 = answers.host || "none";
|
|
8847
|
+
const functions2 = answers.functions || "none";
|
|
8848
|
+
const backend2 = answers.backend || "none";
|
|
8906
8849
|
appConfig = {
|
|
8907
|
-
template:
|
|
8908
|
-
|
|
8909
|
-
|
|
8850
|
+
template: framework,
|
|
8851
|
+
host: host2,
|
|
8852
|
+
functions: functions2,
|
|
8853
|
+
backend: backend2,
|
|
8910
8854
|
needsCRUD: true,
|
|
8911
8855
|
// Always on
|
|
8912
8856
|
selectedEntities: [],
|
|
@@ -8952,12 +8896,14 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8952
8896
|
s.start(`Creating app: ${appName}`);
|
|
8953
8897
|
await ensureDir(appDir);
|
|
8954
8898
|
const builder = appTemplate;
|
|
8955
|
-
const
|
|
8956
|
-
const
|
|
8899
|
+
const host = appConfig.host ?? "none";
|
|
8900
|
+
const functions = appConfig.functions ?? "none";
|
|
8901
|
+
const backend = appConfig.backend ?? "none";
|
|
8902
|
+
const row = getScaffoldParts(builder, host, functions, backend);
|
|
8957
8903
|
const templateDir = row.baseTemplate;
|
|
8958
8904
|
const firebaseProjectId = (appConfig?.firebaseProjectId ?? "").trim() || appName.toLowerCase().replace(/\s+/g, "-");
|
|
8959
8905
|
const firebaseRegion = appConfig?.firebaseRegion ?? "europe-west1";
|
|
8960
|
-
const backendPlatform =
|
|
8906
|
+
const backendPlatform = backend !== "none" ? backend : "firebase";
|
|
8961
8907
|
const deployConfig = row.deployConfig;
|
|
8962
8908
|
const replacements = {
|
|
8963
8909
|
projectName: appName,
|
|
@@ -9295,11 +9241,13 @@ Happy coding!`,
|
|
|
9295
9241
|
}
|
|
9296
9242
|
async function main(options) {
|
|
9297
9243
|
try {
|
|
9298
|
-
const hasExplicitFlags = options?.builder !== void 0 || options?.functions !== void 0;
|
|
9244
|
+
const hasExplicitFlags = options?.builder !== void 0 || options?.host !== void 0 || options?.functions !== void 0 || options?.backend !== void 0;
|
|
9299
9245
|
if (hasExplicitFlags && options?.name) {
|
|
9300
9246
|
const appName = options.name;
|
|
9301
9247
|
const builder = options.builder || "vite";
|
|
9302
|
-
const
|
|
9248
|
+
const hostOpt = options.host ?? "none";
|
|
9249
|
+
const functionsOpt = options.functions ?? "none";
|
|
9250
|
+
const backendOpt = options.backend ?? "none";
|
|
9303
9251
|
if (!isValidFileName(appName)) {
|
|
9304
9252
|
throw new Error(
|
|
9305
9253
|
`Invalid app name "${appName}". Use only letters, numbers, dashes (-), and underscores (_).`
|
|
@@ -9312,8 +9260,9 @@ async function main(options) {
|
|
|
9312
9260
|
}
|
|
9313
9261
|
const appConfig = {
|
|
9314
9262
|
template: builder === "next" ? "nextjs" : builder === "expo" ? "expo" : "vite",
|
|
9315
|
-
|
|
9316
|
-
|
|
9263
|
+
host: hostOpt,
|
|
9264
|
+
functions: functionsOpt,
|
|
9265
|
+
backend: backendOpt,
|
|
9317
9266
|
needsCRUD: true,
|
|
9318
9267
|
selectedEntities: [],
|
|
9319
9268
|
userAuth: "social",
|