castrum 0.9.3 → 0.9.6
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/Cargo.lock +2242 -0
- package/Cargo.toml +155 -0
- package/README.md +14 -6
- package/build.rs +5 -0
- package/castrum.darwin-arm64.node +0 -0
- package/castrum.darwin-x64.node +0 -0
- package/castrum.linux-arm64-gnu.node +0 -0
- package/castrum.linux-arm64-musl.node +0 -0
- package/castrum.linux-x64-gnu.node +0 -0
- package/castrum.linux-x64-musl.node +0 -0
- package/castrum.linux-x64-v3-gnu.node +0 -0
- package/castrum.win32-x64-msvc.node +0 -0
- package/dist/index.d.ts +1508 -1291
- package/dist/index.js +3391 -2069
- package/docs/API.md +2 -1
- package/docs/ARCHITECTURE.md +3 -2
- package/docs/CASE_STUDY.md +5 -3
- package/docs/ENVIRONMENT.md +25 -2
- package/docs/FFI_BUN_GUIDE.md +242 -14
- package/docs/HOW_TO_ADD_AN_OP.md +10 -0
- package/docs/REPO_MAP.md +17 -6
- package/docs/RND-CONCURRENCY.md +772 -0
- package/docs/bun-builtins-decision-matrix.md +4 -1
- package/index.ts +24 -25
- package/package.json +173 -156
- package/rust/crypto/aead.rs +378 -0
- package/rust/crypto/argon2.rs +265 -0
- package/rust/crypto/base64.rs +420 -0
- package/rust/crypto/bcrypt.rs +89 -0
- package/rust/crypto/cookie_sign.rs +169 -0
- package/rust/crypto/csrf.rs +106 -0
- package/rust/crypto/ed25519.rs +215 -0
- package/rust/crypto/hashing.rs +140 -0
- package/rust/crypto/hmac_sha256.rs +88 -0
- package/rust/crypto/jwt/api.rs +286 -0
- package/rust/crypto/jwt/mod.rs +22 -0
- package/rust/crypto/jwt/tests.rs +312 -0
- package/rust/crypto/jwt/token.rs +360 -0
- package/rust/crypto/mod.rs +27 -0
- package/rust/crypto/pbkdf2.rs +105 -0
- package/rust/crypto/random_token.rs +85 -0
- package/rust/crypto/session.rs +222 -0
- package/rust/ffi/crypto.rs +708 -0
- package/rust/ffi/hashing.rs +285 -0
- package/rust/ffi/http.rs +752 -0
- package/rust/ffi/ingress.rs +303 -0
- package/rust/ffi/json.rs +517 -0
- package/rust/ffi/jwt.rs +419 -0
- package/rust/ffi/metrics.rs +373 -0
- package/rust/ffi/mod.rs +69 -0
- package/rust/ffi/payload.rs +275 -0
- package/rust/ffi/probe.rs +60 -0
- package/rust/ffi/rate_limit.rs +77 -0
- package/rust/ffi/route.rs +85 -0
- package/rust/ffi/task.rs +172 -0
- package/rust/ffi/tests.rs +2333 -0
- package/rust/ffi/util.rs +152 -0
- package/rust/ffi/validators.rs +123 -0
- package/rust/http/accept.rs +606 -0
- package/rust/http/cookie_parser.rs +140 -0
- package/rust/http/etag.rs +289 -0
- package/rust/http/form.rs +136 -0
- package/rust/http/headers.rs +267 -0
- package/rust/http/http_date.rs +286 -0
- package/rust/http/http_parser.rs +252 -0
- package/rust/http/media_type.rs +355 -0
- package/rust/http/method.rs +200 -0
- package/rust/http/mime_lookup.rs +130 -0
- package/rust/http/mod.rs +32 -0
- package/rust/http/multipart.rs +685 -0
- package/rust/http/query_parser.rs +211 -0
- package/rust/http/url_codec.rs +296 -0
- package/rust/http/url_join.rs +324 -0
- package/rust/ingress/api.rs +355 -0
- package/rust/ingress/cors.rs +403 -0
- package/rust/ingress/ingress_constants.rs +209 -0
- package/rust/ingress/ip_trust.rs +312 -0
- package/rust/ingress/mod.rs +48 -0
- package/rust/ingress/native_route.rs +770 -0
- package/rust/ingress/options.rs +176 -0
- package/rust/ingress/output.rs +406 -0
- package/rust/ingress/packed.rs +191 -0
- package/rust/ingress/pipeline.rs +534 -0
- package/rust/ingress/proxy.rs +138 -0
- package/rust/ingress/rate_limit.rs +538 -0
- package/rust/ingress/terminal.rs +114 -0
- package/rust/ingress/tests.rs +567 -0
- package/rust/ingress/time.rs +70 -0
- package/rust/json/fast_schema/capture.rs +336 -0
- package/rust/json/fast_schema/compile.rs +556 -0
- package/rust/json/fast_schema/cursor.rs +368 -0
- package/rust/json/fast_schema/email.rs +282 -0
- package/rust/json/fast_schema/errors.rs +247 -0
- package/rust/json/fast_schema/mod.rs +57 -0
- package/rust/json/fast_schema/tests.rs +1143 -0
- package/rust/json/fast_schema/types.rs +140 -0
- package/rust/json/fast_schema/validate.rs +931 -0
- package/rust/json/json_ops.rs +121 -0
- package/rust/json/json_schema.rs +837 -0
- package/rust/json/json_ser.rs +883 -0
- package/rust/json/mod.rs +19 -0
- package/rust/json/napi_marshal.rs +318 -0
- package/rust/json/patch/api.rs +60 -0
- package/rust/json/patch/engine.rs +153 -0
- package/rust/json/patch/mod.rs +47 -0
- package/rust/json/patch/ops.rs +270 -0
- package/rust/json/patch/pointer.rs +49 -0
- package/rust/json/patch/tests.rs +499 -0
- package/rust/lib.rs +73 -0
- package/rust/metrics/api.rs +148 -0
- package/rust/metrics/mod.rs +21 -0
- package/rust/metrics/registry.rs +961 -0
- package/rust/panic_safety.rs +40 -0
- package/rust/payload/compress.rs +512 -0
- package/rust/payload/mod.rs +13 -0
- package/rust/payload/sse.rs +214 -0
- package/rust/payload/template.rs +253 -0
- package/rust/payload/websocket.rs +69 -0
- package/rust/payload/ws_frames.rs +354 -0
- package/rust/proptest_suite.rs +139 -0
- package/rust/selection.rs +95 -0
- package/rust/src/bin/native-bench.rs +495 -0
- package/rust/task/completion.rs +119 -0
- package/rust/task/mod.rs +65 -0
- package/rust/task/ops.rs +503 -0
- package/rust/task/runtime.rs +220 -0
- package/rust/task/tests.rs +231 -0
- package/rust/test_support.rs +71 -0
- package/rust/util/batch/api.rs +266 -0
- package/rust/util/batch/core.rs +473 -0
- package/rust/util/batch/mod.rs +23 -0
- package/rust/util/batch/tests.rs +445 -0
- package/rust/util/batch_core.rs +184 -0
- package/rust/util/bytes.rs +594 -0
- package/rust/util/mod.rs +34 -0
- package/rust/util/packed.rs +473 -0
- package/rust/util/text.rs +130 -0
- package/rust/util/threadpool.rs +128 -0
- package/rust/util/validation.rs +419 -0
- package/rust-toolchain.toml +17 -0
- package/scripts/postinstall.mjs +199 -0
- package/src/ingress/constants.ts +1 -1
- package/src/ingress/context.ts +2 -2
- package/src/ingress/decode/baked-result.ts +13 -13
- package/src/ingress/decode/fast-result.ts +17 -17
- package/src/ingress/errors.ts +7 -7
- package/src/ingress/headers/baked-templates.ts +1 -1
- package/src/ingress/headers/fast-templates.ts +3 -3
- package/src/ingress/health.ts +1 -2
- package/src/ingress/index.ts +1 -1
- package/src/ingress/native-route.ts +9 -5
- package/src/ingress/options.ts +1 -1
- package/src/ingress/packing/gather-raw-headers.ts +1 -1
- package/src/ingress/packing/route-wire.ts +1 -5
- package/src/ingress/response/error-bodies.ts +5 -5
- package/src/ingress/response/terminal.ts +1 -1
- package/src/ingress/routes/echo.ts +4 -4
- package/src/ingress/routes/fallback.ts +2 -2
- package/src/ingress/routes/head.ts +2 -2
- package/src/ingress/routes/native.ts +2 -1
- package/src/ingress/routes/options.ts +1 -1
- package/src/ingress/routes/read.ts +2 -2
- package/src/ingress/server.ts +10 -6
- package/src/ingress/status.ts +7 -7
- package/src/integration/batch.ts +1 -1
- package/src/integration/index.ts +9 -9
- package/src/integration/pipeline.ts +6 -6
- package/src/integration/websocket.ts +2 -2
- package/src/loader/index.ts +1 -5
- package/src/loader/ops.ts +1 -1
- package/src/native/ffi/build/codecs.ts +130 -12
- package/src/native/ffi/build/compress.ts +22 -10
- package/src/native/ffi/build/instances.ts +46 -4
- package/src/native/ffi/build/metrics.ts +247 -0
- package/src/native/ffi/build/parse.ts +59 -23
- package/src/native/ffi/build/task.ts +79 -0
- package/src/native/ffi/build/util.ts +32 -1
- package/src/native/ffi/build.ts +4 -0
- package/src/native/ffi/selftest.ts +12 -3
- package/src/native/ffi/types.ts +151 -9
- package/src/native/ffi.ts +160 -15
- package/src/native/index.ts +1 -1
- package/src/native/loader.ts +55 -5
- package/src/native/types/instances.ts +34 -0
- package/src/native/types.ts +11 -0
- package/src/runtime/codec.ts +53 -9
- package/src/runtime/types.ts +7 -0
- package/src/rust-ffi/batch/build.ts +16 -9
- package/src/rust-ffi/index.ts +7 -6
- package/src/rust-ffi/options.ts +1 -3
- package/src/rust-ffi/proven.ts +3 -3
- package/src/rust-ffi/scalar/crypto.ts +1 -1
- package/src/rust-ffi/scalar/factories.ts +73 -0
- package/src/rust-ffi/scalar/hashing.ts +1 -1
- package/src/rust-ffi/scalar/http.ts +71 -27
- package/src/rust-ffi/scalar/index.ts +2 -0
- package/src/rust-ffi/scalar/interface.ts +20 -0
- package/src/rust-ffi/scalar/payload.ts +11 -3
- package/src/rust-ffi/scalar/validation.ts +121 -0
- package/src/rust-ffi/text.ts +25 -3
- package/src/selection.ts +1 -1
- package/src/shared/bytes.ts +24 -4
- package/src/shared/codec.ts +18 -3
- package/src/task/index.ts +24 -0
- package/src/task/op.ts +171 -0
- package/src/task/runtime.ts +568 -0
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
## Methodology
|
|
9
9
|
|
|
10
|
-
- **Runtime**: Bun **1.4.0** (the
|
|
10
|
+
- **Runtime**: Bun **1.4.0** (the measurement anchor for the rows below; the
|
|
11
|
+
local toolchain has since moved to **1.4.2**, and these TIMING rows have not
|
|
12
|
+
been re-measured — only re-verified for parity, which
|
|
13
|
+
`test/unit/contract/delegation.test.ts` does on every run).
|
|
11
14
|
- **Addon**: castrum **release** build (`bun run build`, baseline CPU — the
|
|
12
15
|
shipped profile).
|
|
13
16
|
- **Driver**: `bun run check` (CPU benchmark → `bench/results/cpu/latest.json`).
|
package/index.ts
CHANGED
|
@@ -11,50 +11,49 @@
|
|
|
11
11
|
// load. Do NOT add more eager-native modules; keep everything else lazy (see
|
|
12
12
|
// test/unit/features/import-contract.test.ts).
|
|
13
13
|
|
|
14
|
+
export * from './src/ingress'
|
|
15
|
+
// Framework-agnostic integration helpers: run the ingress pipeline as a
|
|
16
|
+
// request stage (createPipeline), RFC 6455 upgrade (createWebSocketUpgrade),
|
|
17
|
+
// and SSE framing (sseResponse). See docs/INGRESS.md.
|
|
18
|
+
export * from './src/integration'
|
|
19
|
+
// Higher-order loader (HFC) over the curated op set: createLoader / loader
|
|
20
|
+
// dispatch single items, packed batches, and load() coalescing. See README.
|
|
21
|
+
export * from './src/loader'
|
|
14
22
|
export * from './src/rust-ffi'
|
|
15
|
-
|
|
23
|
+
// Off-thread native task runtime ("castrum Tasks"): submit a CPU-bound native
|
|
24
|
+
// op to the Rust pool and `await` it without ever blocking the JS thread.
|
|
25
|
+
// Bun-only offload today; Node runs the op synchronously. See
|
|
26
|
+
// docs/RND-CONCURRENCY.md.
|
|
27
|
+
export * from './src/task'
|
|
28
|
+
export type { OpDecision, OpImpl } from './src/selection'
|
|
16
29
|
// Native-vs-JS selection (OWNED HERE, not by consumers): `opImpl(op)` is the
|
|
17
30
|
// benchmark-driven recommendation for which operations should use the Rust
|
|
18
31
|
// addon vs a pure-JS implementation. Consumers read it once at load time and
|
|
19
32
|
// bind each op to a fixed impl. Source: rust/selection.rs (audited by
|
|
20
33
|
// `bun run check:selection`). See src/selection.ts.
|
|
21
|
-
export {
|
|
22
|
-
export type {
|
|
23
|
-
|
|
24
|
-
export { encoder, decoder } from './src/shared/bytes'
|
|
34
|
+
export { isNativeOp, opDecision, opImpl } from './src/selection'
|
|
35
|
+
export type { AdaptiveEstimateOptions } from './src/shared/adaptive'
|
|
25
36
|
// Bounded EWMA adaptive-estimate utility (drives BufferPool adaptive sizing
|
|
26
37
|
// and reusable runtime self-optimization decisions).
|
|
27
38
|
export { AdaptiveEstimate } from './src/shared/adaptive'
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
export { uuidv7 } from './src/shared/uuid'
|
|
39
|
+
export { decoder, encoder } from './src/shared/bytes'
|
|
40
|
+
export type { Counter, Gauge, Histogram, MetricsRegistry } from './src/shared/metrics'
|
|
31
41
|
// Zero-dep metrics registry (counters/gauges/histograms + Prometheus render).
|
|
32
42
|
export { createMetrics, DEFAULT_BUCKETS } from './src/shared/metrics'
|
|
33
|
-
export type {
|
|
34
|
-
|
|
43
|
+
export type { Pair, ParsedHttpRequestPacked } from './src/shared/packed'
|
|
35
44
|
export {
|
|
36
45
|
packBatch,
|
|
37
46
|
packPairs,
|
|
38
|
-
readPairsPacked,
|
|
39
|
-
readHttpPacked,
|
|
40
47
|
pairsToObject,
|
|
41
|
-
parseQueryString,
|
|
42
48
|
parseCookieHeader,
|
|
43
49
|
parseFormBody,
|
|
50
|
+
parseQueryString,
|
|
51
|
+
readHttpPacked,
|
|
52
|
+
readPairsPacked,
|
|
44
53
|
unpackBitset,
|
|
45
54
|
unpackByteResults,
|
|
46
55
|
unpackI64ArrayAsBigInt,
|
|
47
56
|
unpackU32Array,
|
|
48
57
|
} from './src/shared/packed'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export * from './src/ingress'
|
|
52
|
-
|
|
53
|
-
// Framework-agnostic integration helpers: run the ingress pipeline as a
|
|
54
|
-
// request stage (createPipeline), RFC 6455 upgrade (createWebSocketUpgrade),
|
|
55
|
-
// and SSE framing (sseResponse). See docs/INGRESS.md.
|
|
56
|
-
export * from './src/integration'
|
|
57
|
-
|
|
58
|
-
// Higher-order loader (HFC) over the curated op set: createLoader / loader
|
|
59
|
-
// dispatch single items, packed batches, and load() coalescing. See README.
|
|
60
|
-
export * from './src/loader'
|
|
58
|
+
// UUIDv7 generation — delegates to Bun.randomUUIDv7, crypto.randomUUID on Node.
|
|
59
|
+
export { uuidv7 } from './src/shared/uuid'
|
package/package.json
CHANGED
|
@@ -1,160 +1,177 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
"name": "castrum",
|
|
3
|
+
"version": "0.9.6",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Enterprise-grade Bun + Rust runtime: Rust-accelerated FFI primitives, a production-grade HTTP ingress pipeline, validation, hashing, and JSON processing with benchmark-grade performance.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"bun",
|
|
13
|
+
"rust",
|
|
14
|
+
"napi",
|
|
15
|
+
"ffi",
|
|
16
|
+
"ingress",
|
|
17
|
+
"http",
|
|
18
|
+
"validation",
|
|
19
|
+
"hashing",
|
|
20
|
+
"json",
|
|
21
|
+
"performance",
|
|
22
|
+
"benchmark"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/Axylabs/castrum.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/Axylabs/castrum#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/Axylabs/castrum/issues"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"bun": "./index.ts",
|
|
39
|
+
"node": "./dist/index.js",
|
|
40
|
+
"default": "./dist/index.js"
|
|
27
41
|
},
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"overrides": {
|
|
142
|
-
"typescript": "5.9.3"
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"index.ts",
|
|
46
|
+
"dist",
|
|
47
|
+
"src",
|
|
48
|
+
"docs",
|
|
49
|
+
"README.md",
|
|
50
|
+
"*.node",
|
|
51
|
+
"scripts/postinstall.mjs",
|
|
52
|
+
"rust",
|
|
53
|
+
"Cargo.toml",
|
|
54
|
+
"Cargo.lock",
|
|
55
|
+
"build.rs",
|
|
56
|
+
"rust-toolchain.toml",
|
|
57
|
+
"!src/bench",
|
|
58
|
+
"!src/baseline",
|
|
59
|
+
"!src/data"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
63
|
+
"build": "napi build --release --platform",
|
|
64
|
+
"build:perf": "bash scripts/build-perf.sh",
|
|
65
|
+
"build:v3": "bash scripts/build-v3.sh",
|
|
66
|
+
"build:all": "bun run build && bun run build:v3",
|
|
67
|
+
"build:js": "bun run build:js:bundle && bun run build:js:types",
|
|
68
|
+
"build:js:bundle": "bun build ./index.ts --target=node --format=esm --outdir=dist",
|
|
69
|
+
"build:js:types": "dts-bundle-generator -o dist/index.d.ts index.ts",
|
|
70
|
+
"bench": "bun run build && bun bench.ts",
|
|
71
|
+
"check": "bun bench.ts",
|
|
72
|
+
"test": "bun test test/unit test/property test/compat",
|
|
73
|
+
"test:all": "bun test && bun run typecheck && bun run typecheck:test && bun run lint:ci && bun run check:clean && cargo test --lib",
|
|
74
|
+
"test:coverage": "node scripts/check-coverage.mjs",
|
|
75
|
+
"setup": "bun install && bun run build",
|
|
76
|
+
"test:node": "node --test test/integration/node-smoke.test.mjs test/integration/node-enterprise.test.mjs",
|
|
77
|
+
"verify:install": "node scripts/verify-install.mjs",
|
|
78
|
+
"build:debug": "napi build --platform",
|
|
79
|
+
"lint": "bunx biome check .",
|
|
80
|
+
"lint:fix": "bunx biome check --write .",
|
|
81
|
+
"lint:ci": "bunx biome check . --formatter-enabled=false --assist-enabled=false --error-on-warnings",
|
|
82
|
+
"format": "bunx biome format --write .",
|
|
83
|
+
"typecheck": "bunx tsc --noEmit",
|
|
84
|
+
"typecheck:test": "bunx tsc --noEmit -p tsconfig.test.json",
|
|
85
|
+
"test:rust": "cargo test",
|
|
86
|
+
"deny": "cargo deny check",
|
|
87
|
+
"check:version": "bun scripts/check-version.mjs",
|
|
88
|
+
"check:jsdoc": "bun scripts/check-jsdoc.ts",
|
|
89
|
+
"check:selection": "bun scripts/select-native.ts --check",
|
|
90
|
+
"check:clean": "bun scripts/check-clean.ts",
|
|
91
|
+
"gen:ai-map": "bun scripts/gen-ai-map.ts",
|
|
92
|
+
"audit": "bun audit",
|
|
93
|
+
"release": "bun scripts/release.ts",
|
|
94
|
+
"release:dry": "bun scripts/release.ts --dry-run",
|
|
95
|
+
"release:manual": "bun scripts/release.ts --publish",
|
|
96
|
+
"prepublishOnly": "bun run build:js && node scripts/prepublish.mjs",
|
|
97
|
+
"bench:http": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts",
|
|
98
|
+
"bench:http:smoke": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts smoke",
|
|
99
|
+
"bench:http:stress": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts stress",
|
|
100
|
+
"bench:http:heavy": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts heavy-json",
|
|
101
|
+
"bench:http:crud": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts crud",
|
|
102
|
+
"bench:http:spike": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts spike",
|
|
103
|
+
"bench:http:soak": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts soak",
|
|
104
|
+
"bench:http:storm": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts storm",
|
|
105
|
+
"bench:http:boundary": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts boundary",
|
|
106
|
+
"bench:http:elysia": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts '' elysia",
|
|
107
|
+
"bench:http:ingress": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts '' ingress",
|
|
108
|
+
"bench:http:bun-only": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts '' bun",
|
|
109
|
+
"bench:http:all-heavy": "BUN_CONFIG_MAX_HTTP_REQUESTS=65535 bun run bench/http/run-bench.ts 1",
|
|
110
|
+
"bench:http:ac": "bun bench/autocannon-stress.mjs",
|
|
111
|
+
"bench:http:stress:ac": "SCENARIO=03-stress bun bench/autocannon-stress.mjs",
|
|
112
|
+
"bench:startup": "bun run bench/startup.ts",
|
|
113
|
+
"bench:load": "bun run bench/http/load-phase.ts",
|
|
114
|
+
"bench:ffi": "bun run bench/ffi/ffi-all.ts",
|
|
115
|
+
"bench:newops": "bun bench/cost/rust-vs-js-new-ops.ts",
|
|
116
|
+
"bench:ffi:load": "bun run bench/ffi/ffi-load.ts",
|
|
117
|
+
"bench:ffi:public": "bun run bench/ffi/ffi-public.ts",
|
|
118
|
+
"bench:ffi:workers": "bun run bench/ffi/ffi-workers.ts",
|
|
119
|
+
"bench:margin": "bun run bench/ffi/ffi-margin.ts",
|
|
120
|
+
"bench:router": "bun run bench/cost/router-cost.ts",
|
|
121
|
+
"bench:task": "bun run bench/cost/task-offload.ts",
|
|
122
|
+
"bench:ingress-cost": "bun run bench/cost/ingress-cost.ts",
|
|
123
|
+
"bench:ingress-cost:post": "bun run bench/cost/ingress-cost-post.ts",
|
|
124
|
+
"verify:native:batch": "bun run scripts/verify-native-batch.ts"
|
|
125
|
+
},
|
|
126
|
+
"dependencies": {},
|
|
127
|
+
"peerDependencies": {
|
|
128
|
+
"@types/node": "^26.1.2"
|
|
129
|
+
},
|
|
130
|
+
"peerDependenciesMeta": {
|
|
131
|
+
"@types/node": {
|
|
132
|
+
"optional": true
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"devDependencies": {
|
|
136
|
+
"@elysia/cors": "^1.4.2",
|
|
137
|
+
"@napi-rs/cli": "^3.8.6",
|
|
138
|
+
"@types/bun": "^1.3.14",
|
|
139
|
+
"@types/mime-types": "^3.0.1",
|
|
140
|
+
"autocannon": "^8.0.0",
|
|
141
|
+
"@types/validator": "^13.15.10",
|
|
142
|
+
"ajv": "^8.20.0",
|
|
143
|
+
"crc-32": "^1.2.2",
|
|
144
|
+
"dts-bundle-generator": "^9.5.1",
|
|
145
|
+
"elysia": "^1.4.29",
|
|
146
|
+
"fast-json-patch": "^3.1.1",
|
|
147
|
+
"mime-types": "^3.0.2",
|
|
148
|
+
"typescript": "7.0.2",
|
|
149
|
+
"validator": "^13.15.35"
|
|
150
|
+
},
|
|
151
|
+
"overrides": {
|
|
152
|
+
"typescript": "7.0.2",
|
|
153
|
+
"dts-bundle-generator": {
|
|
154
|
+
"typescript": "5.9.3"
|
|
143
155
|
},
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
"node": ">=20.3"
|
|
156
|
+
"@napi-rs/cli": {
|
|
157
|
+
"typescript": "6.0.3"
|
|
147
158
|
},
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
"hyperid": "^4.0.0"
|
|
160
|
+
},
|
|
161
|
+
"engines": {
|
|
162
|
+
"bun": ">=1.1.0",
|
|
163
|
+
"node": ">=20.3"
|
|
164
|
+
},
|
|
165
|
+
"napi": {
|
|
166
|
+
"binaryName": "castrum",
|
|
167
|
+
"targets": [
|
|
168
|
+
"aarch64-apple-darwin",
|
|
169
|
+
"aarch64-unknown-linux-gnu",
|
|
170
|
+
"aarch64-unknown-linux-musl",
|
|
171
|
+
"x86_64-apple-darwin",
|
|
172
|
+
"x86_64-pc-windows-msvc",
|
|
173
|
+
"x86_64-unknown-linux-gnu",
|
|
174
|
+
"x86_64-unknown-linux-musl"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
}
|