@geekmidas/cli 1.3.0 → 1.4.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/CHANGELOG.md +6 -0
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/deploy/__tests__/env-resolver.spec.ts +145 -2
- package/src/deploy/__tests__/index.spec.ts +393 -5
- package/src/deploy/env-resolver.ts +10 -0
- package/src/deploy/index.ts +11 -0
- package/src/init/generators/monorepo.ts +3 -1
|
@@ -50,6 +50,8 @@ export interface EnvResolverContext {
|
|
|
50
50
|
userSecrets?: StageSecrets;
|
|
51
51
|
/** Master key for runtime decryption (optional) */
|
|
52
52
|
masterKey?: string;
|
|
53
|
+
/** URLs of deployed dependency apps (e.g., { auth: 'https://auth.example.com' }) */
|
|
54
|
+
dependencyUrls?: Record<string, string>;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
/**
|
|
@@ -205,6 +207,14 @@ export function resolveEnvVar(
|
|
|
205
207
|
break;
|
|
206
208
|
}
|
|
207
209
|
|
|
210
|
+
// Check dependency URLs (e.g., AUTH_URL -> dependencyUrls.auth)
|
|
211
|
+
if (context.dependencyUrls && varName.endsWith('_URL')) {
|
|
212
|
+
const depName = varName.slice(0, -4).toLowerCase(); // AUTH_URL -> auth
|
|
213
|
+
if (context.dependencyUrls[depName]) {
|
|
214
|
+
return context.dependencyUrls[depName];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
208
218
|
// Check user-provided secrets
|
|
209
219
|
if (context.userSecrets) {
|
|
210
220
|
// Check custom secrets first
|
package/src/deploy/index.ts
CHANGED
|
@@ -1375,6 +1375,16 @@ export async function workspaceDeployCommand(
|
|
|
1375
1375
|
false, // Backend apps are not main frontend
|
|
1376
1376
|
);
|
|
1377
1377
|
|
|
1378
|
+
// Build dependency URLs from already-deployed apps
|
|
1379
|
+
const dependencyUrls: Record<string, string> = {};
|
|
1380
|
+
if (app.dependencies) {
|
|
1381
|
+
for (const dep of app.dependencies) {
|
|
1382
|
+
if (publicUrls[dep]) {
|
|
1383
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1378
1388
|
// Build env resolver context
|
|
1379
1389
|
const envContext: EnvResolverContext = {
|
|
1380
1390
|
app,
|
|
@@ -1400,6 +1410,7 @@ export async function workspaceDeployCommand(
|
|
|
1400
1410
|
frontendUrls,
|
|
1401
1411
|
userSecrets: stageSecrets ?? undefined,
|
|
1402
1412
|
masterKey: appSecrets?.masterKey,
|
|
1413
|
+
dependencyUrls,
|
|
1403
1414
|
};
|
|
1404
1415
|
|
|
1405
1416
|
// Resolve all required environment variables
|
|
@@ -48,6 +48,7 @@ export function generateMonorepoFiles(
|
|
|
48
48
|
'@biomejs/biome': '~2.3.0',
|
|
49
49
|
'@geekmidas/cli': GEEKMIDAS_VERSIONS['@geekmidas/cli'],
|
|
50
50
|
esbuild: '~0.27.0',
|
|
51
|
+
tsx: '~4.20.0',
|
|
51
52
|
turbo: '~2.3.0',
|
|
52
53
|
typescript: '~5.8.2',
|
|
53
54
|
vitest: '~4.0.0',
|
|
@@ -342,7 +343,8 @@ export default defineWorkspace({
|
|
|
342
343
|
port: 3000,
|
|
343
344
|
routes: '${getRoutesGlob()}',
|
|
344
345
|
envParser: './src/config/env#envParser',
|
|
345
|
-
logger: './src/config/logger#logger'
|
|
346
|
+
logger: './src/config/logger#logger',
|
|
347
|
+
dependencies: ['auth'],`;
|
|
346
348
|
|
|
347
349
|
if (telescope) {
|
|
348
350
|
config += `
|