@brust/core 2.0.0-alpha.16 → 2.0.0-alpha.17
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 +3 -2
- package/native/index.js +54 -54
- package/package.json +10 -9
- package/src/build/compile.ts +5 -3
- package/src/build/features.ts +5 -1
- package/src/build/index.ts +3 -3
- package/src/build/pkg-src.ts +46 -2
- package/src/build/recognised.ts +19 -0
- package/src/build/scan.ts +6 -1
package/native/index.d.ts
CHANGED
|
@@ -179,9 +179,10 @@ export declare function registerWorker(buf: Uint8Array, slots: number, f: (arg0:
|
|
|
179
179
|
/**
|
|
180
180
|
* F230: scans the app modules the build loads (`modules`, relative to `root`) for writes into another app module's
|
|
181
181
|
* exports; the JSON result goes to every `compile_tree` of the build as `loadWrites`. `path_aliases` as for
|
|
182
|
-
* `compile_tree`; a bad one is ignored (the compile reports it).
|
|
182
|
+
* `compile_tree`; a bad one is ignored (the compile reports it). `source_roots` (F256, F276): the directories besides
|
|
183
|
+
* the app that a relative import may reach, so a module there can be scanned and an import into it resolves.
|
|
183
184
|
*/
|
|
184
|
-
export declare function scanLoadWrites(root: string, modules: Array<string>, pathAliases?: string | undefined | null): string
|
|
185
|
+
export declare function scanLoadWrites(root: string, modules: Array<string>, pathAliases?: string | undefined | null, sourceRoots?: Array<string> | undefined | null): string
|
|
185
186
|
|
|
186
187
|
export interface StartOptions {
|
|
187
188
|
host: string
|
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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17' && 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.17 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.17') {
|
|
665
|
+
throw new Error(`WASI binding package version mismatch, expected 2.0.0-alpha.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
wasiBinding = require('@brust/native-wasm32-wasi')
|
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.17",
|
|
4
4
|
"description": "brust v2 — React components compiled to Rust-rendered templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://brust.dev",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@brust/runtime-dom": "2.0.0-alpha.
|
|
58
|
+
"@brust/runtime-dom": "2.0.0-alpha.17",
|
|
59
59
|
"tsconfig-paths": "4.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@elysia/eden": "2.0.0-beta.6",
|
|
77
77
|
"@napi-rs/cli": "^3.0.0",
|
|
78
|
+
"@radix-ui/react-collection": "1.2.0",
|
|
78
79
|
"@radix-ui/react-slot": "1.5.0",
|
|
79
80
|
"@types/bun": "^1.4.0",
|
|
80
81
|
"@types/react": "^19.2.0",
|
|
@@ -95,12 +96,12 @@
|
|
|
95
96
|
"access": "public"
|
|
96
97
|
},
|
|
97
98
|
"optionalDependencies": {
|
|
98
|
-
"@brust/native-darwin-x64": "2.0.0-alpha.
|
|
99
|
-
"@brust/native-darwin-arm64": "2.0.0-alpha.
|
|
100
|
-
"@brust/native-linux-x64-gnu": "2.0.0-alpha.
|
|
101
|
-
"@brust/native-linux-arm64-gnu": "2.0.0-alpha.
|
|
102
|
-
"@brust/native-linux-x64-musl": "2.0.0-alpha.
|
|
103
|
-
"@brust/native-linux-arm64-musl": "2.0.0-alpha.
|
|
104
|
-
"@brust/core-cf": "2.0.0-alpha.
|
|
99
|
+
"@brust/native-darwin-x64": "2.0.0-alpha.17",
|
|
100
|
+
"@brust/native-darwin-arm64": "2.0.0-alpha.17",
|
|
101
|
+
"@brust/native-linux-x64-gnu": "2.0.0-alpha.17",
|
|
102
|
+
"@brust/native-linux-arm64-gnu": "2.0.0-alpha.17",
|
|
103
|
+
"@brust/native-linux-x64-musl": "2.0.0-alpha.17",
|
|
104
|
+
"@brust/native-linux-arm64-musl": "2.0.0-alpha.17",
|
|
105
|
+
"@brust/core-cf": "2.0.0-alpha.17"
|
|
105
106
|
}
|
|
106
107
|
}
|
package/src/build/compile.ts
CHANGED
|
@@ -119,15 +119,17 @@ export function replaces(kept: Seen, next: Seen): boolean {
|
|
|
119
119
|
* `list.push(…)` through an import) and returns the JSON every `compileTree` of the build reads: a component whose
|
|
120
120
|
* compiled code reads such an export falls back to React (`module-written`). `modules` are absolute paths.
|
|
121
121
|
*/
|
|
122
|
-
export function scanAppWrites(appRoot: string, modules: string[], log: (s: string) => void): string {
|
|
122
|
+
export function scanAppWrites(appRoot: string, modules: string[], log: (s: string) => void, sourceRoots: string[] = []): string {
|
|
123
123
|
// Keyed as `compileApp` names a file to the compiler (relative to `appRoot`), plus the real-path spelling (as
|
|
124
124
|
// `routeRoots`), so an import resolves to the same key either way.
|
|
125
125
|
const real = realpathSync(appRoot)
|
|
126
126
|
const toKey = (base: string, f: string) => relative(base, f).split(sep).join('/')
|
|
127
|
-
|
|
127
|
+
// F276: a module under a `[build] source_roots` directory (`../shared/x.ts`) is scanned too; any other `..` key is not.
|
|
128
|
+
const inSourceRoot = (k: string) => sourceRoots.some((r) => k.startsWith(`${r}/`))
|
|
129
|
+
const rel = [...new Set(modules.flatMap((f) => [toKey(appRoot, f), toKey(real, realpathSync(f))]))].filter((k) => !k.startsWith('..') || inSourceRoot(k)).sort()
|
|
128
130
|
const { aliases } = readPathAliases(appRoot)
|
|
129
131
|
const t0 = performance.now()
|
|
130
|
-
const json = scanLoadWrites(appRoot, rel, aliases.length > 0 ? JSON.stringify(aliases) : undefined)
|
|
132
|
+
const json = scanLoadWrites(appRoot, rel, aliases.length > 0 ? JSON.stringify(aliases) : undefined, sourceRoots.length > 0 ? sourceRoots : undefined)
|
|
131
133
|
const ms = performance.now() - t0
|
|
132
134
|
if (process.env.BRUST_BUILD_TIMINGS) log(`[brust] scan load-time writes: ${rel.length} modules in ${ms.toFixed(1)} ms`)
|
|
133
135
|
return json
|
package/src/build/features.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { BuildError } from './errors'
|
|
6
6
|
|
|
7
7
|
/** Feature modules of `@brust/runtime-dom/features/*` the browser build ships, in load order. */
|
|
8
|
-
export const RUNTIME_FEATURES = ['basics', 'if', 'for', 'model', 'html', 'island'] as const
|
|
8
|
+
export const RUNTIME_FEATURES = ['basics', 'if', 'for', 'model', 'html', 'island', 'collection'] as const
|
|
9
9
|
export type RuntimeFeature = (typeof RUNTIME_FEATURES)[number]
|
|
10
10
|
|
|
11
11
|
/** Directive attribute → the module that binds it. `null`: handled by the core (host, props, inert-markup marker). */
|
|
@@ -25,6 +25,10 @@ export function featureOfAttr(attr: string): RuntimeFeature | null | undefined {
|
|
|
25
25
|
case 'x-model':
|
|
26
26
|
case 'x-html':
|
|
27
27
|
return attr.slice(2) as RuntimeFeature
|
|
28
|
+
case 'x-collection-root':
|
|
29
|
+
case 'x-collection-item':
|
|
30
|
+
case 'x-collection-use':
|
|
31
|
+
return 'collection'
|
|
28
32
|
default:
|
|
29
33
|
return /^x-(bind|on)-/.test(attr) ? 'basics' : undefined
|
|
30
34
|
}
|
package/src/build/index.ts
CHANGED
|
@@ -121,7 +121,7 @@ export async function runBuild(opts: {
|
|
|
121
121
|
if (actions?.prefix === '/') throw new BuildError('config', 'actions.prefix "/" is only for an actions-only build (brust build --actions-only) or a page-only build that points at one')
|
|
122
122
|
|
|
123
123
|
// Everything that can fail on the app's own input runs before a byte is written.
|
|
124
|
-
const { routes, componentFile, componentIssue, appModules, appGraph } = await scanRoutes(entry, appRoot)
|
|
124
|
+
const { routes, componentFile, componentIssue, appModules, appGraph } = await scanRoutes(entry, appRoot, sourceRoots)
|
|
125
125
|
let leaves: ReturnType<typeof validateRoutes>
|
|
126
126
|
try {
|
|
127
127
|
leaves = validateRoutes(routes)
|
|
@@ -245,7 +245,7 @@ async function buildInto(
|
|
|
245
245
|
const runtime = await buildRuntime(out, ctx)
|
|
246
246
|
const runtimeUrls = { core: `/_brust/${runtime.core}`, store: `/_brust/${runtime.store}` }
|
|
247
247
|
// F230: one scan per build for load-time writes into another app module's exports; every compile reads it.
|
|
248
|
-
const loadWrites = scanAppWrites(appRoot, o.appModules, o.log)
|
|
248
|
+
const loadWrites = scanAppWrites(appRoot, o.appModules, o.log, o.sourceRoots)
|
|
249
249
|
// Where a React island renders, the load-time writers run first: every one in the SSR jobs bundle (server code the
|
|
250
250
|
// worker runs anyway); in an island's browser chunk only a writer of a module that island's code imports (Mellow F1:
|
|
251
251
|
// a writer is often a server-side setup module), with a warning.
|
|
@@ -293,7 +293,7 @@ async function buildInto(
|
|
|
293
293
|
// F197: and the packages a helper is imported from, when the compiler asked to prove one plain.
|
|
294
294
|
const external = [...new Set([...compiled.values()].flatMap((c) => [...(c.ir.external ? [c.ir.external.source] : []), ...((c.ir.package_requests ?? []) as string[])]))]
|
|
295
295
|
const packages = preparePackageSources(appRoot, external)
|
|
296
|
-
if (Object.keys(packages.scopes).length > 0) {
|
|
296
|
+
if (Object.keys(packages.scopes).length > 0 || Object.keys(packages.recognised).length > 0) {
|
|
297
297
|
firstLog.length = 0
|
|
298
298
|
;({ compiled, routeComponent } = compileApp({ ...compileOpts, packages, log: (l) => firstLog.push(l) }))
|
|
299
299
|
}
|
package/src/build/pkg-src.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, s
|
|
|
20
20
|
import { dirname, join, posix, relative, resolve, sep } from 'node:path'
|
|
21
21
|
import { BuildError } from './errors'
|
|
22
22
|
import { RELATIVE_SPEC } from './esm-resolve'
|
|
23
|
+
import { RECOGNISED, verifyRecognised } from './recognised'
|
|
23
24
|
|
|
24
25
|
/** What the compiler reads (`AnalyzeOptions.packages`): per importing scope (`""` = the app, else the root-relative
|
|
25
26
|
* directory of a written package), each bare specifier → the root-relative path of its written entry source, or the
|
|
@@ -27,6 +28,9 @@ import { RELATIVE_SPEC } from './esm-resolve'
|
|
|
27
28
|
export interface PackageSources {
|
|
28
29
|
scopes: Record<string, Record<string, string>>
|
|
29
30
|
refused: Record<string, Record<string, string>>
|
|
31
|
+
/** R34.140: packages the compiler recognises by version + hash instead of reading (`recognised.ts`), name → version. A
|
|
32
|
+
* name is here only when EVERY copy of it the build met verified. */
|
|
33
|
+
recognised: Record<string, string>
|
|
30
34
|
/** Each written directory (root-relative) → the package's real directory: a bare import in an artifact compiled from
|
|
31
35
|
* a package source resolves from the package, as it does in a real install (not read by the compiler). */
|
|
32
36
|
dirs: Record<string, string>
|
|
@@ -220,11 +224,27 @@ export function integrityGaps(sources: { path: string; text: string }[], publish
|
|
|
220
224
|
// Import specifiers are module names, which bundling replaces; they are checked as imports instead.
|
|
221
225
|
for (const im of new Bun.Transpiler({ loader }).scanImports(s.text)) sk.strings.delete(im.path)
|
|
222
226
|
for (const v of sk.strings) if (!pub.strings.has(v)) gaps.push(`${s.path}: literal ${JSON.stringify(v.startsWith('#') ? v.slice(1) : v).slice(0, 60)}`)
|
|
223
|
-
|
|
227
|
+
const aliases = importAliases(transpile(s.text, loader), pub.names)
|
|
228
|
+
for (const v of sk.names) if (!JSX_NAMES.has(v) && !JSX_RUNTIME.test(v) && !KEYWORDS.has(v) && !pub.names.has(v) && !aliases.has(v)) gaps.push(`${s.path}: name \`${v}\``)
|
|
224
229
|
}
|
|
225
230
|
return gaps
|
|
226
231
|
}
|
|
227
232
|
|
|
233
|
+
/** R34.142 (W1b): `import { X as Y } from './sibling'` names the same binding as `X` under a local name. A bundler resolves
|
|
234
|
+
* the binding to the sibling's declaration, so `Y` is not in the published file; `X` is. `Y` is dropped from the name check
|
|
235
|
+
* ONLY for a RELATIVE import DECLARATION at the start of a line (a sibling of the same package, bundled in) whose imported name `X` the published file has.
|
|
236
|
+
* An alias of anything else stays a name difference. */
|
|
237
|
+
function importAliases(js: string, pubNames: Set<string>): Set<string> {
|
|
238
|
+
const out = new Set<string>()
|
|
239
|
+
for (const m of js.matchAll(/^import\s*\{([^}]*)\}\s*from\s*["'](\.[^"']*)["']/gm)) {
|
|
240
|
+
for (const item of m[1]!.split(',')) {
|
|
241
|
+
const parts = item.trim().split(/\s+as\s+/)
|
|
242
|
+
if (parts.length === 2 && /^[A-Za-z_$][\w$]*$/.test(parts[1]!) && pubNames.has(parts[0]!)) out.add(parts[1]!)
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return out
|
|
246
|
+
}
|
|
247
|
+
|
|
228
248
|
|
|
229
249
|
/** The `local as exported` pairs of the `export { … }` clauses of transpiled JS (`x` alone is `x as x`). */
|
|
230
250
|
function exportPairs(js: string): Set<string> {
|
|
@@ -401,6 +421,20 @@ function writePackage(appRoot: string, dir: string, budget: { bytes: number }):
|
|
|
401
421
|
return { ok: true, dir: outRel, entry: posix.join(outRel, (entrySrc ?? barrel)!.path), imports: [...bare].sort() }
|
|
402
422
|
}
|
|
403
423
|
|
|
424
|
+
/** The verified version of the pinned package at `dir` (`RECOGNISED`), `null` when its version or entry bytes differ. */
|
|
425
|
+
function recognisedVersion(name: string, dir: string): string | null {
|
|
426
|
+
try {
|
|
427
|
+
const pj = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')) as Record<string, unknown>
|
|
428
|
+
const entryRel = esmEntry(pj)
|
|
429
|
+
if (!entryRel) return null
|
|
430
|
+
const entry = join(dir, entryRel)
|
|
431
|
+
if (!statSync(entry).isFile()) return null
|
|
432
|
+
return verifyRecognised(name, pj.version, readFileSync(entry))
|
|
433
|
+
} catch {
|
|
434
|
+
return null
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
404
438
|
/**
|
|
405
439
|
* Writes the sources of every package `specs` reaches from the app (and of every package those sources import),
|
|
406
440
|
* and returns the resolution map for the compiler. The directory is rebuilt from nothing on every call.
|
|
@@ -420,7 +454,8 @@ export function preparePackageSources(appRoot: string, specs: Iterable<string>):
|
|
|
420
454
|
rmSync(join(root, PKG_SRC_DIR), { recursive: true, force: true })
|
|
421
455
|
mkdirSync(join(root, PKG_SRC_DIR), { recursive: true })
|
|
422
456
|
if (!realpathSync(join(root, PKG_SRC_DIR)).startsWith(root + sep)) throw new BuildError('package-source', `${PKG_SRC_DIR} resolves outside the app root (a link?); remove it and build again`)
|
|
423
|
-
const out: PackageSources = { scopes: {}, refused: {}, dirs: {} }
|
|
457
|
+
const out: PackageSources = { scopes: {}, refused: {}, dirs: {}, recognised: {} }
|
|
458
|
+
const recognisedBad = new Set<string>()
|
|
424
459
|
writtenDirs.clear()
|
|
425
460
|
const byDir = new Map<string, Outcome>()
|
|
426
461
|
const budget = { bytes: 0 }
|
|
@@ -446,6 +481,14 @@ export function preparePackageSources(appRoot: string, specs: Iterable<string>):
|
|
|
446
481
|
continue
|
|
447
482
|
}
|
|
448
483
|
let o = byDir.get(dir)
|
|
484
|
+
if (!o && Object.hasOwn(RECOGNISED, name)) {
|
|
485
|
+
// R34.140: not read: pinned by version and hash. The refusal stays (its imports stay islands where nothing recognises them).
|
|
486
|
+
const v = recognisedVersion(name, dir)
|
|
487
|
+
if (v) out.recognised[name] ??= v
|
|
488
|
+
else recognisedBad.add(name)
|
|
489
|
+
o = { ok: false, reason: v ? `recognised by the compiler (${name}@${v}), not read` : `${name} is not the pinned release the compiler recognises` }
|
|
490
|
+
byDir.set(dir, o)
|
|
491
|
+
}
|
|
449
492
|
if (!o) {
|
|
450
493
|
try {
|
|
451
494
|
o = byDir.size >= LIMITS.packages ? { ok: false, reason: `more than ${LIMITS.packages} packages` } : writePackage(root, dir, budget)
|
|
@@ -464,6 +507,7 @@ export function preparePackageSources(appRoot: string, specs: Iterable<string>):
|
|
|
464
507
|
if (o.ok) (out.scopes[scope] ??= {})[spec] = o.entry
|
|
465
508
|
else refuse(o.reason)
|
|
466
509
|
}
|
|
510
|
+
for (const n of recognisedBad) delete out.recognised[n]
|
|
467
511
|
mkdirSync(join(root, PKG_SRC_DIR), { recursive: true })
|
|
468
512
|
writeFileSync(join(root, PKG_SRC_DIR, 'index.json'), `${JSON.stringify(out, null, 2)}\n`)
|
|
469
513
|
return out
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Packages the compiler RECOGNISES by what they are rather than reading their source (R34.140). A recognised package is
|
|
2
|
+
// pinned: the installed package.json `version` AND the SHA-256 of its published ESM entry must be one of the pairs below.
|
|
3
|
+
// Any other version, or the same version with another byte in the entry, is not recognised (its import stays the React
|
|
4
|
+
// island it is without it). The compiler is told only the package name and the verified version (`index.json#recognised`).
|
|
5
|
+
import { createHash } from 'node:crypto'
|
|
6
|
+
|
|
7
|
+
/** package name → published version → SHA-256 (hex) of the file `module` / `exports['.'].import` names. */
|
|
8
|
+
export const RECOGNISED: Record<string, Record<string, string>> = {
|
|
9
|
+
// `createCollection` (the 3-tuple form roving focus, accordion, menus and slider use) of the 1.2.0 release
|
|
10
|
+
'@radix-ui/react-collection': { '1.2.0': '52a6719c7c1a7a5202ab5ae58bb552f0d7853965a0833cf0e71749ac580e349f' },
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The verified version of `name` when `version` and the bytes of its ESM `entry` are a pinned pair; else `null`. */
|
|
14
|
+
export function verifyRecognised(name: string, version: unknown, entryBytes: Uint8Array): string | null {
|
|
15
|
+
const pins = RECOGNISED[name]
|
|
16
|
+
if (!pins || typeof version !== 'string' || !Object.hasOwn(pins, version)) return null
|
|
17
|
+
const sha = createHash('sha256').update(entryBytes).digest('hex')
|
|
18
|
+
return sha === pins[version] ? version : null
|
|
19
|
+
}
|
package/src/build/scan.ts
CHANGED
|
@@ -10,6 +10,8 @@ import { installServerOnlyRuntime } from './server-only'
|
|
|
10
10
|
export async function scanRoutes(
|
|
11
11
|
entryFile: string,
|
|
12
12
|
appRoot?: string,
|
|
13
|
+
/** `[build] source_roots` (F256): app-root-relative directories outside the app; their modules are part of the graph (F276). */
|
|
14
|
+
sourceRoots: string[] = [],
|
|
13
15
|
): Promise<{ routes: Route[]; componentFile: Map<Function, string>; componentIssue: Map<Function, string>; appModules: string[]; appGraph: Map<string, string[]> }> {
|
|
14
16
|
// biome-ignore lint/suspicious/noExplicitAny: an arbitrary user module
|
|
15
17
|
let mod: any
|
|
@@ -29,7 +31,10 @@ export async function scanRoutes(
|
|
|
29
31
|
const componentIssue = new Map<Function, string>()
|
|
30
32
|
const root = realpathSync(resolve(appRoot ?? dirname(entryFile)))
|
|
31
33
|
const transpiler = new Bun.Transpiler({ loader: 'tsx' })
|
|
32
|
-
|
|
34
|
+
// F276: the app root and every `source_roots` directory: a module in `../shared` is as much part of the app as one in
|
|
35
|
+
// the root, so a load-time write it makes is seen by the F230 scan. Roots are real paths, as `f` is.
|
|
36
|
+
const scopes = [root, ...sourceRoots.map((r) => realpathSync(resolve(root, r)))]
|
|
37
|
+
const inRoot = (f: string) => scopes.some((s) => f.startsWith(s + sep)) && !f.split(sep).includes('node_modules')
|
|
33
38
|
const visited = new Set<string>()
|
|
34
39
|
// F230: each in-root module's in-root static imports (absolute paths), for the island chunks' load-time writers.
|
|
35
40
|
const appGraph = new Map<string, string[]>()
|