@geekmidas/cli 1.10.19 → 1.10.20

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": "1.10.19",
3
+ "version": "1.10.20",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
package/src/dev/index.ts CHANGED
@@ -290,6 +290,7 @@ export async function devCommand(options: DevOptions): Promise<void> {
290
290
  let secretsRoot: string = process.cwd(); // Where .gkm/secrets/ lives
291
291
  let workspaceAppName: string | undefined; // Set if in workspace mode
292
292
  let workspaceAppPort: number | undefined; // Port from workspace config
293
+ let workspace: NormalizedWorkspace | undefined; // Set if in workspace mode
293
294
 
294
295
  if (appName) {
295
296
  // Try to load app-specific config from workspace
@@ -300,6 +301,7 @@ export async function devCommand(options: DevOptions): Promise<void> {
300
301
  secretsRoot = appConfig.workspaceRoot;
301
302
  workspaceAppName = appConfig.appName;
302
303
  workspaceAppPort = appConfig.app.port;
304
+ workspace = appConfig.workspace;
303
305
  logger.log(
304
306
  `📦 Running app: ${appConfig.appName} on port ${workspaceAppPort}`,
305
307
  );
@@ -426,9 +428,26 @@ export async function devCommand(options: DevOptions): Promise<void> {
426
428
  // Determine runtime (default to node)
427
429
  const runtime: Runtime = config.runtime ?? 'node';
428
430
 
429
- // Load secrets for dev mode and write to JSON file
431
+ // Load secrets for dev mode, resolve Docker ports, and write to JSON file
430
432
  let secretsJsonPath: string | undefined;
431
433
  const appSecrets = await loadSecretsForApp(secretsRoot, workspaceAppName);
434
+
435
+ // Resolve Docker service ports and rewrite connection URLs
436
+ const resolvedPorts = await resolveServicePorts(secretsRoot);
437
+ if (Object.keys(resolvedPorts.ports).length > 0) {
438
+ const rewritten = rewriteUrlsWithPorts(appSecrets, resolvedPorts);
439
+ Object.assign(appSecrets, rewritten);
440
+ logger.log(
441
+ `🔌 Applied ${Object.keys(resolvedPorts.ports).length} port mapping(s)`,
442
+ );
443
+ }
444
+
445
+ // Inject dependency URLs if in workspace mode
446
+ if (workspace && workspaceAppName) {
447
+ const depEnv = getDependencyEnvVars(workspace, workspaceAppName);
448
+ Object.assign(appSecrets, depEnv);
449
+ }
450
+
432
451
  if (Object.keys(appSecrets).length > 0) {
433
452
  const secretsDir = join(secretsRoot, '.gkm');
434
453
  await mkdir(secretsDir, { recursive: true });
@@ -33,7 +33,7 @@ export const GEEKMIDAS_VERSIONS = {
33
33
  '@geekmidas/client': '~4.0.0',
34
34
  '@geekmidas/cloud': '~1.0.0',
35
35
  '@geekmidas/constructs': '~3.0.2',
36
- '@geekmidas/db': '~1.0.0',
36
+ '@geekmidas/db': '~1.0.1',
37
37
  '@geekmidas/emailkit': '~1.0.0',
38
38
  '@geekmidas/envkit': '~1.0.4',
39
39
  '@geekmidas/errors': '~1.0.0',