@geekmidas/cli 0.51.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.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.51.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";
@@ -3384,14 +3384,8 @@ WORKDIR /app
3384
3384
  # Copy source (deps already installed)
3385
3385
  COPY . .
3386
3386
 
3387
- # Debug: Show node_modules/.bin contents and build production server
3388
- RUN echo "=== node_modules/.bin contents ===" && \
3389
- ls -la node_modules/.bin/ 2>/dev/null || echo "node_modules/.bin not found" && \
3390
- echo "=== Checking for gkm ===" && \
3391
- which gkm 2>/dev/null || echo "gkm not in PATH" && \
3392
- ls -la node_modules/.bin/gkm 2>/dev/null || echo "gkm binary not found in node_modules/.bin" && \
3393
- echo "=== Running build ===" && \
3394
- ./node_modules/.bin/gkm build --provider server --production
3387
+ # Build production server using gkm
3388
+ RUN pnpm exec gkm build --provider server --production
3395
3389
 
3396
3390
  # Stage 3: Production
3397
3391
  FROM ${baseImage} AS runner
@@ -3472,14 +3466,8 @@ WORKDIR /app
3472
3466
  # Copy pruned source
3473
3467
  COPY --from=pruner /app/out/full/ ./
3474
3468
 
3475
- # Debug: Show node_modules/.bin contents and build production server
3476
- RUN echo "=== node_modules/.bin contents ===" && \
3477
- ls -la node_modules/.bin/ 2>/dev/null || echo "node_modules/.bin not found" && \
3478
- echo "=== Checking for gkm ===" && \
3479
- which gkm 2>/dev/null || echo "gkm not in PATH" && \
3480
- ls -la node_modules/.bin/gkm 2>/dev/null || echo "gkm binary not found in node_modules/.bin" && \
3481
- echo "=== Running build ===" && \
3482
- ./node_modules/.bin/gkm build --provider server --production
3469
+ # Build production server using gkm
3470
+ RUN pnpm exec gkm build --provider server --production
3483
3471
 
3484
3472
  # Stage 4: Production
3485
3473
  FROM ${baseImage} AS runner
@@ -3800,7 +3788,7 @@ RUN if [ -n "$GKM_ENCRYPTED_CREDENTIALS" ]; then \
3800
3788
  fi
3801
3789
 
3802
3790
  # Build production server using gkm
3803
- RUN cd ${appPath} && ./node_modules/.bin/gkm build --provider server --production
3791
+ RUN cd ${appPath} && pnpm exec gkm build --provider server --production
3804
3792
 
3805
3793
  # Stage 4: Production
3806
3794
  FROM ${baseImage} AS runner
@@ -4534,7 +4522,8 @@ function buildRedisUrl(redis) {
4534
4522
  function resolveEnvVar(varName, context) {
4535
4523
  switch (varName) {
4536
4524
  case "PORT": return String(context.app.port);
4537
- case "NODE_ENV": return context.stage === "production" ? "production" : "development";
4525
+ case "NODE_ENV": return "production";
4526
+ case "STAGE": return context.stage;
4538
4527
  case "DATABASE_URL":
4539
4528
  if (context.appCredentials && context.postgres) return buildDatabaseUrl(context.appCredentials, context.postgres);
4540
4529
  break;
@@ -5800,7 +5789,13 @@ async function workspaceDeployCommand(workspace, options) {
5800
5789
  masterKey: appSecrets?.masterKey
5801
5790
  };
5802
5791
  const appRequirements = sniffedApps.get(appName);
5803
- const requiredVars = appRequirements?.requiredEnvVars ?? [];
5792
+ const sniffedVars = appRequirements?.requiredEnvVars ?? [];
5793
+ const requiredVars = [...new Set([
5794
+ "PORT",
5795
+ "NODE_ENV",
5796
+ "STAGE",
5797
+ ...sniffedVars
5798
+ ])];
5804
5799
  const { valid, missing, resolved } = validateEnvVars(requiredVars, envContext);
5805
5800
  if (!valid) throw new Error(formatMissingVarsError(appName, missing, stage));
5806
5801
  const envVars = Object.entries(resolved).map(([key, value]) => `${key}=${value}`);
@@ -5894,7 +5889,11 @@ async function workspaceDeployCommand(workspace, options) {
5894
5889
  buildArgs,
5895
5890
  publicUrlArgs: getPublicUrlArgNames(app)
5896
5891
  });
5897
- const envVars = [`NODE_ENV=production`, `PORT=${app.port}`];
5892
+ const envVars = [
5893
+ `NODE_ENV=production`,
5894
+ `PORT=${app.port}`,
5895
+ `STAGE=${stage}`
5896
+ ];
5898
5897
  await api.saveDockerProvider(application.applicationId, imageRef, { registryId });
5899
5898
  await api.saveApplicationEnv(application.applicationId, envVars.join("\n"));
5900
5899
  logger$1.log(` Deploying to Dokploy...`);