@polishd/next 0.2.2 → 0.2.3-dev.1
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/AGENTS.md +2 -1
- package/CHANGELOG.md +238 -0
- package/README.md +63 -0
- package/bin/doctor.mjs +8 -1
- package/dist/ai/digest.d.ts.map +1 -1
- package/dist/ai/digest.js +3 -2
- package/dist/ai/digest.js.map +1 -1
- package/dist/ai/github.d.ts +22 -1
- package/dist/ai/github.d.ts.map +1 -1
- package/dist/ai/github.js +99 -3
- package/dist/ai/github.js.map +1 -1
- package/dist/ai/issue-pages.d.ts +52 -0
- package/dist/ai/issue-pages.d.ts.map +1 -0
- package/dist/ai/issue-pages.js +50 -0
- package/dist/ai/issue-pages.js.map +1 -0
- package/dist/ai/issues.d.ts +13 -1
- package/dist/ai/issues.d.ts.map +1 -1
- package/dist/ai/issues.js +60 -4
- package/dist/ai/issues.js.map +1 -1
- package/dist/ai/summary.d.ts.map +1 -1
- package/dist/ai/summary.js +7 -0
- package/dist/ai/summary.js.map +1 -1
- package/dist/ai/types.d.ts +43 -0
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/client/dom.d.ts +23 -0
- package/dist/client/dom.d.ts.map +1 -1
- package/dist/client/dom.js +45 -2
- package/dist/client/dom.js.map +1 -1
- package/dist/client/init.d.ts.map +1 -1
- package/dist/client/init.js +54 -14
- package/dist/client/init.js.map +1 -1
- package/dist/client/monitor.d.ts.map +1 -1
- package/dist/client/monitor.js +5 -1
- package/dist/client/monitor.js.map +1 -1
- package/dist/client/script-provenance.d.ts +21 -0
- package/dist/client/script-provenance.d.ts.map +1 -0
- package/dist/client/script-provenance.js +127 -0
- package/dist/client/script-provenance.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/dashboard/chrome.d.ts +4 -2
- package/dist/dashboard/chrome.d.ts.map +1 -1
- package/dist/dashboard/chrome.js +15 -5
- package/dist/dashboard/chrome.js.map +1 -1
- package/dist/dashboard/design-review-card.d.ts.map +1 -1
- package/dist/dashboard/design-review-card.js +3 -3
- package/dist/dashboard/design-review-card.js.map +1 -1
- package/dist/dashboard/design.d.ts +5 -1
- package/dist/dashboard/design.d.ts.map +1 -1
- package/dist/dashboard/design.js +3 -2
- package/dist/dashboard/design.js.map +1 -1
- package/dist/dashboard/drawer.d.ts +34 -0
- package/dist/dashboard/drawer.d.ts.map +1 -0
- package/dist/dashboard/drawer.js +44 -0
- package/dist/dashboard/drawer.js.map +1 -0
- package/dist/dashboard/index.d.ts +3 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +48 -37
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/installs.d.ts.map +1 -1
- package/dist/dashboard/installs.js +2 -1
- package/dist/dashboard/installs.js.map +1 -1
- package/dist/dashboard/issues.d.ts +9 -0
- package/dist/dashboard/issues.d.ts.map +1 -0
- package/dist/dashboard/issues.js +81 -0
- package/dist/dashboard/issues.js.map +1 -0
- package/dist/dashboard/journeys.d.ts.map +1 -1
- package/dist/dashboard/journeys.js +4 -2
- package/dist/dashboard/journeys.js.map +1 -1
- package/dist/dashboard/metric-trends.d.ts +6 -0
- package/dist/dashboard/metric-trends.d.ts.map +1 -0
- package/dist/dashboard/metric-trends.js +236 -0
- package/dist/dashboard/metric-trends.js.map +1 -0
- package/dist/dashboard/pages.d.ts.map +1 -1
- package/dist/dashboard/pages.js +8 -46
- package/dist/dashboard/pages.js.map +1 -1
- package/dist/dashboard/settings.d.ts.map +1 -1
- package/dist/dashboard/settings.js +6 -2
- package/dist/dashboard/settings.js.map +1 -1
- package/dist/dashboard/show-more.d.ts.map +1 -1
- package/dist/dashboard/show-more.js +1 -1
- package/dist/dashboard/show-more.js.map +1 -1
- package/dist/dashboard/snapshot-actions.d.ts +16 -0
- package/dist/dashboard/snapshot-actions.d.ts.map +1 -0
- package/dist/dashboard/snapshot-actions.js +79 -0
- package/dist/dashboard/snapshot-actions.js.map +1 -0
- package/dist/dashboard/snapshots.d.ts +13 -0
- package/dist/dashboard/snapshots.d.ts.map +1 -0
- package/dist/dashboard/snapshots.js +88 -0
- package/dist/dashboard/snapshots.js.map +1 -0
- package/dist/dashboard/summary.d.ts.map +1 -1
- package/dist/dashboard/summary.js +11 -6
- package/dist/dashboard/summary.js.map +1 -1
- package/dist/dashboard/telemetry.d.ts +3 -1
- package/dist/dashboard/telemetry.d.ts.map +1 -1
- package/dist/dashboard/telemetry.js +55 -12
- package/dist/dashboard/telemetry.js.map +1 -1
- package/dist/dashboard/ui.d.ts +33 -6
- package/dist/dashboard/ui.d.ts.map +1 -1
- package/dist/dashboard/ui.js +44 -6
- package/dist/dashboard/ui.js.map +1 -1
- package/dist/dashboard.css +193 -2
- package/dist/server/ingest.d.ts +2 -5
- package/dist/server/ingest.d.ts.map +1 -1
- package/dist/server/ingest.js +47 -10
- package/dist/server/ingest.js.map +1 -1
- package/dist/server/queries.d.ts +64 -11
- package/dist/server/queries.d.ts.map +1 -1
- package/dist/server/queries.js +207 -37
- package/dist/server/queries.js.map +1 -1
- package/dist/server/reclassify.d.ts +3 -0
- package/dist/server/reclassify.d.ts.map +1 -0
- package/dist/server/reclassify.js +65 -0
- package/dist/server/reclassify.js.map +1 -0
- package/dist/server/snapshots.d.ts +81 -0
- package/dist/server/snapshots.d.ts.map +1 -0
- package/dist/server/snapshots.js +371 -0
- package/dist/server/snapshots.js.map +1 -0
- package/dist/server/store.d.ts +5 -0
- package/dist/server/store.d.ts.map +1 -1
- package/dist/server/store.js +17 -0
- package/dist/server/store.js.map +1 -1
- package/dist/server/telemetry.d.ts +13 -0
- package/dist/server/telemetry.d.ts.map +1 -1
- package/dist/server/telemetry.js +28 -7
- package/dist/server/telemetry.js.map +1 -1
- package/dist/shared/capture-status.d.ts +99 -0
- package/dist/shared/capture-status.d.ts.map +1 -0
- package/dist/shared/capture-status.js +133 -0
- package/dist/shared/capture-status.js.map +1 -0
- package/dist/shared/error-noise.d.ts +39 -0
- package/dist/shared/error-noise.d.ts.map +1 -0
- package/dist/shared/error-noise.js +101 -0
- package/dist/shared/error-noise.js.map +1 -0
- package/dist/shared/metric-buckets.d.ts +31 -0
- package/dist/shared/metric-buckets.d.ts.map +1 -0
- package/dist/shared/metric-buckets.js +49 -0
- package/dist/shared/metric-buckets.js.map +1 -0
- package/dist/shared/text-signals.d.ts +56 -0
- package/dist/shared/text-signals.d.ts.map +1 -0
- package/dist/shared/text-signals.js +80 -0
- package/dist/shared/text-signals.js.map +1 -0
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +4 -0
- package/dist/shared/types.js.map +1 -1
- package/docs/SETUP.md +25 -0
- package/package.json +9 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polishd — shared "was this click about text?" heuristics.
|
|
3
|
+
*
|
|
4
|
+
* One source of truth used from two sides that must never drift:
|
|
5
|
+
*
|
|
6
|
+
* • Live, in the browser (`src/client/dom.ts`) — deciding whether a click
|
|
7
|
+
* records as dead/rage or is just reading.
|
|
8
|
+
* • Retroactively, on the server (`src/server/reclassify.ts`) — applying the
|
|
9
|
+
* same decision to rows stored by older clients, using the stored
|
|
10
|
+
* `selector` (which keeps the same 4-level tag path the live ancestor walk
|
|
11
|
+
* sees) and `text` label in place of the DOM.
|
|
12
|
+
*
|
|
13
|
+
* Dependency-free and runtime-agnostic, like the rest of `shared/`.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Block-level prose containers. A click anywhere inside one — including on a
|
|
17
|
+
* bold word or code span nested in it — is reading, never a dead control.
|
|
18
|
+
*/
|
|
19
|
+
export const PROSE_TAGS = new Set([
|
|
20
|
+
"p", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
21
|
+
"blockquote", "pre", "li", "dt", "dd", "figcaption",
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* Inline / cell-level text elements. These carry text but are also the exact
|
|
25
|
+
* shape of a mis-wired fake control (`<span class="link">Click here</span>`),
|
|
26
|
+
* so on their own they only read as prose past the length threshold below.
|
|
27
|
+
*/
|
|
28
|
+
export const INLINE_TEXT_TAGS = new Set([
|
|
29
|
+
"span", "em", "strong", "b", "i", "u", "s", "small", "mark", "code",
|
|
30
|
+
"abbr", "cite", "q", "time", "sup", "sub", "td", "th", "caption",
|
|
31
|
+
]);
|
|
32
|
+
/** Tags the capture layer treats as interactive (see `isInteractive`). */
|
|
33
|
+
export const INTERACTIVE_TAGS = new Set([
|
|
34
|
+
"a", "button", "input", "select", "textarea", "label", "summary",
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
* The length heuristic: standalone text this long reads as content; anything
|
|
38
|
+
* shorter could be a label on something the user believed was clickable.
|
|
39
|
+
* Stored `text` labels are capped at 80 chars, so the threshold must stay
|
|
40
|
+
* under that cap for the retro classifier to see it.
|
|
41
|
+
*/
|
|
42
|
+
export const PROSE_MIN_CHARS = 40;
|
|
43
|
+
/** Tag names of a stored selector path: "div.card>p.intro>span" → ["div","p","span"]. */
|
|
44
|
+
export const selectorTags = (selector) => selector
|
|
45
|
+
.split(">")
|
|
46
|
+
.map((seg) => seg.split(/[.#]/)[0].trim().toLowerCase())
|
|
47
|
+
.filter(Boolean);
|
|
48
|
+
/**
|
|
49
|
+
* The retro mirror of the client's `isTextTarget`, over stored columns:
|
|
50
|
+
* a prose tag anywhere in the selector path stands in for the ancestor walk,
|
|
51
|
+
* and the stored label's length stands in for the target's own text. The label
|
|
52
|
+
* is `innerText`, which includes children — so a layout container wrapping
|
|
53
|
+
* prose can classify as textual here where the live check would not. For
|
|
54
|
+
* history that's the right bias: these rows were recorded under rules known to
|
|
55
|
+
* overcount, and reclassifying reading as reading is the point.
|
|
56
|
+
*/
|
|
57
|
+
export const isTextualClickRow = (selector, text) => {
|
|
58
|
+
if (selector && selectorTags(selector).some((t) => PROSE_TAGS.has(t)))
|
|
59
|
+
return true;
|
|
60
|
+
return (text ?? "").trim().length >= PROSE_MIN_CHARS;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* The single server-side retype decision, shared by the one-time history sweep
|
|
64
|
+
* and the ingest backstop: a dead/rage click that landed on text becomes a
|
|
65
|
+
* `text_click` (kept, counted by nothing); everything else keeps its type. A
|
|
66
|
+
* rage row may have hammered a real control — the selector keeps its tag path,
|
|
67
|
+
* so anything interactive in it stays rage. (Dead clicks were only ever
|
|
68
|
+
* recorded on non-interactive targets — no guard needed.)
|
|
69
|
+
*/
|
|
70
|
+
export const reclassifiedClickType = (type, selector, text) => {
|
|
71
|
+
if (type !== "dead_click" && type !== "rage_click")
|
|
72
|
+
return type;
|
|
73
|
+
if (type === "rage_click" &&
|
|
74
|
+
selector &&
|
|
75
|
+
selectorTags(selector).some((t) => INTERACTIVE_TAGS.has(t))) {
|
|
76
|
+
return type;
|
|
77
|
+
}
|
|
78
|
+
return isTextualClickRow(selector, text) ? "text_click" : type;
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=text-signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-signals.js","sourceRoot":"","sources":["../../src/shared/text-signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC;IACrD,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACvC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY;CACpD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IAC3D,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,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,OAAO,IAAI,CAAC;IAChE,IACE,IAAI,KAAK,YAAY;QACrB,QAAQ;QACR,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;AACjE,CAAC,CAAC"}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* the host notes app.
|
|
11
11
|
*/
|
|
12
12
|
/** Every kind of signal we capture. Ordered roughly by synthesis value. */
|
|
13
|
-
export type PolishdEventType = "page_view" | "click" | "rage_click" | "dead_click" | "scroll_depth" | "viewport" | "js_error" | "web_vital" | "hover" | "component_view" | "mount" | "session_end" | "design_scan";
|
|
13
|
+
export type PolishdEventType = "page_view" | "click" | "rage_click" | "dead_click" | "scroll_depth" | "viewport" | "js_error" | "web_vital" | "hover" | "component_view" | "mount" | "session_end" | "text_click" | "design_scan" | "install_state";
|
|
14
14
|
/**
|
|
15
15
|
* A single captured event. The client sends these without a session id; the
|
|
16
16
|
* ingest layer attaches `session_id` server-side from the signed cookie, so a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,gBAAgB,GAChB,OAAO,GACP,aAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;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AAW,CAAC,gBAAgB,CAkB3D,CAAC;AASH,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/E,mBAAmB;AACnB,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACtE,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACjD,yBAAyB;AACzB,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,WAAW,wBAAwB;IACvC,8BAA8B;IAC9B,CAAC,EAAE,CAAC,CAAC;IACL,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,sDAAsD;IACtD,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,kEAAkE;IAClE,EAAE,EAAE,gBAAgB,EAAE,CAAC;IACvB,mDAAmD;IACnD,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,gEAAgE;IAChE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,kEAAkE;IAClE,GAAG,EAAE,cAAc,EAAE,CAAC;CACvB"}
|
package/dist/shared/types.js
CHANGED
|
@@ -24,5 +24,9 @@ export const CLIENT_EVENT_TYPES = new Set([
|
|
|
24
24
|
"mount",
|
|
25
25
|
"session_end",
|
|
26
26
|
"design_scan",
|
|
27
|
+
// Sent only by the dashboard telemetry emitter (once per session): whether
|
|
28
|
+
// the reporting install has a model connected, and which provider/model.
|
|
29
|
+
// Never carries a key or any secret — see dashboard/telemetry.tsx.
|
|
30
|
+
"install_state",
|
|
27
31
|
]);
|
|
28
32
|
//# sourceMappingURL=types.js.map
|
package/dist/shared/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqFH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAkC,IAAI,GAAG,CAAmB;IACzF,WAAW;IACX,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,UAAU;IACV,WAAW;IACX,OAAO;IACP,gBAAgB;IAChB,OAAO;IACP,aAAa;IACb,aAAa;IACb,2EAA2E;IAC3E,yEAAyE;IACzE,mEAAmE;IACnE,eAAe;CAChB,CAAC,CAAC"}
|
package/docs/SETUP.md
CHANGED
|
@@ -476,9 +476,34 @@ export default definePolishdConfig({
|
|
|
476
476
|
rageClick: { count: 3, windowMs: 500 }, // N clicks on one element
|
|
477
477
|
flushIntervalMs: 10_000,
|
|
478
478
|
dashboardRoute: "/polishd", // never captured; see below
|
|
479
|
+
ignoreErrors: [], // extra error messages to drop
|
|
479
480
|
});
|
|
480
481
|
```
|
|
481
482
|
|
|
483
|
+
Errors thrown by **browser extensions are dropped automatically**. Your page's
|
|
484
|
+
`error` handler hears every throw in the tab, not just your code's, so a wallet
|
|
485
|
+
extension failing to reach its background worker ("Failed to connect to
|
|
486
|
+
MetaMask") would otherwise land in your dashboard as one of your site's loudest
|
|
487
|
+
bugs.
|
|
488
|
+
|
|
489
|
+
This isn't a list of known extensions — it's worked out per error. The browser
|
|
490
|
+
records every script your document actually fetched (Resource Timing), and
|
|
491
|
+
extension code is never in it: the browser injects content scripts, your page
|
|
492
|
+
never asked for them. So an error is classified by where its stack points:
|
|
493
|
+
|
|
494
|
+
| Verdict | Meaning | What happens |
|
|
495
|
+
| --- | --- | --- |
|
|
496
|
+
| `site` | every frame is code you shipped — including third-party scripts your page loads, like Stripe | recorded normally |
|
|
497
|
+
| `extension` | a frame names an extension URL | dropped |
|
|
498
|
+
| `foreign` | a frame names a script your document never loaded | recorded, marked *not your code* |
|
|
499
|
+
| `unknown` | nothing attributable — an opaque cross-origin `Script error.`, an empty stack | recorded, marked *unattributable* |
|
|
500
|
+
|
|
501
|
+
Only `extension` is dropped, because only it is certain. The other two are
|
|
502
|
+
shown dimmed in Recent errors rather than hidden — a filter that quietly
|
|
503
|
+
discards what it can't identify is how a real bug goes missing. `ignoreErrors`
|
|
504
|
+
is the escape hatch if you want them gone anyway: strings match
|
|
505
|
+
case-insensitively anywhere in the message, regexes are tested as-is.
|
|
506
|
+
|
|
482
507
|
The dashboard's own traffic is **never captured**. Reading your analytics is
|
|
483
508
|
browsing too, and left alone it would rank "Refresh summary" as your site's
|
|
484
509
|
most-used feature. Nothing on `dashboardRoute` (or below it) is collected, and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polishd/next",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3-dev.1",
|
|
4
4
|
"description": "Drop-in product analytics for Next.js — capture real user behavioral signals (rage/dead clicks, scroll depth, errors, web vitals) and explore them on a built-in dashboard. What gets measured gets improved.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"CHANGELOG.md"
|
|
39
39
|
],
|
|
40
40
|
"bin": {
|
|
41
|
-
"polishd": "
|
|
41
|
+
"polishd": "bin/polishd.mjs"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsc -p tsconfig.build.json && npm run build:css",
|
|
77
77
|
"typecheck": "tsc -p tsconfig.json",
|
|
78
|
+
"test": "node --experimental-strip-types --test \"src/**/*.test.ts\"",
|
|
78
79
|
"clean": "rm -rf dist",
|
|
79
80
|
"prepublishOnly": "npm run clean && npm run build",
|
|
80
81
|
"build:css": "node scripts/build-css.mjs"
|
|
@@ -84,7 +85,13 @@
|
|
|
84
85
|
"react": ">=18",
|
|
85
86
|
"react-dom": ">=18"
|
|
86
87
|
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"allpages": "^0.3.3",
|
|
90
|
+
"playwright-core": "^1.62.1"
|
|
91
|
+
},
|
|
87
92
|
"optionalDependencies": {
|
|
93
|
+
"@sparticuz/chromium": "^149.0.0",
|
|
94
|
+
"@vercel/blob": "^2.8.0",
|
|
88
95
|
"pg": "^8.0.0"
|
|
89
96
|
},
|
|
90
97
|
"devDependencies": {
|