@geekmidas/cli 10.0.0-alpha.1 → 10.0.0-alpha.10
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/README.md +12 -8
- package/bin/adjacent-tsconfig.mjs +59 -0
- package/bin/gkm.mjs +7 -1
- package/dist/{config-DbPE1KXF.cjs → config-BZ1F0WuA.cjs} +7 -80
- package/dist/config-BZ1F0WuA.cjs.map +1 -0
- package/dist/{config-D8o6I_7Z.mjs → config-DVVph9yz.mjs} +9 -76
- package/dist/config-DVVph9yz.mjs.map +1 -0
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/{credentials-K961ThG3.cjs → credentials-Xamqe_NJ.cjs} +20 -19
- package/dist/credentials-Xamqe_NJ.cjs.map +1 -0
- package/dist/{credentials-Dh0Q6HzY.mjs → credentials-dP8vRVRv.mjs} +20 -19
- package/dist/credentials-dP8vRVRv.mjs.map +1 -0
- package/dist/discover-CAlFgYec.mjs.map +1 -1
- package/dist/discover-DTmFeloL.cjs.map +1 -1
- package/dist/{index-BThUzEIp.d.mts → index-C6e-ULLx.d.mts} +2 -2
- package/dist/index-C6e-ULLx.d.mts.map +1 -0
- package/dist/{index-CHB4tSzX.d.cts → index-CR5urhWX.d.cts} +2 -2
- package/dist/index-CR5urhWX.d.cts.map +1 -0
- package/dist/index.cjs +1917 -597
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1919 -599
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-CljONd_M.cjs → openapi-SjsgARie.cjs} +127 -50
- package/dist/openapi-SjsgARie.cjs.map +1 -0
- package/dist/{openapi-CgpMWMmM.mjs → openapi-Xx0A7Wg0.mjs} +109 -50
- package/dist/openapi-Xx0A7Wg0.mjs.map +1 -0
- package/dist/openapi.cjs +5 -3
- package/dist/openapi.d.cts +46 -10
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +46 -10
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +4 -4
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{setup-DSutDAlt.mjs → setup-BA8ciTPU.mjs} +4 -4
- package/dist/setup-BsZvZP6f.cjs +11 -0
- package/dist/{setup-DOsYueeQ.mjs → setup-C8KOx8_8.mjs} +5 -5
- package/dist/setup-C8KOx8_8.mjs.map +1 -0
- package/dist/{setup-CJiQM2pX.cjs → setup-hC6hI86f.cjs} +5 -5
- package/dist/setup-hC6hI86f.cjs.map +1 -0
- package/dist/{types-C-arnQ1r.d.mts → types-6pkp2RRj.d.mts} +46 -10
- package/dist/types-6pkp2RRj.d.mts.map +1 -0
- package/dist/{types-abJQuk7m.d.cts → types-Y3fKQSAK.d.cts} +46 -10
- package/dist/types-Y3fKQSAK.d.cts.map +1 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/workspace-BzrG_2SI.mjs +8 -0
- package/dist/workspace-C6VJQVtG.cjs +6845 -0
- package/dist/workspace-C6VJQVtG.cjs.map +1 -0
- package/dist/{workspace-8acupeaI.cjs → workspace-XXtNhqJl.cjs} +3 -3
- package/dist/workspace-zoqRbihZ.mjs +6678 -0
- package/dist/workspace-zoqRbihZ.mjs.map +1 -0
- package/package.json +33 -32
- package/dist/config-D8o6I_7Z.mjs.map +0 -1
- package/dist/config-DbPE1KXF.cjs.map +0 -1
- package/dist/credentials-Dh0Q6HzY.mjs.map +0 -1
- package/dist/credentials-K961ThG3.cjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-CHB4tSzX.d.cts.map +0 -1
- package/dist/openapi-CgpMWMmM.mjs.map +0 -1
- package/dist/openapi-CljONd_M.cjs.map +0 -1
- package/dist/setup-CJiQM2pX.cjs.map +0 -1
- package/dist/setup-DMtU3p41.cjs +0 -11
- package/dist/setup-DOsYueeQ.mjs.map +0 -1
- package/dist/types-C-arnQ1r.d.mts.map +0 -1
- package/dist/types-abJQuk7m.d.cts.map +0 -1
- package/dist/workspace-7FqprxuJ.mjs +0 -4323
- package/dist/workspace-7FqprxuJ.mjs.map +0 -1
- package/dist/workspace-XvqO9jIv.cjs +0 -4472
- package/dist/workspace-XvqO9jIv.cjs.map +0 -1
- package/dist/workspace-yP5AHnrn.mjs +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
2
|
const require_discover = require('./discover-DTmFeloL.cjs');
|
|
3
|
-
const require_config = require('./config-
|
|
4
|
-
const require_workspace = require('./workspace-
|
|
3
|
+
const require_config = require('./config-BZ1F0WuA.cjs');
|
|
4
|
+
const require_workspace = require('./workspace-C6VJQVtG.cjs');
|
|
5
5
|
const require_generator = require('./generator-CNzBw7g5.cjs');
|
|
6
6
|
const require_storage = require('./storage-BJmzYxt8.cjs');
|
|
7
7
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
@@ -349,7 +349,7 @@ function postgresImage(version) {
|
|
|
349
349
|
*/
|
|
350
350
|
const DEFAULT_IMAGES = {
|
|
351
351
|
postgres: postgresImage(__geekmidas_manifest.DEFAULT_POSTGRES_VERSION),
|
|
352
|
-
minio: "
|
|
352
|
+
minio: "pgsty/minio:RELEASE.2026-08-04T00-00-00Z",
|
|
353
353
|
mailpit: "axllent/mailpit:latest",
|
|
354
354
|
redis: "redis:8-alpine",
|
|
355
355
|
"redis-http": "hiett/serverless-redis-http:latest",
|
|
@@ -796,8 +796,6 @@ const dockerCli = {
|
|
|
796
796
|
|
|
797
797
|
//#endregion
|
|
798
798
|
//#region src/reconcile/plan.ts
|
|
799
|
-
/** The stage whose resources carry no suffix. */
|
|
800
|
-
const DEFAULT_STAGE = "development";
|
|
801
799
|
/**
|
|
802
800
|
* Which container serves a kind.
|
|
803
801
|
*
|
|
@@ -916,13 +914,13 @@ const SEPARATORS = {
|
|
|
916
914
|
/**
|
|
917
915
|
* The stage-scoped name for a resource.
|
|
918
916
|
*
|
|
919
|
-
* The
|
|
920
|
-
* developer's psql history, saved connections, and muscle memory survive
|
|
921
|
-
* change. Every other stage is suffixed.
|
|
917
|
+
* The local stage carries no suffix, so `gkm dev` keeps using `orders` and a
|
|
918
|
+
* developer's psql history, saved connections, and muscle memory survive a
|
|
919
|
+
* change of stage name. Every other stage is suffixed.
|
|
922
920
|
*/
|
|
923
|
-
function resourceName(id, kind, stage) {
|
|
921
|
+
function resourceName(id, kind, stage, localStage) {
|
|
924
922
|
const base = id.toLowerCase();
|
|
925
|
-
if (stage ===
|
|
923
|
+
if (stage === localStage) return base;
|
|
926
924
|
return `${base}${SEPARATORS[kind] ?? "-"}${stage}`;
|
|
927
925
|
}
|
|
928
926
|
/**
|
|
@@ -966,7 +964,7 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
966
964
|
id,
|
|
967
965
|
kind: declaration.kind,
|
|
968
966
|
...container ? { container } : {},
|
|
969
|
-
name: resourceName(id, declaration.kind, stage),
|
|
967
|
+
name: resourceName(id, declaration.kind, stage, options.localStage),
|
|
970
968
|
envKey: (0, __geekmidas_manifest.providedKeyFor)(id, declaration.kind, ROLES[declaration.kind] ?? "url"),
|
|
971
969
|
provisions: PROVISIONS[declaration.kind] === true,
|
|
972
970
|
...declaration.kind === "rest-api" ? { callers: (0, __geekmidas_manifest.dependentsOf)(manifest, id) } : {},
|
|
@@ -1841,6 +1839,7 @@ const CADDY_ROOT_IN_CONTAINER = "/data/caddy/pki/authorities/local/root.crt";
|
|
|
1841
1839
|
async function reconcile(options) {
|
|
1842
1840
|
const { root, project, manifest, stage, start = true, provision = true, docker = dockerCli, probe = isPortFree, sql = pgClient, buckets = bucketClient } = options;
|
|
1843
1841
|
const plan = planFor(manifest, stage, (0, __geekmidas_manifest.provisionOrder)(manifest), {
|
|
1842
|
+
localStage: options.localStage,
|
|
1844
1843
|
events: options.events,
|
|
1845
1844
|
cache: options.cache,
|
|
1846
1845
|
extraContainers: options.extraContainers,
|
|
@@ -2000,6 +1999,7 @@ async function derivedContainers(workspace, stage, manifest) {
|
|
|
2000
1999
|
cwd: workspace.root
|
|
2001
2000
|
});
|
|
2002
2001
|
return planFor(found, stage, (0, __geekmidas_manifest.provisionOrder)(found), {
|
|
2002
|
+
localStage: workspace.stages.local,
|
|
2003
2003
|
events: workspace.services.events,
|
|
2004
2004
|
cache: cacheBackendOf(workspace.services.cache, providerOf(workspace))
|
|
2005
2005
|
}).containers;
|
|
@@ -2020,6 +2020,7 @@ async function reconcileWorkspace(workspace, options) {
|
|
|
2020
2020
|
project: workspace.name,
|
|
2021
2021
|
manifest,
|
|
2022
2022
|
stage: options.stage,
|
|
2023
|
+
localStage: workspace.stages.local,
|
|
2023
2024
|
events: workspace.services.events,
|
|
2024
2025
|
cache: cacheBackendOf(workspace.services.cache, providerOf(workspace)),
|
|
2025
2026
|
images: imagePins(workspace),
|
|
@@ -2359,14 +2360,13 @@ async function startWorkspaceServices(workspace, portEnv, secretsEnv) {
|
|
|
2359
2360
|
* For workspace app: maps {APP}_DATABASE_URL → DATABASE_URL.
|
|
2360
2361
|
* @internal Exported for testing
|
|
2361
2362
|
*/
|
|
2362
|
-
async function loadSecretsForApp(secretsRoot,
|
|
2363
|
+
async function loadSecretsForApp(secretsRoot, stage, appName) {
|
|
2363
2364
|
let secrets = {};
|
|
2364
|
-
|
|
2365
|
+
if (require_storage.secretsExist(stage, secretsRoot)) {
|
|
2365
2366
|
const stageSecrets = await require_storage.readStageSecrets(stage, secretsRoot);
|
|
2366
2367
|
if (stageSecrets) {
|
|
2367
2368
|
logger.log(`🔐 Loading secrets from stage: ${stage}`);
|
|
2368
2369
|
secrets = require_storage.toEmbeddableSecrets(stageSecrets);
|
|
2369
|
-
break;
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
2372
|
if (Object.keys(secrets).length === 0) return {};
|
|
@@ -2447,7 +2447,7 @@ await import('${entryPath}');
|
|
|
2447
2447
|
* @param options.resolveDockerPorts - How to resolve Docker ports:
|
|
2448
2448
|
* - `'full'` (default): probe running containers, saved state, then find available ports. Used by dev/test.
|
|
2449
2449
|
* - `'readonly'`: check running containers and saved state only, never probe for new ports. Used by exec.
|
|
2450
|
-
* @param options.
|
|
2450
|
+
* @param options.stage - The stage whose secrets to load. Default: the project's `stages.local`.
|
|
2451
2451
|
* @param options.startDocker - Start Docker Compose services after port resolution. Default: false.
|
|
2452
2452
|
* @param options.secretsFileName - Custom secrets JSON filename. Default: 'dev-secrets-{appName}.json' or 'dev-secrets.json'.
|
|
2453
2453
|
* @internal Exported for testing
|
|
@@ -2469,13 +2469,14 @@ async function prepareEntryCredentials(options) {
|
|
|
2469
2469
|
appName = require_config.getAppNameFromCwd(cwd) ?? void 0;
|
|
2470
2470
|
}
|
|
2471
2471
|
const resolvedPort = options.explicitPort ?? workspaceAppPort ?? 3e3;
|
|
2472
|
-
const
|
|
2472
|
+
const stage = options.stage ?? appInfo?.workspace.stages.local;
|
|
2473
|
+
const credentials = stage ? await loadSecretsForApp(secretsRoot, stage, appName) : {};
|
|
2473
2474
|
credentials.PORT = String(resolvedPort);
|
|
2474
2475
|
const declaredKeys = [];
|
|
2475
2476
|
if (appInfo && usesConstructs(appInfo.workspace)) {
|
|
2476
|
-
const { reconcileWorkspace: reconcileWorkspace$1 } = await Promise.resolve().then(() => require("./workspace-
|
|
2477
|
+
const { reconcileWorkspace: reconcileWorkspace$1 } = await Promise.resolve().then(() => require("./workspace-XXtNhqJl.cjs"));
|
|
2477
2478
|
const reconciled = await reconcileWorkspace$1(appInfo.workspace, {
|
|
2478
|
-
stage: options.reconcileStage ??
|
|
2479
|
+
stage: options.reconcileStage ?? appInfo.workspace.stages.local,
|
|
2479
2480
|
start: options.startDocker ?? false
|
|
2480
2481
|
});
|
|
2481
2482
|
Object.assign(credentials, reconciled.env);
|
|
@@ -2677,4 +2678,4 @@ Object.defineProperty(exports, 'usesConstructs', {
|
|
|
2677
2678
|
return usesConstructs;
|
|
2678
2679
|
}
|
|
2679
2680
|
});
|
|
2680
|
-
//# sourceMappingURL=credentials-
|
|
2681
|
+
//# sourceMappingURL=credentials-Xamqe_NJ.cjs.map
|