@vitest-agent/plugin 5.4.6 → 5.4.8
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/bin/vitest-agent-mcp.js +1 -2
- package/bin/vitest-agent.js +1 -2
- package/index.d.ts +0 -48
- package/index.js +1 -2
- package/layers/ConfigValidationLive.js +1 -2
- package/layers/ConfigValidationTest.js +1 -2
- package/layers/CoverageAnalyzerLive.js +1 -2
- package/layers/CoverageAnalyzerTest.js +1 -2
- package/layers/ReporterLive.js +1 -2
- package/package.json +13 -13
- package/plugin.js +1 -2
- package/reporter.js +261 -260
- package/services/ConfigValidation.js +1 -2
- package/services/CoverageAnalyzer.js +1 -2
- package/utils/build-module-info.js +1 -2
- package/utils/build-reporter-kit.js +1 -2
- package/utils/capture-env.js +1 -2
- package/utils/capture-settings.js +1 -2
- package/utils/classify-helpers.js +1 -2
- package/utils/configuration-error.js +1 -2
- package/utils/discover-projects.js +1 -2
- package/utils/discover-strategy.js +1 -2
- package/utils/ensure-github-reporter.js +1 -2
- package/utils/find-test-files.js +1 -2
- package/utils/inject-tags.js +1 -2
- package/utils/is-benign-vite-source-map-warning.js +1 -2
- package/utils/is-partial-run.js +1 -2
- package/utils/is-test-shaped-package.js +1 -2
- package/utils/process-failure.js +1 -2
- package/utils/report-writer.js +1 -2
- package/utils/resolve-coverage-dir-isolation.js +1 -2
- package/utils/resolve-no-color.js +1 -2
- package/utils/resolve-thresholds.js +1 -2
- package/utils/route-rendered-output.js +1 -2
- package/utils/run-script-lock.js +1 -2
- package/utils/stray-output-capture.js +1 -2
- package/utils/stringify-failure-value.js +1 -2
- package/utils/strip-console-reporters.js +1 -2
- package/utils/tag-cache-key.js +1 -2
- package/utils/tag.js +1 -2
- package/utils/to-posix-path.js +1 -2
- package/utils/vitest-peer-version-mismatch-error.js +1 -2
- package/utils/walker-fs.js +1 -2
- package/version.js +2 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { osc8 } from "@vitest-agent/sdk";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/build-reporter-kit.ts
|
|
4
4
|
const buildReporterKit = (input) => {
|
|
5
5
|
const consoleOutput = input.consoleMode === "silent" ? "silent" : "failures";
|
|
6
6
|
const githubSummary = input.githubActions;
|
|
@@ -44,5 +44,4 @@ const normalizeReporters = (result) => {
|
|
|
44
44
|
return Array.isArray(result) ? result : [result];
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { buildReporterKit, normalizeReporters };
|
package/utils/capture-env.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/capture-settings.ts
|
|
4
4
|
/**
|
|
5
5
|
* Extract a serializable settings snapshot from the resolved Vitest config.
|
|
6
6
|
* @param config - The resolved Vitest config record
|
|
@@ -50,5 +50,4 @@ function hashSettings(settings) {
|
|
|
50
50
|
return createHash("sha256").update(json).digest("hex");
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
//#endregion
|
|
54
53
|
export { captureSettings, hashSettings };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toPosixPath } from "./to-posix-path.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/classify-helpers.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a ClassifyFn that maps filename suffix patterns to tag arrays.
|
|
6
6
|
*
|
|
@@ -68,5 +68,4 @@ function combineClassifiers(...fns) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
//#endregion
|
|
72
71
|
export { classifyByDirectory, classifyByFilename, combineClassifiers };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/configuration-error.ts
|
|
2
2
|
/**
|
|
3
3
|
* A mistake in the user's own `AgentPlugin` configuration — a bad report
|
|
4
4
|
* scope, an unsafe report filename — as opposed to an internal failure of
|
|
@@ -15,5 +15,4 @@ var ConfigurationError = class extends Error {
|
|
|
15
15
|
name = "ConfigurationError";
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { ConfigurationError };
|
|
@@ -7,7 +7,7 @@ import { NON_DISCOVERABLE_DIRS, SRC_DIR, TEST_DIR } from "@vitest-agent/sdk";
|
|
|
7
7
|
import { findWorkspaceRootSync, getWorkspacePackagesSync } from "@effected/workspaces";
|
|
8
8
|
import { nodeSyncOps } from "@effected/workspaces/node-sync";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/utils/discover-projects.ts
|
|
11
11
|
const DISCOVERY_LAST_SCAN_SYMBOL = Symbol.for("vitest-agent:discovery:last-scan-at");
|
|
12
12
|
const warnedDeclinedPackagePaths = /* @__PURE__ */ new Set();
|
|
13
13
|
async function warnIfDeclinedPackageIsTestShaped(pkg, fs) {
|
|
@@ -166,5 +166,4 @@ async function discoverProjects(options) {
|
|
|
166
166
|
return result;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
//#endregion
|
|
170
169
|
export { discoverProjects };
|
|
@@ -7,7 +7,7 @@ import { NON_DISCOVERABLE_DIRS, SRC_DIR, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_H
|
|
|
7
7
|
import { Option } from "effect";
|
|
8
8
|
import { configDefaults } from "vitest/config";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/utils/discover-strategy.ts
|
|
11
11
|
const SETUP_EXTS = [
|
|
12
12
|
"ts",
|
|
13
13
|
"tsx",
|
|
@@ -153,5 +153,4 @@ var DefaultDiscoverStrategy = class extends DiscoverStrategy {
|
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
//#endregion
|
|
157
156
|
export { DefaultDiscoverStrategy, DiscoverStrategy };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/ensure-github-reporter.ts
|
|
2
2
|
/**
|
|
3
3
|
* Ensure a Vitest `reporters` array contains a `github-actions` entry with
|
|
4
4
|
* its markdown job summary disabled.
|
|
@@ -47,5 +47,4 @@ function ensureGithubActionsReporter(reporters) {
|
|
|
47
47
|
return [...reporters, ["github-actions", { jobSummary: { enabled: false } }]];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { ensureGithubActionsReporter };
|
package/utils/find-test-files.js
CHANGED
|
@@ -3,7 +3,7 @@ import { nodeWalkerFs } from "./walker-fs.js";
|
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
4
|
import { NON_DISCOVERABLE_DIRS } from "@vitest-agent/sdk";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/find-test-files.ts
|
|
7
7
|
function globToRegex(pattern) {
|
|
8
8
|
const alts = expandBraces(pattern).map(toRegexFragment);
|
|
9
9
|
return new RegExp(`^(?:${alts.join("|")})$`);
|
|
@@ -96,5 +96,4 @@ async function walkDir(root, dir, matchers, results, fs) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
//#endregion
|
|
100
99
|
export { findTestFiles };
|
package/utils/inject-tags.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MagicString from "magic-string";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/inject-tags.ts
|
|
4
4
|
function tagsLiteral(tags) {
|
|
5
5
|
return `[${tags.map((t) => JSON.stringify(t)).join(", ")}]`;
|
|
6
6
|
}
|
|
@@ -34,5 +34,4 @@ function injectTags(source, tags) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { injectTags };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/is-benign-vite-source-map-warning.ts
|
|
2
2
|
/**
|
|
3
3
|
* Matches the benign Vite core warning emitted when a dependency's shipped
|
|
4
4
|
* `.js` file references a `.js.map` sibling that was never published in the
|
|
@@ -17,5 +17,4 @@ function isBenignViteSourceMapWarning(message) {
|
|
|
17
17
|
return /Failed to load source map/.test(message) && /ENOENT:.*\.js\.map/.test(message);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
export { isBenignViteSourceMapWarning };
|
package/utils/is-partial-run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/is-partial-run.ts
|
|
2
2
|
/**
|
|
3
3
|
* Stable comparison key for a `configOverride.testNamePattern` value: `""`
|
|
4
4
|
* for `undefined`, otherwise `RegExp#toString()` (`/source/flags`) — two
|
|
@@ -89,5 +89,4 @@ function isPartialRun(input) {
|
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
//#endregion
|
|
93
92
|
export { hasCliScopeFilter, hasTestNameFilter, isPartialRun };
|
|
@@ -3,7 +3,7 @@ import { findTestFiles } from "./find-test-files.js";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { BATS_FILE_GLOB_SUFFIX, SRC_DIR, TEST_DIR, TEST_FILE_GLOB_SUFFIX } from "@vitest-agent/sdk";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/is-test-shaped-package.ts
|
|
7
7
|
/**
|
|
8
8
|
* True when `pkgPath` looks like it was meant to hold tests, yet neither a
|
|
9
9
|
* discoverable Vitest test file nor a Bats test file was found anywhere
|
|
@@ -50,5 +50,4 @@ async function isTestShapedPackage(pkgPath, fs = nodeWalkerFs) {
|
|
|
50
50
|
return (await fs.statEntry(join(pkgPath, TEST_DIR)))?.isDirectory === true;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
//#endregion
|
|
54
53
|
export { isTestShapedPackage };
|
package/utils/process-failure.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
import { computeFailureSignature } from "@vitest-agent/engine";
|
|
3
3
|
import { findFunctionBoundary } from "@vitest-agent/sdk";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/process-failure.ts
|
|
6
6
|
const FRAME_LINE_REGEX = /^\s*at\s+(?:([\w$.<>[\] ]+?)\s+)?\(?([^\n)]+):(\d+):(\d+)\)?\s*$/;
|
|
7
7
|
const isFrameworkPath = (filePath) => filePath.includes("/node_modules/") || filePath.includes("vitest/dist") || filePath.includes("@vitest/") || filePath.startsWith("node:");
|
|
8
8
|
const parseFramesFromStackString = (stack) => {
|
|
@@ -93,5 +93,4 @@ const processFailure = (error, options) => {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
//#endregion
|
|
97
96
|
export { processFailure };
|
package/utils/report-writer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigurationError } from "./configuration-error.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/report-writer.ts
|
|
4
4
|
/**
|
|
5
5
|
* Lazily-created writer over Vitest 5's `createReport` scope directory.
|
|
6
6
|
*
|
|
@@ -79,5 +79,4 @@ const createReportWriter = (vitest, scope) => {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
//#endregion
|
|
83
82
|
export { assertFlatScope, assertReportCapable, createReportWriter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/resolve-coverage-dir-isolation.ts
|
|
2
2
|
/**
|
|
3
3
|
* Values of `VITEST_AGENT_COVERAGE_DIR_ISOLATION` that opt out of the
|
|
4
4
|
* per-process coverage directory rewrite.
|
|
@@ -40,5 +40,4 @@ function resolveCoverageDirIsolation(input) {
|
|
|
40
40
|
return { kind: "isolate" };
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { resolveCoverageDirIsolation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TerminalEnv } from "@effected/env";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/resolve-no-color.ts
|
|
5
5
|
/**
|
|
6
6
|
* Whether the reporter should render without colour, decided by the kit's
|
|
7
7
|
* terminal rule rather than `NO_COLOR` alone: `FORCE_COLOR` beats `NO_COLOR`,
|
|
@@ -9,5 +9,4 @@ import { Effect } from "effect";
|
|
|
9
9
|
*/
|
|
10
10
|
const resolveNoColor = TerminalEnv.colorLevel("stdout").pipe(Effect.map((level) => level === "none"));
|
|
11
11
|
|
|
12
|
-
//#endregion
|
|
13
12
|
export { resolveNoColor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/resolve-thresholds.ts
|
|
2
2
|
const METRIC_KEYS = /* @__PURE__ */ new Set([
|
|
3
3
|
"lines",
|
|
4
4
|
"functions",
|
|
@@ -73,5 +73,4 @@ function resolveThresholds(input) {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
//#endregion
|
|
77
76
|
export { resolveThresholds };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/route-rendered-output.ts
|
|
5
5
|
/**
|
|
6
6
|
* Route a {@link RenderedOutput} entry to its declared target.
|
|
7
7
|
*
|
|
@@ -53,5 +53,4 @@ const routeRenderedOutput = (output, options) => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
56
|
export { routeRenderedOutput };
|
package/utils/run-script-lock.js
CHANGED
|
@@ -3,7 +3,7 @@ import { homedir } from "node:os";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/run-script-lock.ts
|
|
7
7
|
/**
|
|
8
8
|
* File-based advisory lock backing `AgentPlugin.runScript` (issue #191,
|
|
9
9
|
* sub-item B). Two concurrent `vitest` invocations in one checkout used
|
|
@@ -264,5 +264,4 @@ function markRunScriptDone(lock) {
|
|
|
264
264
|
} catch {}
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
//#endregion
|
|
268
267
|
export { DEFAULT_BUILT_RECENTLY_MS, DEFAULT_LOCK_STALE_MS, DEFAULT_LOCK_WAIT_TIMEOUT_MS, acquireRunScriptLock, markRunScriptDone, parseLockTimingOverride, releaseRunScriptLock, resolveRunScriptLockDir };
|
|
@@ -2,7 +2,7 @@ import { STRAY_OUTPUT_SOURCE, isEscapeOnly, makeStrayOutputRecorder } from "@vit
|
|
|
2
2
|
import { Writable } from "node:stream";
|
|
3
3
|
import { StringDecoder } from "node:string_decoder";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/stray-output-capture.ts
|
|
6
6
|
/**
|
|
7
7
|
* Stray-output capture: a pass-through over Vitest's `Logger.outputStream` /
|
|
8
8
|
* `errorStream`.
|
|
@@ -173,5 +173,4 @@ const installStrayOutputCapture = (logger, terminal) => {
|
|
|
173
173
|
return capture;
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
//#endregion
|
|
177
176
|
export { MAX_HELD_CHARS, installStrayOutputCapture, strayOutputCaptureOf };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/stringify-failure-value.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a raw Vitest assertion value (`.expected` / `.actual`) into a
|
|
4
4
|
* one-line string suitable for display in the stream renderer.
|
|
@@ -36,5 +36,4 @@ const stringifyFailureValue = (value) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { stringifyFailureValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/strip-console-reporters.ts
|
|
2
2
|
/**
|
|
3
3
|
* Built-in Vitest reporters that write to the console (stdout).
|
|
4
4
|
* These are the reporters suppressed when an agent takes over console output.
|
|
@@ -45,5 +45,4 @@ function stripConsoleReporters(reporters) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
//#endregion
|
|
49
48
|
export { CONSOLE_REPORTERS, stripConsoleReporters };
|
package/utils/tag-cache-key.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/tag-cache-key.ts
|
|
2
2
|
/**
|
|
3
3
|
* Cache-key material for Vitest 5's `fsModuleCache`.
|
|
4
4
|
*
|
|
@@ -26,5 +26,4 @@ function makeTagCacheKeyGenerator(classify) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { makeTagCacheKeyGenerator, tagCacheKey };
|
package/utils/tag.js
CHANGED
package/utils/to-posix-path.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/to-posix-path.ts
|
|
2
2
|
/**
|
|
3
3
|
* Normalize a filesystem path to forward-slash separators.
|
|
4
4
|
*
|
|
@@ -31,5 +31,4 @@ function toPosixPath(p) {
|
|
|
31
31
|
return p.indexOf("\\") === -1 ? p : p.split("\\").join("/");
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
//#endregion
|
|
35
34
|
export { toPosixPath };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/vitest-peer-version-mismatch-error.ts
|
|
2
2
|
/**
|
|
3
3
|
* Builds the message `configureVitest` throws as a {@link ConfigurationError}
|
|
4
4
|
* when the Vitest 5-only `ctx.defineCacheKeyGenerator` field is absent — the
|
|
@@ -36,5 +36,4 @@ function readVitestVersion(vitest) {
|
|
|
36
36
|
return typeof version === "string" ? version : void 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { readVitestVersion, vitestPeerVersionMismatchMessage };
|
package/utils/walker-fs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdir, stat } from "node:fs/promises";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/walker-fs.ts
|
|
4
4
|
/**
|
|
5
5
|
* {@link WalkerFileSystem} over `node:fs/promises` — the binding every
|
|
6
6
|
* production call site uses, and the default when a walker is called without
|
|
@@ -23,5 +23,4 @@ const nodeWalkerFs = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { nodeWalkerFs };
|
package/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/version.ts
|
|
2
2
|
/**
|
|
3
3
|
* The version of this package, inlined at build time from
|
|
4
4
|
* `package.json#version` via the bundler's build-time `__PACKAGE_VERSION__` substitution.
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
const CURRENT_PLUGIN_VERSION = "5.4.
|
|
11
|
+
const CURRENT_PLUGIN_VERSION = "5.4.8";
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { CURRENT_PLUGIN_VERSION };
|