@geekmidas/cli 10.0.0-alpha.16 → 10.0.0-alpha.18

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.
Files changed (90) hide show
  1. package/dist/{bundler-BeNDZdHQ.cjs → bundler-mjqGAvu1.cjs} +2 -2
  2. package/dist/{bundler-BeNDZdHQ.cjs.map → bundler-mjqGAvu1.cjs.map} +1 -1
  3. package/dist/{bundler-BodTL4kf.mjs → bundler-mwH7WOb1.mjs} +2 -2
  4. package/dist/{bundler-BodTL4kf.mjs.map → bundler-mwH7WOb1.mjs.map} +1 -1
  5. package/dist/{config-Q1rvKHvw.cjs → config-DSXI480r.cjs} +2 -2
  6. package/dist/{config-Q1rvKHvw.cjs.map → config-DSXI480r.cjs.map} +1 -1
  7. package/dist/{config-pqGD3hF9.mjs → config-DdKkoUE1.mjs} +2 -2
  8. package/dist/{config-pqGD3hF9.mjs.map → config-DdKkoUE1.mjs.map} +1 -1
  9. package/dist/config.cjs +2 -2
  10. package/dist/config.d.cts +2 -2
  11. package/dist/config.d.mts +2 -2
  12. package/dist/config.mjs +2 -2
  13. package/dist/{credentials-Q6F0uqJq.cjs → credentials-C6Pfn6GY.cjs} +31 -9
  14. package/dist/credentials-C6Pfn6GY.cjs.map +1 -0
  15. package/dist/{credentials-BekkKtY_.mjs → credentials-lbv-j0Be.mjs} +32 -10
  16. package/dist/{credentials-BekkKtY_.mjs.map → credentials-lbv-j0Be.mjs.map} +1 -1
  17. package/dist/discover-BERGFg8v.cjs.map +1 -1
  18. package/dist/discover-CK-n3w6b.mjs.map +1 -1
  19. package/dist/{github-CRwnxKmD.mjs → github-DlIrXPee.mjs} +21 -8
  20. package/dist/github-DlIrXPee.mjs.map +1 -0
  21. package/dist/{github-BfflNPVe.cjs → github-n7N9yOff.cjs} +22 -9
  22. package/dist/github-n7N9yOff.cjs.map +1 -0
  23. package/dist/{index-C-VLwB_Y.d.mts → index-B4H4XF7A.d.mts} +2 -2
  24. package/dist/{index-C-HkOEBt.d.cts.map → index-B4H4XF7A.d.mts.map} +1 -1
  25. package/dist/{index-C-HkOEBt.d.cts → index-RCUizGxL.d.cts} +2 -2
  26. package/dist/{index-C-VLwB_Y.d.mts.map → index-RCUizGxL.d.cts.map} +1 -1
  27. package/dist/index.cjs +164 -172
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.mjs +159 -167
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/{openapi-Dcbme-Us.cjs → openapi-B8bu_OXN.cjs} +2 -2
  32. package/dist/{openapi-Dcbme-Us.cjs.map → openapi-B8bu_OXN.cjs.map} +1 -1
  33. package/dist/{openapi-vy4JzhUv.mjs → openapi-DfjbhrsM.mjs} +2 -2
  34. package/dist/{openapi-vy4JzhUv.mjs.map → openapi-DfjbhrsM.mjs.map} +1 -1
  35. package/dist/openapi.cjs +1 -1
  36. package/dist/openapi.d.cts +1 -1
  37. package/dist/openapi.d.mts +1 -1
  38. package/dist/openapi.mjs +1 -1
  39. package/dist/reconcile/public.d.cts +1 -1
  40. package/dist/reconcile/public.d.mts +1 -1
  41. package/dist/{fullstack-secrets-DXsWO-5m.cjs → reconcile-Cq4cO83R.cjs} +45 -1
  42. package/dist/reconcile-Cq4cO83R.cjs.map +1 -0
  43. package/dist/{fullstack-secrets-BET8gqwK.mjs → reconcile-fmoluZmZ.mjs} +34 -2
  44. package/dist/reconcile-fmoluZmZ.mjs.map +1 -0
  45. package/dist/ssm-BKN1Cg4z.mjs +60 -0
  46. package/dist/ssm-BKN1Cg4z.mjs.map +1 -0
  47. package/dist/ssm-FxeSAt35.cjs +60 -0
  48. package/dist/ssm-FxeSAt35.cjs.map +1 -0
  49. package/dist/{storage-C-30BD1e.cjs → storage-DgypfSD6.cjs} +83 -4
  50. package/dist/storage-DgypfSD6.cjs.map +1 -0
  51. package/dist/{storage-P_b3w7uj.mjs → storage-TP0x118M.mjs} +77 -4
  52. package/dist/storage-TP0x118M.mjs.map +1 -0
  53. package/dist/transfer-2aRVVJ6I.mjs +122 -0
  54. package/dist/transfer-2aRVVJ6I.mjs.map +1 -0
  55. package/dist/transfer-C3WZVmj_.cjs +151 -0
  56. package/dist/transfer-C3WZVmj_.cjs.map +1 -0
  57. package/dist/{types-RhXmHR-e.d.cts → types-7R81hu0i.d.mts} +138 -1
  58. package/dist/types-7R81hu0i.d.mts.map +1 -0
  59. package/dist/{types-kvBQjpPo.d.mts → types-N7c2O2m7.d.cts} +140 -1
  60. package/dist/types-N7c2O2m7.d.cts.map +1 -0
  61. package/dist/workspace/index.cjs +1 -1
  62. package/dist/workspace/index.d.cts +2 -2
  63. package/dist/workspace/index.d.mts +2 -2
  64. package/dist/workspace/index.mjs +1 -1
  65. package/dist/{workspace-CgwmXEtc.mjs → workspace-Bu3xNCej.mjs} +14 -3
  66. package/dist/{workspace-CgwmXEtc.mjs.map → workspace-Bu3xNCej.mjs.map} +1 -1
  67. package/dist/{workspace-mFpI_ky_.cjs → workspace-CRD9YinV.cjs} +19 -2
  68. package/dist/{workspace-mFpI_ky_.cjs.map → workspace-CRD9YinV.cjs.map} +1 -1
  69. package/package.json +11 -11
  70. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  71. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  72. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  73. package/dist/github-BfflNPVe.cjs.map +0 -1
  74. package/dist/github-CRwnxKmD.mjs.map +0 -1
  75. package/dist/keystore-B4PRlbgE.mjs +0 -81
  76. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  77. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  78. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  79. package/dist/reconcile-Dd2iyILf.cjs +0 -34
  80. package/dist/reconcile-Dd2iyILf.cjs.map +0 -1
  81. package/dist/reconcile-DhQ00DpU.mjs +0 -34
  82. package/dist/reconcile-DhQ00DpU.mjs.map +0 -1
  83. package/dist/storage-C-30BD1e.cjs.map +0 -1
  84. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  85. package/dist/sync-B3xxXtJT.mjs +0 -88
  86. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  87. package/dist/sync-D7uTIIEi.cjs +0 -111
  88. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  89. package/dist/types-RhXmHR-e.d.cts.map +0 -1
  90. package/dist/types-kvBQjpPo.d.mts.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
2
  import { a as DEFAULT_EVENTS$1, i as DEFAULT_CACHE, o as DEFAULT_STORAGE, t as discover } from "./discover-CK-n3w6b.mjs";
3
- import { a as loadWorkspaceAppInfo, c as appKey, n as getAppNameFromCwd } from "./config-pqGD3hF9.mjs";
4
- import { s as getDependencyEnvVars, t as allConstructGlobs } from "./workspace-CgwmXEtc.mjs";
3
+ import { a as loadWorkspaceAppInfo, c as appKey, n as getAppNameFromCwd, o as loadWorkspaceConfig } from "./config-DdKkoUE1.mjs";
4
+ import { s as getDependencyEnvVars, t as allConstructGlobs, w as TEST_STAGE } from "./workspace-Bu3xNCej.mjs";
5
5
  import { r as generatePgBossUrl } from "./generator-LfZU7NlU.mjs";
6
- import { n as readStageSecrets, o as toEmbeddableSecrets, r as secretsExist } from "./storage-P_b3w7uj.mjs";
6
+ import { n as readStageSecrets, o as toEmbeddableSecrets, r as secretsExist } from "./storage-TP0x118M.mjs";
7
7
  import { existsSync, readFileSync } from "node:fs";
8
- import { mkdir, readFile, writeFile } from "node:fs/promises";
8
+ import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
9
9
  import { dirname, join, resolve } from "node:path";
10
10
  import { execFile, execSync } from "node:child_process";
11
11
  import { DEFAULT_POSTGRES_VERSION, cacheTable, cookieDomain, dependentsOf, provideKey, providedKeyFor, provisionOrder, publicEnvFor } from "@geekmidas/manifest";
@@ -2109,6 +2109,11 @@ async function reconcile(options) {
2109
2109
  if (plan.containers.includes("caddy")) {
2110
2110
  await write(join(root, CADDYFILE_PATH), caddyfileRoot());
2111
2111
  await write(join(root, caddySitesPath(stage)), caddyfile);
2112
+ await pruneCaddySites(root, [
2113
+ stage,
2114
+ options.localStage,
2115
+ TEST_STAGE
2116
+ ]);
2112
2117
  }
2113
2118
  if (start && plan.containers.length > 0) await docker.up(composePath, plan.containers);
2114
2119
  if (start && plan.containers.includes("caddy")) await docker.reload(composePath, "caddy").catch(() => {});
@@ -2174,6 +2179,20 @@ function addressesFor(containers, ports) {
2174
2179
  return addresses;
2175
2180
  }
2176
2181
  /** Write a file only when its content would change, so mtimes stay meaningful. */
2182
+ /**
2183
+ * Remove the routes of stages this project no longer reconciles.
2184
+ *
2185
+ * Only the local stage and `test` are ever written, so any other file is left
2186
+ * over from a stage that was renamed — `development` becoming `dev`. Caddy
2187
+ * imports every file, and the leftover declares the same hosts as its
2188
+ * replacement: it refuses the whole config as ambiguous, and every URL behind
2189
+ * the edge goes with it.
2190
+ */
2191
+ async function pruneCaddySites(root, stages) {
2192
+ const dir = dirname(join(root, caddySitesPath(TEST_STAGE)));
2193
+ const keep = new Set(stages.map((stage) => stage && `${stage}.caddy`));
2194
+ for (const file of await readdir(dir)) if (file.endsWith(".caddy") && !keep.has(file)) await rm(join(dir, file));
2195
+ }
2177
2196
  async function write(path, content) {
2178
2197
  try {
2179
2198
  if (await readFile(path, "utf-8") === content) return;
@@ -2688,24 +2707,27 @@ async function prepareEntryCredentials(options) {
2688
2707
  let secretsRoot = cwd;
2689
2708
  let appName;
2690
2709
  let appInfo;
2710
+ let workspace;
2691
2711
  try {
2692
2712
  appInfo = await loadWorkspaceAppInfo(cwd);
2713
+ workspace = appInfo.workspace;
2693
2714
  workspaceAppPort = appInfo.app.port;
2694
2715
  secretsRoot = appInfo.workspaceRoot;
2695
2716
  appName = appInfo.appName;
2696
2717
  } catch {
2697
- secretsRoot = findSecretsRoot(cwd);
2718
+ workspace = await loadWorkspaceConfig(cwd).then((loaded) => loaded.workspace).catch(() => void 0);
2719
+ secretsRoot = workspace?.root ?? findSecretsRoot(cwd);
2698
2720
  appName = getAppNameFromCwd(cwd) ?? void 0;
2699
2721
  }
2700
2722
  const resolvedPort = options.explicitPort ?? workspaceAppPort ?? 3e3;
2701
- const stage = options.stage ?? appInfo?.workspace.stages.local;
2723
+ const stage = options.stage ?? workspace?.stages.local;
2702
2724
  const credentials = stage ? await loadSecretsForApp(secretsRoot, stage, appName) : {};
2703
2725
  credentials.PORT = String(resolvedPort);
2704
2726
  const declaredKeys = [];
2705
- if (appInfo && usesConstructs(appInfo.workspace)) {
2727
+ if (workspace && usesConstructs(workspace)) {
2706
2728
  const { reconcileWorkspace } = await Promise.resolve().then(() => workspace_exports);
2707
- const reconciled = await reconcileWorkspace(appInfo.workspace, {
2708
- stage: options.reconcileStage ?? appInfo.workspace.stages.local,
2729
+ const reconciled = await reconcileWorkspace(workspace, {
2730
+ stage: options.reconcileStage ?? workspace.stages.local,
2709
2731
  start: options.startDocker ?? false
2710
2732
  });
2711
2733
  Object.assign(credentials, reconciled.env);
@@ -2777,4 +2799,4 @@ async function prepareEntryCredentials(options) {
2777
2799
  //#endregion
2778
2800
  export { storageBackendFor as C, providerOf as S, LOCAL_CA_PATH as _, loadEnvFiles as a, cacheBackendFor as b, resolveServicePorts as c, constructGlobs as d, derivedContainers as f, COMPOSE_PATH as g, workspace_exports as h, isPortAvailable as i, rewriteUrlsWithPorts as l, usesConstructs as m, createEntryWrapper as n, loadSecretsForApp as o, reconcileWorkspace as p, findAvailablePort as r, prepareEntryCredentials as s, createCredentialsPreload as t, startWorkspaceServices as u, applyPostgres as v, eventsBackendFor as x, resourceName as y };
2779
2801
 
2780
- //# sourceMappingURL=credentials-BekkKtY_.mjs.map
2802
+ //# sourceMappingURL=credentials-lbv-j0Be.mjs.map