@geekmidas/cli 10.0.0-alpha.29 → 10.0.0-alpha.30
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/dist/{HostingerProvider-Btxpto71.mjs → HostingerProvider-GF6NAZAK.mjs} +2 -2
- package/dist/{HostingerProvider-Btxpto71.mjs.map → HostingerProvider-GF6NAZAK.mjs.map} +1 -1
- package/dist/{openapi-K4H5tHzA.cjs → OpenApiTsGenerator-D1nhN98m.cjs} +2 -224
- package/dist/OpenApiTsGenerator-D1nhN98m.cjs.map +1 -0
- package/dist/{openapi-D-Lk5Hr5.mjs → OpenApiTsGenerator-hDINScnz.mjs} +4 -190
- package/dist/OpenApiTsGenerator-hDINScnz.mjs.map +1 -0
- package/dist/{bundler-7iaO93G8.mjs → bundler-D9IPNvDt.mjs} +2 -2
- package/dist/{bundler-7iaO93G8.mjs.map → bundler-D9IPNvDt.mjs.map} +1 -1
- package/dist/{config-Dqxa-_Ge.mjs → config-BH3Ki69F.mjs} +2 -2
- package/dist/{config-Dqxa-_Ge.mjs.map → config-BH3Ki69F.mjs.map} +1 -1
- package/dist/{config-BTFLHfRb.cjs → config-URVD4bTj.cjs} +2 -2
- package/dist/{config-BTFLHfRb.cjs.map → config-URVD4bTj.cjs.map} +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.mjs +1 -1
- package/dist/{discover-CXGlQHm1.mjs → discover-CMxesskG.mjs} +8 -2
- package/dist/{discover-CXGlQHm1.mjs.map → discover-CMxesskG.mjs.map} +1 -1
- package/dist/{discover-BTh87DOO.cjs → discover-CroTIm0K.cjs} +12 -1
- package/dist/{discover-BTh87DOO.cjs.map → discover-CroTIm0K.cjs.map} +1 -1
- package/dist/{github-ZL3RcUVD.cjs → github-B2fis34P.cjs} +2 -2
- package/dist/{github-ZL3RcUVD.cjs.map → github-B2fis34P.cjs.map} +1 -1
- package/dist/{github-DPpNfzu4.mjs → github-BrDmlm1x.mjs} +2 -2
- package/dist/{github-DPpNfzu4.mjs.map → github-BrDmlm1x.mjs.map} +1 -1
- package/dist/index.cjs +187 -455
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +181 -451
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-BuCx7tIv.cjs +498 -0
- package/dist/migrate-BuCx7tIv.cjs.map +1 -0
- package/dist/migrate-CBICVMAi.mjs +493 -0
- package/dist/migrate-CBICVMAi.mjs.map +1 -0
- package/dist/openapi.cjs +197 -7
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.mjs +191 -1
- package/dist/openapi.mjs.map +1 -0
- package/dist/ready-CvP3JVEw.mjs +355 -0
- package/dist/ready-CvP3JVEw.mjs.map +1 -0
- package/dist/ready-DXtNfk7v.cjs +390 -0
- package/dist/ready-DXtNfk7v.cjs.map +1 -0
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/vitest.cjs +61 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +28 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +28 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +61 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/{workspace-B3ApLW6p.cjs → workspace-BhiMkRuA.cjs} +3 -3
- package/dist/{workspace-B3ApLW6p.cjs.map → workspace-BhiMkRuA.cjs.map} +1 -1
- package/dist/{workspace-DnHW8ooI.mjs → workspace-C97QUCIf.mjs} +3 -3
- package/dist/{workspace-DnHW8ooI.mjs.map → workspace-C97QUCIf.mjs.map} +1 -1
- package/package.json +24 -14
- package/dist/openapi-D-Lk5Hr5.mjs.map +0 -1
- package/dist/openapi-K4H5tHzA.cjs.map +0 -1
package/dist/vitest.mjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { n as TEST_READY_FILE, r as TEST_MANIFEST_ENV } from "./ready-CvP3JVEw.mjs";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
//#region src/vitest.ts
|
|
7
|
+
/**
|
|
8
|
+
* The Vitest global setup for a gkm project: the test stage, reconciled and
|
|
9
|
+
* migrated, before any test runs.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // vitest.config.ts — the only one
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* test: { globalSetup: ['@geekmidas/cli/vitest'] },
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Declared once, at the root, it runs however the suite starts — `gkm test`,
|
|
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
|
|
22
|
+
* filter and no teardown to run twice.
|
|
23
|
+
*/
|
|
24
|
+
/** This package's `gkm`, whichever install of it loaded this file. */
|
|
25
|
+
const GKM = join(dirname(fileURLToPath(import.meta.url)), "..", "bin", "gkm.mjs");
|
|
26
|
+
function setup(project) {
|
|
27
|
+
const cwd = process.cwd();
|
|
28
|
+
const readyPath = process.env["GKM_TEST_READY"] ?? prepare(cwd);
|
|
29
|
+
const ready = JSON.parse(readFileSync(readyPath, "utf-8"));
|
|
30
|
+
const env = JSON.parse(readFileSync(ready.env, "utf-8"));
|
|
31
|
+
Object.assign(process.env, env);
|
|
32
|
+
if (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;
|
|
33
|
+
project?.onTestsRerun(() => {
|
|
34
|
+
gkm([
|
|
35
|
+
"migrate",
|
|
36
|
+
"--stage",
|
|
37
|
+
"test"
|
|
38
|
+
], cwd);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function prepare(cwd) {
|
|
42
|
+
gkm(["test", "--setup"], cwd);
|
|
43
|
+
return join(cwd, TEST_READY_FILE);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Run `gkm` as its own process.
|
|
47
|
+
*
|
|
48
|
+
* Not in this one: discovery imports the project's constructs, with its path
|
|
49
|
+
* aliases, through the loader `gkm` registers for itself — which a module
|
|
50
|
+
* Vite loaded into Vitest does not have.
|
|
51
|
+
*/
|
|
52
|
+
function gkm(args, cwd) {
|
|
53
|
+
execFileSync(process.execPath, [GKM, ...args], {
|
|
54
|
+
cwd,
|
|
55
|
+
stdio: "inherit"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { setup as default };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=vitest.mjs.map
|
|
@@ -0,0 +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,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
-
const require_discover = require("./discover-
|
|
3
|
-
const require_config = require("./config-
|
|
2
|
+
const require_discover = require("./discover-CroTIm0K.cjs");
|
|
3
|
+
const require_config = require("./config-URVD4bTj.cjs");
|
|
4
4
|
const require_workspace = require("./workspace-Bav3TVrP.cjs");
|
|
5
5
|
const require_storage = require("./storage-C2JC31V9.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
@@ -2790,4 +2790,4 @@ Object.defineProperty(exports, "workspace_exports", {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
});
|
|
2792
2792
|
|
|
2793
|
-
//# sourceMappingURL=workspace-
|
|
2793
|
+
//# sourceMappingURL=workspace-BhiMkRuA.cjs.map
|