@geekmidas/cli 1.10.18 → 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/CHANGELOG.md +12 -0
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +16 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/dev/index.ts +24 -2
- package/src/init/versions.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/cli",
|
|
3
|
-
"version": "1.10.
|
|
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",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"prompts": "~2.4.2",
|
|
57
57
|
"tsx": "~4.20.3",
|
|
58
58
|
"yaml": "~2.8.2",
|
|
59
|
+
"@geekmidas/envkit": "~1.0.4",
|
|
59
60
|
"@geekmidas/constructs": "~3.0.2",
|
|
60
61
|
"@geekmidas/logger": "~1.0.0",
|
|
61
62
|
"@geekmidas/errors": "~1.0.0",
|
|
62
|
-
"@geekmidas/schema": "~1.0.0"
|
|
63
|
-
"@geekmidas/envkit": "~1.0.4"
|
|
63
|
+
"@geekmidas/schema": "~1.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/lodash.kebabcase": "^4.1.9",
|
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,13 +428,33 @@ 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 });
|
|
435
|
-
|
|
454
|
+
const secretsFileName = workspaceAppName
|
|
455
|
+
? `dev-secrets-${workspaceAppName}.json`
|
|
456
|
+
: 'dev-secrets.json';
|
|
457
|
+
secretsJsonPath = join(secretsDir, secretsFileName);
|
|
436
458
|
await writeFile(secretsJsonPath, JSON.stringify(appSecrets, null, 2));
|
|
437
459
|
logger.log(`🔐 Loaded ${Object.keys(appSecrets).length} secret(s)`);
|
|
438
460
|
}
|
package/src/init/versions.ts
CHANGED
|
@@ -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.
|
|
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',
|