@brust/core 2.0.0-alpha.2 → 2.0.0-alpha.4
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/README.md +64 -6
- package/native/index.d.ts +65 -2
- package/native/index.js +59 -54
- package/package.json +16 -8
- package/src/actions/client.ts +22 -5
- package/src/actions/load.ts +2 -1
- package/src/actions/prefix.ts +24 -2
- package/src/actions-bridge.ts +29 -11
- package/src/browser.ts +3 -1
- package/src/build/actions-only.ts +86 -0
- package/src/build/build-eval.ts +199 -0
- package/src/build/build-icons.ts +69 -0
- package/src/build/bundle.ts +48 -12
- package/src/build/cf-assets.ts +83 -0
- package/src/build/cf-core.ts +90 -0
- package/src/build/cf-entry.ts +76 -0
- package/src/build/cf-wrangler.ts +169 -0
- package/src/build/cloudflare.ts +315 -0
- package/src/build/compile.ts +41 -4
- package/src/build/config.ts +255 -10
- package/src/build/css.ts +286 -0
- package/src/build/index.ts +199 -16
- package/src/build/manifest.ts +41 -4
- package/src/build/scan.ts +59 -20
- package/src/build/ssg-render.ts +65 -0
- package/src/build/ssg.ts +146 -0
- package/src/build/static-worker.ts +91 -0
- package/src/build/static.ts +258 -0
- package/src/build-time.ts +10 -0
- package/src/cache-adapter/bridge.ts +91 -0
- package/src/cache-adapter/conformance.ts +226 -0
- package/src/cache-adapter/index.ts +10 -0
- package/src/cache-adapter/load.ts +144 -0
- package/src/cache-adapter/memory.ts +229 -0
- package/src/cache-adapter/runtime.ts +124 -0
- package/src/cache-adapter/types.ts +96 -0
- package/src/cache-adapter/workers.ts +118 -0
- package/src/cache.ts +4 -1
- package/src/cf.ts +19 -0
- package/src/cli.ts +50 -2
- package/src/config.ts +127 -25
- package/src/css-modules.d.ts +8 -0
- package/src/dev/bun.ts +365 -0
- package/src/dev/client.ts +92 -0
- package/src/dev/devtools-data.ts +23 -0
- package/src/dev/devtools.ts +356 -0
- package/src/dev/diag.ts +30 -0
- package/src/dev/proxy.ts +236 -0
- package/src/dev/tui.ts +144 -0
- package/src/dev/watch.ts +81 -0
- package/src/dev.ts +93 -0
- package/src/handlers.ts +282 -0
- package/src/index.ts +3 -1
- package/src/native.ts +38 -1
- package/src/routes.ts +20 -1
- package/src/run.ts +46 -9
- package/src/server-handlers.ts +32 -0
- package/src/worker.ts +125 -245
package/README.md
CHANGED
|
@@ -18,19 +18,24 @@ export const routes = defineRoutes([
|
|
|
18
18
|
])
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Route fields are exactly `path`, `Component`, `loader`, `cache`, `children
|
|
21
|
+
Route fields are exactly `path`, `Component`, `loader`, `cache`, `ssg`, `children` (`ssg` only matters
|
|
22
|
+
to `--target static`, see [docs/static.md](../../docs/static.md)); anything else fails the
|
|
22
23
|
build with `<field> is not supported in M2 (M3)`. Loaders run root → leaf, results merge flat
|
|
23
24
|
(later keys win); return `notFound(data)` / `redirect(location, status)` or throw
|
|
24
25
|
`httpError(status, body)` for a verdict. `cache(Comp, opts)` and `cache.invalidate(…)` ship too.
|
|
25
26
|
|
|
26
27
|
## `brust build [entry=routes.tsx] [--out-dir dist]`
|
|
27
28
|
|
|
29
|
+
`--target static [--strict]` also renders every page to `dist/static/` for Cloudflare Pages or Workers
|
|
30
|
+
Static Assets: see [docs/static.md](../../docs/static.md).
|
|
31
|
+
|
|
28
32
|
Compiles every route component through lowering, then writes (always from scratch):
|
|
29
33
|
|
|
30
34
|
```
|
|
31
35
|
dist/manifest.json the only build → server contract (spec S6)
|
|
32
36
|
dist/jinja/<id>.jinja templates dist/jobs.js + jobs/*.server.ts worker jobs
|
|
33
37
|
dist/client/*-<hex>.js runtime, native chunks, react-<id> island chunks (served immutable)
|
|
38
|
+
dist/client/*-<hex>.css one minified stylesheet per imported .css / .module.css (see docs/css.md)
|
|
34
39
|
dist/public/ copied from ./public dist/index.js `bun dist/index.js` = start
|
|
35
40
|
```
|
|
36
41
|
|
|
@@ -62,15 +67,64 @@ generated files resolve against the component's source dir, bare imports against
|
|
|
62
67
|
`--out-dir` may point anywhere; at run time `dist/` must still resolve `react` and `@brust/core`
|
|
63
68
|
(keep it inside the app, or next to a `node_modules` that has them).
|
|
64
69
|
|
|
70
|
+
## `brust dev [entry=routes.tsx] [--port N] [--workers N]`
|
|
71
|
+
|
|
72
|
+
The Bun-target dev server. A long-lived parent owns your port and proxies to the newest build; every
|
|
73
|
+
successful build is booted as a new child (`brust start` on a loopback port, `--workers 1` unless you pass
|
|
74
|
+
`--workers`), the proxy switches over, browsers are told to `reload`, and the old child is stopped. A failed
|
|
75
|
+
build **or a failed boot** keeps the old child serving and shows the error as an overlay above the stale page
|
|
76
|
+
(a page opened while builds fail shows it too); the next good build clears it and reloads.
|
|
77
|
+
|
|
78
|
+
- Source changes do a full reload (debounced ~150 ms; an edit made during a rebuild is not dropped).
|
|
79
|
+
- A change to `public/*.css` skips the build: the file is copied into the running dist and the `<link>` is
|
|
80
|
+
swapped (`?v=`), the page keeps its state. Other `public/` files reload.
|
|
81
|
+
- Every `text/html` response, including error pages, gets `/_brust/dev/client.js` (a WebSocket at
|
|
82
|
+
`/_brust/dev/ws`); responses are `cache-control: no-store`. `Host` and `Origin` reach the child unchanged,
|
|
83
|
+
so the actions cross-site guard behaves as in production.
|
|
84
|
+
- Dev builds use React in development mode (`NODE_ENV=development`); `brust build` / `brust start` are unchanged.
|
|
85
|
+
- The terminal shows request lines (`method path status ms cache`) and a status block of at most 6 lines at the
|
|
86
|
+
bottom (state, URL, generation, build time, last request, warnings, hotkeys `r` reload, `o` open, `w` warnings,
|
|
87
|
+
`c` clear, `q` quit). It never uses the alternate screen. Not a TTY, `CI` or `NO_COLOR`: plain lines only.
|
|
88
|
+
- **Trace for dev tools (L14).** The dev proxy generates a token per session and gives it to each child (`BRUST_DEV_TOKEN`,
|
|
89
|
+
napi `devToken`) and to every upstream request (`x-brust-dev-token`). Only then the core answers `x-brust-dev: base64(json)`
|
|
90
|
+
(route, pattern, chain, params, cache outcome, loader and render ms, jobs with kind/key/tags/hit, bun calls, the components the
|
|
91
|
+
page is made of). It is added after the L1 store, so it is never cached; a core without a token (production) never makes it.
|
|
92
|
+
The proxy strips the header, puts the trace in the page as `<script type=application/json id=__brust_trace>` and keeps the
|
|
93
|
+
last 50 (actions included) at `/_brust/dev/traces`. `brust build --dev` (used by `brust dev`) also writes `dev.json`
|
|
94
|
+
(component id → source file, tier, the react reason, diagnostics with rule/line/col/remediation; served at `/_brust/dev/meta`);
|
|
95
|
+
a production build writes none. In dev only, every chain level is wrapped in `<!--brust:<id>-->…<!--/brust-->` (never inside a
|
|
96
|
+
`<brust-island>`), and the runtime exposes its live instances on `globalThis.__brustDev.instances` (`__BRUST_DEV__` is a
|
|
97
|
+
build define that is `false`, and removed by the minifier, in every other build).
|
|
98
|
+
- **`<brust-devtools>` (L15).** The dev proxy serves `/_brust/dev/devtools.js` (bundled from `src/dev/devtools.ts` on first request) and
|
|
99
|
+
injects it into every HTML response, so `brust start` and production builds contain none of it. A corner indicator shows the build state
|
|
100
|
+
and the page's tier counts (`ready · 2s 1n 1r`); `Alt+Shift+B` toggles the panel (real buttons and tabs, arrow keys, `Esc` closes and
|
|
101
|
+
restores focus, contrast ≥ 4.5:1 in light and dark). Panels, each from the trace, `dev.json`, the DOM or `__brustDev` only: **Page**
|
|
102
|
+
(route, params, cache, timings), **Components** (tree with tier badges; a react component shows its reason and diagnostic location;
|
|
103
|
+
hover highlights it), **Jobs**, **Store** (seed from `data-brust-store`, live values of mounted native stores), **Islands**
|
|
104
|
+
(hydrated or not), **Build** (diagnostics with `file:line:col`, the current build error), **Requests** (the last 50). The terminal
|
|
105
|
+
status block shows the same tier counts for the last page.
|
|
106
|
+
- Not hot module replacement: component state does not survive an edit. `brust dev --target cloudflare` keeps
|
|
107
|
+
its wrangler loop (now on the same watch loop).
|
|
108
|
+
|
|
65
109
|
## `brust start [--port N] [--workers N] [--dist-dir dist] [--entry routes.tsx]`
|
|
66
110
|
|
|
67
111
|
Prints `[brust] listening on <addr>` then `[brust] ready (N workers)`. `--port 0` picks a free port.
|
|
68
112
|
SIGINT/SIGTERM drains gracefully (`BRUST_DRAIN_TIMEOUT_MS`); a second signal exits at once.
|
|
69
113
|
Config precedence: env (`BRUST_ADDR`, `BRUST_PORT`, `BRUST_WORKERS`, `BRUST_RENDER_SLOTS`,
|
|
70
|
-
`BRUST_DRAIN_TIMEOUT_MS`, `BRUST_BOOT_TIMEOUT_MS`, `BRUST_CALL_TIMEOUT_MS`, `
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
worker
|
|
114
|
+
`BRUST_DRAIN_TIMEOUT_MS`, `BRUST_BOOT_TIMEOUT_MS`, `BRUST_CALL_TIMEOUT_MS`, `BRUST_SLOT_BYTES`,
|
|
115
|
+
`BRUST_MAX_LOADER_RESPONSE_BYTES`, `BRUST_DIST_DIR`, `BRUST_APP_ENTRY`) > flags
|
|
116
|
+
(`--port`, `--workers`, `--dist-dir`, `--entry`) and `run({ config })` > `brust.toml` (`[server] address/port/max_loader_response_bytes`,
|
|
117
|
+
`[workers] count/slot_bytes`, `[cors]`) > defaults (`localhost:1337`, one worker per CPU, `min(cores, 16)` slots per worker (each slot is a `slotBytes` shared response buffer, 256 KiB by default, so 10 slots = 2.5 MiB per worker), 10 s drain, 30 s
|
|
118
|
+
worker boot timeout, 30 s call timeout, 8 MiB loader response limit).
|
|
119
|
+
`slotBytes` (`[workers] slot_bytes`, env `BRUST_SLOT_BYTES`, `run({ config: { slotBytes } })`) is 64 KiB..16 MiB.
|
|
120
|
+
A loader, jobs or planned reply that does not fit its slot is not an error: the worker hands it to the server
|
|
121
|
+
over the heap, up to `maxLoaderResponseBytes` (`[server] max_loader_response_bytes`, env
|
|
122
|
+
`BRUST_MAX_LOADER_RESPONSE_BYTES`, `run({ config: { maxLoaderResponseBytes } })`; 256 KiB..64 MiB, default 8 MiB).
|
|
123
|
+
A bigger reply answers `{"error":"response too large: <n> > <limit> (maxLoaderResponseBytes)"}` (a 500). This
|
|
124
|
+
limit applies to loader and jobs replies; `[actions]` has its own `max_response_bytes`.
|
|
125
|
+
`[cors]` can also be given as `run({ config: { cors: { origins, methods, headers, exposeHeaders, credentials,
|
|
126
|
+
maxAgeSeconds } } })` (camelCase, an unknown key is rejected). It replaces a `brust.toml` `[cors]` as a whole,
|
|
127
|
+
never merging with it; `cors: null` turns the toml table off.
|
|
74
128
|
A loader or job call that has not settled within `BRUST_CALL_TIMEOUT_MS` answers **504**; its worker
|
|
75
129
|
slot stays claimed until the call settles (the late result is discarded), so a stuck call costs one
|
|
76
130
|
slot, never a frozen worker. Waiting for a free slot is the separate 503 "all workers busy".
|
|
@@ -80,7 +134,11 @@ slot, never a frozen worker. Waiting for a free slot is the separate 503 "all wo
|
|
|
80
134
|
## Worker wire (contract 7, `crates/brust-server/src/protocol.rs`)
|
|
81
135
|
|
|
82
136
|
Requests arrive as inline JSON; responses go into the worker's SharedArrayBuffer slot (never
|
|
83
|
-
past `floor(len / slots)` bytes
|
|
137
|
+
past `floor(len / slots)` bytes). A `loader`/`jobs` reply that does not fit crosses by heap: the worker
|
|
138
|
+
puts the bytes with `putFetchReply` and writes the 5-byte marker `[0x00][u32 LE n]` into the slot (JSON
|
|
139
|
+
never starts with 0x00); the server reads the `n` bytes it was handed. A loader context too large for the
|
|
140
|
+
slot is planned from the bytes (`planJobsBuf`). Over `maxLoaderResponseBytes` the reply becomes
|
|
141
|
+
`{"error":…}`. A handler never rejects.
|
|
84
142
|
|
|
85
143
|
`loader` `{routeId, params, path, req}` → `{ok:true, data}` | `{verdict, …}` | `{error}`;
|
|
86
144
|
`jobs` `{jobs:[{id, componentId, kind, inputs, target?, row?}]}` → `{results:[{id, value}|{id, error}]}`
|
package/native/index.d.ts
CHANGED
|
@@ -15,9 +15,31 @@ export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-was
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function beginDrain(timeoutMs: number): Promise<void>
|
|
17
17
|
|
|
18
|
+
/** Drop both tier-1 caches (a broadcast gap, R10); `stats.l2.resets`++. The L1 entries removed. */
|
|
19
|
+
export declare function cacheClear(): number
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Static output (gaps round R9.4): the request reads of one `cache.prefix` / `cache.bypass`
|
|
23
|
+
* expression (`header(x)`, `cookie(x)`, `query(x)`, `request(host)`), parsed by the server's own
|
|
24
|
+
* grammar. Errors when the expression does not parse. Needs no running server.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cacheExprReads(src: string): Array<string>
|
|
27
|
+
|
|
18
28
|
/** `cache.invalidate({ key?, tags?, path?, method? })` (spec §5). */
|
|
19
29
|
export declare function cacheInvalidate(args: NapiInvalidateArgs): NapiInvalidateResult
|
|
20
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Bump the `stats.l2` counter `name` (the JS side's counts, R9). `false` = unknown name, no
|
|
33
|
+
* adapter, or no server. Never throws.
|
|
34
|
+
*/
|
|
35
|
+
export declare function cacheL2Count(name: string): boolean
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A broadcast invalidation another process published (worker 0's subscriber, cache-adapter R10):
|
|
39
|
+
* tier 1 + the floor at `seq`. Never re-published (L3). Same args/result as `cache_invalidate`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function cacheReplay(args: NapiInvalidateArgs, seq?: number | undefined | null): NapiInvalidateResult
|
|
42
|
+
|
|
21
43
|
/** `/_brust/cache/stats` JSON (snake_case keys, as the server serialises it). */
|
|
22
44
|
export declare function cacheStats(): string
|
|
23
45
|
|
|
@@ -28,6 +50,8 @@ export interface CompiledComponent {
|
|
|
28
50
|
ir: string
|
|
29
51
|
jinja: string
|
|
30
52
|
serverTs?: string
|
|
53
|
+
/** Build-time evaluation module (L2): one thunk per `ir.build_eval` slot. */
|
|
54
|
+
evalTs?: string
|
|
31
55
|
clientJs?: string
|
|
32
56
|
diagnostics: Array<NapiDiagnostic>
|
|
33
57
|
}
|
|
@@ -37,12 +61,22 @@ export interface CompiledTree {
|
|
|
37
61
|
error?: NapiDiagnostic
|
|
38
62
|
}
|
|
39
63
|
|
|
40
|
-
/**
|
|
41
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Compiles `path` (relative to `root`) and every child it reaches through lowering. `css_modules` (L20): the class
|
|
66
|
+
* map of each `*.module.css`, keyed by its path relative to `root`; `styles.x` folds to the literal class.
|
|
67
|
+
*/
|
|
68
|
+
export declare function compileTree(path: string, root: string, runtimeImport: string, serverOnly: Array<string>, slotValues?: string | undefined | null, cssModules?: Record<string, Record<string, string>> | undefined | null, iconSvgs?: string | undefined | null): CompiledTree
|
|
42
69
|
|
|
43
70
|
/** The bound address as `host:port` (port 0 resolves here). */
|
|
44
71
|
export declare function localAddr(): string
|
|
45
72
|
|
|
73
|
+
/** L16: what the page tells the browser client. `credentials`: `"same-origin"` (default), `"include"` or `"omit"`. */
|
|
74
|
+
export interface NapiActionsClient {
|
|
75
|
+
prefix?: string
|
|
76
|
+
baseUrl?: string
|
|
77
|
+
credentials?: string
|
|
78
|
+
}
|
|
79
|
+
|
|
46
80
|
/** M3-F A3 consumer `{ prefix?, maxBodyBytes?, maxResponseBytes? }` (defaults `/_brust/action`, 1 MiB, 8 MiB). Present = actions on. */
|
|
47
81
|
export interface NapiActionsOptions {
|
|
48
82
|
prefix?: string
|
|
@@ -87,6 +121,17 @@ export interface NapiInvalidateResult {
|
|
|
87
121
|
jobRemoved: number
|
|
88
122
|
}
|
|
89
123
|
|
|
124
|
+
/** The cache adapter (`[cache]`, cache-adapter lane A); built by `brust start` from `manifest.cache`. */
|
|
125
|
+
export interface NapiL2Options {
|
|
126
|
+
adapter: string
|
|
127
|
+
/** The `store.get` budget; absent = 50. */
|
|
128
|
+
getTimeoutMs?: number
|
|
129
|
+
/** A bigger rendered body is not written; absent = 1 048 576. */
|
|
130
|
+
maxBodyBytes?: number
|
|
131
|
+
namespace: string
|
|
132
|
+
buildId: string
|
|
133
|
+
}
|
|
134
|
+
|
|
90
135
|
/**
|
|
91
136
|
* M3-P P6: plan the calling worker's in-flight loader call for `slot` from the `len` bytes it
|
|
92
137
|
* just wrote there. Returns the misses' `JobsRequest` JSON, `""` when every job hit, or `"!"`
|
|
@@ -95,6 +140,13 @@ export interface NapiInvalidateResult {
|
|
|
95
140
|
*/
|
|
96
141
|
export declare function planJobs(slot: number, len: number): string
|
|
97
142
|
|
|
143
|
+
/**
|
|
144
|
+
* L10: [`plan_jobs`] for a loader response too large for the slot: the worker hands the bytes
|
|
145
|
+
* over in `buf` instead of writing them to the slot. Same answers (`""`, the misses' JSON, or
|
|
146
|
+
* `"!"`); a declined plan leaves the response for the worker to hand over with `putFetchReply`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function planJobsBuf(slot: number, buf: Uint8Array): string
|
|
149
|
+
|
|
98
150
|
/**
|
|
99
151
|
* F82: hand Rust the response body of the calling worker's in-flight `fetch` call for `slot`
|
|
100
152
|
* (too large for the SAB slot). `false` = declined (over `max_response_bytes`, not in a `fetch`
|
|
@@ -126,6 +178,11 @@ export interface StartOptions {
|
|
|
126
178
|
* 504 (the slot stays claimed until JS settles). Absent = 30 000.
|
|
127
179
|
*/
|
|
128
180
|
callTimeoutMs?: number
|
|
181
|
+
/**
|
|
182
|
+
* L10: the biggest loader/jobs reply that may cross the heap when it does not fit the slot
|
|
183
|
+
* (256 KiB..=64 MiB; boot error otherwise). Absent = 8 MiB.
|
|
184
|
+
*/
|
|
185
|
+
maxLoaderResponseBytes?: number
|
|
129
186
|
/**
|
|
130
187
|
* tokio threads of the HTTP runtime (every page renders there); absent =
|
|
131
188
|
* one per core (`Tuning::default`).
|
|
@@ -139,6 +196,12 @@ export interface StartOptions {
|
|
|
139
196
|
cors?: NapiCorsOptions
|
|
140
197
|
/** The actions subtree (M3-F); absent = no actions (byte-identical server). */
|
|
141
198
|
actions?: NapiActionsOptions
|
|
199
|
+
/** L16: base URL / credentials / prefix injected for the browser `client()`; absent = from `actions` alone. */
|
|
200
|
+
actionsClient?: NapiActionsClient
|
|
201
|
+
/** The cache adapter; absent = none (byte-identical server). */
|
|
202
|
+
l2?: NapiL2Options
|
|
203
|
+
/** `brust dev` only (L14): a request carrying this token in `x-brust-dev-token` is traced. Absent in production. */
|
|
204
|
+
devToken?: string
|
|
142
205
|
}
|
|
143
206
|
|
|
144
207
|
/**
|
package/native/index.js
CHANGED
|
@@ -89,8 +89,8 @@ function requireNative() {
|
|
|
89
89
|
try {
|
|
90
90
|
const binding = require('@brust/native-android-arm64')
|
|
91
91
|
const bindingPackageVersion = require('@brust/native-android-arm64/package.json').version
|
|
92
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
93
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
92
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
93
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
94
94
|
}
|
|
95
95
|
return binding
|
|
96
96
|
} catch (e) {
|
|
@@ -105,8 +105,8 @@ function requireNative() {
|
|
|
105
105
|
try {
|
|
106
106
|
const binding = require('@brust/native-android-arm-eabi')
|
|
107
107
|
const bindingPackageVersion = require('@brust/native-android-arm-eabi/package.json').version
|
|
108
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
109
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
108
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
109
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
110
110
|
}
|
|
111
111
|
return binding
|
|
112
112
|
} catch (e) {
|
|
@@ -126,8 +126,8 @@ function requireNative() {
|
|
|
126
126
|
try {
|
|
127
127
|
const binding = require('@brust/native-win32-x64-gnu')
|
|
128
128
|
const bindingPackageVersion = require('@brust/native-win32-x64-gnu/package.json').version
|
|
129
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
130
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
129
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
130
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
131
131
|
}
|
|
132
132
|
return binding
|
|
133
133
|
} catch (e) {
|
|
@@ -142,8 +142,8 @@ function requireNative() {
|
|
|
142
142
|
try {
|
|
143
143
|
const binding = require('@brust/native-win32-x64-msvc')
|
|
144
144
|
const bindingPackageVersion = require('@brust/native-win32-x64-msvc/package.json').version
|
|
145
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
146
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
145
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
146
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
147
147
|
}
|
|
148
148
|
return binding
|
|
149
149
|
} catch (e) {
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@brust/native-win32-ia32-msvc')
|
|
161
161
|
const bindingPackageVersion = require('@brust/native-win32-ia32-msvc/package.json').version
|
|
162
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
162
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
164
164
|
}
|
|
165
165
|
return binding
|
|
166
166
|
} catch (e) {
|
|
@@ -175,8 +175,8 @@ function requireNative() {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = require('@brust/native-win32-arm64-msvc')
|
|
177
177
|
const bindingPackageVersion = require('@brust/native-win32-arm64-msvc/package.json').version
|
|
178
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
179
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
178
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
179
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
180
180
|
}
|
|
181
181
|
return binding
|
|
182
182
|
} catch (e) {
|
|
@@ -194,8 +194,8 @@ function requireNative() {
|
|
|
194
194
|
try {
|
|
195
195
|
const binding = require('@brust/native-darwin-universal')
|
|
196
196
|
const bindingPackageVersion = require('@brust/native-darwin-universal/package.json').version
|
|
197
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
198
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
197
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
198
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
199
199
|
}
|
|
200
200
|
return binding
|
|
201
201
|
} catch (e) {
|
|
@@ -210,8 +210,8 @@ function requireNative() {
|
|
|
210
210
|
try {
|
|
211
211
|
const binding = require('@brust/native-darwin-x64')
|
|
212
212
|
const bindingPackageVersion = require('@brust/native-darwin-x64/package.json').version
|
|
213
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
214
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
213
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
214
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
215
215
|
}
|
|
216
216
|
return binding
|
|
217
217
|
} catch (e) {
|
|
@@ -226,8 +226,8 @@ function requireNative() {
|
|
|
226
226
|
try {
|
|
227
227
|
const binding = require('@brust/native-darwin-arm64')
|
|
228
228
|
const bindingPackageVersion = require('@brust/native-darwin-arm64/package.json').version
|
|
229
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
230
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
229
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
230
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
231
231
|
}
|
|
232
232
|
return binding
|
|
233
233
|
} catch (e) {
|
|
@@ -246,8 +246,8 @@ function requireNative() {
|
|
|
246
246
|
try {
|
|
247
247
|
const binding = require('@brust/native-freebsd-x64')
|
|
248
248
|
const bindingPackageVersion = require('@brust/native-freebsd-x64/package.json').version
|
|
249
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
250
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
249
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
250
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
251
251
|
}
|
|
252
252
|
return binding
|
|
253
253
|
} catch (e) {
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@brust/native-freebsd-arm64')
|
|
264
264
|
const bindingPackageVersion = require('@brust/native-freebsd-arm64/package.json').version
|
|
265
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
265
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
267
267
|
}
|
|
268
268
|
return binding
|
|
269
269
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('@brust/native-linux-x64-musl')
|
|
285
285
|
const bindingPackageVersion = require('@brust/native-linux-x64-musl/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
286
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
287
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -299,8 +299,8 @@ function requireNative() {
|
|
|
299
299
|
try {
|
|
300
300
|
const binding = require('@brust/native-linux-x64-gnu')
|
|
301
301
|
const bindingPackageVersion = require('@brust/native-linux-x64-gnu/package.json').version
|
|
302
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
303
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
302
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
303
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
304
304
|
}
|
|
305
305
|
return binding
|
|
306
306
|
} catch (e) {
|
|
@@ -317,8 +317,8 @@ function requireNative() {
|
|
|
317
317
|
try {
|
|
318
318
|
const binding = require('@brust/native-linux-arm64-musl')
|
|
319
319
|
const bindingPackageVersion = require('@brust/native-linux-arm64-musl/package.json').version
|
|
320
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
321
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
320
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
321
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
322
322
|
}
|
|
323
323
|
return binding
|
|
324
324
|
} catch (e) {
|
|
@@ -333,8 +333,8 @@ function requireNative() {
|
|
|
333
333
|
try {
|
|
334
334
|
const binding = require('@brust/native-linux-arm64-gnu')
|
|
335
335
|
const bindingPackageVersion = require('@brust/native-linux-arm64-gnu/package.json').version
|
|
336
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
337
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
336
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
337
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
338
338
|
}
|
|
339
339
|
return binding
|
|
340
340
|
} catch (e) {
|
|
@@ -351,8 +351,8 @@ function requireNative() {
|
|
|
351
351
|
try {
|
|
352
352
|
const binding = require('@brust/native-linux-arm-musleabihf')
|
|
353
353
|
const bindingPackageVersion = require('@brust/native-linux-arm-musleabihf/package.json').version
|
|
354
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
355
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
354
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
355
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
356
356
|
}
|
|
357
357
|
return binding
|
|
358
358
|
} catch (e) {
|
|
@@ -367,8 +367,8 @@ function requireNative() {
|
|
|
367
367
|
try {
|
|
368
368
|
const binding = require('@brust/native-linux-arm-gnueabihf')
|
|
369
369
|
const bindingPackageVersion = require('@brust/native-linux-arm-gnueabihf/package.json').version
|
|
370
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
371
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
370
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
371
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
372
372
|
}
|
|
373
373
|
return binding
|
|
374
374
|
} catch (e) {
|
|
@@ -385,8 +385,8 @@ function requireNative() {
|
|
|
385
385
|
try {
|
|
386
386
|
const binding = require('@brust/native-linux-loong64-musl')
|
|
387
387
|
const bindingPackageVersion = require('@brust/native-linux-loong64-musl/package.json').version
|
|
388
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
389
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
388
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
389
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
390
390
|
}
|
|
391
391
|
return binding
|
|
392
392
|
} catch (e) {
|
|
@@ -401,8 +401,8 @@ function requireNative() {
|
|
|
401
401
|
try {
|
|
402
402
|
const binding = require('@brust/native-linux-loong64-gnu')
|
|
403
403
|
const bindingPackageVersion = require('@brust/native-linux-loong64-gnu/package.json').version
|
|
404
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
405
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
404
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
405
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
406
406
|
}
|
|
407
407
|
return binding
|
|
408
408
|
} catch (e) {
|
|
@@ -419,8 +419,8 @@ function requireNative() {
|
|
|
419
419
|
try {
|
|
420
420
|
const binding = require('@brust/native-linux-riscv64-musl')
|
|
421
421
|
const bindingPackageVersion = require('@brust/native-linux-riscv64-musl/package.json').version
|
|
422
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
423
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
422
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
423
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
424
424
|
}
|
|
425
425
|
return binding
|
|
426
426
|
} catch (e) {
|
|
@@ -435,8 +435,8 @@ function requireNative() {
|
|
|
435
435
|
try {
|
|
436
436
|
const binding = require('@brust/native-linux-riscv64-gnu')
|
|
437
437
|
const bindingPackageVersion = require('@brust/native-linux-riscv64-gnu/package.json').version
|
|
438
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
439
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
438
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
439
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
440
440
|
}
|
|
441
441
|
return binding
|
|
442
442
|
} catch (e) {
|
|
@@ -452,8 +452,8 @@ function requireNative() {
|
|
|
452
452
|
try {
|
|
453
453
|
const binding = require('@brust/native-linux-ppc64-gnu')
|
|
454
454
|
const bindingPackageVersion = require('@brust/native-linux-ppc64-gnu/package.json').version
|
|
455
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
456
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
455
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
456
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
457
457
|
}
|
|
458
458
|
return binding
|
|
459
459
|
} catch (e) {
|
|
@@ -468,8 +468,8 @@ function requireNative() {
|
|
|
468
468
|
try {
|
|
469
469
|
const binding = require('@brust/native-linux-s390x-gnu')
|
|
470
470
|
const bindingPackageVersion = require('@brust/native-linux-s390x-gnu/package.json').version
|
|
471
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
472
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
471
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
472
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
473
473
|
}
|
|
474
474
|
return binding
|
|
475
475
|
} catch (e) {
|
|
@@ -488,8 +488,8 @@ function requireNative() {
|
|
|
488
488
|
try {
|
|
489
489
|
const binding = require('@brust/native-openharmony-arm64')
|
|
490
490
|
const bindingPackageVersion = require('@brust/native-openharmony-arm64/package.json').version
|
|
491
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
492
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
491
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
492
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
493
493
|
}
|
|
494
494
|
return binding
|
|
495
495
|
} catch (e) {
|
|
@@ -504,8 +504,8 @@ function requireNative() {
|
|
|
504
504
|
try {
|
|
505
505
|
const binding = require('@brust/native-openharmony-x64')
|
|
506
506
|
const bindingPackageVersion = require('@brust/native-openharmony-x64/package.json').version
|
|
507
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
508
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
507
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
508
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
509
509
|
}
|
|
510
510
|
return binding
|
|
511
511
|
} catch (e) {
|
|
@@ -520,8 +520,8 @@ function requireNative() {
|
|
|
520
520
|
try {
|
|
521
521
|
const binding = require('@brust/native-openharmony-arm')
|
|
522
522
|
const bindingPackageVersion = require('@brust/native-openharmony-arm/package.json').version
|
|
523
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
524
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
523
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
524
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
525
525
|
}
|
|
526
526
|
return binding
|
|
527
527
|
} catch (e) {
|
|
@@ -661,8 +661,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
661
661
|
if (!candidateFailed) {
|
|
662
662
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
663
663
|
const bindingPackageVersion = require('@brust/native-wasm32-wasi/package.json').version
|
|
664
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
665
|
-
throw new Error(`WASI binding package version mismatch, expected 2.0.0-alpha.
|
|
664
|
+
if (bindingPackageVersion !== '2.0.0-alpha.4') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 2.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('@brust/native-wasm32-wasi')
|
|
@@ -779,11 +779,16 @@ function __napiStampBindingTarget(exportsObject, target) {
|
|
|
779
779
|
module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
|
|
780
780
|
module.exports = nativeBinding
|
|
781
781
|
module.exports.beginDrain = nativeBinding.beginDrain
|
|
782
|
+
module.exports.cacheClear = nativeBinding.cacheClear
|
|
783
|
+
module.exports.cacheExprReads = nativeBinding.cacheExprReads
|
|
782
784
|
module.exports.cacheInvalidate = nativeBinding.cacheInvalidate
|
|
785
|
+
module.exports.cacheL2Count = nativeBinding.cacheL2Count
|
|
786
|
+
module.exports.cacheReplay = nativeBinding.cacheReplay
|
|
783
787
|
module.exports.cacheStats = nativeBinding.cacheStats
|
|
784
788
|
module.exports.compileTree = nativeBinding.compileTree
|
|
785
789
|
module.exports.localAddr = nativeBinding.localAddr
|
|
786
790
|
module.exports.planJobs = nativeBinding.planJobs
|
|
791
|
+
module.exports.planJobsBuf = nativeBinding.planJobsBuf
|
|
787
792
|
module.exports.putFetchReply = nativeBinding.putFetchReply
|
|
788
793
|
module.exports.registerWorker = nativeBinding.registerWorker
|
|
789
794
|
module.exports.startServer = nativeBinding.startServer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brust/core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "brust v2 — React components compiled to Rust-rendered templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,11 +13,17 @@
|
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
+
"workerd": "./src/cf.ts",
|
|
16
17
|
"browser": "./src/browser.ts",
|
|
17
18
|
"default": "./src/index.ts"
|
|
18
19
|
},
|
|
20
|
+
"./build-time": "./src/build-time.ts",
|
|
19
21
|
"./routes": "./src/routes.ts",
|
|
20
22
|
"./server": "./src/server.ts",
|
|
23
|
+
"./server-handlers": "./src/server-handlers.ts",
|
|
24
|
+
"./server-handlers/actions": "./src/actions/load.ts",
|
|
25
|
+
"./cache-adapter": "./src/cache-adapter/index.ts",
|
|
26
|
+
"./cache-adapter/conformance": "./src/cache-adapter/conformance.ts",
|
|
21
27
|
"./store": "./src/store/index.ts",
|
|
22
28
|
"./store/react": "./src/store/react.ts",
|
|
23
29
|
"./elysia": "./src/actions/elysia.ts",
|
|
@@ -44,7 +50,7 @@
|
|
|
44
50
|
]
|
|
45
51
|
},
|
|
46
52
|
"dependencies": {
|
|
47
|
-
"@brust/runtime-dom": "2.0.0-alpha.
|
|
53
|
+
"@brust/runtime-dom": "2.0.0-alpha.4"
|
|
48
54
|
},
|
|
49
55
|
"peerDependencies": {
|
|
50
56
|
"react": "^19.0.0",
|
|
@@ -66,6 +72,7 @@
|
|
|
66
72
|
"@types/bun": "^1.4.0",
|
|
67
73
|
"@types/react": "^19.2.0",
|
|
68
74
|
"elysia": "2.0.0-beta.30",
|
|
75
|
+
"lucide-react": "1.55.0",
|
|
69
76
|
"react": "^19.2.0",
|
|
70
77
|
"react-dom": "^19.2.0",
|
|
71
78
|
"typescript": "^7.0.2"
|
|
@@ -81,11 +88,12 @@
|
|
|
81
88
|
"access": "public"
|
|
82
89
|
},
|
|
83
90
|
"optionalDependencies": {
|
|
84
|
-
"@brust/native-darwin-x64": "2.0.0-alpha.
|
|
85
|
-
"@brust/native-darwin-arm64": "2.0.0-alpha.
|
|
86
|
-
"@brust/native-linux-x64-gnu": "2.0.0-alpha.
|
|
87
|
-
"@brust/native-linux-arm64-gnu": "2.0.0-alpha.
|
|
88
|
-
"@brust/native-linux-x64-musl": "2.0.0-alpha.
|
|
89
|
-
"@brust/native-linux-arm64-musl": "2.0.0-alpha.
|
|
91
|
+
"@brust/native-darwin-x64": "2.0.0-alpha.4",
|
|
92
|
+
"@brust/native-darwin-arm64": "2.0.0-alpha.4",
|
|
93
|
+
"@brust/native-linux-x64-gnu": "2.0.0-alpha.4",
|
|
94
|
+
"@brust/native-linux-arm64-gnu": "2.0.0-alpha.4",
|
|
95
|
+
"@brust/native-linux-x64-musl": "2.0.0-alpha.4",
|
|
96
|
+
"@brust/native-linux-arm64-musl": "2.0.0-alpha.4",
|
|
97
|
+
"@brust/core-cf": "2.0.0-alpha.4"
|
|
90
98
|
}
|
|
91
99
|
}
|