@valancex/mesh-compiler 0.4.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jack Miller
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,45 @@
1
+ # @valancex/mesh-compiler
2
+
3
+ The [MESH](https://github.com/ValanceX/Mesh) compiler, built for WebAssembly. Check MPRX, with or without a component manifest, and get back exactly the diagnostics `mesh check --format json` prints for the same inputs.
4
+
5
+ It's the Rust compiler itself, compiled to WebAssembly, not a reimplementation: this package adds no rule of its own. It returns diagnostics only.
6
+
7
+ ```js
8
+ import { check } from "@valancex/mesh-compiler";
9
+
10
+ const document = await check({
11
+ source: generated, // the MPRX text
12
+ path: "card.mprx", // an identifier you choose; never read
13
+ model: { // optional: check what the file means, too
14
+ manifest: manifestText, // the manifest's JSON text
15
+ path: "components.json", // an identifier you choose; never read
16
+ component: "user-card", // whose template `source` is: always explicit
17
+ },
18
+ });
19
+
20
+ for (const diagnostic of document.diagnostics) {
21
+ console.log(diagnostic.code, diagnostic.message);
22
+ // source.slice(diagnostic.span.start.utf16, diagnostic.span.end.utf16) is the text it points at.
23
+ }
24
+ ```
25
+
26
+ The [Using MESH from JavaScript](https://github.com/ValanceX/Mesh/blob/main/docs/guides/using-mesh-from-javascript.md) guide builds a generate-check-repair loop with it.
27
+
28
+ ## The API
29
+
30
+ - **`check(input)`** returns a promise of the diagnostics document, the one [`schemas/diagnostics-v1.schema.json`](https://github.com/ValanceX/Mesh/blob/main/schemas/diagnostics-v1.schema.json) describes. Anything wrong with your MPRX or your manifest is a diagnostic in it, never an exception. Diagnostics about the manifest carry the manifest's `path`. Each position has a `byte` offset, a 1-based `line` and `column`, and, for JavaScript, `utf16` (an offset into your string) and `utf16Column`.
31
+ - **`init(module)`** loads the WebAssembly module: a URL, its bytes, or a compiled `WebAssembly.Module`. In Node you don't need it; the package loads its own. In a browser, call it once before the first check, with the URL of `@valancex/mesh-compiler/mesh.wasm` as your setup serves it. Automatic loading by bundlers isn't part of this package's contract.
32
+ - **`version`**: the package's version.
33
+ - **`MeshVersionError`**: the WebAssembly module isn't this version's. No check runs against it.
34
+ - **`MeshInternalError`**: the compiler itself failed (a bug). The failed compiler instance is discarded, and the next check uses a fresh one.
35
+ - A `TypeError` for arguments of the wrong type.
36
+
37
+ Paths are identifiers: the package never touches the file system. Strings are passed as UTF-8, so a lone surrogate in a JavaScript string becomes U+FFFD, as with any UTF-8 encoding.
38
+
39
+ ## Support
40
+
41
+ Node 22 and 24, and browsers with WebAssembly. ESM only, with TypeScript declarations.
42
+
43
+ ## License
44
+
45
+ MIT
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The diagnostics document, as `schemas/diagnostics-v1.schema.json`
3
+ * describes it: what `mesh check --format json` prints, and what
4
+ * {@link check} returns. A later version may add properties; ignore any
5
+ * you don't know.
6
+ */
7
+ export interface DiagnosticsDocument {
8
+ /** The version of the document's shape. */
9
+ version: 1;
10
+ /** Every diagnostic, in the order MESH reports them. */
11
+ diagnostics: Diagnostic[];
12
+ }
13
+ /** Only errors fail a check. */
14
+ export type Severity = "error" | "warning";
15
+ export interface Diagnostic {
16
+ severity: Severity;
17
+ /** The stable code, such as `"unknown-reference"`. Match on this, not on `message`. */
18
+ code: string;
19
+ /** The human-readable message. It may change between versions. */
20
+ message: string;
21
+ /** The path the span points into: the source's, or the manifest's for a `manifest-*` code. */
22
+ path: string;
23
+ span: Span;
24
+ /** Replacements that would probably fix the problem, best first. Usually empty. */
25
+ suggestions: Suggestion[];
26
+ }
27
+ export interface Suggestion {
28
+ replacement: string;
29
+ span: Span;
30
+ }
31
+ /** `end` is just past the span's last character. */
32
+ export interface Span {
33
+ start: Position;
34
+ end: Position;
35
+ }
36
+ export interface Position {
37
+ /** A 0-based offset into the text's UTF-8 bytes; a byte-order mark counts. */
38
+ byte: number;
39
+ /** The 1-based line. */
40
+ line: number;
41
+ /** The 1-based column, in characters; a byte-order mark and a line's `\r` aren't columns. */
42
+ column: number;
43
+ /** The same place as `byte`, in UTF-16 code units: `source.slice(start.utf16, end.utf16)` is the span's text. */
44
+ utf16: number;
45
+ /** The 1-based column in UTF-16 code units, with `column`'s rules. */
46
+ utf16Column: number;
47
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The internal engine behind the public API: loading the WebAssembly
3
+ * module, checking its version, keeping one instance, moving bytes in and
4
+ * out of it, and discarding it after a failure.
5
+ *
6
+ * Deliberately boring (outline v0.4 I6): nothing here knows MPRX, the
7
+ * manifest, positions or diagnostics. It transfers UTF-8 in and the
8
+ * diagnostics document out, and checks only that what came out is a
9
+ * document at all. Not public API (D11): the package's `exports` map
10
+ * doesn't expose this file.
11
+ */
12
+ import type { DiagnosticsDocument } from "./document.js";
13
+ /**
14
+ * A failure at the boundary with the compiler: a trap (a Rust panic, or
15
+ * running out of memory), or a result that isn't a diagnostics document.
16
+ * It is never how a check reports a problem with its input; those are
17
+ * diagnostics. The failed compiler instance is discarded, and the next
18
+ * check uses a fresh one.
19
+ */
20
+ export declare class MeshInternalError extends Error {
21
+ name: string;
22
+ }
23
+ /**
24
+ * The WebAssembly module isn't the version this package was built for, or
25
+ * isn't a MESH module at all. No check runs against it.
26
+ */
27
+ export declare class MeshVersionError extends Error {
28
+ name: string;
29
+ }
30
+ /** What {@link init} accepts: where the module is, its bytes, or the module. */
31
+ export type ModuleSource = URL | string | BufferSource | WebAssembly.Module;
32
+ /** One check's inputs. */
33
+ export interface CheckInput {
34
+ /** The MPRX source text. */
35
+ source: string;
36
+ /** An opaque identifier for the source, used only to name it in diagnostics. Never read. */
37
+ path: string;
38
+ /** The model to check against. Without one, only syntax and structure are checked. */
39
+ model?: {
40
+ /** The manifest's text. */
41
+ manifest: string;
42
+ /** An opaque identifier for the manifest, used only to name it in diagnostics. Never read. */
43
+ path: string;
44
+ /** The component whose template the source is. Always explicit. */
45
+ component: string;
46
+ };
47
+ }
48
+ /**
49
+ * Loads the module from `source` and checks its version. In Node, the
50
+ * package loads its own module on the first check, so this is only
51
+ * needed to use another copy; in a browser, it's needed once, before the
52
+ * first check. If it fails, nothing is kept.
53
+ */
54
+ export declare function init(source: ModuleSource): Promise<void>;
55
+ /** Checks `input`. See the package's `check`. */
56
+ export declare function check(input: CheckInput): Promise<DiagnosticsDocument>;
57
+ /**
58
+ * The instance in use, if any, for the package's own memory and failure
59
+ * tests. Not API.
60
+ */
61
+ export declare function instanceForTests(): Record<string, unknown> | undefined;
package/dist/engine.js ADDED
@@ -0,0 +1,228 @@
1
+ /**
2
+ * The internal engine behind the public API: loading the WebAssembly
3
+ * module, checking its version, keeping one instance, moving bytes in and
4
+ * out of it, and discarding it after a failure.
5
+ *
6
+ * Deliberately boring (outline v0.4 I6): nothing here knows MPRX, the
7
+ * manifest, positions or diagnostics. It transfers UTF-8 in and the
8
+ * diagnostics document out, and checks only that what came out is a
9
+ * document at all. Not public API (D11): the package's `exports` map
10
+ * doesn't expose this file.
11
+ */
12
+ import { version } from "./version.js";
13
+ /**
14
+ * A failure at the boundary with the compiler: a trap (a Rust panic, or
15
+ * running out of memory), or a result that isn't a diagnostics document.
16
+ * It is never how a check reports a problem with its input; those are
17
+ * diagnostics. The failed compiler instance is discarded, and the next
18
+ * check uses a fresh one.
19
+ */
20
+ export class MeshInternalError extends Error {
21
+ name = "MeshInternalError";
22
+ }
23
+ /**
24
+ * The WebAssembly module isn't the version this package was built for, or
25
+ * isn't a MESH module at all. No check runs against it.
26
+ */
27
+ export class MeshVersionError extends Error {
28
+ name = "MeshVersionError";
29
+ }
30
+ const CHECK_EXPORTS = [
31
+ "mesh_alloc",
32
+ "mesh_free",
33
+ "mesh_check",
34
+ "mesh_result_ptr",
35
+ "mesh_result_len",
36
+ "mesh_result_clear",
37
+ ];
38
+ const encoder = new TextEncoder();
39
+ const decoder = new TextDecoder("utf-8", { fatal: true });
40
+ /** The compiled module, once loaded. */
41
+ let compiled;
42
+ /** The instance in use. Dropped after any boundary failure. */
43
+ let instance;
44
+ /** Checks run one at a time, in call order. */
45
+ let queue = Promise.resolve();
46
+ function isNode() {
47
+ return typeof process !== "undefined" && typeof process.versions?.node === "string";
48
+ }
49
+ async function bytesOf(location) {
50
+ if (location.protocol === "file:" && isNode()) {
51
+ const { readFile } = await import("node:fs/promises");
52
+ return readFile(location);
53
+ }
54
+ const response = await fetch(location);
55
+ if (!response.ok) {
56
+ throw new Error(`could not fetch the MESH module from ${location.href}: ${response.status}`);
57
+ }
58
+ return response.arrayBuffer();
59
+ }
60
+ async function compile(source) {
61
+ if (source instanceof WebAssembly.Module) {
62
+ return source;
63
+ }
64
+ if (typeof source === "string" || source instanceof URL) {
65
+ const base = typeof location === "undefined" ? undefined : location.href;
66
+ return WebAssembly.compile(await bytesOf(new URL(source, base)));
67
+ }
68
+ return WebAssembly.compile(source);
69
+ }
70
+ /** Instantiates `module` and checks it's a MESH module of this version (I10). */
71
+ async function instantiate(module) {
72
+ let exports;
73
+ try {
74
+ exports = (await WebAssembly.instantiate(module, {})).exports;
75
+ }
76
+ catch (cause) {
77
+ throw new MeshVersionError("this WebAssembly module isn't a MESH module", { cause });
78
+ }
79
+ const { memory, mesh_version_ptr, mesh_version_len } = exports;
80
+ if (!(memory instanceof WebAssembly.Memory) ||
81
+ typeof mesh_version_ptr !== "function" ||
82
+ typeof mesh_version_len !== "function") {
83
+ throw new MeshVersionError("this WebAssembly module isn't a MESH module: it has no version");
84
+ }
85
+ let found;
86
+ try {
87
+ const ptr = mesh_version_ptr();
88
+ const len = mesh_version_len();
89
+ found = decoder.decode(new Uint8Array(memory.buffer, ptr, len));
90
+ }
91
+ catch (cause) {
92
+ throw new MeshVersionError("this WebAssembly module's version can't be read", { cause });
93
+ }
94
+ if (found !== version) {
95
+ throw new MeshVersionError(`this package is @valancex/mesh-compiler ${version}, but its WebAssembly module is ${found}`);
96
+ }
97
+ for (const name of CHECK_EXPORTS) {
98
+ if (typeof exports[name] !== "function") {
99
+ throw new MeshVersionError(`this WebAssembly module ${found} has no ${name}`);
100
+ }
101
+ }
102
+ // A plain copy of the exports (theirs is frozen), which the package's
103
+ // failure tests can instrument.
104
+ return { ...exports };
105
+ }
106
+ /**
107
+ * Loads the module from `source` and checks its version. In Node, the
108
+ * package loads its own module on the first check, so this is only
109
+ * needed to use another copy; in a browser, it's needed once, before the
110
+ * first check. If it fails, nothing is kept.
111
+ */
112
+ export function init(source) {
113
+ const run = queue.then(async () => {
114
+ compiled = undefined;
115
+ instance = undefined;
116
+ const module = await compile(source);
117
+ instance = await instantiate(module);
118
+ compiled = module;
119
+ });
120
+ queue = run.catch(() => undefined);
121
+ return run;
122
+ }
123
+ async function current() {
124
+ if (instance) {
125
+ return instance;
126
+ }
127
+ if (!compiled) {
128
+ if (!isNode()) {
129
+ throw new Error("@valancex/mesh-compiler: call init() with the URL of mesh.wasm before the first check");
130
+ }
131
+ const module = await compile(new URL("./mesh.wasm", import.meta.url));
132
+ instance = await instantiate(module);
133
+ compiled = module;
134
+ return instance;
135
+ }
136
+ instance = await instantiate(compiled);
137
+ return instance;
138
+ }
139
+ /** Copies `bytes` into a new buffer in the module; returns its address. */
140
+ function put(exports, bytes) {
141
+ const ptr = exports.mesh_alloc(bytes.length);
142
+ // Read `memory.buffer` after allocating: growing memory replaces it.
143
+ new Uint8Array(exports.memory.buffer, ptr, bytes.length).set(bytes);
144
+ return ptr;
145
+ }
146
+ function isDocument(value) {
147
+ return (typeof value === "object" &&
148
+ value !== null &&
149
+ "version" in value &&
150
+ Array.isArray(value.diagnostics));
151
+ }
152
+ /** One check on `exports`. Any exception means the instance failed. */
153
+ function transfer(exports, input) {
154
+ const model = input.model;
155
+ const texts = [
156
+ input.source,
157
+ input.path,
158
+ model?.manifest ?? "",
159
+ model?.path ?? "",
160
+ model?.component ?? "",
161
+ ].map((text) => encoder.encode(text));
162
+ const buffers = texts.map((bytes) => ({ ptr: put(exports, bytes), len: bytes.length }));
163
+ const status = exports.mesh_check(...buffers.flatMap(({ ptr, len }) => [ptr, len]), model ? 1 : 0);
164
+ for (const { ptr, len } of buffers) {
165
+ exports.mesh_free(ptr, len);
166
+ }
167
+ if (status !== 0) {
168
+ throw new MeshInternalError(`the compiler refused its input (status ${status})`);
169
+ }
170
+ const bytes = new Uint8Array(exports.memory.buffer, exports.mesh_result_ptr(), exports.mesh_result_len()).slice();
171
+ exports.mesh_result_clear();
172
+ const document = JSON.parse(decoder.decode(bytes));
173
+ if (!isDocument(document)) {
174
+ throw new MeshInternalError("the compiler's result isn't a diagnostics document");
175
+ }
176
+ return document;
177
+ }
178
+ function validate(input) {
179
+ if (typeof input !== "object" || input === null) {
180
+ throw new TypeError("check() takes an object: { source, path, model? }");
181
+ }
182
+ const strings = [
183
+ ["source", input.source],
184
+ ["path", input.path],
185
+ ];
186
+ if (input.model !== undefined) {
187
+ const model = input.model;
188
+ if (typeof model !== "object" || model === null) {
189
+ throw new TypeError("model must be an object: { manifest, path, component }");
190
+ }
191
+ strings.push(["model.manifest", model.manifest], ["model.path", model.path], ["model.component", model.component]);
192
+ }
193
+ for (const [name, value] of strings) {
194
+ if (typeof value !== "string") {
195
+ throw new TypeError(`${name} must be a string`);
196
+ }
197
+ }
198
+ }
199
+ async function checkNow(input) {
200
+ validate(input);
201
+ const exports = await current();
202
+ try {
203
+ return transfer(exports, input);
204
+ }
205
+ catch (cause) {
206
+ // The instance may be half-updated: never call it again (outline D6).
207
+ if (instance === exports) {
208
+ instance = undefined;
209
+ }
210
+ if (cause instanceof MeshInternalError) {
211
+ throw cause;
212
+ }
213
+ throw new MeshInternalError("the compiler failed", { cause });
214
+ }
215
+ }
216
+ /** Checks `input`. See the package's `check`. */
217
+ export function check(input) {
218
+ const run = queue.then(() => checkNow(input));
219
+ queue = run.catch(() => undefined);
220
+ return run;
221
+ }
222
+ /**
223
+ * The instance in use, if any, for the package's own memory and failure
224
+ * tests. Not API.
225
+ */
226
+ export function instanceForTests() {
227
+ return instance;
228
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The MESH compiler, in WebAssembly: check MPRX against a component
3
+ * manifest, and get back exactly the diagnostics `mesh check --format
4
+ * json` prints for the same inputs.
5
+ *
6
+ * ```js
7
+ * import { check } from "@valancex/mesh-compiler";
8
+ *
9
+ * const document = await check({
10
+ * source: generated,
11
+ * path: "card.mprx",
12
+ * model: { manifest, path: "components.json", component: "user-card" },
13
+ * });
14
+ * for (const diagnostic of document.diagnostics) { ... }
15
+ * ```
16
+ *
17
+ * Paths are identifiers you choose; nothing reads them. The compiler runs
18
+ * entirely in WebAssembly, and this package adds no rule of its own.
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ import type { CheckInput, ModuleSource } from "./engine.js";
23
+ import type { DiagnosticsDocument } from "./document.js";
24
+ export type { Diagnostic, DiagnosticsDocument, Position, Severity, Span, Suggestion, } from "./document.js";
25
+ export type { CheckInput, ModuleSource } from "./engine.js";
26
+ export { MeshInternalError, MeshVersionError } from "./engine.js";
27
+ export { version } from "./version.js";
28
+ /**
29
+ * Checks `input.source`, as the template of `input.model.component` when a
30
+ * model is given, and returns the diagnostics document. A problem with the
31
+ * input is a diagnostic in the document, never an exception.
32
+ *
33
+ * It rejects with a `TypeError` for arguments of the wrong type, with
34
+ * `MeshVersionError` if the WebAssembly module isn't this version's, and
35
+ * with `MeshInternalError` if the compiler itself fails. In a browser,
36
+ * call {@link init} first.
37
+ */
38
+ export declare function check(input: CheckInput): Promise<DiagnosticsDocument>;
39
+ /**
40
+ * Loads the WebAssembly module from `source`: a URL (or a string resolved
41
+ * against the page), its bytes, or a compiled `WebAssembly.Module`, and
42
+ * checks its version. Needed once in a browser, before the first check;
43
+ * in Node the package loads its own module. The module is
44
+ * `@valancex/mesh-compiler/mesh.wasm`.
45
+ */
46
+ export declare function init(source: ModuleSource): Promise<void>;
package/dist/index.js ADDED
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The MESH compiler, in WebAssembly: check MPRX against a component
3
+ * manifest, and get back exactly the diagnostics `mesh check --format
4
+ * json` prints for the same inputs.
5
+ *
6
+ * ```js
7
+ * import { check } from "@valancex/mesh-compiler";
8
+ *
9
+ * const document = await check({
10
+ * source: generated,
11
+ * path: "card.mprx",
12
+ * model: { manifest, path: "components.json", component: "user-card" },
13
+ * });
14
+ * for (const diagnostic of document.diagnostics) { ... }
15
+ * ```
16
+ *
17
+ * Paths are identifiers you choose; nothing reads them. The compiler runs
18
+ * entirely in WebAssembly, and this package adds no rule of its own.
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ import { check as checkWith, init as initWith } from "./engine.js";
23
+ export { MeshInternalError, MeshVersionError } from "./engine.js";
24
+ export { version } from "./version.js";
25
+ /**
26
+ * Checks `input.source`, as the template of `input.model.component` when a
27
+ * model is given, and returns the diagnostics document. A problem with the
28
+ * input is a diagnostic in the document, never an exception.
29
+ *
30
+ * It rejects with a `TypeError` for arguments of the wrong type, with
31
+ * `MeshVersionError` if the WebAssembly module isn't this version's, and
32
+ * with `MeshInternalError` if the compiler itself fails. In a browser,
33
+ * call {@link init} first.
34
+ */
35
+ export function check(input) {
36
+ return checkWith(input);
37
+ }
38
+ /**
39
+ * Loads the WebAssembly module from `source`: a URL (or a string resolved
40
+ * against the page), its bytes, or a compiled `WebAssembly.Module`, and
41
+ * checks its version. Needed once in a browser, before the first check;
42
+ * in Node the package loads its own module. The module is
43
+ * `@valancex/mesh-compiler/mesh.wasm`.
44
+ */
45
+ export function init(source) {
46
+ return initWith(source);
47
+ }
package/dist/mesh.wasm ADDED
Binary file
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The package's version, which must equal the WebAssembly module's
3
+ * (outline v0.4 I10). `crates/mesh-cli/tests/packages.rs` pins it to
4
+ * `package.json` and to the Rust workspace.
5
+ */
6
+ export declare const version = "0.4.0";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The package's version, which must equal the WebAssembly module's
3
+ * (outline v0.4 I10). `crates/mesh-cli/tests/packages.rs` pins it to
4
+ * `package.json` and to the Rust workspace.
5
+ */
6
+ export const version = "0.4.0";
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@valancex/mesh-compiler",
3
+ "version": "0.4.0",
4
+ "description": "The MESH compiler, built for WebAssembly: checks MPRX against a component manifest and returns its diagnostics.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Jack Miller <jackmiller0899@gmail.com>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/ValanceX/Mesh.git",
11
+ "directory": "packages/mesh-compiler"
12
+ },
13
+ "keywords": [
14
+ "mesh",
15
+ "mprx",
16
+ "valancex",
17
+ "compiler",
18
+ "webassembly"
19
+ ],
20
+ "engines": {
21
+ "node": ">=22"
22
+ },
23
+ "sideEffects": false,
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./mesh.wasm": "./dist/mesh.wasm",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "dist/*.js",
35
+ "dist/*.d.ts",
36
+ "dist/mesh.wasm"
37
+ ],
38
+ "scripts": {
39
+ "build:wasm": "node scripts/build-wasm.mjs",
40
+ "build": "tsc -p tsconfig.json",
41
+ "typecheck": "tsc --noEmit -p tsconfig.json",
42
+ "test": "node --test --test-concurrency=1 \"test/*.test.mjs\""
43
+ }
44
+ }