@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -49,11 +49,11 @@
49
49
  "openapi-typescript": "^7.4.2",
50
50
  "pg": "~8.17.1",
51
51
  "prompts": "~2.4.2",
52
- "@geekmidas/constructs": "~0.8.0",
53
52
  "@geekmidas/envkit": "~0.7.0",
54
53
  "@geekmidas/errors": "~0.1.0",
55
- "@geekmidas/schema": "~0.1.0",
56
- "@geekmidas/logger": "~0.4.0"
54
+ "@geekmidas/logger": "~0.4.0",
55
+ "@geekmidas/constructs": "~0.8.0",
56
+ "@geekmidas/schema": "~0.1.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/lodash.kebabcase": "^4.1.9",
@@ -68,6 +68,7 @@ export interface EnvResolutionResult {
68
68
  export const AUTO_SUPPORTED_VARS = [
69
69
  'PORT',
70
70
  'NODE_ENV',
71
+ 'STAGE',
71
72
  'DATABASE_URL',
72
73
  'REDIS_URL',
73
74
  'BETTER_AUTH_URL',
@@ -157,7 +158,11 @@ export function resolveEnvVar(
157
158
  return String(context.app.port);
158
159
 
159
160
  case 'NODE_ENV':
160
- return context.stage === 'production' ? 'production' : 'development';
161
+ // Always 'production' for deployed apps (gkm dev handles development mode)
162
+ return 'production';
163
+
164
+ case 'STAGE':
165
+ return context.stage;
161
166
 
162
167
  case 'DATABASE_URL':
163
168
  if (context.appCredentials && context.postgres) {
@@ -1395,8 +1395,12 @@ export async function workspaceDeployCommand(
1395
1395
  };
1396
1396
 
1397
1397
  // Resolve all required environment variables
1398
+ // Always include PORT, NODE_ENV, STAGE even if not explicitly required
1398
1399
  const appRequirements = sniffedApps.get(appName);
1399
- const requiredVars = appRequirements?.requiredEnvVars ?? [];
1400
+ const sniffedVars = appRequirements?.requiredEnvVars ?? [];
1401
+ const requiredVars = [
1402
+ ...new Set(['PORT', 'NODE_ENV', 'STAGE', ...sniffedVars]),
1403
+ ];
1400
1404
  const { valid, missing, resolved } = validateEnvVars(
1401
1405
  requiredVars,
1402
1406
  envContext,
@@ -1582,7 +1586,11 @@ export async function workspaceDeployCommand(
1582
1586
  });
1583
1587
 
1584
1588
  // Prepare environment variables - no secrets needed
1585
- const envVars: string[] = [`NODE_ENV=production`, `PORT=${app.port}`];
1589
+ const envVars: string[] = [
1590
+ `NODE_ENV=production`,
1591
+ `PORT=${app.port}`,
1592
+ `STAGE=${stage}`,
1593
+ ];
1586
1594
 
1587
1595
  // Configure and deploy application in Dokploy
1588
1596
  await api.saveDockerProvider(application.applicationId, imageRef, {
@@ -811,7 +811,9 @@ export interface EntryDockerfileOptions {
811
811
  * This is used for apps that don't use gkm routes (e.g., Better Auth servers).
812
812
  * @internal Exported for testing
813
813
  */
814
- export function generateEntryDockerfile(options: EntryDockerfileOptions): string {
814
+ export function generateEntryDockerfile(
815
+ options: EntryDockerfileOptions,
816
+ ): string {
815
817
  const {
816
818
  baseImage,
817
819
  port,