@vitest-agent/plugin 2.5.0 → 2.5.2
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/index.d.ts +10 -2
- package/package.json +6 -6
- package/plugin.js +3 -2
- package/utils/discover-projects.js +5 -1
package/index.d.ts
CHANGED
|
@@ -424,13 +424,16 @@ declare namespace AgentPlugin {
|
|
|
424
424
|
* };
|
|
425
425
|
* ```
|
|
426
426
|
*
|
|
427
|
-
* @param strategy - Optional strategy or options object
|
|
427
|
+
* @param strategy - Optional strategy or options object
|
|
428
|
+
* `{ strategy?, cwd?, maxDepth? }`.
|
|
428
429
|
* Pass a {@link DiscoverStrategy} directly, or an options object to also
|
|
429
|
-
* specify a custom workspace root via `cwd
|
|
430
|
+
* specify a custom workspace root via `cwd` and deeper package traversal via
|
|
431
|
+
* `maxDepth`.
|
|
430
432
|
*/
|
|
431
433
|
function discover(strategy?: DiscoverStrategy | {
|
|
432
434
|
strategy?: DiscoverStrategy;
|
|
433
435
|
cwd?: string;
|
|
436
|
+
maxDepth?: number;
|
|
434
437
|
}): DiscoverBuilder;
|
|
435
438
|
/**
|
|
436
439
|
* Run a shell command, suppressing all output unless the command fails.
|
|
@@ -1034,6 +1037,11 @@ interface DiscoverProjectsOptions {
|
|
|
1034
1037
|
* package list through. Defaults to its `nodeSyncOps` binding.
|
|
1035
1038
|
*/
|
|
1036
1039
|
readonly syncOps?: WorkspacesSyncOptions;
|
|
1040
|
+
/**
|
|
1041
|
+
* Optional traversal depth override for workspace package enumeration.
|
|
1042
|
+
* Forwarded to `@effected/workspaces`' `getWorkspacePackagesSync`.
|
|
1043
|
+
*/
|
|
1044
|
+
readonly maxDepth?: number;
|
|
1037
1045
|
}
|
|
1038
1046
|
/**
|
|
1039
1047
|
* Scan all workspace packages and additional entries through the active strategy and return projects + tags.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/plugin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Vitest plugin for the vitest-agent ecosystem: owns persistence, classification, baselines, trends, and dispatches rendering to a configurable reporter.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@effect/platform-node": "4.0.0-rc.109",
|
|
43
43
|
"@effect/sql-sqlite-node": "4.0.0-rc.109",
|
|
44
44
|
"@effected/workspaces": "^0.18.3",
|
|
45
|
-
"@vitest-agent/cli": "2.2.
|
|
46
|
-
"@vitest-agent/mcp": "2.4.
|
|
47
|
-
"@vitest-agent/reporter": "2.2.
|
|
48
|
-
"@vitest-agent/sdk": "2.4.
|
|
45
|
+
"@vitest-agent/cli": "2.2.12",
|
|
46
|
+
"@vitest-agent/mcp": "2.4.10",
|
|
47
|
+
"@vitest-agent/reporter": "2.2.1",
|
|
48
|
+
"@vitest-agent/sdk": "2.4.12",
|
|
49
49
|
"effect": "4.0.0-rc.109",
|
|
50
|
-
"magic-string": "^1.2.
|
|
50
|
+
"magic-string": "^1.2.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@vitest/coverage-istanbul": "^4.1.0",
|
package/plugin.js
CHANGED
|
@@ -101,7 +101,7 @@ const aggregatedReporterByVitest = /* @__PURE__ */ new WeakSet();
|
|
|
101
101
|
*
|
|
102
102
|
* @public
|
|
103
103
|
*/
|
|
104
|
-
const CURRENT_PLUGIN_VERSION = "2.5.
|
|
104
|
+
const CURRENT_PLUGIN_VERSION = "2.5.2";
|
|
105
105
|
const TEST_FILE_DIR_RE = new RegExp(`/(?:${SRC_DIR}|${TEST_DIR})/`);
|
|
106
106
|
const isTestFile = (id) => isTestFileName(id) && TEST_FILE_DIR_RE.test(id);
|
|
107
107
|
/**
|
|
@@ -312,7 +312,8 @@ function makeDiscoverBuilder(options) {
|
|
|
312
312
|
const opts = strategy;
|
|
313
313
|
return makeDiscoverBuilder({
|
|
314
314
|
...opts.strategy !== void 0 ? { strategy: opts.strategy } : {},
|
|
315
|
-
...opts.cwd !== void 0 ? { cwd: opts.cwd } : {}
|
|
315
|
+
...opts.cwd !== void 0 ? { cwd: opts.cwd } : {},
|
|
316
|
+
...opts.maxDepth !== void 0 ? { maxDepth: opts.maxDepth } : {}
|
|
316
317
|
});
|
|
317
318
|
}
|
|
318
319
|
_AgentPlugin.discover = discover;
|
|
@@ -103,11 +103,15 @@ async function discoverProjects(options) {
|
|
|
103
103
|
const additionalEntries = options?.additionalEntries ?? [];
|
|
104
104
|
const fs = options?.fs ?? nodeWalkerFs;
|
|
105
105
|
const syncOps = options?.syncOps ?? nodeSyncOps;
|
|
106
|
+
const packageEnumerationOptions = {
|
|
107
|
+
...syncOps,
|
|
108
|
+
...options?.maxDepth !== void 0 ? { maxDepth: options.maxDepth } : {}
|
|
109
|
+
};
|
|
106
110
|
const root = findWorkspaceRootSync(cwd ?? process.cwd(), syncOps);
|
|
107
111
|
if (!root) throw new Error(`[vitest-agent] Could not find workspace root from ${cwd ?? process.cwd()}. Ensure a pnpm-workspace.yaml or package.json with "workspaces" exists.`);
|
|
108
112
|
const useCache = strategy === void 0 && additionalEntries.length === 0;
|
|
109
113
|
const resolvedStrategy = strategy ?? new DefaultDiscoverStrategy();
|
|
110
|
-
const packages = getWorkspacePackagesSync(root,
|
|
114
|
+
const packages = getWorkspacePackagesSync(root, packageEnumerationOptions);
|
|
111
115
|
let signature;
|
|
112
116
|
if (useCache) {
|
|
113
117
|
signature = await computeWorkspaceSignature(packages, fs);
|