@stoker-platform/cli 0.5.161 → 0.5.163
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/init-files/bin/build.js +5 -1
- package/lib/package.json +1 -1
- package/lib/src/main.js +1 -0
- package/lib/src/project/addProject.js +4 -0
- package/package.json +1 -1
package/init-files/bin/build.js
CHANGED
|
@@ -125,7 +125,8 @@ try {
|
|
|
125
125
|
const projectSpecificEnvFile = join(envDir, `.env.${process.env.GCP_PROJECT}`)
|
|
126
126
|
|
|
127
127
|
let envContent = ""
|
|
128
|
-
const envPattern =
|
|
128
|
+
const envPattern =
|
|
129
|
+
/^(FB_FIRESTORE_EDITION|FB_FUNCTIONS_|FB_AI_REGION|GENKIT_ENV|STOKER_(?!FB_APP_CHECK_DEBUG_TOKEN)|ADMIN_)/
|
|
129
130
|
|
|
130
131
|
if (existsSync(projectEnvFile)) {
|
|
131
132
|
const projectEnvContent = await readFile(projectEnvFile, "utf8")
|
|
@@ -146,6 +147,9 @@ try {
|
|
|
146
147
|
const filteredLines = allLines.filter((line) => envPattern.test(line.trim()))
|
|
147
148
|
envContent = filteredLines.join("\n")
|
|
148
149
|
}
|
|
150
|
+
if (!/^\s*GENKIT_ENV\s*=/m.test(envContent)) {
|
|
151
|
+
envContent = envContent ? `${envContent}\nGENKIT_ENV="prod"` : `GENKIT_ENV="prod"`
|
|
152
|
+
}
|
|
149
153
|
|
|
150
154
|
await writeFile(functionsEnvPath, envContent, "utf8")
|
|
151
155
|
|
package/lib/package.json
CHANGED
package/lib/src/main.js
CHANGED
|
@@ -284,6 +284,7 @@ program
|
|
|
284
284
|
.option("-r, --backup-retention <duration>", "set Firestore backup duration (default 7 days)")
|
|
285
285
|
.option("-c, --custom-cors <path>", "file path for custom Cloud Storage CORS policy")
|
|
286
286
|
.option("-d, --development", "specifies that this will be a development project")
|
|
287
|
+
.option("-e, --set-emulator-data", "set emulator data for the project")
|
|
287
288
|
.option("-t, --test-mode", "add the project in test mode")
|
|
288
289
|
.action((options) => {
|
|
289
290
|
addProject(options);
|
|
@@ -7,6 +7,7 @@ import { SecretManagerServiceClient } from "@google-cloud/secret-manager";
|
|
|
7
7
|
import { addTenant } from "./addTenant.js";
|
|
8
8
|
import { existsSync } from "fs";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
|
+
import { prepareEmulatorData } from "./prepareEmulatorData.js";
|
|
10
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
12
|
export const addProject = async (options) => {
|
|
12
13
|
if (!process.env.GCP_BILLING_ACCOUNT) {
|
|
@@ -1056,5 +1057,8 @@ STOKER_FB_EMULATOR_FUNCTIONS_PORT=${functionsPort}`;
|
|
|
1056
1057
|
await runChildProcess("npx", ["stoker", "set-project"]);
|
|
1057
1058
|
await addTenant();
|
|
1058
1059
|
await updateProjectData(1000);
|
|
1060
|
+
if (options.development && options.setEmulatorData) {
|
|
1061
|
+
await prepareEmulatorData();
|
|
1062
|
+
}
|
|
1059
1063
|
process.exit();
|
|
1060
1064
|
};
|