@mizchi/mutator-bun 0.0.0-stage → 0.5.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mizchi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,19 @@
1
+ export interface Bunfig {
2
+ /** The bunfig.toml in effect, if any (absolute). */
3
+ path: string | undefined;
4
+ /** `[test] root`: where Bun looks for test files (absolute). */
5
+ testRoot: string | undefined;
6
+ /** Preload modules, from `preload` and `[test] preload` (absolute). */
7
+ preload: string[];
8
+ /** `[test] pathIgnorePatterns`: globs of test files Bun leaves out, relative to the project root. */
9
+ ignore: string[];
10
+ }
11
+ /** Reads the keys the session uses from bunfig.toml: an explicit file, else `<root>/bunfig.toml`. */
12
+ export declare function readBunfig(root: string, configFile?: string): Bunfig;
13
+ /**
14
+ * The string values of `key = "..."` and `key = ["...", ...]` entries, by `table.key` (top-level
15
+ * keys without a table). Enough for the keys read here, not a TOML parser.
16
+ */
17
+ export declare function tomlValues(text: string): Map<string, string[]>;
18
+ /** The test files `bun test` collects under `dir` (absolute, sorted); `ignore` globs are relative to `root`. */
19
+ export declare function listTestFiles(dir: string, root?: string, ignore?: readonly string[]): string[];
package/dist/config.js ADDED
@@ -0,0 +1,103 @@
1
+ // What the session needs from the project's Bun setup: the bunfig.toml (`[test]` root,
2
+ // preload and pathIgnorePatterns), and the test files `bun test` would collect. Bun has no
3
+ // list mode, so the files are found with Bun's own rules: `*.test.*`, `*_test.*`, `*.spec.*`
4
+ // and `*_spec.*` with a JavaScript / TypeScript extension, outside node_modules and hidden
5
+ // directories.
6
+ import { existsSync, globSync, readFileSync } from 'node:fs';
7
+ import { dirname, join, matchesGlob, relative, resolve } from 'node:path';
8
+ /** Reads the keys the session uses from bunfig.toml: an explicit file, else `<root>/bunfig.toml`. */
9
+ export function readBunfig(root, configFile) {
10
+ const path = configFile ? resolve(root, configFile) : join(root, 'bunfig.toml');
11
+ if (!existsSync(path)) {
12
+ if (configFile)
13
+ throw new Error(`mutator: bun config ${path} does not exist`);
14
+ return { path: undefined, testRoot: undefined, preload: [], ignore: [] };
15
+ }
16
+ const values = tomlValues(readFileSync(path, 'utf8'));
17
+ const base = dirname(path);
18
+ const testRoot = values.get('test.root')?.[0];
19
+ const preload = [...(values.get('preload') ?? []), ...(values.get('test.preload') ?? [])];
20
+ return {
21
+ path,
22
+ testRoot: testRoot === undefined ? undefined : resolve(base, testRoot),
23
+ // Package names (no leading `.` or `/`) are left out: they are not project files.
24
+ preload: preload.filter((p) => /^(?:\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/])/.test(p)).map((p) => resolve(base, p)),
25
+ ignore: values.get('test.pathIgnorePatterns') ?? [],
26
+ };
27
+ }
28
+ /**
29
+ * The string values of `key = "..."` and `key = ["...", ...]` entries, by `table.key` (top-level
30
+ * keys without a table). Enough for the keys read here, not a TOML parser.
31
+ */
32
+ export function tomlValues(text) {
33
+ const values = new Map();
34
+ let table = '';
35
+ let pending;
36
+ const STRING = /"((?:[^"\\]|\\.)*)"|'([^']*)'/g;
37
+ const strings = (s) => [...s.matchAll(STRING)].map((m) => m[2] ?? decodeEscapes(m[1]));
38
+ // A `]` inside a string (a glob like `[ab]`) does not close the array.
39
+ const closes = (s) => s.replace(STRING, '').includes(']');
40
+ for (const raw of text.split(/\r?\n/)) {
41
+ const line = stripComment(raw).trim();
42
+ if (pending) {
43
+ pending.text += ` ${line}`;
44
+ if (closes(line)) {
45
+ values.set(pending.key, strings(pending.text));
46
+ pending = undefined;
47
+ }
48
+ continue;
49
+ }
50
+ const header = /^\[\s*([^\]]+?)\s*\]$/.exec(line);
51
+ if (header) {
52
+ table = header[1];
53
+ continue;
54
+ }
55
+ const entry = /^([\w.-]+)\s*=\s*(.*)$/.exec(line);
56
+ if (!entry)
57
+ continue;
58
+ const key = table ? `${table}.${entry[1]}` : entry[1];
59
+ const value = entry[2];
60
+ if (value.startsWith('[') && !closes(value))
61
+ pending = { key, text: value };
62
+ else
63
+ values.set(key, strings(value));
64
+ }
65
+ return values;
66
+ }
67
+ const ESCAPES = { b: '\b', t: '\t', n: '\n', f: '\f', r: '\r', e: '\x1b', '"': '"', '\\': '\\' };
68
+ /** A basic string's escapes decoded: TOML's \uXXXX, \UXXXXXXXX and \xXX too. An invalid one is kept as written. */
69
+ function decodeEscapes(s) {
70
+ return s.replace(/\\(?:u([0-9A-Fa-f]{4})|U([0-9A-Fa-f]{8})|x([0-9A-Fa-f]{2})|(.))/g, (escape, u, U, x, c) => {
71
+ const hex = u ?? U ?? x;
72
+ if (hex === undefined)
73
+ return ESCAPES[c] ?? escape;
74
+ const code = Number.parseInt(hex, 16);
75
+ return code <= 0x10ffff ? String.fromCodePoint(code) : escape;
76
+ });
77
+ }
78
+ function stripComment(line) {
79
+ let quote;
80
+ for (let i = 0; i < line.length; i++) {
81
+ const c = line[i];
82
+ if (quote) {
83
+ if (c === '\\' && quote === '"')
84
+ i++;
85
+ else if (c === quote)
86
+ quote = undefined;
87
+ }
88
+ else if (c === '"' || c === "'")
89
+ quote = c;
90
+ else if (c === '#')
91
+ return line.slice(0, i);
92
+ }
93
+ return line;
94
+ }
95
+ const TEST_FILES = '**/*{.test,_test,.spec,_spec}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}';
96
+ /** The test files `bun test` collects under `dir` (absolute, sorted); `ignore` globs are relative to `root`. */
97
+ export function listTestFiles(dir, root = dir, ignore = []) {
98
+ return globSync(TEST_FILES, { cwd: dir, exclude: ['**/node_modules/**', '**/.*/**'] })
99
+ .map((file) => join(dir, file))
100
+ .filter((file) => !ignore.some((pattern) => matchesGlob(relative(root, file), pattern)))
101
+ .sort();
102
+ }
103
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,2FAA2F;AAC3F,6FAA6F;AAC7F,2FAA2F;AAC3F,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAa1E,qGAAqG;AACrG,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,UAAmB;IAC1D,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAChF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,IAAI,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,iBAAiB,CAAC,CAAC;QAC9E,OAAO,EAAE,IAAI,EA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AAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACnB,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,KAAK,GAAG;gBAAE,CAAC,EAAE,CAAC;iBAChC,IAAI,CAAC,KAAK,KAAK;gBAAE,KAAK,GAAG,SAAS,CAAC;QAC1C,CAAC;aAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG;YAAE,KAAK,GAAG,CAAC,CAAC;aACxC,IAAI,CAAC,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,GAAG,+DAA+D,CAAC;AAEnF,gHAAgH;AAChH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,IAAI,GAAG,GAAG,EAAE,MAAM,GAAsB,EAAE;IACnF,OAAO,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,oBAAoB,EAAE,UAAU,CAAC,EAAE,CAAC;SACnF,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;SACvF,IAAI,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { type BunSessionOptions, createBunSession } from './session.ts';
2
+ export type { DryRunResult, MutantRunResult, RunMutantOptions, Session, TestLocation } from '@mizchi/mutator-core';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createBunSession } from './session.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface JunitTest {
2
+ /** Describe blocks and test name joined by spaces: what `--test-name-pattern` matches. */
3
+ fullName: string;
4
+ state: 'passed' | 'failed' | 'skipped';
5
+ durationMs: number;
6
+ /** Failure and error messages. */
7
+ messages: string[];
8
+ }
9
+ export interface JunitFile {
10
+ /** The test file as Bun names it (relative to the working directory). */
11
+ file: string;
12
+ /** In report order, which is declaration order. */
13
+ tests: JunitTest[];
14
+ }
15
+ export declare function decodeEntities(text: string): string;
16
+ export declare function parseJunit(xml: string): JunitFile[];
package/dist/junit.js ADDED
@@ -0,0 +1,81 @@
1
+ // Reads the JUnit XML `bun test --reporter=junit` writes. Only the subset Bun emits is
2
+ // understood: nested <testsuite> elements (a file, then its describe blocks) holding
3
+ // <testcase> elements with optional <failure>, <error> and <skipped> children.
4
+ const TAG = /<(\/?)([A-Za-z][\w:-]*)((?:\s+[\w:-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>|<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[([\s\S]*?)\]\]>/g;
5
+ const ATTRIBUTE = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
6
+ const ENTITIES = { lt: '<', gt: '>', amp: '&', quot: '"', apos: "'" };
7
+ export function decodeEntities(text) {
8
+ return text.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (whole, entity) => {
9
+ if (entity.startsWith('#x'))
10
+ return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
11
+ if (entity.startsWith('#'))
12
+ return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
13
+ return ENTITIES[entity] ?? whole;
14
+ });
15
+ }
16
+ function attributes(source) {
17
+ const out = {};
18
+ for (const m of source.matchAll(ATTRIBUTE))
19
+ out[m[1]] = decodeEntities(m[2] ?? m[3] ?? '');
20
+ return out;
21
+ }
22
+ export function parseJunit(xml) {
23
+ const files = [];
24
+ // Open <testsuite> names, outermost (the file) first.
25
+ const suites = [];
26
+ let file;
27
+ let test;
28
+ // The <failure> / <error> being read: its message attribute, then its text.
29
+ let failure;
30
+ let last = 0;
31
+ const close = (name) => {
32
+ if (name === 'testsuite') {
33
+ suites.pop();
34
+ if (suites.length === 0)
35
+ file = undefined;
36
+ }
37
+ else if (name === 'testcase')
38
+ test = undefined;
39
+ else if ((name === 'failure' || name === 'error') && failure) {
40
+ test?.messages.push(failure.text.trim() || failure.message);
41
+ failure = undefined;
42
+ }
43
+ };
44
+ for (const m of xml.matchAll(TAG)) {
45
+ if (failure)
46
+ failure.text += decodeEntities(xml.slice(last, m.index)) + (m[5] ?? '');
47
+ last = m.index + m[0].length;
48
+ const [, closing, name, attrs = '', selfClosing] = m;
49
+ if (!name)
50
+ continue;
51
+ if (closing) {
52
+ close(name);
53
+ continue;
54
+ }
55
+ const a = attributes(attrs);
56
+ if (name === 'testsuite') {
57
+ if (suites.length === 0) {
58
+ file = { file: a.file ?? a.name ?? '', tests: [] };
59
+ files.push(file);
60
+ }
61
+ suites.push(a.name ?? '');
62
+ }
63
+ else if (name === 'testcase' && file) {
64
+ const fullName = [...suites.slice(1), a.name ?? ''].join(' ');
65
+ const seconds = Number(a.time);
66
+ test = { fullName, state: 'passed', durationMs: Number.isFinite(seconds) ? seconds * 1000 : 0, messages: [] };
67
+ file.tests.push(test);
68
+ }
69
+ else if (name === 'skipped' && test) {
70
+ test.state = 'skipped';
71
+ }
72
+ else if ((name === 'failure' || name === 'error') && test) {
73
+ test.state = 'failed';
74
+ failure = { message: a.message ?? '', text: '' };
75
+ }
76
+ if (selfClosing)
77
+ close(name);
78
+ }
79
+ return files;
80
+ }
81
+ //# sourceMappingURL=junit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jun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,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAC5D,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;YACtB,OAAO,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACnD,CAAC;QACD,IAAI,WAAW;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { type InstrumentOptions, type RunReport, type Session } from '@mizchi/mutator-core';
2
+ export declare const PRELOAD: string;
3
+ export interface BunSessionOptions {
4
+ root: string;
5
+ /** Absolute paths of the source files to mutate. */
6
+ targets: readonly string[];
7
+ /** bunfig.toml to run with (`bun test --config`); defaults to Bun's own `<root>/bunfig.toml`. */
8
+ configFile?: string;
9
+ /** Worker processes for dry runs (`bun test --parallel`). Mutants run in one process. */
10
+ maxWorkers?: number;
11
+ arid?: InstrumentOptions['arid'];
12
+ excludedMutators?: InstrumentOptions['excludedMutators'];
13
+ weak?: InstrumentOptions['weak'];
14
+ mutators?: InstrumentOptions['mutators'];
15
+ ignorers?: InstrumentOptions['ignorers'];
16
+ }
17
+ /**
18
+ * A regex source matching exactly these absolute paths, with either separator (Bun may report
19
+ * Windows paths with `/` or `\`). Grouped by directory: Bun compiles it in every test file,
20
+ * and a flat alternation of whole paths takes tens of milliseconds there in a large project.
21
+ */
22
+ export declare function pathFilter(files: readonly string[]): string;
23
+ export declare function createBunSession(options: BunSessionOptions): Promise<Session>;
24
+ /**
25
+ * `report` with the failures of selected tests in `earlier` added: a test may fail in both
26
+ * runs in different ways (an assertion, then the hit limit), and each failure counts.
27
+ */
28
+ export declare function withFailures(report: RunReport, earlier: RunReport): RunReport;
29
+ /**
30
+ * Whether a command line is short enough to start. Windows limits the whole line, with each
31
+ * argument quoted (its quotes and backslashes escaped) and separated by a space; elsewhere one
32
+ * argument stays within MAX_ARG.
33
+ */
34
+ export declare function fitsCommandLine(argv: readonly string[], platform?: NodeJS.Platform): boolean;