@youth-healthtech/web-sdk 0.0.0-stage → 0.5.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 +92 -2
- package/dist/index.d.ts +58 -0
- package/dist/index.js +149 -0
- package/package.json +64 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Youth HealthTech Germany UG
|
|
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
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @youth-healthtech/web-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runs a YOU(th) checkup in an iframe on your page. The checkup itself is a page YOU(th) hosts: this
|
|
4
|
+
package sets the iframe up, starts the checkup with your settings and reports its progress, its
|
|
5
|
+
result and its errors. It has no dependencies, holds no measuring code and no keys of ours: the key
|
|
6
|
+
in the settings is yours.
|
|
7
|
+
|
|
8
|
+
The [Web SDK guide](https://website.youth-healthtech.com/docs/sdks/web) covers everything around it:
|
|
9
|
+
what your page needs, the checkups, the settings, the results and the errors.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @youth-healthtech/web-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
A page without a build step loads the same code as a script tag, which defines `window.YouthSDK`
|
|
18
|
+
with the same two functions. Copy the tag, with its version and its `integrity`, from
|
|
19
|
+
[Start a checkup](https://website.youth-healthtech.com/docs/sdks/web#start-a-checkup).
|
|
20
|
+
|
|
21
|
+
## Start a checkup
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { startCheckup, nextCheckup } from "@youth-healthtech/web-sdk";
|
|
25
|
+
|
|
26
|
+
const iframe = document.getElementById("checkup") as HTMLIFrameElement;
|
|
27
|
+
const address = "https://sdk.youth-platform.io/embed.html";
|
|
28
|
+
|
|
29
|
+
const stop = startCheckup(
|
|
30
|
+
iframe,
|
|
31
|
+
address,
|
|
32
|
+
{ apiKey: "your test key", locale: "de" },
|
|
33
|
+
{
|
|
34
|
+
onResult: (biomarkers) => save(biomarkers),
|
|
35
|
+
onError: (code) => showError(code),
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// The next person, in the same iframe, without loading it again.
|
|
40
|
+
nextCheckup(iframe, address, { user: { age: 35, height: 180, weight: 78 } });
|
|
41
|
+
|
|
42
|
+
// When the page no longer needs the checkup.
|
|
43
|
+
stop();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Your organization's admins issue its keys in the YOU(th) console, under SDK, Keys. The key alone
|
|
47
|
+
decides the environment: `pk_test_…` is a test (never billed, with its own limits) and `pk_live_…`
|
|
48
|
+
is live (billed). You build and test with your test key, and go live by swapping it for your live
|
|
49
|
+
key. Nothing else changes.
|
|
50
|
+
|
|
51
|
+
Your page needs HTTPS and two cross-origin isolation headers:
|
|
52
|
+
[What your page needs](https://website.youth-healthtech.com/docs/sdks/web#what-your-page-needs).
|
|
53
|
+
|
|
54
|
+
## API
|
|
55
|
+
|
|
56
|
+
- `startCheckup(iframe, address, settings, events) => stop`. Adds `camera`, `microphone` and
|
|
57
|
+
`cross-origin-isolated` to the iframe's `allow` (what the iframe already allows stays, and none is
|
|
58
|
+
listed twice), sets its `src`, and waits for `ready`. It answers with `init`, carrying `settings`,
|
|
59
|
+
to the checkup's origin only, never to any origin, each time the checkup says `ready` (a reload
|
|
60
|
+
asks again). It believes only messages from that iframe's window at that origin, and ignores
|
|
61
|
+
messages that are not the checkup's. An iframe runs one checkup at a time: starting again on it
|
|
62
|
+
stops the earlier one first, so a component that starts twice (React StrictMode) hears each event
|
|
63
|
+
once. `stop` removes the listener and the load timer and **unloads the checkup** (the iframe goes
|
|
64
|
+
to `about:blank`), so the page lets go of the camera and the microphone; call it when the person
|
|
65
|
+
is done or the component unmounts. To run another person, use `nextCheckup` before `stop`, or
|
|
66
|
+
start again. Throws a `TypeError`, having done nothing, when `address` is not a URL.
|
|
67
|
+
- `nextCheckup(iframe, address, payload)`. Sends `checkup` with `payload` (`user`, `checkupType`,
|
|
68
|
+
`voiceType`, `model`) to the checkup's origin.
|
|
69
|
+
|
|
70
|
+
Events: `onResult(biomarkers)` and `onError(code, detail?)` are required. A biomarker is
|
|
71
|
+
`{ type, name, value, unit, model, modelVersion }`: `model` and `modelVersion` name the model that
|
|
72
|
+
measured it and that model's version, and read `unknown` when the checkup names none.
|
|
73
|
+
`onProgress(state, progress, detail?)`, `onReady(version?)` and `onInitialized()` are optional.
|
|
74
|
+
`detail` is `{ step, steps }`, the recording of a voice checkup, there only when the checkup sends
|
|
75
|
+
both. Besides the checkup's own [error codes](https://website.youth-healthtech.com/docs/sdks/web/reference#errors),
|
|
76
|
+
`onError` gets `LOAD_TIMEOUT` (no `ready` within 30 seconds) and `UNSUPPORTED_VERSION` (the checkup
|
|
77
|
+
speaks another version of its messages); both stop the checkup. If the address ends up on another
|
|
78
|
+
origin (a redirect), or the iframe is sandboxed (its origin is then `null`), the checkup is never
|
|
79
|
+
believed, and the end is `LOAD_TIMEOUT`.
|
|
80
|
+
|
|
81
|
+
The package's TypeScript types describe all of it. A page that does not use the package can speak
|
|
82
|
+
the [messages](https://website.youth-healthtech.com/docs/sdks/web/reference#messages) itself.
|
|
83
|
+
|
|
84
|
+
## Versions
|
|
85
|
+
|
|
86
|
+
The package follows semantic versioning, and the script tag of a version has the same code. A
|
|
87
|
+
version, once released, never changes: a script tag pins it with its `integrity`. What each version
|
|
88
|
+
brings is in the [changelog](https://website.youth-healthtech.com/docs/changelog).
|
|
89
|
+
|
|
90
|
+
## Licence
|
|
91
|
+
|
|
92
|
+
The package is under the MIT licence, in its `LICENSE` file. Running YOU(th)'s checkups with it is
|
|
93
|
+
subject to your organization's agreement with YOU(th). For questions, write to your YOU(th) contact.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One measured value of a result. See the Results documentation for what each `type` is. `model`
|
|
3
|
+
* is the model that measured it (`face_video_1`, `face_video_2`, `voice_1`, `face_selfie_1`) and
|
|
4
|
+
* `modelVersion` that model's version, such as `2026.11`; both read `unknown` when the checkup
|
|
5
|
+
* names none.
|
|
6
|
+
*/
|
|
7
|
+
export type Biomarker = {
|
|
8
|
+
type: string;
|
|
9
|
+
name: string;
|
|
10
|
+
value: number;
|
|
11
|
+
unit: string;
|
|
12
|
+
model: string;
|
|
13
|
+
modelVersion: string;
|
|
14
|
+
};
|
|
15
|
+
/** Detail the checkup adds to an error. Absent for the two errors this package raises itself. */
|
|
16
|
+
export type ErrorDetail = {
|
|
17
|
+
reason?: string;
|
|
18
|
+
message?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Recording `step` of `steps`, of a voice checkup. */
|
|
21
|
+
export type ProgressDetail = {
|
|
22
|
+
step: number;
|
|
23
|
+
steps: number;
|
|
24
|
+
};
|
|
25
|
+
export type CheckupEvents = {
|
|
26
|
+
/** The checkup loaded, with its own version when it says it. `init` has been sent. */
|
|
27
|
+
onReady?: (version?: string) => void;
|
|
28
|
+
/** The key was accepted. The measurement loads next. */
|
|
29
|
+
onInitialized?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* `state` is `initialization`, `ready`, `progress`, `extraTime` (a face video that needs longer
|
|
32
|
+
* than its minute) or `processing`, and a later release can add one; `progress` is 0 to 100. A
|
|
33
|
+
* voice checkup also says which of its recordings this is: `detail` is there only then, when
|
|
34
|
+
* the checkup sent both `step` and `steps` as numbers.
|
|
35
|
+
*/
|
|
36
|
+
onProgress?: (state: string, progress: number, detail?: ProgressDetail) => void;
|
|
37
|
+
onResult: (biomarkers: Biomarker[]) => void;
|
|
38
|
+
/**
|
|
39
|
+
* The checkup's own `code` (see the reference's Errors), or one of the two this package raises:
|
|
40
|
+
* `LOAD_TIMEOUT`, when the checkup says no `ready` in time, and `UNSUPPORTED_VERSION`, when it
|
|
41
|
+
* speaks another version of the messages. Both stop the checkup.
|
|
42
|
+
*/
|
|
43
|
+
onError: (code: string, detail?: ErrorDetail) => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Loads the checkup at `address` into `iframe` and runs it with `settings`, the `init` payload.
|
|
47
|
+
* Returns `stop`: it stops listening and unloads the checkup, which lets go of the camera and the
|
|
48
|
+
* microphone. An iframe runs one checkup at a time: starting again stops the earlier one. Throws a TypeError, having done nothing, when
|
|
49
|
+
* `address` is not a URL.
|
|
50
|
+
*/
|
|
51
|
+
export declare function startCheckup(iframe: HTMLIFrameElement, address: string, settings: Record<string, unknown>, events: CheckupEvents): () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Starts again in the same iframe with the next person (`payload.user`, and `checkupType`,
|
|
54
|
+
* `voiceType` or `model`), without loading it again. A measurement under way is dropped.
|
|
55
|
+
* Also how to try again after an error while the measurement loads. Sent to `address`'s origin
|
|
56
|
+
* only. Throws a TypeError when `address` is not a URL; does nothing when the iframe has no window.
|
|
57
|
+
*/
|
|
58
|
+
export declare function nextCheckup(iframe: HTMLIFrameElement, address: string, payload: Record<string, unknown>): void;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Runs the YOU(th) Web SDK checkup, a page YOU(th) hosts, in an iframe on the customer's page, and
|
|
2
|
+
// speaks host protocol v1 with it. Everything it says is documented in
|
|
3
|
+
// https://youth-healthtech.com/docs/sdks/web. No dependencies, no vendor code, no keys: the
|
|
4
|
+
// settings, which carry the customer's key, are only ever sent to the checkup's own origin.
|
|
5
|
+
const PROTOCOL_VERSION = 1;
|
|
6
|
+
/** How long the checkup may take to load before `onError("LOAD_TIMEOUT")`. */
|
|
7
|
+
const LOAD_TIMEOUT_MS = 30_000;
|
|
8
|
+
/** What the checkup's page needs the iframe to allow. */
|
|
9
|
+
const REQUIRED_PERMISSIONS = ["camera", "microphone", "cross-origin-isolated"];
|
|
10
|
+
/** The checkup each iframe runs, by its `stop`: an iframe runs one at a time. */
|
|
11
|
+
const running = new WeakMap();
|
|
12
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
13
|
+
/** The documented fields of a biomarker, or nothing: what else the page sent is not passed on. */
|
|
14
|
+
function biomarkerOf(value) {
|
|
15
|
+
if (isRecord(value) &&
|
|
16
|
+
typeof value.type === "string" &&
|
|
17
|
+
typeof value.name === "string" &&
|
|
18
|
+
typeof value.value === "number" &&
|
|
19
|
+
Number.isFinite(value.value) &&
|
|
20
|
+
typeof value.unit === "string") {
|
|
21
|
+
return {
|
|
22
|
+
type: value.type,
|
|
23
|
+
name: value.name,
|
|
24
|
+
value: value.value,
|
|
25
|
+
unit: value.unit,
|
|
26
|
+
model: namedOr(value.model),
|
|
27
|
+
modelVersion: namedOr(value.modelVersion),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
/** A model or its version as the checkup names it; `unknown` from a checkup that names none. */
|
|
33
|
+
function namedOr(value) {
|
|
34
|
+
return typeof value === "string" ? value : "unknown";
|
|
35
|
+
}
|
|
36
|
+
/** The iframe's own permissions with the ones the checkup needs added, none twice. */
|
|
37
|
+
function permissionsFor(current) {
|
|
38
|
+
const entries = (current ?? "")
|
|
39
|
+
.split(";")
|
|
40
|
+
.map((entry) => entry.trim())
|
|
41
|
+
.filter((entry) => entry !== "");
|
|
42
|
+
const named = new Set(entries.map((entry) => entry.split(/\s+/)[0]));
|
|
43
|
+
return [...entries, ...REQUIRED_PERMISSIONS.filter((name) => !named.has(name))].join("; ");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Loads the checkup at `address` into `iframe` and runs it with `settings`, the `init` payload.
|
|
47
|
+
* Returns `stop`: it stops listening and unloads the checkup, which lets go of the camera and the
|
|
48
|
+
* microphone. An iframe runs one checkup at a time: starting again stops the earlier one. Throws a TypeError, having done nothing, when
|
|
49
|
+
* `address` is not a URL.
|
|
50
|
+
*/
|
|
51
|
+
export function startCheckup(iframe, address, settings, events) {
|
|
52
|
+
const origin = new URL(address).origin;
|
|
53
|
+
// One checkup per iframe: a second listener would answer every message twice.
|
|
54
|
+
// The earlier one is not unloaded: the new `src` follows at once, and a browser may drop a load
|
|
55
|
+
// that comes straight after another.
|
|
56
|
+
running.get(iframe)?.(false);
|
|
57
|
+
function onMessage(event) {
|
|
58
|
+
// Only the checkup in this iframe, from its own origin.
|
|
59
|
+
const checkup = iframe.contentWindow;
|
|
60
|
+
if (checkup === null || event.source !== checkup || event.origin !== origin)
|
|
61
|
+
return;
|
|
62
|
+
const message = event.data;
|
|
63
|
+
// Something that does not speak this protocol at all (a script of the checkup's page may post
|
|
64
|
+
// to its parent) is not for us.
|
|
65
|
+
if (!isRecord(message) || typeof message.v !== "number")
|
|
66
|
+
return;
|
|
67
|
+
// Another version of the messages is not understood here: say so once rather than wait.
|
|
68
|
+
if (message.v !== PROTOCOL_VERSION) {
|
|
69
|
+
stop();
|
|
70
|
+
events.onError("UNSUPPORTED_VERSION");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const payload = message.payload;
|
|
74
|
+
if (message.type === "ready") {
|
|
75
|
+
clearTimeout(loading);
|
|
76
|
+
// To the checkup's origin only: the settings carry the key.
|
|
77
|
+
checkup.postMessage({ v: PROTOCOL_VERSION, type: "init", payload: settings }, origin);
|
|
78
|
+
events.onReady?.(typeof message.version === "string" ? message.version : undefined);
|
|
79
|
+
}
|
|
80
|
+
else if (message.type === "initialized") {
|
|
81
|
+
events.onInitialized?.();
|
|
82
|
+
}
|
|
83
|
+
else if (message.type === "progress") {
|
|
84
|
+
if (isRecord(payload) &&
|
|
85
|
+
typeof payload.state === "string" &&
|
|
86
|
+
typeof payload.progress === "number" &&
|
|
87
|
+
Number.isFinite(payload.progress)) {
|
|
88
|
+
const { step, steps } = payload;
|
|
89
|
+
if (typeof step === "number" &&
|
|
90
|
+
typeof steps === "number" &&
|
|
91
|
+
Number.isFinite(step + steps)) {
|
|
92
|
+
events.onProgress?.(payload.state, payload.progress, { step, steps });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
events.onProgress?.(payload.state, payload.progress);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (message.type === "result") {
|
|
100
|
+
const list = isRecord(payload) ? payload.biomarkers : undefined;
|
|
101
|
+
const biomarkers = Array.isArray(list) ? list.map(biomarkerOf) : [undefined];
|
|
102
|
+
// A result is whole or it is not one: no half a list.
|
|
103
|
+
if (biomarkers.every((biomarker) => biomarker !== undefined))
|
|
104
|
+
events.onResult(biomarkers);
|
|
105
|
+
}
|
|
106
|
+
else if (message.type === "error") {
|
|
107
|
+
if (isRecord(payload) && typeof payload.code === "string") {
|
|
108
|
+
const { reason, message: text } = payload;
|
|
109
|
+
events.onError(payload.code, {
|
|
110
|
+
...(typeof reason === "string" && { reason }),
|
|
111
|
+
...(typeof text === "string" && { message: text }),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function end(unload) {
|
|
117
|
+
clearTimeout(loading);
|
|
118
|
+
window.removeEventListener("message", onMessage);
|
|
119
|
+
// Only the checkup this iframe still runs is unloaded, so that a late call of an old stop does
|
|
120
|
+
// not take down the next one. Unloaded, the page lets go of the camera and the microphone.
|
|
121
|
+
if (running.get(iframe) === end) {
|
|
122
|
+
running.delete(iframe);
|
|
123
|
+
if (unload)
|
|
124
|
+
iframe.src = "about:blank";
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const stop = () => end(true);
|
|
128
|
+
// Listen first: `ready` comes once, as soon as the checkup has loaded.
|
|
129
|
+
window.addEventListener("message", onMessage);
|
|
130
|
+
// A checkup that loads after this is ignored.
|
|
131
|
+
const loading = setTimeout(() => {
|
|
132
|
+
stop();
|
|
133
|
+
events.onError("LOAD_TIMEOUT");
|
|
134
|
+
}, LOAD_TIMEOUT_MS);
|
|
135
|
+
iframe.setAttribute("allow", permissionsFor(iframe.getAttribute("allow")));
|
|
136
|
+
iframe.src = address;
|
|
137
|
+
running.set(iframe, end);
|
|
138
|
+
return stop;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Starts again in the same iframe with the next person (`payload.user`, and `checkupType`,
|
|
142
|
+
* `voiceType` or `model`), without loading it again. A measurement under way is dropped.
|
|
143
|
+
* Also how to try again after an error while the measurement loads. Sent to `address`'s origin
|
|
144
|
+
* only. Throws a TypeError when `address` is not a URL; does nothing when the iframe has no window.
|
|
145
|
+
*/
|
|
146
|
+
export function nextCheckup(iframe, address, payload) {
|
|
147
|
+
const origin = new URL(address).origin;
|
|
148
|
+
iframe.contentWindow?.postMessage({ v: PROTOCOL_VERSION, type: "checkup", payload }, origin);
|
|
149
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youth-healthtech/web-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Runs a YOU(th) checkup in an iframe on your page: loads it, starts it with your settings and reports its progress, its result and its errors.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"biomarkers",
|
|
7
|
+
"checkup",
|
|
8
|
+
"iframe",
|
|
9
|
+
"postmessage",
|
|
10
|
+
"web-sdk",
|
|
11
|
+
"youth"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://website.youth-healthtech.com/docs/sdks/web",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "YOU(th) Health Tech",
|
|
17
|
+
"url": "https://www.youth-healthtech.com"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/YOUTH-Health-Tech-Inc/youth-apps.git",
|
|
22
|
+
"directory": "packages/web-sdk"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rm -rf dist dist-script && tsc -p tsconfig.build.json && vite build --config vite.script.config.ts",
|
|
45
|
+
"format": "oxfmt --write .",
|
|
46
|
+
"format:check": "oxfmt --check .",
|
|
47
|
+
"lint": "oxlint --deny-warnings .",
|
|
48
|
+
"package:check": "bash scripts/check-package.sh",
|
|
49
|
+
"prepack": "npm run build",
|
|
50
|
+
"test": "vitest run --coverage",
|
|
51
|
+
"typecheck": "tsc --noEmit"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
55
|
+
"@types/node": "26.6.2",
|
|
56
|
+
"@vitest/coverage-v8": "5.0.1",
|
|
57
|
+
"jsdom": "30.1.1",
|
|
58
|
+
"oxfmt": "0.77.0",
|
|
59
|
+
"oxlint": "1.92.0",
|
|
60
|
+
"oxlint-tsgolint": "7.0.2006",
|
|
61
|
+
"publint": "0.3.25",
|
|
62
|
+
"typescript": "7.0.2",
|
|
63
|
+
"vite": "8.3.3",
|
|
64
|
+
"vitest": "5.0.1"
|
|
65
|
+
}
|
|
66
|
+
}
|