@systemfsoftware/stryker-js-vitest-runner 4.0.3 → 5.0.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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # @systemfsoftware/stryker-js-vitest-runner
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Every module Stryker loads — config files, `extends` targets, plugins, and the vitest runner's own vitest — now resolves and imports through Node's native ECMAScript module system: `import.meta.resolve` resolves each bare specifier from the consuming module, and dynamic `import()` loads the resolved URL. The package's `exports` map (or a legacy `main`) selects the entry file, ESM-only plugin packages load, and no require-based loader ships in any package. An unresolvable bare specifier warns with a machine-readable reason; the run fails at prepare only when nothing provides the configured runner or checker. Node.js 22.18.0 or later is required.
8
+
9
+ To migrate, install Node.js 22.18.0 or later. Bare plugin specifiers keep working, but a plugin package must publish an ES module entry through `exports` or `main`, and the plugin must be resolvable from where Stryker itself is installed.
10
+
11
+ - The plugin system now runs each configured TestRunner/Checker/Reporter plugin in its own spawned process over an @effect/rpc wire: plugins load from the project's config-declared specifiers (no glob discovery), boundary failures are typed errors, and plugin spans link into the host trace. Breaking: the in-process plugin Layer contract is removed.
12
+
13
+ ### Patch Changes
14
+
15
+ - Maintenance release. Every published entry point, export, option, and behaviour is exactly as it was.
16
+
17
+ - effect peer range widens to ^4.0.0-rc.112; repository metadata now points at stryker-js-effect
18
+
19
+ - The worker environment now arrives on the spawn params instead of mid-init self-mutation, and the setup filename uses a uuid instead of the process id.
20
+
21
+ ## 4.0.4
22
+
23
+ ### Patch Changes
24
+
25
+ - Imports rewired to the collapsed `@systemfsoftware/stryker-js` root entry; each package now co-releases against the root-entry major.
26
+
27
+ - Updated dependencies:
28
+ - @systemfsoftware/effect-cell-types@8.0.0
29
+ - @systemfsoftware/stryker-js@4.0.0
30
+
3
31
  ## 4.0.3
4
32
 
5
33
  ### Patch Changes
package/README.md CHANGED
@@ -27,8 +27,8 @@ Name the plugin in your Stryker configuration:
27
27
 
28
28
  ## API
29
29
 
30
- The public surface is generated from the source and versioned with the package: [`etc/stryker-js-vitest-runner.api.md`](./etc/stryker-js-vitest-runner.api.md).
30
+ The public surface ships as this package's type declarations in `dist`; no generated API report is carried in this repository.
31
31
 
32
32
  ## License
33
33
 
34
- Apache-2.0. Part of [systemfsoftware](https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/stryker-js/vitest-runner#readme).
34
+ Apache-2.0. Part of [systemfsoftware](https://github.com/systemfsoftware/stryker-js-effect#readme).
@@ -0,0 +1,10 @@
1
+ import { i as __require, r as __commonJSMin } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
3
+ var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.execAsync = void 0;
6
+ const child_process = __require("child_process");
7
+ exports.execAsync = __require("util").promisify(child_process.exec);
8
+ }));
9
+ //#endregion
10
+ export { require_execAsync as t };
@@ -0,0 +1,10 @@
1
+ import { i as __require, r as __commonJSMin } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
3
+ var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.execAsync = void 0;
6
+ const child_process = __require("child_process");
7
+ exports.execAsync = __require("util").promisify(child_process.exec);
8
+ }));
9
+ //#endregion
10
+ export { require_execAsync as t };
@@ -0,0 +1,26 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-zBkwnfr9.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js
4
+ var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const fs_1 = __require("fs");
8
+ const execAsync_1 = require_execAsync();
9
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
10
+ async function getMachineId() {
11
+ try {
12
+ return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim();
13
+ } catch (e) {
14
+ api_1.diag.debug(`error reading machine id: ${e}`);
15
+ }
16
+ try {
17
+ return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim();
18
+ } catch (e) {
19
+ api_1.diag.debug(`error reading machine id: ${e}`);
20
+ }
21
+ }
22
+ exports.getMachineId = getMachineId;
23
+ }));
24
+ //#endregion
25
+ export default require_getMachineId_bsd();
26
+ export {};
@@ -0,0 +1,26 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-CUNMu62l.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js
4
+ var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const fs_1 = __require("fs");
8
+ const execAsync_1 = require_execAsync();
9
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
10
+ async function getMachineId() {
11
+ try {
12
+ return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim();
13
+ } catch (e) {
14
+ api_1.diag.debug(`error reading machine id: ${e}`);
15
+ }
16
+ try {
17
+ return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim();
18
+ } catch (e) {
19
+ api_1.diag.debug(`error reading machine id: ${e}`);
20
+ }
21
+ }
22
+ exports.getMachineId = getMachineId;
23
+ }));
24
+ //#endregion
25
+ export default require_getMachineId_bsd();
26
+ export {};
@@ -0,0 +1,23 @@
1
+ import { a as __toCommonJS, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-CUNMu62l.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js
4
+ var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const execAsync_1 = require_execAsync();
8
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
9
+ async function getMachineId() {
10
+ try {
11
+ const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID"));
12
+ if (!idLine) return;
13
+ const parts = idLine.split("\" = \"");
14
+ if (parts.length === 2) return parts[1].slice(0, -1);
15
+ } catch (e) {
16
+ api_1.diag.debug(`error reading machine id: ${e}`);
17
+ }
18
+ }
19
+ exports.getMachineId = getMachineId;
20
+ }));
21
+ //#endregion
22
+ export default require_getMachineId_darwin();
23
+ export {};
@@ -0,0 +1,23 @@
1
+ import { a as __toCommonJS, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-zBkwnfr9.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js
4
+ var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const execAsync_1 = require_execAsync();
8
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
9
+ async function getMachineId() {
10
+ try {
11
+ const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID"));
12
+ if (!idLine) return;
13
+ const parts = idLine.split("\" = \"");
14
+ if (parts.length === 2) return parts[1].slice(0, -1);
15
+ } catch (e) {
16
+ api_1.diag.debug(`error reading machine id: ${e}`);
17
+ }
18
+ }
19
+ exports.getMachineId = getMachineId;
20
+ }));
21
+ //#endregion
22
+ export default require_getMachineId_darwin();
23
+ export {};
@@ -0,0 +1,19 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js
3
+ var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getMachineId = void 0;
6
+ const fs_1 = __require("fs");
7
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
8
+ async function getMachineId() {
9
+ for (const path of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try {
10
+ return (await fs_1.promises.readFile(path, { encoding: "utf8" })).trim();
11
+ } catch (e) {
12
+ api_1.diag.debug(`error reading machine id: ${e}`);
13
+ }
14
+ }
15
+ exports.getMachineId = getMachineId;
16
+ }));
17
+ //#endregion
18
+ export default require_getMachineId_linux();
19
+ export {};
@@ -0,0 +1,19 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js
3
+ var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getMachineId = void 0;
6
+ const fs_1 = __require("fs");
7
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
8
+ async function getMachineId() {
9
+ for (const path of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try {
10
+ return (await fs_1.promises.readFile(path, { encoding: "utf8" })).trim();
11
+ } catch (e) {
12
+ api_1.diag.debug(`error reading machine id: ${e}`);
13
+ }
14
+ }
15
+ exports.getMachineId = getMachineId;
16
+ }));
17
+ //#endregion
18
+ export default require_getMachineId_linux();
19
+ export {};
@@ -0,0 +1,14 @@
1
+ import { a as __toCommonJS, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js
3
+ var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getMachineId = void 0;
6
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
7
+ async function getMachineId() {
8
+ api_1.diag.debug("could not read machine-id: unsupported platform");
9
+ }
10
+ exports.getMachineId = getMachineId;
11
+ }));
12
+ //#endregion
13
+ export default require_getMachineId_unsupported();
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { a as __toCommonJS, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js
3
+ var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getMachineId = void 0;
6
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
7
+ async function getMachineId() {
8
+ api_1.diag.debug("could not read machine-id: unsupported platform");
9
+ }
10
+ exports.getMachineId = getMachineId;
11
+ }));
12
+ //#endregion
13
+ export default require_getMachineId_unsupported();
14
+ export {};
@@ -0,0 +1,25 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-zBkwnfr9.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.11.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js
4
+ var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const process = __require("process");
8
+ const execAsync_1 = require_execAsync();
9
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
10
+ async function getMachineId() {
11
+ const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
12
+ let command = "%windir%\\System32\\REG.exe";
13
+ if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) command = "%windir%\\sysnative\\cmd.exe /c " + command;
14
+ try {
15
+ const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ");
16
+ if (parts.length === 2) return parts[1].trim();
17
+ } catch (e) {
18
+ api_1.diag.debug(`error reading machine id: ${e}`);
19
+ }
20
+ }
21
+ exports.getMachineId = getMachineId;
22
+ }));
23
+ //#endregion
24
+ export default require_getMachineId_win();
25
+ export {};
@@ -0,0 +1,25 @@
1
+ import { a as __toCommonJS, i as __require, n as init_esm, r as __commonJSMin, t as esm_exports } from "./main.mjs";
2
+ import { t as require_execAsync } from "./execAsync-CUNMu62l.mjs";
3
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js
4
+ var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getMachineId = void 0;
7
+ const process = __require("process");
8
+ const execAsync_1 = require_execAsync();
9
+ const api_1 = (init_esm(), __toCommonJS(esm_exports));
10
+ async function getMachineId() {
11
+ const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
12
+ let command = "%windir%\\System32\\REG.exe";
13
+ if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) command = "%windir%\\sysnative\\cmd.exe /c " + command;
14
+ try {
15
+ const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ");
16
+ if (parts.length === 2) return parts[1].trim();
17
+ } catch (e) {
18
+ api_1.diag.debug(`error reading machine id: ${e}`);
19
+ }
20
+ }
21
+ exports.getMachineId = getMachineId;
22
+ }));
23
+ //#endregion
24
+ export default require_getMachineId_win();
25
+ export {};
package/dist/index.d.mts CHANGED
@@ -1,18 +1,15 @@
1
- //#region src/index.d.ts
2
- /**
3
- * The `vitest` test runner, as the plugin the engine loads.
4
- *
5
- * The declared layer asks for the run's resolved options and the sandbox it runs
6
- * in, so the requirement is visible in the type and an engine that does not
7
- * provide it fails to compile.
8
- */
9
- declare const strykerPlugins: import("@systemfsoftware/stryker-js/Plugin").PluginLayerContribution<"TestRunner">[];
10
- /**
11
- * The `vitest` option section as a JSON Schema document, for Stryker's option
12
- * validation — derived from the declaration, never read from a file. It is built
13
- * here, at the entry that contributes it, because a document is a *use* of a
14
- * schema and the schema module exports only declarations.
15
- */
16
- declare const strykerValidationSchema: Record<string, unknown>;
17
- //#endregion
18
- export { strykerPlugins, strykerValidationSchema };
1
+ export declare const strykerPlugins: readonly {
2
+ readonly kind: 'TestRunner';
3
+ readonly name: string;
4
+ readonly workerEntry: string;
5
+ }[];
6
+
7
+ /**
8
+ * The `vitest` option section as a JSON Schema document, for Stryker's option
9
+ * validation — derived from the declaration, never read from a file. It is built
10
+ * here, at the entry that contributes it, because a document is a *use* of a
11
+ * schema and the schema module exports only declarations.
12
+ */
13
+ export declare const strykerValidationSchema: Record<string, unknown>;
14
+
15
+ export { }