@geekmidas/cli 10.0.0-alpha.31 → 10.0.0-alpha.33

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 (63) hide show
  1. package/dist/{config-URVD4bTj.cjs → config-DMpzmsQL.cjs} +2 -2
  2. package/dist/{config-URVD4bTj.cjs.map → config-DMpzmsQL.cjs.map} +1 -1
  3. package/dist/{config-BH3Ki69F.mjs → config-Du8AQJRK.mjs} +2 -2
  4. package/dist/{config-BH3Ki69F.mjs.map → config-Du8AQJRK.mjs.map} +1 -1
  5. package/dist/config.cjs +2 -2
  6. package/dist/config.d.cts +2 -2
  7. package/dist/config.d.mts +2 -2
  8. package/dist/config.mjs +2 -2
  9. package/dist/discover-CMxesskG.mjs.map +1 -1
  10. package/dist/discover-CroTIm0K.cjs.map +1 -1
  11. package/dist/{github-BrDmlm1x.mjs → github-DN-92LWP.mjs} +3 -3
  12. package/dist/{github-BrDmlm1x.mjs.map → github-DN-92LWP.mjs.map} +1 -1
  13. package/dist/{github-B2fis34P.cjs → github-JhvrmjQp.cjs} +3 -3
  14. package/dist/{github-B2fis34P.cjs.map → github-JhvrmjQp.cjs.map} +1 -1
  15. package/dist/{index-p89EzILa.d.mts → index-CAp22ul5.d.cts} +2 -2
  16. package/dist/{index-p89EzILa.d.mts.map → index-CAp22ul5.d.cts.map} +1 -1
  17. package/dist/{index-rU9u761a.d.cts → index-DxXMtQNT.d.mts} +2 -2
  18. package/dist/{index-rU9u761a.d.cts.map → index-DxXMtQNT.d.mts.map} +1 -1
  19. package/dist/index.cjs +191 -121
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.mjs +192 -122
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/{migrate-BuCx7tIv.cjs → migrate-BkytlJlU.cjs} +272 -29
  24. package/dist/migrate-BkytlJlU.cjs.map +1 -0
  25. package/dist/{migrate-CBICVMAi.mjs → migrate-D2rtGKYi.mjs} +272 -31
  26. package/dist/migrate-D2rtGKYi.mjs.map +1 -0
  27. package/dist/openapi.cjs +1 -1
  28. package/dist/openapi.d.cts +1 -1
  29. package/dist/openapi.d.mts +1 -1
  30. package/dist/openapi.mjs +1 -1
  31. package/dist/{ready-DXtNfk7v.cjs → ready-CXhoutix.cjs} +108 -25
  32. package/dist/ready-CXhoutix.cjs.map +1 -0
  33. package/dist/{ready-CvP3JVEw.mjs → ready-D1BCiaYU.mjs} +106 -29
  34. package/dist/ready-D1BCiaYU.mjs.map +1 -0
  35. package/dist/reconcile/public.d.cts +1 -1
  36. package/dist/reconcile/public.d.mts +1 -1
  37. package/dist/{types-CzK6hsXP.d.mts → types-BTiu5kwo.d.mts} +26 -1
  38. package/dist/{types-CzK6hsXP.d.mts.map → types-BTiu5kwo.d.mts.map} +1 -1
  39. package/dist/{types-DOOAevjG.d.cts → types-Bj_FpeTc.d.cts} +26 -1
  40. package/dist/{types-DOOAevjG.d.cts.map → types-Bj_FpeTc.d.cts.map} +1 -1
  41. package/dist/vitest.cjs +6 -6
  42. package/dist/vitest.cjs.map +1 -1
  43. package/dist/vitest.d.cts +4 -4
  44. package/dist/vitest.d.mts +4 -4
  45. package/dist/vitest.mjs +6 -6
  46. package/dist/vitest.mjs.map +1 -1
  47. package/dist/workspace/index.cjs +1 -1
  48. package/dist/workspace/index.d.cts +2 -2
  49. package/dist/workspace/index.d.mts +2 -2
  50. package/dist/workspace/index.mjs +1 -1
  51. package/dist/{workspace-C97QUCIf.mjs → workspace-BNurJoFx.mjs} +3 -3
  52. package/dist/{workspace-C97QUCIf.mjs.map → workspace-BNurJoFx.mjs.map} +1 -1
  53. package/dist/{workspace-BhiMkRuA.cjs → workspace-C8TbIWxO.cjs} +3 -3
  54. package/dist/{workspace-BhiMkRuA.cjs.map → workspace-C8TbIWxO.cjs.map} +1 -1
  55. package/dist/{workspace-Bav3TVrP.cjs → workspace-CAJk6UmC.cjs} +11 -4
  56. package/dist/{workspace-Bav3TVrP.cjs.map → workspace-CAJk6UmC.cjs.map} +1 -1
  57. package/dist/{workspace-T4IVGSoB.mjs → workspace-CsL76tpc.mjs} +11 -4
  58. package/dist/{workspace-T4IVGSoB.mjs.map → workspace-CsL76tpc.mjs.map} +1 -1
  59. package/package.json +14 -14
  60. package/dist/migrate-BuCx7tIv.cjs.map +0 -1
  61. package/dist/migrate-CBICVMAi.mjs.map +0 -1
  62. package/dist/ready-CvP3JVEw.mjs.map +0 -1
  63. package/dist/ready-DXtNfk7v.cjs.map +0 -1
package/dist/vitest.cjs CHANGED
@@ -1,12 +1,12 @@
1
- const require_ready = require("./ready-DXtNfk7v.cjs");
1
+ const require_ready = require("./ready-CXhoutix.cjs");
2
2
  let node_fs = require("node:fs");
3
3
  let node_path = require("node:path");
4
4
  let node_child_process = require("node:child_process");
5
5
  let node_url = require("node:url");
6
6
  //#region src/vitest.ts
7
7
  /**
8
- * The Vitest global setup for a gkm project: the test stage, reconciled and
9
- * migrated, before any test runs.
8
+ * The Vitest global setup for a gkm project: the test stage, reconciled,
9
+ * migrated and seeded, before any test runs.
10
10
  *
11
11
  * ```ts
12
12
  * // vitest.config.ts — the only one
@@ -17,8 +17,8 @@ let node_url = require("node:url");
17
17
  *
18
18
  * Declared once, at the root, it runs however the suite starts — `gkm test`,
19
19
  * plain `vitest`, an editor's runner, a filtered run of one project. Its
20
- * databases are migrated for every construct at once, and kept rather than
21
- * dropped afterwards, so there is no per-project setup to be skipped by a
20
+ * databases are migrated and seeded for every construct at once, and kept
21
+ * rather than dropped afterwards, so there is no per-project setup to be skipped by a
22
22
  * filter and no teardown to run twice.
23
23
  */
24
24
  /** This package's `gkm`, whichever install of it loaded this file. */
@@ -32,7 +32,7 @@ function setup(project) {
32
32
  if (ready.manifest) process.env[require_ready.TEST_MANIFEST_ENV] = ready.manifest;
33
33
  project?.onTestsRerun(() => {
34
34
  gkm([
35
- "migrate",
35
+ "seed",
36
36
  "--stage",
37
37
  "test"
38
38
  ], cwd);
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.cjs","names":["join","dirname","fileURLToPath","readFileSync","TEST_MANIFEST_ENV","TEST_READY_FILE"],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled and\n * migrated, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are migrated for every construct at once, and kept rather than\n * dropped afterwards, so there is no per-project setup to be skipped by a\n * filter and no teardown to run twice.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration written while watching is applied on the next run, rather\n\t// than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['migrate', '--stage', 'test'], cwd);\n\t});\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,OAAA,GAAMA,UAAAA,KAAAA,EAAAA,GACXC,UAAAA,QAAAA,EAAAA,GAAQC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAkC;CAC/D,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,OAAA,GAAMC,QAAAA,aAAAA,CAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,OAAA,GAAMA,QAAAA,aAAAA,CAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAIC,cAAAA,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAW;GAAW;EAAM,GAAG,GAAG;CACxC,CAAC;AACF;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,QAAA,GAAOJ,UAAAA,KAAAA,CAAK,KAAKK,cAAAA,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,CAAA,GAAA,mBAAA,aAAA,CAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
1
+ {"version":3,"file":"vitest.cjs","names":["join","dirname","fileURLToPath","readFileSync","TEST_MANIFEST_ENV","TEST_READY_FILE"],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled,\n * migrated and seeded, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are migrated and seeded for every construct at once, and kept\n * rather than dropped afterwards, so there is no per-project setup to be skipped by a\n * filter and no teardown to run twice.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration or seed written while watching is applied on the next run,\n\t// rather than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['seed', '--stage', 'test'], cwd);\n\t});\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,OAAA,GAAMA,UAAAA,KAAAA,EAAAA,GACXC,UAAAA,QAAAA,EAAAA,GAAQC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAkC;CAC/D,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,OAAA,GAAMC,QAAAA,aAAAA,CAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,OAAA,GAAMA,QAAAA,aAAAA,CAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAIC,cAAAA,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAQ;GAAW;EAAM,GAAG,GAAG;CACrC,CAAC;AACF;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,QAAA,GAAOJ,UAAAA,KAAAA,CAAK,KAAKK,cAAAA,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,CAAA,GAAA,mBAAA,aAAA,CAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
package/dist/vitest.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/vitest.d.ts
2
2
  /**
3
- * The Vitest global setup for a gkm project: the test stage, reconciled and
4
- * migrated, before any test runs.
3
+ * The Vitest global setup for a gkm project: the test stage, reconciled,
4
+ * migrated and seeded, before any test runs.
5
5
  *
6
6
  * ```ts
7
7
  * // vitest.config.ts — the only one
@@ -12,8 +12,8 @@
12
12
  *
13
13
  * Declared once, at the root, it runs however the suite starts — `gkm test`,
14
14
  * plain `vitest`, an editor's runner, a filtered run of one project. Its
15
- * databases are migrated for every construct at once, and kept rather than
16
- * dropped afterwards, so there is no per-project setup to be skipped by a
15
+ * databases are migrated and seeded for every construct at once, and kept
16
+ * rather than dropped afterwards, so there is no per-project setup to be skipped by a
17
17
  * filter and no teardown to run twice.
18
18
  */
19
19
  /**
package/dist/vitest.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/vitest.d.ts
2
2
  /**
3
- * The Vitest global setup for a gkm project: the test stage, reconciled and
4
- * migrated, before any test runs.
3
+ * The Vitest global setup for a gkm project: the test stage, reconciled,
4
+ * migrated and seeded, before any test runs.
5
5
  *
6
6
  * ```ts
7
7
  * // vitest.config.ts — the only one
@@ -12,8 +12,8 @@
12
12
  *
13
13
  * Declared once, at the root, it runs however the suite starts — `gkm test`,
14
14
  * plain `vitest`, an editor's runner, a filtered run of one project. Its
15
- * databases are migrated for every construct at once, and kept rather than
16
- * dropped afterwards, so there is no per-project setup to be skipped by a
15
+ * databases are migrated and seeded for every construct at once, and kept
16
+ * rather than dropped afterwards, so there is no per-project setup to be skipped by a
17
17
  * filter and no teardown to run twice.
18
18
  */
19
19
  /**
package/dist/vitest.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { n as TEST_READY_FILE, r as TEST_MANIFEST_ENV } from "./ready-CvP3JVEw.mjs";
1
+ import { i as TEST_MANIFEST_ENV, n as TEST_READY_FILE } from "./ready-D1BCiaYU.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { execFileSync } from "node:child_process";
5
5
  import { fileURLToPath } from "node:url";
6
6
  //#region src/vitest.ts
7
7
  /**
8
- * The Vitest global setup for a gkm project: the test stage, reconciled and
9
- * migrated, before any test runs.
8
+ * The Vitest global setup for a gkm project: the test stage, reconciled,
9
+ * migrated and seeded, before any test runs.
10
10
  *
11
11
  * ```ts
12
12
  * // vitest.config.ts — the only one
@@ -17,8 +17,8 @@ import { fileURLToPath } from "node:url";
17
17
  *
18
18
  * Declared once, at the root, it runs however the suite starts — `gkm test`,
19
19
  * plain `vitest`, an editor's runner, a filtered run of one project. Its
20
- * databases are migrated for every construct at once, and kept rather than
21
- * dropped afterwards, so there is no per-project setup to be skipped by a
20
+ * databases are migrated and seeded for every construct at once, and kept
21
+ * rather than dropped afterwards, so there is no per-project setup to be skipped by a
22
22
  * filter and no teardown to run twice.
23
23
  */
24
24
  /** This package's `gkm`, whichever install of it loaded this file. */
@@ -32,7 +32,7 @@ function setup(project) {
32
32
  if (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;
33
33
  project?.onTestsRerun(() => {
34
34
  gkm([
35
- "migrate",
35
+ "seed",
36
36
  "--stage",
37
37
  "test"
38
38
  ], cwd);
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.mjs","names":[],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled and\n * migrated, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are migrated for every construct at once, and kept rather than\n * dropped afterwards, so there is no per-project setup to be skipped by a\n * filter and no teardown to run twice.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration written while watching is applied on the next run, rather\n\t// than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['migrate', '--stage', 'test'], cwd);\n\t});\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,MAAM,KACX,QAAQ,cAAc,YAAY,GAAG,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAkC;CAC/D,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,MAAM,aAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,MAAM,aAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAI,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAW;GAAW;EAAM,GAAG,GAAG;CACxC,CAAC;AACF;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,OAAO,KAAK,KAAK,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,aAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
1
+ {"version":3,"file":"vitest.mjs","names":[],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled,\n * migrated and seeded, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are migrated and seeded for every construct at once, and kept\n * rather than dropped afterwards, so there is no per-project setup to be skipped by a\n * filter and no teardown to run twice.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration or seed written while watching is applied on the next run,\n\t// rather than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['seed', '--stage', 'test'], cwd);\n\t});\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,MAAM,KACX,QAAQ,cAAc,YAAY,GAAG,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAkC;CAC/D,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,MAAM,aAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,MAAM,aAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAI,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAQ;GAAW;EAAM,GAAG,GAAG;CACrC,CAAC;AACF;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,OAAO,KAAK,KAAK,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,aAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_workspace = require("../workspace-Bav3TVrP.cjs");
2
+ const require_workspace = require("../workspace-CAJk6UmC.cjs");
3
3
  exports.PHASE_2_DEPLOY_TARGETS = require_workspace.PHASE_2_DEPLOY_TARGETS;
4
4
  exports.PUBLIC_ENV_PREFIXES = require_workspace.PUBLIC_ENV_PREFIXES;
5
5
  exports.SUPPORTED_DEPLOY_TARGETS = require_workspace.SUPPORTED_DEPLOY_TARGETS;
@@ -1,3 +1,3 @@
1
- import { A as SUPPORTED_DEPLOY_TARGETS, C as WorkspaceInput, D as FrontendFramework, F as isPhase2DeployTarget, I as safeValidateWorkspaceConfig, L as validateWorkspaceConfig, M as formatValidationErrors, N as getDeployTargetError, O as MobileFramework, P as isDeployTargetSupported, S as WorkspaceConfig, T as BackendFramework, _ as ModelsConfig, b as SecretsConfig, c as AppInput, d as DeployConfig, f as DeployTarget, g as LoadedConfig, h as InferredWorkspaceConfig, j as WorkspaceConfigSchema, k as PHASE_2_DEPLOY_TARGETS, l as AppsRecord, m as InferAppNames, o as AppConfig, p as DokployWorkspaceConfig, s as AppConfigInput, u as ConstrainedApps, v as NormalizedAppConfig, w as isWorkspaceConfig, x as SharedConfig, y as NormalizedWorkspace } from "../types-DOOAevjG.cjs";
2
- import { a as getAppBuildOrder, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs } from "../index-rU9u761a.cjs";
1
+ import { A as SUPPORTED_DEPLOY_TARGETS, C as WorkspaceInput, D as FrontendFramework, F as isPhase2DeployTarget, I as safeValidateWorkspaceConfig, L as validateWorkspaceConfig, M as formatValidationErrors, N as getDeployTargetError, O as MobileFramework, P as isDeployTargetSupported, S as WorkspaceConfig, T as BackendFramework, _ as ModelsConfig, b as SecretsConfig, c as AppInput, d as DeployConfig, f as DeployTarget, g as LoadedConfig, h as InferredWorkspaceConfig, j as WorkspaceConfigSchema, k as PHASE_2_DEPLOY_TARGETS, l as AppsRecord, m as InferAppNames, o as AppConfig, p as DokployWorkspaceConfig, s as AppConfigInput, u as ConstrainedApps, v as NormalizedAppConfig, w as isWorkspaceConfig, x as SharedConfig, y as NormalizedWorkspace } from "../types-Bj_FpeTc.cjs";
2
+ import { a as getAppBuildOrder, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs } from "../index-CAp22ul5.cjs";
3
3
  export { type AppConfig, type AppConfigInput, type AppInput, type AppsRecord, type BackendFramework, type ConstrainedApps, type DeployConfig, type DeployTarget, type DokployWorkspaceConfig, type FrontendFramework, type InferAppNames, type InferredWorkspaceConfig, type LoadedConfig, type MobileFramework, type ModelsConfig, type NormalizedAppConfig, type NormalizedWorkspace, PHASE_2_DEPLOY_TARGETS, PUBLIC_ENV_PREFIXES, SUPPORTED_DEPLOY_TARGETS, type SecretsConfig, type SharedConfig, type WorkspaceConfig, WorkspaceConfigSchema, type WorkspaceInput, allConstructGlobs, appConstructGlobs, constructPatterns, defineWorkspace, formatValidationErrors, getAppBuildOrder, getAppGkmConfig, getDeployTargetError, getEndpointForStage, getPublicEnvPrefix, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, normalizeWorkspace, processConfig, safeValidateWorkspaceConfig, stripPublicPrefix, validateWorkspaceConfig, workspaceConstructGlobs, wrapSingleAppAsWorkspace };
@@ -1,3 +1,3 @@
1
- import { A as SUPPORTED_DEPLOY_TARGETS, C as WorkspaceInput, D as FrontendFramework, F as isPhase2DeployTarget, I as safeValidateWorkspaceConfig, L as validateWorkspaceConfig, M as formatValidationErrors, N as getDeployTargetError, O as MobileFramework, P as isDeployTargetSupported, S as WorkspaceConfig, T as BackendFramework, _ as ModelsConfig, b as SecretsConfig, c as AppInput, d as DeployConfig, f as DeployTarget, g as LoadedConfig, h as InferredWorkspaceConfig, j as WorkspaceConfigSchema, k as PHASE_2_DEPLOY_TARGETS, l as AppsRecord, m as InferAppNames, o as AppConfig, p as DokployWorkspaceConfig, s as AppConfigInput, u as ConstrainedApps, v as NormalizedAppConfig, w as isWorkspaceConfig, x as SharedConfig, y as NormalizedWorkspace } from "../types-CzK6hsXP.mjs";
2
- import { a as getAppBuildOrder, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs } from "../index-p89EzILa.mjs";
1
+ import { A as SUPPORTED_DEPLOY_TARGETS, C as WorkspaceInput, D as FrontendFramework, F as isPhase2DeployTarget, I as safeValidateWorkspaceConfig, L as validateWorkspaceConfig, M as formatValidationErrors, N as getDeployTargetError, O as MobileFramework, P as isDeployTargetSupported, S as WorkspaceConfig, T as BackendFramework, _ as ModelsConfig, b as SecretsConfig, c as AppInput, d as DeployConfig, f as DeployTarget, g as LoadedConfig, h as InferredWorkspaceConfig, j as WorkspaceConfigSchema, k as PHASE_2_DEPLOY_TARGETS, l as AppsRecord, m as InferAppNames, o as AppConfig, p as DokployWorkspaceConfig, s as AppConfigInput, u as ConstrainedApps, v as NormalizedAppConfig, w as isWorkspaceConfig, x as SharedConfig, y as NormalizedWorkspace } from "../types-BTiu5kwo.mjs";
2
+ import { a as getAppBuildOrder, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs } from "../index-DxXMtQNT.mjs";
3
3
  export { type AppConfig, type AppConfigInput, type AppInput, type AppsRecord, type BackendFramework, type ConstrainedApps, type DeployConfig, type DeployTarget, type DokployWorkspaceConfig, type FrontendFramework, type InferAppNames, type InferredWorkspaceConfig, type LoadedConfig, type MobileFramework, type ModelsConfig, type NormalizedAppConfig, type NormalizedWorkspace, PHASE_2_DEPLOY_TARGETS, PUBLIC_ENV_PREFIXES, SUPPORTED_DEPLOY_TARGETS, type SecretsConfig, type SharedConfig, type WorkspaceConfig, WorkspaceConfigSchema, type WorkspaceInput, allConstructGlobs, appConstructGlobs, constructPatterns, defineWorkspace, formatValidationErrors, getAppBuildOrder, getAppGkmConfig, getDeployTargetError, getEndpointForStage, getPublicEnvPrefix, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, normalizeWorkspace, processConfig, safeValidateWorkspaceConfig, stripPublicPrefix, validateWorkspaceConfig, workspaceConstructGlobs, wrapSingleAppAsWorkspace };
@@ -1,2 +1,2 @@
1
- import { C as safeValidateWorkspaceConfig, S as isPhase2DeployTarget, _ as SUPPORTED_DEPLOY_TARGETS, a as getAppBuildOrder, b as getDeployTargetError, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, g as PHASE_2_DEPLOY_TARGETS, h as isWorkspaceConfig, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs, v as WorkspaceConfigSchema, w as validateWorkspaceConfig, x as isDeployTargetSupported, y as formatValidationErrors } from "../workspace-T4IVGSoB.mjs";
1
+ import { C as safeValidateWorkspaceConfig, S as isPhase2DeployTarget, _ as SUPPORTED_DEPLOY_TARGETS, a as getAppBuildOrder, b as getDeployTargetError, c as normalizeWorkspace, d as wrapSingleAppAsWorkspace, f as PUBLIC_ENV_PREFIXES, g as PHASE_2_DEPLOY_TARGETS, h as isWorkspaceConfig, i as defineWorkspace, l as processConfig, m as stripPublicPrefix, n as appConstructGlobs, o as getAppGkmConfig, p as getPublicEnvPrefix, r as constructPatterns, s as getEndpointForStage, t as allConstructGlobs, u as workspaceConstructGlobs, v as WorkspaceConfigSchema, w as validateWorkspaceConfig, x as isDeployTargetSupported, y as formatValidationErrors } from "../workspace-CsL76tpc.mjs";
2
2
  export { PHASE_2_DEPLOY_TARGETS, PUBLIC_ENV_PREFIXES, SUPPORTED_DEPLOY_TARGETS, WorkspaceConfigSchema, allConstructGlobs, appConstructGlobs, constructPatterns, defineWorkspace, formatValidationErrors, getAppBuildOrder, getAppGkmConfig, getDeployTargetError, getEndpointForStage, getPublicEnvPrefix, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, normalizeWorkspace, processConfig, safeValidateWorkspaceConfig, stripPublicPrefix, validateWorkspaceConfig, workspaceConstructGlobs, wrapSingleAppAsWorkspace };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
2
  import { a as DEFAULT_CACHE, o as DEFAULT_EVENTS$1, s as DEFAULT_STORAGE, t as discover } from "./discover-CMxesskG.mjs";
3
- import { l as appKey, o as loadWorkspaceAppInfo, r as getAppNameFromCwd, s as loadWorkspaceConfig } from "./config-BH3Ki69F.mjs";
4
- import { E as TEST_STAGE, t as allConstructGlobs } from "./workspace-T4IVGSoB.mjs";
3
+ import { l as appKey, o as loadWorkspaceAppInfo, r as getAppNameFromCwd, s as loadWorkspaceConfig } from "./config-Du8AQJRK.mjs";
4
+ import { E as TEST_STAGE, t as allConstructGlobs } from "./workspace-CsL76tpc.mjs";
5
5
  import { n as readStageSecrets, o as toEmbeddableSecrets, r as secretsExist } from "./storage-BjTLjDDp.mjs";
6
6
  import { existsSync } from "node:fs";
7
7
  import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
@@ -2665,4 +2665,4 @@ function localAddress(port) {
2665
2665
  //#endregion
2666
2666
  export { findAvailablePort as _, workspace_exports as a, loadSecretsForApp as b, applyPostgres as c, cacheBackendFor as d, eventsBackendFor as f, createEntryWrapper as g, createCredentialsPreload as h, reconcileWorkspace as i, resourceName as l, storageBackendFor as m, constructGlobs as n, COMPOSE_PATH as o, providerOf as p, derivedContainers as r, LOCAL_CA_PATH as s, backendsOf as t, rootSite as u, isPortAvailable as v, prepareEntryCredentials as x, loadEnvFiles as y };
2667
2667
 
2668
- //# sourceMappingURL=workspace-C97QUCIf.mjs.map
2668
+ //# sourceMappingURL=workspace-BNurJoFx.mjs.map