@brust/core 2.0.0-alpha.2 → 2.0.0-alpha.3
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/native/index.d.ts +28 -0
- package/native/index.js +57 -54
- package/package.json +14 -8
- package/src/actions-bridge.ts +27 -9
- package/src/build/bundle.ts +12 -2
- package/src/build/cf-assets.ts +81 -0
- package/src/build/cf-core.ts +90 -0
- package/src/build/cf-entry.ts +72 -0
- package/src/build/cf-wrangler.ts +167 -0
- package/src/build/cloudflare.ts +310 -0
- package/src/build/config.ts +213 -4
- package/src/build/index.ts +75 -7
- package/src/build/manifest.ts +18 -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 +18 -0
- package/src/cli.ts +35 -2
- package/src/config.ts +16 -0
- package/src/dev.ts +110 -0
- package/src/handlers.ts +243 -0
- package/src/native.ts +20 -1
- package/src/run.ts +6 -1
- package/src/server-handlers.ts +32 -0
- package/src/worker.ts +43 -231
package/native/index.d.ts
CHANGED
|
@@ -15,9 +15,24 @@ 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
|
+
|
|
18
21
|
/** `cache.invalidate({ key?, tags?, path?, method? })` (spec §5). */
|
|
19
22
|
export declare function cacheInvalidate(args: NapiInvalidateArgs): NapiInvalidateResult
|
|
20
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Bump the `stats.l2` counter `name` (the JS side's counts, R9). `false` = unknown name, no
|
|
26
|
+
* adapter, or no server. Never throws.
|
|
27
|
+
*/
|
|
28
|
+
export declare function cacheL2Count(name: string): boolean
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A broadcast invalidation another process published (worker 0's subscriber, cache-adapter R10):
|
|
32
|
+
* tier 1 + the floor at `seq`. Never re-published (L3). Same args/result as `cache_invalidate`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function cacheReplay(args: NapiInvalidateArgs, seq?: number | undefined | null): NapiInvalidateResult
|
|
35
|
+
|
|
21
36
|
/** `/_brust/cache/stats` JSON (snake_case keys, as the server serialises it). */
|
|
22
37
|
export declare function cacheStats(): string
|
|
23
38
|
|
|
@@ -87,6 +102,17 @@ export interface NapiInvalidateResult {
|
|
|
87
102
|
jobRemoved: number
|
|
88
103
|
}
|
|
89
104
|
|
|
105
|
+
/** The cache adapter (`[cache]`, cache-adapter lane A); built by `brust start` from `manifest.cache`. */
|
|
106
|
+
export interface NapiL2Options {
|
|
107
|
+
adapter: string
|
|
108
|
+
/** The `store.get` budget; absent = 50. */
|
|
109
|
+
getTimeoutMs?: number
|
|
110
|
+
/** A bigger rendered body is not written; absent = 1 048 576. */
|
|
111
|
+
maxBodyBytes?: number
|
|
112
|
+
namespace: string
|
|
113
|
+
buildId: string
|
|
114
|
+
}
|
|
115
|
+
|
|
90
116
|
/**
|
|
91
117
|
* M3-P P6: plan the calling worker's in-flight loader call for `slot` from the `len` bytes it
|
|
92
118
|
* just wrote there. Returns the misses' `JobsRequest` JSON, `""` when every job hit, or `"!"`
|
|
@@ -139,6 +165,8 @@ export interface StartOptions {
|
|
|
139
165
|
cors?: NapiCorsOptions
|
|
140
166
|
/** The actions subtree (M3-F); absent = no actions (byte-identical server). */
|
|
141
167
|
actions?: NapiActionsOptions
|
|
168
|
+
/** The cache adapter; absent = none (byte-identical server). */
|
|
169
|
+
l2?: NapiL2Options
|
|
142
170
|
}
|
|
143
171
|
|
|
144
172
|
/**
|
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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 2.0.0-alpha.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('@brust/native-wasm32-wasi')
|
|
@@ -779,7 +779,10 @@ 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
|
|
782
783
|
module.exports.cacheInvalidate = nativeBinding.cacheInvalidate
|
|
784
|
+
module.exports.cacheL2Count = nativeBinding.cacheL2Count
|
|
785
|
+
module.exports.cacheReplay = nativeBinding.cacheReplay
|
|
783
786
|
module.exports.cacheStats = nativeBinding.cacheStats
|
|
784
787
|
module.exports.compileTree = nativeBinding.compileTree
|
|
785
788
|
module.exports.localAddr = nativeBinding.localAddr
|
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.3",
|
|
4
4
|
"description": "brust v2 — React components compiled to Rust-rendered templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,11 +13,16 @@
|
|
|
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
|
},
|
|
19
20
|
"./routes": "./src/routes.ts",
|
|
20
21
|
"./server": "./src/server.ts",
|
|
22
|
+
"./server-handlers": "./src/server-handlers.ts",
|
|
23
|
+
"./server-handlers/actions": "./src/actions/load.ts",
|
|
24
|
+
"./cache-adapter": "./src/cache-adapter/index.ts",
|
|
25
|
+
"./cache-adapter/conformance": "./src/cache-adapter/conformance.ts",
|
|
21
26
|
"./store": "./src/store/index.ts",
|
|
22
27
|
"./store/react": "./src/store/react.ts",
|
|
23
28
|
"./elysia": "./src/actions/elysia.ts",
|
|
@@ -44,7 +49,7 @@
|
|
|
44
49
|
]
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"@brust/runtime-dom": "2.0.0-alpha.
|
|
52
|
+
"@brust/runtime-dom": "2.0.0-alpha.3"
|
|
48
53
|
},
|
|
49
54
|
"peerDependencies": {
|
|
50
55
|
"react": "^19.0.0",
|
|
@@ -81,11 +86,12 @@
|
|
|
81
86
|
"access": "public"
|
|
82
87
|
},
|
|
83
88
|
"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.
|
|
89
|
+
"@brust/native-darwin-x64": "2.0.0-alpha.3",
|
|
90
|
+
"@brust/native-darwin-arm64": "2.0.0-alpha.3",
|
|
91
|
+
"@brust/native-linux-x64-gnu": "2.0.0-alpha.3",
|
|
92
|
+
"@brust/native-linux-arm64-gnu": "2.0.0-alpha.3",
|
|
93
|
+
"@brust/native-linux-x64-musl": "2.0.0-alpha.3",
|
|
94
|
+
"@brust/native-linux-arm64-musl": "2.0.0-alpha.3",
|
|
95
|
+
"@brust/core-cf": "2.0.0-alpha.3"
|
|
90
96
|
}
|
|
91
97
|
}
|
package/src/actions-bridge.ts
CHANGED
|
@@ -112,6 +112,32 @@ export function readFramed(view: Uint8Array, slot: number, slots: number, len: n
|
|
|
112
112
|
|
|
113
113
|
const fail = (view: Uint8Array, slot: number, slots: number, msg: string) => writeFramed(view, slot, slots, 500, TEXT_PLAIN, enc.encode(msg))
|
|
114
114
|
|
|
115
|
+
/** The store-scoped core shared by `runFetch` and `fetchInScope`: R1/E5 — one store scope around the handler AND the
|
|
116
|
+
* body read (a lazy body may still touch stores); set-cookie values kept apart. */
|
|
117
|
+
export async function fetchParts(a: ActionsApp, req: Request): Promise<{ status: number; pairs: [string, string][]; body: Uint8Array }> {
|
|
118
|
+
return runInStoreContext(async () => {
|
|
119
|
+
const res = await a.fetch(req)
|
|
120
|
+
const pairs: [string, string][] = []
|
|
121
|
+
res.headers.forEach((v, k) => {
|
|
122
|
+
if (k !== 'set-cookie') pairs.push([k, v])
|
|
123
|
+
})
|
|
124
|
+
for (const c of res.headers.getSetCookie()) pairs.push(['set-cookie', c])
|
|
125
|
+
return { status: res.status, pairs, body: new Uint8Array(await res.arrayBuffer()) }
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Host-agnostic entry (Cloudflare `action(req)`): the same scope and framing-free parts as `runFetch`, as a Response. */
|
|
130
|
+
export async function fetchInScope(a: ActionsApp, req: Request): Promise<Response> {
|
|
131
|
+
const { status, pairs, body } = await fetchParts(a, req)
|
|
132
|
+
const headers = new Headers()
|
|
133
|
+
for (const [k, v] of pairs) headers.append(k, v)
|
|
134
|
+
return new Response([101, 204, 205, 304].includes(status) ? null : (body as BodyInit), { status, headers })
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** The `action` export of a worker whose app has no `[actions]`. */
|
|
138
|
+
export const noActions = async (_: Request): Promise<Response> =>
|
|
139
|
+
new Response('brust: actions are not configured in this worker', { status: 500, headers: { 'content-type': 'text/plain; charset=utf-8' } })
|
|
140
|
+
|
|
115
141
|
/** The `fetch` call (makeDispatch). Never rejects, never writes JSON: every outcome is a frame. A body of
|
|
116
142
|
* more than 262144 bytes arrives by `io.takeBody` (A1 `{heap}`); a response that does not fit the slot leaves
|
|
117
143
|
* by `io.putReply` with only status/headers/`heap` in the slot (F82), unless it exceeds `max_response_bytes`. */
|
|
@@ -128,15 +154,7 @@ export async function runFetch(requestJson: string, view: Uint8Array, slot: numb
|
|
|
128
154
|
}
|
|
129
155
|
const req = toRequest(fr, heapBody)
|
|
130
156
|
// R1/E5: one store scope around the handler AND the body read (a lazy body may still touch stores).
|
|
131
|
-
const out = await
|
|
132
|
-
const res = await a.fetch(req)
|
|
133
|
-
const pairs: [string, string][] = []
|
|
134
|
-
res.headers.forEach((v, k) => {
|
|
135
|
-
if (k !== 'set-cookie') pairs.push([k, v])
|
|
136
|
-
})
|
|
137
|
-
for (const c of res.headers.getSetCookie()) pairs.push(['set-cookie', c])
|
|
138
|
-
return { status: res.status, pairs, body: new Uint8Array(await res.arrayBuffer()) }
|
|
139
|
-
})
|
|
157
|
+
const out = await fetchParts(a, req)
|
|
140
158
|
const sub = Math.floor(view.byteLength / Math.max(1, slots))
|
|
141
159
|
const metaLen = (m: FetchMeta) => enc.encode(JSON.stringify(m)).length
|
|
142
160
|
if (4 + metaLen({ status: out.status, headers: out.pairs }) + out.body.length <= sub) return writeFramed(view, slot, slots, out.status, out.pairs, out.body)
|
package/src/build/bundle.ts
CHANGED
|
@@ -16,10 +16,11 @@ import { BuildError } from './errors'
|
|
|
16
16
|
|
|
17
17
|
const REACT_EXTERNALS = ['react', 'react/*', 'react-dom', 'react-dom/*']
|
|
18
18
|
/** Production React (and the production JSX transform: `react/jsx-runtime`, never `jsxDEV`). */
|
|
19
|
-
const PRODUCTION = { 'process.env.NODE_ENV': JSON.stringify('production') }
|
|
19
|
+
export const PRODUCTION = { 'process.env.NODE_ENV': JSON.stringify('production') }
|
|
20
20
|
|
|
21
21
|
const matchesExternal = (spec: string, external: string[]) =>
|
|
22
|
-
|
|
22
|
+
// A trailing `*` is a prefix (`elysia/*`, `node:*`, `cloudflare:*`): the generated CF entry imports `cloudflare:workers`.
|
|
23
|
+
external.some((p) => (p.endsWith('*') ? spec.startsWith(p.slice(0, -1)) : spec === p))
|
|
23
24
|
|
|
24
25
|
/** Staged artifact (by its absolute and its real path) → the component SOURCE file it was
|
|
25
26
|
* generated from. */
|
|
@@ -341,6 +342,15 @@ export async function buildActions(dist: string, entry: string): Promise<string>
|
|
|
341
342
|
return 'actions.js'
|
|
342
343
|
}
|
|
343
344
|
|
|
345
|
+
/** `dist/cache-adapter.js` (cache adapters R8): a custom adapter module for the worker (`target: 'bun'`), with
|
|
346
|
+
* the actions externals so it shares the app's dependencies. */
|
|
347
|
+
export async function buildCacheAdapter(dist: string, entry: string): Promise<string> {
|
|
348
|
+
const res = await Bun.build({ entrypoints: [entry], target: 'bun', format: 'esm', external: ACTIONS_EXTERNALS })
|
|
349
|
+
if (!res.success) throw new BuildError('bundle', `cache adapter: ${res.logs.map(String).join('\n')}`)
|
|
350
|
+
write(join(dist, 'cache-adapter.js'), await res.outputs[0]!.text())
|
|
351
|
+
return 'cache-adapter.js'
|
|
352
|
+
}
|
|
353
|
+
|
|
344
354
|
/** `dist/jobs.js` (`target: 'bun'`, React and `@brust/core` external): default export
|
|
345
355
|
* `{ [componentId]: { precompute?, ssr? } }`; `ssr` only for react-tier, non-client_only components. */
|
|
346
356
|
export async function buildJobs(dist: string, compiled: Map<string, Compiled>, sourceOf: SourceOf, appRoot: string, stores: string[] = []): Promise<void> {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Static assets for Workers Static Assets (M4-CF R7): only files the native host would serve (`safe_rel` in
|
|
2
|
+
// `crates/brust-core/src/static_rules.rs`), laid out under the URL they are requested at, plus `_headers`.
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, statSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { dirname, join } from 'node:path'
|
|
5
|
+
|
|
6
|
+
const SEG = /^[A-Za-z0-9_.-]+$/
|
|
7
|
+
const IMMUTABLE = 'public, max-age=31536000, immutable'
|
|
8
|
+
const PUBLIC_DEFAULT = 'public, max-age=3600'
|
|
9
|
+
const MAX_RULES = 100
|
|
10
|
+
|
|
11
|
+
/** `static_rules.rs` `is_hashed`: the stem ends in `-<hex6+>` (lowercase) with at least one digit. */
|
|
12
|
+
export function isHashed(file: string): boolean {
|
|
13
|
+
const base = file.slice(file.lastIndexOf('/') + 1)
|
|
14
|
+
const dot = base.lastIndexOf('.')
|
|
15
|
+
const stem = dot > 0 ? base.slice(0, dot) : base
|
|
16
|
+
const i = stem.lastIndexOf('-')
|
|
17
|
+
if (i < 0) return false
|
|
18
|
+
const h = stem.slice(i + 1)
|
|
19
|
+
return h.length >= 6 && /^[0-9a-f]+$/.test(h) && /\d/.test(h)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const segOk = (s: string) => s !== '' && !s.startsWith('.') && SEG.test(s)
|
|
23
|
+
|
|
24
|
+
/** `client/<file>.js|.css`: `is_safe_island_filename` / `is_safe_css_filename`. */
|
|
25
|
+
const clientOk = (f: string) => segOk(f) && !f.includes('..') && (f.endsWith('.js') || f.endsWith('.css'))
|
|
26
|
+
|
|
27
|
+
function walk(dir: string, rel = ''): string[] {
|
|
28
|
+
const out: string[] = []
|
|
29
|
+
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
30
|
+
const r = rel ? `${rel}/${e.name}` : e.name
|
|
31
|
+
if (e.isDirectory()) out.push(...walk(join(dir, e.name), r))
|
|
32
|
+
else if (e.isFile() || statSync(join(dir, e.name)).isFile()) out.push(r)
|
|
33
|
+
}
|
|
34
|
+
return out.sort()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Copies the admissible files of `<out>/client` and `<out>/public` into `<cfDir>/assets/...`; returns the
|
|
38
|
+
* asset-relative paths (`_brust/client/x.js`, `public/img/a.png`) and writes `assets/_headers`. */
|
|
39
|
+
export function layoutAssets(out: string, cfDir: string, version: string): { files: string[]; warnings: string[] } {
|
|
40
|
+
const assets = join(cfDir, 'assets')
|
|
41
|
+
mkdirSync(assets, { recursive: true })
|
|
42
|
+
const files: string[] = []
|
|
43
|
+
const warnings: string[] = []
|
|
44
|
+
const copy = (from: string, to: string) => {
|
|
45
|
+
mkdirSync(dirname(join(assets, to)), { recursive: true })
|
|
46
|
+
cpSync(from, join(assets, to))
|
|
47
|
+
files.push(to)
|
|
48
|
+
}
|
|
49
|
+
const client = join(out, 'client')
|
|
50
|
+
if (existsSync(client))
|
|
51
|
+
for (const f of walk(client)) {
|
|
52
|
+
if (!f.includes('/') && clientOk(f)) copy(join(client, f), `_brust/client/${f}`)
|
|
53
|
+
else warnings.push(`[brust] assets: client/${f} is not served natively; skipped`)
|
|
54
|
+
}
|
|
55
|
+
const pub = join(out, 'public')
|
|
56
|
+
if (existsSync(pub))
|
|
57
|
+
for (const f of walk(pub)) {
|
|
58
|
+
if (f.split('/').every(segOk)) copy(join(pub, f), `public/${f}`)
|
|
59
|
+
else warnings.push(`[brust] assets: public/${f} has a name the native host would not serve; skipped`)
|
|
60
|
+
}
|
|
61
|
+
const h = headersFile(files, version)
|
|
62
|
+
warnings.push(...h.warnings)
|
|
63
|
+
writeFileSync(join(assets, '_headers'), h.text)
|
|
64
|
+
return { files, warnings }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function headersFile(files: string[], version: string): { text: string; warnings: string[] } {
|
|
68
|
+
const warnings: string[] = []
|
|
69
|
+
const rules: string[] = [
|
|
70
|
+
`/*\n X-Content-Type-Options: nosniff\n X-Powered-By: brust/${version}`,
|
|
71
|
+
`/_brust/client/*\n Cache-Control: ${IMMUTABLE}`,
|
|
72
|
+
]
|
|
73
|
+
const pub = files.filter((f) => f.startsWith('public/'))
|
|
74
|
+
if (rules.length + pub.length <= MAX_RULES)
|
|
75
|
+
for (const f of pub) rules.push(`/${f}\n Cache-Control: ${isHashed(f) ? IMMUTABLE : PUBLIC_DEFAULT}`)
|
|
76
|
+
else if (pub.length > 0) {
|
|
77
|
+
rules.push(`/public/*\n Cache-Control: ${PUBLIC_DEFAULT}`)
|
|
78
|
+
warnings.push(`[brust] assets: ${pub.length} public files exceed the 100-rule _headers limit; one /public/* max-age=3600 rule (no per-file immutable)`)
|
|
79
|
+
}
|
|
80
|
+
return { text: `${rules.join('\n\n')}\n`, warnings }
|
|
81
|
+
}
|