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