@donotdev/cli 0.0.16 → 0.0.17
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 +33 -129
- package/dist/bin/commands/bump.js +9 -2
- package/dist/bin/commands/create-app.js +195 -40
- package/dist/bin/commands/create-project.js +195 -40
- package/dist/bin/commands/deploy.js +51 -20
- package/dist/bin/commands/doctor.js +249 -56
- package/dist/bin/commands/emu.js +18 -20
- package/dist/bin/commands/make-admin.js +30 -10
- package/dist/bin/commands/setup.js +512 -122
- package/dist/bin/commands/type-check.d.ts.map +1 -1
- package/dist/bin/commands/type-check.js +7 -3
- package/dist/bin/commands/type-check.js.map +1 -1
- package/dist/bin/donotdev.js +26 -14
- package/dist/index.js +264 -80
- package/package.json +1 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +6 -6
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -1086
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +68 -16
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +123 -32
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
- package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
- package/dist/bin/commands/firebase-setup.d.ts +0 -6
- package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
- package/dist/bin/commands/firebase-setup.js +0 -7
- package/dist/bin/commands/firebase-setup.js.map +0 -1
- package/dist/bin/commands/supabase-setup.d.ts +0 -6
- package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
- package/dist/bin/commands/supabase-setup.js +0 -7
- package/dist/bin/commands/supabase-setup.js.map +0 -1
|
@@ -8714,7 +8714,11 @@ function getMatrixPath(mode) {
|
|
|
8714
8714
|
const executionMode = mode || detectExecutionMode();
|
|
8715
8715
|
if (executionMode === "development") {
|
|
8716
8716
|
const templatesRoot = getTemplatesRoot();
|
|
8717
|
-
const devPath = normalizePath(
|
|
8717
|
+
const devPath = normalizePath(
|
|
8718
|
+
templatesRoot,
|
|
8719
|
+
"..",
|
|
8720
|
+
"dependencies-matrix.json"
|
|
8721
|
+
);
|
|
8718
8722
|
if (pathExists(devPath)) {
|
|
8719
8723
|
return devPath;
|
|
8720
8724
|
}
|
|
@@ -9066,18 +9070,102 @@ init_pathResolver();
|
|
|
9066
9070
|
// packages/tooling/src/scaffolding/scaffold-matrix.ts
|
|
9067
9071
|
init_utils();
|
|
9068
9072
|
var MATRIX = [
|
|
9069
|
-
{
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
{
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9073
|
+
{
|
|
9074
|
+
builder: "vite",
|
|
9075
|
+
backend: "none",
|
|
9076
|
+
baseTemplate: "app-vite",
|
|
9077
|
+
overlay: null,
|
|
9078
|
+
deployConfig: null,
|
|
9079
|
+
functionsTemplate: null
|
|
9080
|
+
},
|
|
9081
|
+
{
|
|
9082
|
+
builder: "vite",
|
|
9083
|
+
backend: "firebase",
|
|
9084
|
+
baseTemplate: "app-vite",
|
|
9085
|
+
overlay: "overlay-firebase",
|
|
9086
|
+
deployConfig: "firebase",
|
|
9087
|
+
functionsTemplate: "functions-firebase"
|
|
9088
|
+
},
|
|
9089
|
+
{
|
|
9090
|
+
builder: "vite",
|
|
9091
|
+
backend: "supabase",
|
|
9092
|
+
baseTemplate: "app-vite",
|
|
9093
|
+
overlay: "overlay-supabase",
|
|
9094
|
+
deployConfig: "vercel-supabase",
|
|
9095
|
+
functionsTemplate: "functions-supabase"
|
|
9096
|
+
},
|
|
9097
|
+
{
|
|
9098
|
+
builder: "vite",
|
|
9099
|
+
backend: "vercel",
|
|
9100
|
+
baseTemplate: "app-vite",
|
|
9101
|
+
overlay: "overlay-vercel",
|
|
9102
|
+
deployConfig: "vercel-vercel",
|
|
9103
|
+
functionsTemplate: "functions-vercel"
|
|
9104
|
+
},
|
|
9105
|
+
{
|
|
9106
|
+
builder: "nextjs",
|
|
9107
|
+
backend: "none",
|
|
9108
|
+
baseTemplate: "app-next",
|
|
9109
|
+
overlay: null,
|
|
9110
|
+
deployConfig: null,
|
|
9111
|
+
functionsTemplate: null
|
|
9112
|
+
},
|
|
9113
|
+
{
|
|
9114
|
+
builder: "nextjs",
|
|
9115
|
+
backend: "firebase",
|
|
9116
|
+
baseTemplate: "app-next",
|
|
9117
|
+
overlay: "overlay-firebase",
|
|
9118
|
+
deployConfig: "firebase",
|
|
9119
|
+
functionsTemplate: "functions-firebase"
|
|
9120
|
+
},
|
|
9121
|
+
{
|
|
9122
|
+
builder: "nextjs",
|
|
9123
|
+
backend: "supabase",
|
|
9124
|
+
baseTemplate: "app-next",
|
|
9125
|
+
overlay: "overlay-supabase",
|
|
9126
|
+
deployConfig: "vercel-supabase",
|
|
9127
|
+
functionsTemplate: "functions-supabase"
|
|
9128
|
+
},
|
|
9129
|
+
{
|
|
9130
|
+
builder: "nextjs",
|
|
9131
|
+
backend: "vercel",
|
|
9132
|
+
baseTemplate: "app-next",
|
|
9133
|
+
overlay: "overlay-vercel",
|
|
9134
|
+
deployConfig: "vercel-vercel",
|
|
9135
|
+
functionsTemplate: "functions-vercel"
|
|
9136
|
+
},
|
|
9137
|
+
{
|
|
9138
|
+
builder: "expo",
|
|
9139
|
+
backend: "none",
|
|
9140
|
+
baseTemplate: "app-expo",
|
|
9141
|
+
overlay: null,
|
|
9142
|
+
deployConfig: null,
|
|
9143
|
+
functionsTemplate: null
|
|
9144
|
+
},
|
|
9145
|
+
{
|
|
9146
|
+
builder: "expo",
|
|
9147
|
+
backend: "firebase",
|
|
9148
|
+
baseTemplate: "app-expo",
|
|
9149
|
+
overlay: "overlay-firebase",
|
|
9150
|
+
deployConfig: null,
|
|
9151
|
+
functionsTemplate: "functions-firebase"
|
|
9152
|
+
},
|
|
9153
|
+
{
|
|
9154
|
+
builder: "expo",
|
|
9155
|
+
backend: "supabase",
|
|
9156
|
+
baseTemplate: "app-expo",
|
|
9157
|
+
overlay: "overlay-supabase",
|
|
9158
|
+
deployConfig: null,
|
|
9159
|
+
functionsTemplate: "functions-supabase"
|
|
9160
|
+
},
|
|
9161
|
+
{
|
|
9162
|
+
builder: "demo",
|
|
9163
|
+
backend: "none",
|
|
9164
|
+
baseTemplate: "app-demo",
|
|
9165
|
+
overlay: null,
|
|
9166
|
+
deployConfig: null,
|
|
9167
|
+
functionsTemplate: null
|
|
9168
|
+
}
|
|
9081
9169
|
];
|
|
9082
9170
|
function comboKey(builder, backend) {
|
|
9083
9171
|
return `${builder}-${backend}`;
|
|
@@ -9090,7 +9178,9 @@ function getScaffoldRow(builder, backend) {
|
|
|
9090
9178
|
const key = comboKey(builder, backend);
|
|
9091
9179
|
const row = ROWS_BY_KEY.get(key);
|
|
9092
9180
|
if (!row) {
|
|
9093
|
-
throw new Error(
|
|
9181
|
+
throw new Error(
|
|
9182
|
+
`Unsupported scaffold combo: ${key}. Supported: ${[...ROWS_BY_KEY.keys()].join(", ")}`
|
|
9183
|
+
);
|
|
9094
9184
|
}
|
|
9095
9185
|
return row;
|
|
9096
9186
|
}
|
|
@@ -9246,13 +9336,16 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9246
9336
|
const variantFile = `src/config/providers.${appTemplate}.ts.example`;
|
|
9247
9337
|
if (overlayFiles.includes(variantFile)) continue;
|
|
9248
9338
|
}
|
|
9249
|
-
const providersVariant = file.match(
|
|
9339
|
+
const providersVariant = file.match(
|
|
9340
|
+
/^src\/config\/providers\.(\w+)\.ts\.example$/
|
|
9341
|
+
);
|
|
9250
9342
|
if (providersVariant) {
|
|
9251
9343
|
if (providersVariant[1] !== appTemplate) continue;
|
|
9252
9344
|
const destPath2 = joinPath(appDir, "src/config/providers.ts");
|
|
9253
9345
|
await ensureDir(getDirname(destPath2));
|
|
9254
9346
|
await copy(joinPath(overlayDir, file), destPath2, { overwrite: true });
|
|
9255
|
-
if (await isTextFile(destPath2))
|
|
9347
|
+
if (await isTextFile(destPath2))
|
|
9348
|
+
await replacePlaceholders(destPath2, replacements);
|
|
9256
9349
|
continue;
|
|
9257
9350
|
}
|
|
9258
9351
|
const sourcePath = joinPath(overlayDir, file);
|
|
@@ -9277,16 +9370,28 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9277
9370
|
}
|
|
9278
9371
|
if (deployConfig === "vercel-supabase") {
|
|
9279
9372
|
const vercelPath = joinPath(appDir, "vercel.json");
|
|
9280
|
-
const headersFragmentPath = joinPath(
|
|
9373
|
+
const headersFragmentPath = joinPath(
|
|
9374
|
+
overlayDir,
|
|
9375
|
+
"vercel.headers.example"
|
|
9376
|
+
);
|
|
9281
9377
|
const fullVercelPath = joinPath(overlayDir, "vercel.json.example");
|
|
9282
9378
|
if (pathExists(vercelPath) && pathExists(headersFragmentPath)) {
|
|
9283
9379
|
const vercelJson = readSync(vercelPath, { format: "json" });
|
|
9284
|
-
const headersFragment = readSync(headersFragmentPath, {
|
|
9285
|
-
|
|
9286
|
-
|
|
9380
|
+
const headersFragment = readSync(headersFragmentPath, {
|
|
9381
|
+
format: "json"
|
|
9382
|
+
});
|
|
9383
|
+
vercelJson.headers = [
|
|
9384
|
+
...vercelJson.headers ?? [],
|
|
9385
|
+
...headersFragment
|
|
9386
|
+
];
|
|
9387
|
+
await write(vercelPath, vercelJson, {
|
|
9388
|
+
format: "json",
|
|
9389
|
+
overwrite: true
|
|
9390
|
+
});
|
|
9287
9391
|
} else if (pathExists(fullVercelPath)) {
|
|
9288
9392
|
await copy(fullVercelPath, vercelPath);
|
|
9289
|
-
if (await isTextFile(vercelPath))
|
|
9393
|
+
if (await isTextFile(vercelPath))
|
|
9394
|
+
await replacePlaceholders(vercelPath, replacements);
|
|
9290
9395
|
}
|
|
9291
9396
|
}
|
|
9292
9397
|
}
|
|
@@ -9306,9 +9411,13 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9306
9411
|
});
|
|
9307
9412
|
if (row.functionsTemplate) {
|
|
9308
9413
|
const functionsTemplateName = row.functionsTemplate;
|
|
9309
|
-
const functionsTemplateExists = pathExists(
|
|
9414
|
+
const functionsTemplateExists = pathExists(
|
|
9415
|
+
joinPath(templatesRoot, functionsTemplateName)
|
|
9416
|
+
);
|
|
9310
9417
|
if (!functionsTemplateExists) {
|
|
9311
|
-
log.warn(
|
|
9418
|
+
log.warn(
|
|
9419
|
+
`Functions template "${functionsTemplateName}" not found \u2014 skipping functions scaffolding.`
|
|
9420
|
+
);
|
|
9312
9421
|
} else {
|
|
9313
9422
|
const isSupabaseFunctions = functionsTemplateName === "functions-supabase";
|
|
9314
9423
|
const functionsRootDir = isSupabaseFunctions ? appDir : joinPath(appDir, "functions");
|
|
@@ -9316,7 +9425,10 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9316
9425
|
const functionsPackageJson = generatePackageJson(
|
|
9317
9426
|
functionsTemplateName,
|
|
9318
9427
|
executionMode,
|
|
9319
|
-
{
|
|
9428
|
+
{
|
|
9429
|
+
appName,
|
|
9430
|
+
platform: row.functionsTemplate.replace("functions-", "")
|
|
9431
|
+
}
|
|
9320
9432
|
);
|
|
9321
9433
|
const packageJsonPath2 = joinPath(functionsRootDir, "package.json");
|
|
9322
9434
|
await ensureDir(functionsRootDir);
|
|
@@ -9352,13 +9464,19 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9352
9464
|
}
|
|
9353
9465
|
const deploymentTemplateDir = joinPath(templatesRoot, "root-consumer");
|
|
9354
9466
|
if (deployConfig === "firebase") {
|
|
9355
|
-
const firebaseJsonSource = joinPath(
|
|
9467
|
+
const firebaseJsonSource = joinPath(
|
|
9468
|
+
deploymentTemplateDir,
|
|
9469
|
+
"firebase.json.example"
|
|
9470
|
+
);
|
|
9356
9471
|
if (pathExists(firebaseJsonSource)) {
|
|
9357
9472
|
await copy(firebaseJsonSource, joinPath(appDir, "firebase.json"));
|
|
9358
9473
|
const firebaseJsonDest = joinPath(appDir, "firebase.json");
|
|
9359
|
-
if (await isTextFile(firebaseJsonDest))
|
|
9474
|
+
if (await isTextFile(firebaseJsonDest))
|
|
9475
|
+
await replacePlaceholders(firebaseJsonDest, replacements);
|
|
9360
9476
|
if (appTemplate === "nextjs") {
|
|
9361
|
-
const firebaseJson = readSync(firebaseJsonDest, {
|
|
9477
|
+
const firebaseJson = readSync(firebaseJsonDest, {
|
|
9478
|
+
format: "json"
|
|
9479
|
+
});
|
|
9362
9480
|
if (firebaseJson.hosting?.rewrites) {
|
|
9363
9481
|
firebaseJson.hosting.rewrites = firebaseJson.hosting.rewrites.filter(
|
|
9364
9482
|
(r2) => r2.destination !== "/index.html"
|
|
@@ -9367,17 +9485,28 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9367
9485
|
if (firebaseJson.hosting) {
|
|
9368
9486
|
firebaseJson.hosting.public = "out";
|
|
9369
9487
|
}
|
|
9370
|
-
await write(firebaseJsonDest, firebaseJson, {
|
|
9488
|
+
await write(firebaseJsonDest, firebaseJson, {
|
|
9489
|
+
format: "json",
|
|
9490
|
+
overwrite: true
|
|
9491
|
+
});
|
|
9371
9492
|
}
|
|
9372
9493
|
}
|
|
9373
|
-
const firebasercSource = joinPath(
|
|
9494
|
+
const firebasercSource = joinPath(
|
|
9495
|
+
deploymentTemplateDir,
|
|
9496
|
+
".firebaserc.example"
|
|
9497
|
+
);
|
|
9374
9498
|
if (pathExists(firebasercSource)) {
|
|
9375
9499
|
await copy(firebasercSource, joinPath(appDir, ".firebaserc"));
|
|
9376
9500
|
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9377
|
-
if (await isTextFile(firebasercDest))
|
|
9501
|
+
if (await isTextFile(firebasercDest))
|
|
9502
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9378
9503
|
}
|
|
9379
9504
|
if (row.functionsTemplate === "functions-firebase") {
|
|
9380
|
-
for (const example of [
|
|
9505
|
+
for (const example of [
|
|
9506
|
+
"firestore.rules.example",
|
|
9507
|
+
"firestore.indexes.json.example",
|
|
9508
|
+
"storage.rules.example"
|
|
9509
|
+
]) {
|
|
9381
9510
|
const src = joinPath(deploymentTemplateDir, example);
|
|
9382
9511
|
if (pathExists(src)) {
|
|
9383
9512
|
await copy(src, joinPath(appDir, example.replace(".example", "")));
|
|
@@ -9393,11 +9522,22 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9393
9522
|
{
|
|
9394
9523
|
source: "functions",
|
|
9395
9524
|
codebase: "default",
|
|
9396
|
-
ignore: [
|
|
9525
|
+
ignore: [
|
|
9526
|
+
"node_modules",
|
|
9527
|
+
".git",
|
|
9528
|
+
"firebase-debug.log",
|
|
9529
|
+
"firebase-debug.*.log",
|
|
9530
|
+
"**/.*",
|
|
9531
|
+
"**/*.test.ts",
|
|
9532
|
+
"**/__tests__/**"
|
|
9533
|
+
],
|
|
9397
9534
|
runtime: "nodejs22"
|
|
9398
9535
|
}
|
|
9399
9536
|
],
|
|
9400
|
-
firestore: {
|
|
9537
|
+
firestore: {
|
|
9538
|
+
rules: "firestore.rules",
|
|
9539
|
+
indexes: "firestore.indexes.json"
|
|
9540
|
+
},
|
|
9401
9541
|
storage: { rules: "storage.rules" },
|
|
9402
9542
|
emulators: {
|
|
9403
9543
|
auth: { port: 9099 },
|
|
@@ -9407,15 +9547,26 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9407
9547
|
ui: { enabled: true, port: 4e3 }
|
|
9408
9548
|
}
|
|
9409
9549
|
};
|
|
9410
|
-
await write(firebaseJsonPath, expoFirebaseJson, {
|
|
9550
|
+
await write(firebaseJsonPath, expoFirebaseJson, {
|
|
9551
|
+
format: "json",
|
|
9552
|
+
overwrite: true
|
|
9553
|
+
});
|
|
9411
9554
|
}
|
|
9412
|
-
const firebasercSource = joinPath(
|
|
9555
|
+
const firebasercSource = joinPath(
|
|
9556
|
+
deploymentTemplateDir,
|
|
9557
|
+
".firebaserc.example"
|
|
9558
|
+
);
|
|
9413
9559
|
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9414
9560
|
if (pathExists(firebasercSource) && !pathExists(firebasercDest)) {
|
|
9415
9561
|
await copy(firebasercSource, firebasercDest);
|
|
9416
|
-
if (await isTextFile(firebasercDest))
|
|
9417
|
-
|
|
9418
|
-
|
|
9562
|
+
if (await isTextFile(firebasercDest))
|
|
9563
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9564
|
+
}
|
|
9565
|
+
for (const example of [
|
|
9566
|
+
"firestore.rules.example",
|
|
9567
|
+
"firestore.indexes.json.example",
|
|
9568
|
+
"storage.rules.example"
|
|
9569
|
+
]) {
|
|
9419
9570
|
const src = joinPath(deploymentTemplateDir, example);
|
|
9420
9571
|
const dest = joinPath(appDir, example.replace(".example", ""));
|
|
9421
9572
|
if (pathExists(src) && !pathExists(dest)) {
|
|
@@ -9424,11 +9575,15 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9424
9575
|
}
|
|
9425
9576
|
}
|
|
9426
9577
|
if (deployConfig === "vercel-vercel") {
|
|
9427
|
-
const vercelJsonSource = joinPath(
|
|
9578
|
+
const vercelJsonSource = joinPath(
|
|
9579
|
+
deploymentTemplateDir,
|
|
9580
|
+
"vercel.json.example"
|
|
9581
|
+
);
|
|
9428
9582
|
if (pathExists(vercelJsonSource)) {
|
|
9429
9583
|
await copy(vercelJsonSource, joinPath(appDir, "vercel.json"));
|
|
9430
9584
|
const vercelJsonDest = joinPath(appDir, "vercel.json");
|
|
9431
|
-
if (await isTextFile(vercelJsonDest))
|
|
9585
|
+
if (await isTextFile(vercelJsonDest))
|
|
9586
|
+
await replacePlaceholders(vercelJsonDest, replacements);
|
|
9432
9587
|
}
|
|
9433
9588
|
}
|
|
9434
9589
|
const backendInfo = row.functionsTemplate ? ` with ${row.functionsTemplate.replace("functions-", "")} functions` : "";
|
|
@@ -7951,7 +7951,14 @@ function readServiceAccountKey(filePath) {
|
|
|
7951
7951
|
throw new DoNotDevError(
|
|
7952
7952
|
`Invalid service account key: missing required fields`,
|
|
7953
7953
|
DO_NOT_DEV_ERROR_CODES.CONFIG_INVALID,
|
|
7954
|
-
{
|
|
7954
|
+
{
|
|
7955
|
+
context: {
|
|
7956
|
+
filePath,
|
|
7957
|
+
missingFields: ["project_id", "private_key", "client_email"].filter(
|
|
7958
|
+
(f) => !key[f]
|
|
7959
|
+
)
|
|
7960
|
+
}
|
|
7961
|
+
}
|
|
7955
7962
|
);
|
|
7956
7963
|
}
|
|
7957
7964
|
return content;
|
|
@@ -8198,9 +8205,7 @@ function getCLIInstallInstructions(tool) {
|
|
|
8198
8205
|
"Or: winget install Supabase.CLI",
|
|
8199
8206
|
"Or download from: https://github.com/supabase/cli/releases"
|
|
8200
8207
|
],
|
|
8201
|
-
darwin: [
|
|
8202
|
-
"brew install supabase/tap/supabase"
|
|
8203
|
-
],
|
|
8208
|
+
darwin: ["brew install supabase/tap/supabase"],
|
|
8204
8209
|
linux: [
|
|
8205
8210
|
"brew install supabase/tap/supabase",
|
|
8206
8211
|
"Or see: https://supabase.com/docs/guides/cli"
|
|
@@ -8208,7 +8213,11 @@ function getCLIInstallInstructions(tool) {
|
|
|
8208
8213
|
},
|
|
8209
8214
|
[CLI_TOOLS.VERCEL]: {
|
|
8210
8215
|
win32: ["npm install -g vercel", "Or: npx vercel (no install)"],
|
|
8211
|
-
darwin: [
|
|
8216
|
+
darwin: [
|
|
8217
|
+
"npm install -g vercel",
|
|
8218
|
+
"Or: brew install vercel",
|
|
8219
|
+
"Or: npx vercel"
|
|
8220
|
+
],
|
|
8212
8221
|
linux: ["npm install -g vercel", "Or: npx vercel"]
|
|
8213
8222
|
},
|
|
8214
8223
|
[CLI_TOOLS.SENTRY_CLI]: {
|
|
@@ -16356,7 +16365,9 @@ async function deploySupabaseFunctions(appDir, config) {
|
|
|
16356
16365
|
const supabaseDir = joinPath(appDir, "supabase");
|
|
16357
16366
|
const functionsDir = joinPath(supabaseDir, "functions");
|
|
16358
16367
|
if (!pathExists(functionsDir)) {
|
|
16359
|
-
log.warn(
|
|
16368
|
+
log.warn(
|
|
16369
|
+
"No supabase/functions/ directory found. Skipping Supabase functions deployment."
|
|
16370
|
+
);
|
|
16360
16371
|
return;
|
|
16361
16372
|
}
|
|
16362
16373
|
requireCLI(
|
|
@@ -16372,10 +16383,14 @@ async function deploySupabaseFunctions(appDir, config) {
|
|
|
16372
16383
|
return pathExists(indexPath);
|
|
16373
16384
|
});
|
|
16374
16385
|
if (functionDirs.length === 0) {
|
|
16375
|
-
log.warn(
|
|
16386
|
+
log.warn(
|
|
16387
|
+
"No Edge Functions found in supabase/functions/. Skipping deployment."
|
|
16388
|
+
);
|
|
16376
16389
|
return;
|
|
16377
16390
|
}
|
|
16378
|
-
log.info(
|
|
16391
|
+
log.info(
|
|
16392
|
+
`Found ${functionDirs.length} Edge Function(s): ${functionDirs.join(", ")}`
|
|
16393
|
+
);
|
|
16379
16394
|
const s = Y2();
|
|
16380
16395
|
for (const functionName of functionDirs) {
|
|
16381
16396
|
s.start(`Deploying Edge Function: ${functionName}...`);
|
|
@@ -16394,7 +16409,12 @@ async function deploySupabaseFunctions(appDir, config) {
|
|
|
16394
16409
|
throw new DoNotDevError(
|
|
16395
16410
|
`Failed to deploy Supabase Edge Function: ${functionName}`,
|
|
16396
16411
|
"deployment-failed",
|
|
16397
|
-
{
|
|
16412
|
+
{
|
|
16413
|
+
context: {
|
|
16414
|
+
functionName,
|
|
16415
|
+
error: error2 instanceof Error ? error2.message : String(error2)
|
|
16416
|
+
}
|
|
16417
|
+
}
|
|
16398
16418
|
);
|
|
16399
16419
|
}
|
|
16400
16420
|
}
|
|
@@ -16548,7 +16568,12 @@ init_utils();
|
|
|
16548
16568
|
async function deployFrontend(appDir, serviceAccountPath, projectId, config) {
|
|
16549
16569
|
const s = Y2();
|
|
16550
16570
|
s.start("Deploying frontend to Firebase Hosting...");
|
|
16551
|
-
const args = buildFirebaseDeployArgs(
|
|
16571
|
+
const args = buildFirebaseDeployArgs(
|
|
16572
|
+
"hosting",
|
|
16573
|
+
projectId,
|
|
16574
|
+
config.debug,
|
|
16575
|
+
config.force ?? true
|
|
16576
|
+
);
|
|
16552
16577
|
const result = executeFirebaseCommand(args, {
|
|
16553
16578
|
cwd: appDir,
|
|
16554
16579
|
serviceAccountPath,
|
|
@@ -16595,7 +16620,9 @@ async function deployVercelFrontend(appDir, _config) {
|
|
|
16595
16620
|
if (result.status !== 0) {
|
|
16596
16621
|
s.stop("Vercel deployment failed");
|
|
16597
16622
|
const errOutput = result.stderr?.trim();
|
|
16598
|
-
throw new Error(
|
|
16623
|
+
throw new Error(
|
|
16624
|
+
errOutput || `Vercel deploy exited with code ${result.status}`
|
|
16625
|
+
);
|
|
16599
16626
|
}
|
|
16600
16627
|
s.stop("Frontend deployed to Vercel");
|
|
16601
16628
|
} catch (err) {
|
|
@@ -17052,7 +17079,12 @@ async function deployRules(appDir, serviceAccountPath, projectId, config, option
|
|
|
17052
17079
|
const targetNames = targets.join(", ");
|
|
17053
17080
|
const s = Y2();
|
|
17054
17081
|
s.start(`Deploying ${targetNames}...`);
|
|
17055
|
-
const args = buildFirebaseDeployArgs(
|
|
17082
|
+
const args = buildFirebaseDeployArgs(
|
|
17083
|
+
targets,
|
|
17084
|
+
projectId,
|
|
17085
|
+
config.debug,
|
|
17086
|
+
config.force ?? true
|
|
17087
|
+
);
|
|
17056
17088
|
const result = executeFirebaseCommand(args, {
|
|
17057
17089
|
cwd: appDir,
|
|
17058
17090
|
serviceAccountPath,
|
|
@@ -17426,13 +17458,17 @@ async function main2(options = {}) {
|
|
|
17426
17458
|
const availableApps = detectAvailableApps();
|
|
17427
17459
|
if (availableApps.length === 0) {
|
|
17428
17460
|
if (providerInfo.hasSupabase && !providerInfo.hasFirebase) {
|
|
17429
|
-
log.info(
|
|
17461
|
+
log.info(
|
|
17462
|
+
"Supabase project detected. Deploying Supabase resources..."
|
|
17463
|
+
);
|
|
17430
17464
|
} else {
|
|
17431
17465
|
log.info("No apps with firebase.json or supabase/ directory found.");
|
|
17432
17466
|
log.info(
|
|
17433
17467
|
"To deploy, ensure your app has a firebase.json or supabase/ configuration."
|
|
17434
17468
|
);
|
|
17435
|
-
log.info(
|
|
17469
|
+
log.info(
|
|
17470
|
+
"Run from a DoNotDev project, or create one with: dndev init"
|
|
17471
|
+
);
|
|
17436
17472
|
return;
|
|
17437
17473
|
}
|
|
17438
17474
|
}
|
|
@@ -17712,12 +17748,7 @@ async function main2(options = {}) {
|
|
|
17712
17748
|
}
|
|
17713
17749
|
}
|
|
17714
17750
|
}
|
|
17715
|
-
await deployFunctions(
|
|
17716
|
-
appDir,
|
|
17717
|
-
serviceAccountPath,
|
|
17718
|
-
config.project,
|
|
17719
|
-
config
|
|
17720
|
-
);
|
|
17751
|
+
await deployFunctions(appDir, serviceAccountPath, config.project, config);
|
|
17721
17752
|
}
|
|
17722
17753
|
if (shouldDeployFirebaseRules && serviceAccountPath && config.project && appProviderInfo.firebaseConfig) {
|
|
17723
17754
|
await deployRules(appDir, serviceAccountPath, config.project, config, {
|