@uiverify/vitest 0.1.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 +21 -0
- package/README.md +81 -0
- package/dist/browser-setup.d.ts +12 -0
- package/dist/browser-setup.js +22 -0
- package/dist/chunk-ZCABESWT.js +127 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/options-BJ_jO0NW.d.ts +11 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/plugin.js +54 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UI Verify
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @uiverify/vitest
|
|
2
|
+
|
|
3
|
+
Vitest browser-mode capture SDK for [UI Verify](https://uiverify.ai) - visual regression testing for agent-written UI, and an alternative to Chromatic and Percy.
|
|
4
|
+
|
|
5
|
+
Add one plugin to your Vitest config and every browser-mode test archives its final DOM (the serialized DOM plus the bytes of every resource the page loaded). UI Verify re-renders and pixel-diffs that archive in the cloud, so you get deterministic, cross-browser visual tests from the component tests you already have - no Storybook required.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Vitest 4 in **browser mode** on the Playwright provider (`@vitest/browser-playwright`) with Chromium.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -D @uiverify/vitest @vitest/browser-playwright
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configure
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// vitest.config.ts
|
|
21
|
+
import { defineConfig } from "vitest/config";
|
|
22
|
+
import { playwright } from "@vitest/browser-playwright";
|
|
23
|
+
import { uiverifyPlugin } from "@uiverify/vitest/plugin";
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
plugins: [uiverifyPlugin()],
|
|
27
|
+
test: {
|
|
28
|
+
browser: {
|
|
29
|
+
enabled: true,
|
|
30
|
+
provider: playwright(),
|
|
31
|
+
instances: [{ browser: "chromium" }],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That is the whole setup. Every browser-mode test now archives its final rendered DOM.
|
|
38
|
+
|
|
39
|
+
## Capture points
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { test } from "vitest";
|
|
43
|
+
import { render } from "vitest-browser-react"; // or your framework's browser render helper
|
|
44
|
+
import { takeSnapshot, disableAutoSnapshot } from "@uiverify/vitest";
|
|
45
|
+
|
|
46
|
+
test("menu", async () => {
|
|
47
|
+
render(<Menu />);
|
|
48
|
+
await takeSnapshot("closed"); // optional named checkpoint
|
|
49
|
+
// the final state is archived automatically at the end of the test
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- `takeSnapshot(name?)` - archive the current DOM as a named checkpoint mid-test.
|
|
54
|
+
- `disableAutoSnapshot()` - opt the current test out of the automatic end-of-test snapshot (or pass `disableAutoSnapshot: true` to `uiverifyPlugin()` to turn it off for every test).
|
|
55
|
+
|
|
56
|
+
## Upload
|
|
57
|
+
|
|
58
|
+
Archives are written to `./uiverify-archive` (override with `UIVERIFY_ARCHIVE_DIR` or the plugin's `outDir`). After your run, upload with the [`uiverify`](https://www.npmjs.com/package/uiverify) CLI:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx playwright install --with-deps # one-time: browsers for Vitest browser mode
|
|
62
|
+
npx vitest run
|
|
63
|
+
UIVERIFY_API_KEY=your_key npx -y uiverify@latest upload --static-dir ./uiverify-archive
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Options
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
uiverifyPlugin({
|
|
70
|
+
outDir: "./uiverify-archive", // where archives are written
|
|
71
|
+
disableAutoSnapshot: false, // capture only via takeSnapshot() when true
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## How it works
|
|
76
|
+
|
|
77
|
+
In Vitest browser mode the test runs inside the page, so the DOM is serialized in the same realm with [`rrweb-snapshot`](https://www.npmjs.com/package/rrweb-snapshot); the resources the page loaded are fetched and base64-encoded; and the assembled archive is written to disk by a Vitest browser command. Nothing runs at runtime beyond your test - the archive is a plain JSON bundle the CLI uploads.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The setup file `uiverifyPlugin()` injects into every browser-mode test run. It is what turns the bare
|
|
3
|
+
* plugin install into "each test archives its final DOM": a `beforeEach` marks the current test, and an
|
|
4
|
+
* `afterEach` takes the automatic snapshot. It carries no per-test boilerplate for the user.
|
|
5
|
+
*/
|
|
6
|
+
declare module "vitest" {
|
|
7
|
+
interface ProvidedContext {
|
|
8
|
+
__uiverify: {
|
|
9
|
+
disableAutoSnapshot: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autoSnapshot,
|
|
3
|
+
beginTest
|
|
4
|
+
} from "./chunk-ZCABESWT.js";
|
|
5
|
+
|
|
6
|
+
// src/browser-setup.ts
|
|
7
|
+
import { afterEach, beforeEach, inject } from "vitest";
|
|
8
|
+
function globalAutoDisabled() {
|
|
9
|
+
try {
|
|
10
|
+
return Boolean(inject("__uiverify")?.disableAutoSnapshot);
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
beforeEach((ctx) => {
|
|
16
|
+
beginTest(ctx.task);
|
|
17
|
+
});
|
|
18
|
+
afterEach(async (ctx) => {
|
|
19
|
+
if (globalAutoDisabled()) return;
|
|
20
|
+
const passed = ctx.task.result?.state !== "fail";
|
|
21
|
+
await autoSnapshot(passed);
|
|
22
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// src/capture.ts
|
|
2
|
+
import { commands } from "@vitest/browser/context";
|
|
3
|
+
import { snapshot } from "rrweb-snapshot";
|
|
4
|
+
|
|
5
|
+
// src/snapshot-id.ts
|
|
6
|
+
function snapshotIdParts(task) {
|
|
7
|
+
const file = task.file;
|
|
8
|
+
const suites = [];
|
|
9
|
+
let cur = task.suite;
|
|
10
|
+
while (cur && cur !== file) {
|
|
11
|
+
if (cur.name) suites.unshift(cur.name);
|
|
12
|
+
cur = cur.suite;
|
|
13
|
+
}
|
|
14
|
+
const parts = [];
|
|
15
|
+
if (file?.name) parts.push(file.name);
|
|
16
|
+
parts.push(...suites, task.name);
|
|
17
|
+
return parts;
|
|
18
|
+
}
|
|
19
|
+
function snapshotIds(task, name) {
|
|
20
|
+
const parts = snapshotIdParts(task);
|
|
21
|
+
const idBase = parts.join(" > ");
|
|
22
|
+
const title = parts.length > 1 ? parts.slice(0, -1).join(" > ") : parts[0] ?? "";
|
|
23
|
+
return { id: name ? `${idBase}::${name}` : idBase, title };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/capture.ts
|
|
27
|
+
var MAX_RESOURCE_BYTES = 10 * 1024 * 1024;
|
|
28
|
+
function isArchivableContentType(contentType) {
|
|
29
|
+
if (!contentType) return false;
|
|
30
|
+
const ct = contentType.toLowerCase();
|
|
31
|
+
return ct.startsWith("image/") || ct.startsWith("font/") || ct.startsWith("audio/") || ct.startsWith("video/") || ct.startsWith("text/css") || ct.startsWith("application/font") || ct.startsWith("application/x-font") || ct.startsWith("application/vnd.ms-fontobject");
|
|
32
|
+
}
|
|
33
|
+
function isModuleOrData(url) {
|
|
34
|
+
if (/^(data|blob):/.test(url)) return true;
|
|
35
|
+
const path = url.split("?")[0];
|
|
36
|
+
if (/\.(m?js|cjs|ts|tsx|jsx|json|map|html)$/i.test(path)) return true;
|
|
37
|
+
return /\/(@vite|@id|@fs)\//.test(url) || url.includes("/node_modules/.vite/");
|
|
38
|
+
}
|
|
39
|
+
function toBase64(buffer) {
|
|
40
|
+
const bytes = new Uint8Array(buffer);
|
|
41
|
+
let binary = "";
|
|
42
|
+
const chunk = 32768;
|
|
43
|
+
for (let i = 0; i < bytes.length; i += chunk) {
|
|
44
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + chunk));
|
|
45
|
+
}
|
|
46
|
+
return btoa(binary);
|
|
47
|
+
}
|
|
48
|
+
async function collectResources() {
|
|
49
|
+
const urls = /* @__PURE__ */ new Set();
|
|
50
|
+
for (const entry of performance.getEntriesByType("resource")) {
|
|
51
|
+
if (/^https?:/.test(entry.name) && !isModuleOrData(entry.name)) urls.add(entry.name);
|
|
52
|
+
}
|
|
53
|
+
const out = {};
|
|
54
|
+
await Promise.all(
|
|
55
|
+
[...urls].map(async (url) => {
|
|
56
|
+
try {
|
|
57
|
+
const resp = await fetch(url);
|
|
58
|
+
const contentType = resp.headers.get("content-type");
|
|
59
|
+
if (!isArchivableContentType(contentType)) return;
|
|
60
|
+
const buffer = await resp.arrayBuffer();
|
|
61
|
+
if (buffer.byteLength > MAX_RESOURCE_BYTES) return;
|
|
62
|
+
out[url] = { contentType, status: resp.status, body: toBase64(buffer) };
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
async function capture(task, name) {
|
|
70
|
+
const { id, title } = snapshotIds(task, name);
|
|
71
|
+
const serialize = (recordCanvas) => snapshot(document, { inlineStylesheet: true, recordCanvas, slimDOM: { script: true } });
|
|
72
|
+
let dom;
|
|
73
|
+
try {
|
|
74
|
+
dom = serialize(true);
|
|
75
|
+
} catch {
|
|
76
|
+
dom = serialize(false);
|
|
77
|
+
}
|
|
78
|
+
if (!dom) throw new Error(`@uiverify/vitest: rrweb failed to serialize the DOM for "${id}"`);
|
|
79
|
+
const resources = await collectResources();
|
|
80
|
+
const deviceScaleFactor = window.devicePixelRatio || void 0;
|
|
81
|
+
const colorScheme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
82
|
+
const archived = {
|
|
83
|
+
id,
|
|
84
|
+
title,
|
|
85
|
+
name,
|
|
86
|
+
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
87
|
+
...deviceScaleFactor ? { deviceScaleFactor } : {},
|
|
88
|
+
colorScheme,
|
|
89
|
+
dom,
|
|
90
|
+
resources
|
|
91
|
+
};
|
|
92
|
+
await commands.__uiverifyWriteSnapshot(archived);
|
|
93
|
+
return id;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/runtime.ts
|
|
97
|
+
var currentTask = null;
|
|
98
|
+
var manualCount = 0;
|
|
99
|
+
var autoDisabledForTest = false;
|
|
100
|
+
function beginTest(task) {
|
|
101
|
+
currentTask = task;
|
|
102
|
+
manualCount = 0;
|
|
103
|
+
autoDisabledForTest = false;
|
|
104
|
+
}
|
|
105
|
+
async function takeSnapshot(name = "") {
|
|
106
|
+
if (!currentTask) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
"@uiverify/vitest: takeSnapshot() was called outside a test. Add uiverifyPlugin() to your vitest.config so the setup hooks run."
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
manualCount++;
|
|
112
|
+
return capture(currentTask, name);
|
|
113
|
+
}
|
|
114
|
+
function disableAutoSnapshot() {
|
|
115
|
+
autoDisabledForTest = true;
|
|
116
|
+
}
|
|
117
|
+
async function autoSnapshot(passed) {
|
|
118
|
+
if (!currentTask || autoDisabledForTest || manualCount > 0 || !passed) return;
|
|
119
|
+
await capture(currentTask, "");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
beginTest,
|
|
124
|
+
takeSnapshot,
|
|
125
|
+
disableAutoSnapshot,
|
|
126
|
+
autoSnapshot
|
|
127
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { U as UiverifyPluginOptions } from './options-BJ_jO0NW.js';
|
|
2
|
+
|
|
3
|
+
/** Archive the page's current DOM as a named snapshot mid-test. Counts as a manual snapshot, so the
|
|
4
|
+
* automatic end-of-test snapshot is suppressed (the test is capturing deliberately). */
|
|
5
|
+
declare function takeSnapshot(name?: string): Promise<string>;
|
|
6
|
+
/** Turn off the automatic end-of-test snapshot for the current test only. */
|
|
7
|
+
declare function disableAutoSnapshot(): void;
|
|
8
|
+
|
|
9
|
+
export { disableAutoSnapshot, takeSnapshot };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Options for {@link uiverifyPlugin}. */
|
|
2
|
+
interface UiverifyPluginOptions {
|
|
3
|
+
/** Directory archives are written to. Defaults to `UIVERIFY_ARCHIVE_DIR` or `./uiverify-archive` - the
|
|
4
|
+
* same directory the `uiverify` CLI uploads, so no extra wiring is needed. */
|
|
5
|
+
outDir?: string;
|
|
6
|
+
/** Turn off the automatic end-of-test snapshot for every test, so capture happens only where you call
|
|
7
|
+
* `takeSnapshot()`. Off by default (every browser-mode test archives its final DOM). */
|
|
8
|
+
disableAutoSnapshot?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type { UiverifyPluginOptions as U };
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Plugin } from 'vitest/config';
|
|
2
|
+
import { U as UiverifyPluginOptions } from './options-BJ_jO0NW.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `uiverifyPlugin()` — the Node side of @uiverify/vitest. Added to `plugins` in a Vitest config, it wires
|
|
6
|
+
* capture into a browser-mode run with no per-test code:
|
|
7
|
+
*
|
|
8
|
+
* - injects the setup file that auto-snapshots each test (`browser-setup`),
|
|
9
|
+
* - registers the `__uiverifyWriteSnapshot` browser command that writes each snapshot to disk (the
|
|
10
|
+
* browser has no filesystem, so the in-page capture hands the assembled snapshot to this Node command),
|
|
11
|
+
* - passes the global `disableAutoSnapshot` option through to the setup file via provide/inject.
|
|
12
|
+
*
|
|
13
|
+
* The archive lands in the same `./uiverify-archive` directory the `uiverify` CLI uploads.
|
|
14
|
+
*/
|
|
15
|
+
declare module "vitest" {
|
|
16
|
+
interface ProvidedContext {
|
|
17
|
+
__uiverify: {
|
|
18
|
+
disableAutoSnapshot: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare function uiverifyPlugin(options?: UiverifyPluginOptions): Plugin;
|
|
23
|
+
|
|
24
|
+
export { uiverifyPlugin };
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// ../archive-core/src/snapshot-file.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
function snapshotFileName(id) {
|
|
4
|
+
const slug = id.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
|
|
5
|
+
const hash = createHash("sha1").update(id).digest("hex").slice(0, 10);
|
|
6
|
+
return `${slug || "snapshot"}-${hash}.json`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// ../archive-core/src/out-dir.ts
|
|
10
|
+
import path from "path";
|
|
11
|
+
function resolveOutDir() {
|
|
12
|
+
return process.env.UIVERIFY_ARCHIVE_DIR ?? path.resolve(process.cwd(), "uiverify-archive");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ../archive-core/src/write.ts
|
|
16
|
+
import fs from "fs";
|
|
17
|
+
import path2 from "path";
|
|
18
|
+
function writeSnapshot(outDir, snapshot) {
|
|
19
|
+
const dir = path2.join(outDir, "snapshots");
|
|
20
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
21
|
+
const file = path2.join(dir, snapshotFileName(snapshot.id));
|
|
22
|
+
fs.writeFileSync(file, JSON.stringify(snapshot));
|
|
23
|
+
return file;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ../archive-core/src/finalize.ts
|
|
27
|
+
import fs2 from "fs";
|
|
28
|
+
import path3 from "path";
|
|
29
|
+
|
|
30
|
+
// src/plugin.ts
|
|
31
|
+
var SETUP_MODULE = "@uiverify/vitest/browser-setup";
|
|
32
|
+
function uiverifyPlugin(options = {}) {
|
|
33
|
+
const outDir = options.outDir ?? resolveOutDir();
|
|
34
|
+
const config = {
|
|
35
|
+
test: {
|
|
36
|
+
setupFiles: [SETUP_MODULE],
|
|
37
|
+
provide: { __uiverify: { disableAutoSnapshot: options.disableAutoSnapshot ?? false } },
|
|
38
|
+
browser: {
|
|
39
|
+
commands: {
|
|
40
|
+
__uiverifyWriteSnapshot: async (_ctx, snapshot) => {
|
|
41
|
+
writeSnapshot(outDir, snapshot);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
name: "uiverify",
|
|
49
|
+
config: () => config
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
uiverifyPlugin
|
|
54
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uiverify/vitest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vitest browser-mode capture SDK for UI Verify (uiverify.ai): add uiverifyPlugin() to your Vitest config and each browser-mode test archives its final DOM (serialized DOM + resource bytes) to be replayed + visually diffed by UI Verify. Produces an archive the uiverify CLI uploads; talks to nothing at runtime.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"visual-testing",
|
|
7
|
+
"visual-regression",
|
|
8
|
+
"vitest",
|
|
9
|
+
"vitest-browser",
|
|
10
|
+
"screenshot-testing",
|
|
11
|
+
"rrweb",
|
|
12
|
+
"uiverify"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://uiverify.ai",
|
|
15
|
+
"bugs": "https://github.com/uiverify/uiverify/issues",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/uiverify/uiverify.git",
|
|
19
|
+
"directory": "packages/vitest"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "UI Verify",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=24"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./plugin": {
|
|
38
|
+
"types": "./dist/plugin.d.ts",
|
|
39
|
+
"default": "./dist/plugin.js"
|
|
40
|
+
},
|
|
41
|
+
"./browser-setup": {
|
|
42
|
+
"types": "./dist/browser-setup.d.ts",
|
|
43
|
+
"default": "./dist/browser-setup.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@vitest/browser": ">=3.0.0",
|
|
52
|
+
"vitest": ">=3.0.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"rrweb-snapshot": "^2.1.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@rrweb/types": "^2.0.0",
|
|
59
|
+
"@types/node": "^24.0.0",
|
|
60
|
+
"@vitest/browser": "^4.1.8",
|
|
61
|
+
"tsup": "^8.5.0",
|
|
62
|
+
"typescript": "^5.7.0",
|
|
63
|
+
"vite": "^6.0.0",
|
|
64
|
+
"vitest": "^4.1.8",
|
|
65
|
+
"@uiverify/archive-core": "0.0.0"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsup",
|
|
69
|
+
"typecheck": "tsc --noEmit",
|
|
70
|
+
"test": "vitest run"
|
|
71
|
+
}
|
|
72
|
+
}
|