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