@donotdev/cli 0.0.15 → 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 +67 -147
- package/dist/bin/commands/build.js +69 -52
- package/dist/bin/commands/bump.js +15 -14
- package/dist/bin/commands/create-app.js +258 -55
- package/dist/bin/commands/create-project.js +290 -161
- package/dist/bin/commands/deploy.js +146 -63
- package/dist/bin/commands/dev.js +43 -24
- package/dist/bin/commands/doctor.d.ts +6 -0
- package/dist/bin/commands/doctor.d.ts.map +1 -0
- package/dist/bin/commands/{lint.js → doctor.js} +1370 -146
- package/dist/bin/commands/doctor.js.map +1 -0
- package/dist/bin/commands/emu.js +295 -107
- package/dist/bin/commands/make-admin.js +77519 -11
- package/dist/bin/commands/preview.js +44 -25
- package/dist/bin/commands/setup.d.ts +6 -0
- package/dist/bin/commands/setup.d.ts.map +1 -0
- package/dist/bin/commands/setup.js +12123 -0
- package/dist/bin/commands/setup.js.map +1 -0
- package/dist/bin/commands/type-check.d.ts.map +1 -1
- package/dist/bin/commands/type-check.js +2022 -283
- package/dist/bin/commands/type-check.js.map +1 -1
- package/dist/bin/dndev.js +54 -58
- package/dist/bin/donotdev.js +54 -58
- package/dist/index.js +860 -459
- package/package.json +2 -2
- package/templates/app-expo/.env.example +2 -22
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/assets/adaptive-icon.png +0 -0
- package/templates/app-expo/assets/favicon.png +0 -0
- package/templates/app-expo/assets/icon.png +0 -0
- package/templates/app-expo/assets/splash.png +0 -0
- package/templates/app-expo/src/config/app.ts.example +46 -0
- package/templates/app-expo/src/config/providers.ts.example +7 -0
- package/templates/app-next/src/config/providers.ts.example +7 -0
- package/templates/app-vite/src/config/providers.ts.example +7 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
- package/templates/functions-firebase/README.md.example +1 -1
- package/templates/functions-firebase/functions-firebase/.env.example.example +1 -1
- package/templates/functions-firebase/functions-firebase/README.md.example +1 -1
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
- package/templates/functions-firebase/functions.config.js.example +1 -1
- package/templates/functions-supabase/supabase/config.toml.example +59 -0
- package/templates/functions-supabase/supabase/functions/.env.example +13 -0
- package/templates/functions-supabase/supabase/functions/deno.json.example +8 -0
- 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 +8 -3
- package/templates/overlay-supabase/env.fragment.expo.example +8 -3
- package/templates/overlay-supabase/env.fragment.nextjs.example +8 -3
- package/templates/overlay-vercel/env.fragment.example +1 -1
- package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
- package/templates/root-consumer/AI.md.example +15 -0
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +2 -2
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +12 -12
- package/templates/root-consumer/guides/dndev/INDEX.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -988
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +72 -20
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +60 -0
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +62 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -33
- 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/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +7 -8
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +9 -5
- 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/lint.d.ts +0 -11
- package/dist/bin/commands/lint.d.ts.map +0 -1
- package/dist/bin/commands/lint.js.map +0 -1
- package/dist/bin/commands/staging.d.ts +0 -11
- package/dist/bin/commands/staging.d.ts.map +0 -1
- package/dist/bin/commands/staging.js +0 -12
- package/dist/bin/commands/staging.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
|
@@ -8393,15 +8393,14 @@ function getMatrixPath(mode) {
|
|
|
8393
8393
|
}
|
|
8394
8394
|
const executionMode = mode || detectExecutionMode();
|
|
8395
8395
|
if (executionMode === "development") {
|
|
8396
|
-
const
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
}
|
|
8396
|
+
const templatesRoot = getTemplatesRoot();
|
|
8397
|
+
const devPath = normalizePath(
|
|
8398
|
+
templatesRoot,
|
|
8399
|
+
"..",
|
|
8400
|
+
"dependencies-matrix.json"
|
|
8401
|
+
);
|
|
8402
|
+
if (pathExists(devPath)) {
|
|
8403
|
+
return devPath;
|
|
8405
8404
|
}
|
|
8406
8405
|
}
|
|
8407
8406
|
return null;
|
|
@@ -8416,8 +8415,8 @@ function getCliVersion(mode) {
|
|
|
8416
8415
|
}
|
|
8417
8416
|
const executionMode = mode || detectExecutionMode();
|
|
8418
8417
|
if (executionMode === "development") {
|
|
8419
|
-
const
|
|
8420
|
-
const cliPackageJson =
|
|
8418
|
+
const templatesRoot = getTemplatesRoot();
|
|
8419
|
+
const cliPackageJson = normalizePath(templatesRoot, "..", "package.json");
|
|
8421
8420
|
if (pathExists(cliPackageJson)) {
|
|
8422
8421
|
const pkg = readSync(cliPackageJson, { format: "json" });
|
|
8423
8422
|
return String(pkg?.version || "0.0.0");
|
|
@@ -8706,7 +8705,7 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
8706
8705
|
}
|
|
8707
8706
|
if (templateName.includes("functions")) {
|
|
8708
8707
|
result.main = "lib/index.js";
|
|
8709
|
-
result.engines = { node: "
|
|
8708
|
+
result.engines = { node: "22" };
|
|
8710
8709
|
if (options.appName) {
|
|
8711
8710
|
const platform = templateName.includes("vercel") ? "Vercel" : "Firebase";
|
|
8712
8711
|
result.description = `${options.appName} ${platform} Functions`;
|
|
@@ -8751,18 +8750,102 @@ init_pathResolver();
|
|
|
8751
8750
|
// packages/tooling/src/scaffolding/scaffold-matrix.ts
|
|
8752
8751
|
init_utils();
|
|
8753
8752
|
var MATRIX = [
|
|
8754
|
-
{
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
{
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8753
|
+
{
|
|
8754
|
+
builder: "vite",
|
|
8755
|
+
backend: "none",
|
|
8756
|
+
baseTemplate: "app-vite",
|
|
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
|
+
}
|
|
8766
8849
|
];
|
|
8767
8850
|
function comboKey(builder, backend) {
|
|
8768
8851
|
return `${builder}-${backend}`;
|
|
@@ -8775,7 +8858,9 @@ function getScaffoldRow(builder, backend) {
|
|
|
8775
8858
|
const key = comboKey(builder, backend);
|
|
8776
8859
|
const row = ROWS_BY_KEY.get(key);
|
|
8777
8860
|
if (!row) {
|
|
8778
|
-
throw new Error(
|
|
8861
|
+
throw new Error(
|
|
8862
|
+
`Unsupported scaffold combo: ${key}. Supported: ${[...ROWS_BY_KEY.keys()].join(", ")}`
|
|
8863
|
+
);
|
|
8779
8864
|
}
|
|
8780
8865
|
return row;
|
|
8781
8866
|
}
|
|
@@ -8931,13 +9016,16 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8931
9016
|
const variantFile = `src/config/providers.${appTemplate}.ts.example`;
|
|
8932
9017
|
if (overlayFiles.includes(variantFile)) continue;
|
|
8933
9018
|
}
|
|
8934
|
-
const providersVariant = file.match(
|
|
9019
|
+
const providersVariant = file.match(
|
|
9020
|
+
/^src\/config\/providers\.(\w+)\.ts\.example$/
|
|
9021
|
+
);
|
|
8935
9022
|
if (providersVariant) {
|
|
8936
9023
|
if (providersVariant[1] !== appTemplate) continue;
|
|
8937
9024
|
const destPath2 = joinPath(appDir, "src/config/providers.ts");
|
|
8938
9025
|
await ensureDir(getDirname(destPath2));
|
|
8939
|
-
await copy(joinPath(overlayDir, file), destPath2);
|
|
8940
|
-
if (await isTextFile(destPath2))
|
|
9026
|
+
await copy(joinPath(overlayDir, file), destPath2, { overwrite: true });
|
|
9027
|
+
if (await isTextFile(destPath2))
|
|
9028
|
+
await replacePlaceholders(destPath2, replacements);
|
|
8941
9029
|
continue;
|
|
8942
9030
|
}
|
|
8943
9031
|
const sourcePath = joinPath(overlayDir, file);
|
|
@@ -8947,7 +9035,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8947
9035
|
}
|
|
8948
9036
|
const destPath = joinPath(appDir, destFileName);
|
|
8949
9037
|
await ensureDir(getDirname(destPath));
|
|
8950
|
-
await copy(sourcePath, destPath);
|
|
9038
|
+
await copy(sourcePath, destPath, { overwrite: true });
|
|
8951
9039
|
if (await isTextFile(destPath)) {
|
|
8952
9040
|
await replacePlaceholders(destPath, replacements);
|
|
8953
9041
|
}
|
|
@@ -8962,16 +9050,28 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8962
9050
|
}
|
|
8963
9051
|
if (deployConfig === "vercel-supabase") {
|
|
8964
9052
|
const vercelPath = joinPath(appDir, "vercel.json");
|
|
8965
|
-
const headersFragmentPath = joinPath(
|
|
9053
|
+
const headersFragmentPath = joinPath(
|
|
9054
|
+
overlayDir,
|
|
9055
|
+
"vercel.headers.example"
|
|
9056
|
+
);
|
|
8966
9057
|
const fullVercelPath = joinPath(overlayDir, "vercel.json.example");
|
|
8967
9058
|
if (pathExists(vercelPath) && pathExists(headersFragmentPath)) {
|
|
8968
9059
|
const vercelJson = readSync(vercelPath, { format: "json" });
|
|
8969
|
-
const headersFragment = readSync(headersFragmentPath, {
|
|
8970
|
-
|
|
8971
|
-
|
|
9060
|
+
const headersFragment = readSync(headersFragmentPath, {
|
|
9061
|
+
format: "json"
|
|
9062
|
+
});
|
|
9063
|
+
vercelJson.headers = [
|
|
9064
|
+
...vercelJson.headers ?? [],
|
|
9065
|
+
...headersFragment
|
|
9066
|
+
];
|
|
9067
|
+
await write(vercelPath, vercelJson, {
|
|
9068
|
+
format: "json",
|
|
9069
|
+
overwrite: true
|
|
9070
|
+
});
|
|
8972
9071
|
} else if (pathExists(fullVercelPath)) {
|
|
8973
9072
|
await copy(fullVercelPath, vercelPath);
|
|
8974
|
-
if (await isTextFile(vercelPath))
|
|
9073
|
+
if (await isTextFile(vercelPath))
|
|
9074
|
+
await replacePlaceholders(vercelPath, replacements);
|
|
8975
9075
|
}
|
|
8976
9076
|
}
|
|
8977
9077
|
}
|
|
@@ -8990,23 +9090,33 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8990
9090
|
overwrite: true
|
|
8991
9091
|
});
|
|
8992
9092
|
if (row.functionsTemplate) {
|
|
8993
|
-
const functionsRootDir = joinPath(appDir, "functions");
|
|
8994
9093
|
const functionsTemplateName = row.functionsTemplate;
|
|
8995
|
-
const functionsTemplateExists = pathExists(
|
|
9094
|
+
const functionsTemplateExists = pathExists(
|
|
9095
|
+
joinPath(templatesRoot, functionsTemplateName)
|
|
9096
|
+
);
|
|
8996
9097
|
if (!functionsTemplateExists) {
|
|
8997
|
-
log.warn(
|
|
8998
|
-
|
|
8999
|
-
const functionsPackageJson = generatePackageJson(
|
|
9000
|
-
functionsTemplateName,
|
|
9001
|
-
executionMode,
|
|
9002
|
-
{ appName, platform: row.functionsTemplate.replace("functions-", "") }
|
|
9098
|
+
log.warn(
|
|
9099
|
+
`Functions template "${functionsTemplateName}" not found \u2014 skipping functions scaffolding.`
|
|
9003
9100
|
);
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9101
|
+
} else {
|
|
9102
|
+
const isSupabaseFunctions = functionsTemplateName === "functions-supabase";
|
|
9103
|
+
const functionsRootDir = isSupabaseFunctions ? appDir : joinPath(appDir, "functions");
|
|
9104
|
+
if (!isSupabaseFunctions) {
|
|
9105
|
+
const functionsPackageJson = generatePackageJson(
|
|
9106
|
+
functionsTemplateName,
|
|
9107
|
+
executionMode,
|
|
9108
|
+
{
|
|
9109
|
+
appName,
|
|
9110
|
+
platform: row.functionsTemplate.replace("functions-", "")
|
|
9111
|
+
}
|
|
9112
|
+
);
|
|
9113
|
+
const packageJsonPath2 = joinPath(functionsRootDir, "package.json");
|
|
9114
|
+
await ensureDir(functionsRootDir);
|
|
9115
|
+
await write(packageJsonPath2, functionsPackageJson, {
|
|
9116
|
+
format: "json",
|
|
9117
|
+
overwrite: true
|
|
9118
|
+
});
|
|
9119
|
+
}
|
|
9010
9120
|
const templateDir2 = joinPath(templatesRoot, functionsTemplateName);
|
|
9011
9121
|
const templateFiles2 = await glob("**/*", {
|
|
9012
9122
|
cwd: templateDir2,
|
|
@@ -9034,20 +9144,49 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9034
9144
|
}
|
|
9035
9145
|
const deploymentTemplateDir = joinPath(templatesRoot, "root-consumer");
|
|
9036
9146
|
if (deployConfig === "firebase") {
|
|
9037
|
-
const firebaseJsonSource = joinPath(
|
|
9147
|
+
const firebaseJsonSource = joinPath(
|
|
9148
|
+
deploymentTemplateDir,
|
|
9149
|
+
"firebase.json.example"
|
|
9150
|
+
);
|
|
9038
9151
|
if (pathExists(firebaseJsonSource)) {
|
|
9039
9152
|
await copy(firebaseJsonSource, joinPath(appDir, "firebase.json"));
|
|
9040
9153
|
const firebaseJsonDest = joinPath(appDir, "firebase.json");
|
|
9041
|
-
if (await isTextFile(firebaseJsonDest))
|
|
9154
|
+
if (await isTextFile(firebaseJsonDest))
|
|
9155
|
+
await replacePlaceholders(firebaseJsonDest, replacements);
|
|
9156
|
+
if (appTemplate === "nextjs") {
|
|
9157
|
+
const firebaseJson = readSync(firebaseJsonDest, {
|
|
9158
|
+
format: "json"
|
|
9159
|
+
});
|
|
9160
|
+
if (firebaseJson.hosting?.rewrites) {
|
|
9161
|
+
firebaseJson.hosting.rewrites = firebaseJson.hosting.rewrites.filter(
|
|
9162
|
+
(r2) => r2.destination !== "/index.html"
|
|
9163
|
+
);
|
|
9164
|
+
}
|
|
9165
|
+
if (firebaseJson.hosting) {
|
|
9166
|
+
firebaseJson.hosting.public = "out";
|
|
9167
|
+
}
|
|
9168
|
+
await write(firebaseJsonDest, firebaseJson, {
|
|
9169
|
+
format: "json",
|
|
9170
|
+
overwrite: true
|
|
9171
|
+
});
|
|
9172
|
+
}
|
|
9042
9173
|
}
|
|
9043
|
-
const firebasercSource = joinPath(
|
|
9174
|
+
const firebasercSource = joinPath(
|
|
9175
|
+
deploymentTemplateDir,
|
|
9176
|
+
".firebaserc.example"
|
|
9177
|
+
);
|
|
9044
9178
|
if (pathExists(firebasercSource)) {
|
|
9045
9179
|
await copy(firebasercSource, joinPath(appDir, ".firebaserc"));
|
|
9046
9180
|
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9047
|
-
if (await isTextFile(firebasercDest))
|
|
9181
|
+
if (await isTextFile(firebasercDest))
|
|
9182
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9048
9183
|
}
|
|
9049
9184
|
if (row.functionsTemplate === "functions-firebase") {
|
|
9050
|
-
for (const example of [
|
|
9185
|
+
for (const example of [
|
|
9186
|
+
"firestore.rules.example",
|
|
9187
|
+
"firestore.indexes.json.example",
|
|
9188
|
+
"storage.rules.example"
|
|
9189
|
+
]) {
|
|
9051
9190
|
const src = joinPath(deploymentTemplateDir, example);
|
|
9052
9191
|
if (pathExists(src)) {
|
|
9053
9192
|
await copy(src, joinPath(appDir, example.replace(".example", "")));
|
|
@@ -9055,12 +9194,76 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9055
9194
|
}
|
|
9056
9195
|
}
|
|
9057
9196
|
}
|
|
9197
|
+
if (!deployConfig && backend === "firebase" && row.functionsTemplate) {
|
|
9198
|
+
const firebaseJsonPath = joinPath(appDir, "firebase.json");
|
|
9199
|
+
if (!pathExists(firebaseJsonPath)) {
|
|
9200
|
+
const expoFirebaseJson = {
|
|
9201
|
+
functions: [
|
|
9202
|
+
{
|
|
9203
|
+
source: "functions",
|
|
9204
|
+
codebase: "default",
|
|
9205
|
+
ignore: [
|
|
9206
|
+
"node_modules",
|
|
9207
|
+
".git",
|
|
9208
|
+
"firebase-debug.log",
|
|
9209
|
+
"firebase-debug.*.log",
|
|
9210
|
+
"**/.*",
|
|
9211
|
+
"**/*.test.ts",
|
|
9212
|
+
"**/__tests__/**"
|
|
9213
|
+
],
|
|
9214
|
+
runtime: "nodejs22"
|
|
9215
|
+
}
|
|
9216
|
+
],
|
|
9217
|
+
firestore: {
|
|
9218
|
+
rules: "firestore.rules",
|
|
9219
|
+
indexes: "firestore.indexes.json"
|
|
9220
|
+
},
|
|
9221
|
+
storage: { rules: "storage.rules" },
|
|
9222
|
+
emulators: {
|
|
9223
|
+
auth: { port: 9099 },
|
|
9224
|
+
functions: { port: 5001 },
|
|
9225
|
+
firestore: { port: 8080 },
|
|
9226
|
+
storage: { port: 9199 },
|
|
9227
|
+
ui: { enabled: true, port: 4e3 }
|
|
9228
|
+
}
|
|
9229
|
+
};
|
|
9230
|
+
await write(firebaseJsonPath, expoFirebaseJson, {
|
|
9231
|
+
format: "json",
|
|
9232
|
+
overwrite: true
|
|
9233
|
+
});
|
|
9234
|
+
}
|
|
9235
|
+
const firebasercSource = joinPath(
|
|
9236
|
+
deploymentTemplateDir,
|
|
9237
|
+
".firebaserc.example"
|
|
9238
|
+
);
|
|
9239
|
+
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9240
|
+
if (pathExists(firebasercSource) && !pathExists(firebasercDest)) {
|
|
9241
|
+
await copy(firebasercSource, firebasercDest);
|
|
9242
|
+
if (await isTextFile(firebasercDest))
|
|
9243
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9244
|
+
}
|
|
9245
|
+
for (const example of [
|
|
9246
|
+
"firestore.rules.example",
|
|
9247
|
+
"firestore.indexes.json.example",
|
|
9248
|
+
"storage.rules.example"
|
|
9249
|
+
]) {
|
|
9250
|
+
const src = joinPath(deploymentTemplateDir, example);
|
|
9251
|
+
const dest = joinPath(appDir, example.replace(".example", ""));
|
|
9252
|
+
if (pathExists(src) && !pathExists(dest)) {
|
|
9253
|
+
await copy(src, dest);
|
|
9254
|
+
}
|
|
9255
|
+
}
|
|
9256
|
+
}
|
|
9058
9257
|
if (deployConfig === "vercel-vercel") {
|
|
9059
|
-
const vercelJsonSource = joinPath(
|
|
9258
|
+
const vercelJsonSource = joinPath(
|
|
9259
|
+
deploymentTemplateDir,
|
|
9260
|
+
"vercel.json.example"
|
|
9261
|
+
);
|
|
9060
9262
|
if (pathExists(vercelJsonSource)) {
|
|
9061
9263
|
await copy(vercelJsonSource, joinPath(appDir, "vercel.json"));
|
|
9062
9264
|
const vercelJsonDest = joinPath(appDir, "vercel.json");
|
|
9063
|
-
if (await isTextFile(vercelJsonDest))
|
|
9265
|
+
if (await isTextFile(vercelJsonDest))
|
|
9266
|
+
await replacePlaceholders(vercelJsonDest, replacements);
|
|
9064
9267
|
}
|
|
9065
9268
|
}
|
|
9066
9269
|
const backendInfo = row.functionsTemplate ? ` with ${row.functionsTemplate.replace("functions-", "")} functions` : "";
|