@geekmidas/cli 0.52.0 → 0.53.0
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/dist/index.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/deploy/env-resolver.ts +6 -1
- package/src/deploy/index.ts +10 -2
- package/src/docker/templates.ts +3 -1
package/dist/index.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import prompts from "prompts";
|
|
|
30
30
|
|
|
31
31
|
//#region package.json
|
|
32
32
|
var name = "@geekmidas/cli";
|
|
33
|
-
var version = "0.
|
|
33
|
+
var version = "0.53.0";
|
|
34
34
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
35
35
|
var private$1 = false;
|
|
36
36
|
var type = "module";
|
|
@@ -4522,7 +4522,8 @@ function buildRedisUrl(redis) {
|
|
|
4522
4522
|
function resolveEnvVar(varName, context) {
|
|
4523
4523
|
switch (varName) {
|
|
4524
4524
|
case "PORT": return String(context.app.port);
|
|
4525
|
-
case "NODE_ENV": return
|
|
4525
|
+
case "NODE_ENV": return "production";
|
|
4526
|
+
case "STAGE": return context.stage;
|
|
4526
4527
|
case "DATABASE_URL":
|
|
4527
4528
|
if (context.appCredentials && context.postgres) return buildDatabaseUrl(context.appCredentials, context.postgres);
|
|
4528
4529
|
break;
|
|
@@ -5788,7 +5789,13 @@ async function workspaceDeployCommand(workspace, options) {
|
|
|
5788
5789
|
masterKey: appSecrets?.masterKey
|
|
5789
5790
|
};
|
|
5790
5791
|
const appRequirements = sniffedApps.get(appName);
|
|
5791
|
-
const
|
|
5792
|
+
const sniffedVars = appRequirements?.requiredEnvVars ?? [];
|
|
5793
|
+
const requiredVars = [...new Set([
|
|
5794
|
+
"PORT",
|
|
5795
|
+
"NODE_ENV",
|
|
5796
|
+
"STAGE",
|
|
5797
|
+
...sniffedVars
|
|
5798
|
+
])];
|
|
5792
5799
|
const { valid, missing, resolved } = validateEnvVars(requiredVars, envContext);
|
|
5793
5800
|
if (!valid) throw new Error(formatMissingVarsError(appName, missing, stage));
|
|
5794
5801
|
const envVars = Object.entries(resolved).map(([key, value]) => `${key}=${value}`);
|
|
@@ -5882,7 +5889,11 @@ async function workspaceDeployCommand(workspace, options) {
|
|
|
5882
5889
|
buildArgs,
|
|
5883
5890
|
publicUrlArgs: getPublicUrlArgNames(app)
|
|
5884
5891
|
});
|
|
5885
|
-
const envVars = [
|
|
5892
|
+
const envVars = [
|
|
5893
|
+
`NODE_ENV=production`,
|
|
5894
|
+
`PORT=${app.port}`,
|
|
5895
|
+
`STAGE=${stage}`
|
|
5896
|
+
];
|
|
5886
5897
|
await api.saveDockerProvider(application.applicationId, imageRef, { registryId });
|
|
5887
5898
|
await api.saveApplicationEnv(application.applicationId, envVars.join("\n"));
|
|
5888
5899
|
logger$1.log(` Deploying to Dokploy...`);
|