@vitest-agent/sdk 5.1.2 → 5.2.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/index.d.ts +10 -0
- package/package.json +2 -2
- package/schemas/RunReportFile.js +4 -2
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -1538,6 +1538,16 @@ export interface ReporterRenderInput {
|
|
|
1538
1538
|
*/
|
|
1539
1539
|
export interface VitestAgentReporter {
|
|
1540
1540
|
readonly render: (input: ReporterRenderInput, kit: ReporterKit) => ReadonlyArray<RenderedOutput>;
|
|
1541
|
+
/**
|
|
1542
|
+
* Release what the factory acquired, once, when Vitest closes (never per
|
|
1543
|
+
* run: watch mode reruns `render` many times on one reporter). The plugin
|
|
1544
|
+
* calls it before it shuts the {@link ReporterKit.runEvents | run-event
|
|
1545
|
+
* channel} down, so a subscriber can still drain what was published (a
|
|
1546
|
+
* shutdown drops what a subscriber has not pulled) and end its own stream;
|
|
1547
|
+
* a live view waits here for its last frame to commit. Optional; the plugin
|
|
1548
|
+
* awaits it and treats a rejection as a logged warning.
|
|
1549
|
+
*/
|
|
1550
|
+
readonly close?: () => Promise<void>;
|
|
1541
1551
|
}
|
|
1542
1552
|
/**
|
|
1543
1553
|
* Factory that the plugin's `reporter` option accepts. The plugin calls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Platform-free core for the vitest-agent package family: Effect Schema definitions, reporter and dispatcher contracts, errors, formatters, and pure utilities.",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"acorn": "^8.18.0",
|
|
45
45
|
"acorn-typescript": "^1.4.13",
|
|
46
|
-
"effect": "4.0.0
|
|
46
|
+
"effect": "^4.0.0"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=24.11.0"
|
package/schemas/RunReportFile.js
CHANGED
|
@@ -28,9 +28,11 @@ const RUN_REPORT_FILE_SCHEMA_URL = "https://raw.githubusercontent.com/spencerbeg
|
|
|
28
28
|
* `Date.parse` alone is too permissive — it accepts `"Sep 7 2026"` and
|
|
29
29
|
* other locale spellings a JSON Schema validator would reject — so the
|
|
30
30
|
* pattern is checked first and the parse only rules out impossible
|
|
31
|
-
* component values such as month 13.
|
|
31
|
+
* component values such as month 13. The `u` flag marks the pattern exact:
|
|
32
|
+
* without it effect treats a RegExp as approximate and omits it from the
|
|
33
|
+
* emitted JSON Schema.
|
|
32
34
|
*/
|
|
33
|
-
const ISO_8601_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})
|
|
35
|
+
const ISO_8601_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/u;
|
|
34
36
|
const ISO_8601_MESSAGE = "generatedAt must be an ISO-8601 instant, e.g. 2026-09-07T23:45:57.308Z.";
|
|
35
37
|
const IsoInstant = Schema.String.check(Schema.isPattern(ISO_8601_INSTANT, {
|
|
36
38
|
description: "An ISO-8601 instant, the shape Date.prototype.toISOString produces.",
|