oxmutate 1.2.2 → 1.2.3
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.
|
Binary file
|
package/dist/command-runner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cpSync, mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
1
|
+
import { cpSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { ambientRuntime, run as spawn } from 'bellpull';
|
|
4
4
|
import { ACTIVE_MUTANT_ENV, env } from './runtime.js';
|
|
@@ -11,8 +11,28 @@ export function makeSandbox(root) {
|
|
|
11
11
|
for (const entry of readdirSync(root))
|
|
12
12
|
if (!SKIP.has(entry))
|
|
13
13
|
cpSync(path.join(root, entry), path.join(sandbox, entry), { recursive: true });
|
|
14
|
+
rebaseExtends(root, sandbox);
|
|
14
15
|
return sandbox;
|
|
15
16
|
}
|
|
17
|
+
const RELATIVE_EXTENDS = /("extends"\s*:\s*")(\.{1,2}\/[^"]*)(")/g;
|
|
18
|
+
function rebaseExtends(from, to) {
|
|
19
|
+
for (const entry of readdirSync(to, { withFileTypes: true })) {
|
|
20
|
+
if (SKIP.has(entry.name))
|
|
21
|
+
continue;
|
|
22
|
+
const copied = path.join(to, entry.name);
|
|
23
|
+
if (entry.isDirectory())
|
|
24
|
+
rebaseExtends(path.join(from, entry.name), copied);
|
|
25
|
+
else if (/^tsconfig.*\.json$/.test(entry.name)) {
|
|
26
|
+
const text = readFileSync(copied, 'utf8');
|
|
27
|
+
const rebased = text.replace(RELATIVE_EXTENDS, (_match, open, rel, close) => {
|
|
28
|
+
const relative = path.relative(to, path.resolve(from, rel)).split(path.sep).join('/');
|
|
29
|
+
return `${open}${relative.startsWith('.') ? relative : `./${relative}`}${close}`;
|
|
30
|
+
});
|
|
31
|
+
if (rebased !== text)
|
|
32
|
+
writeFileSync(copied, rebased);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
16
36
|
const MS_PER_MINUTE = 60_000;
|
|
17
37
|
const OUTPUT_TAIL = 1500;
|
|
18
38
|
const PROCESS_SLACK_MS = 5000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxmutate",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Mutation testing for JavaScript and TypeScript on the oxc engine, run warm inside the project's own Vitest, with CI lanes, SARIF and an agent surface. No dependency outside the burgee family. A Stryker migration path.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|