chrnx
d6c5cee0ee
feat: beta-hardening — routing, degradation, mesh gate, uploads, @header
...
Restructure first: split the two oversized files by cohesion (http.ts 449
→ http/{router,request,stream,ws,server,types}; app.ts 556 → app/{types,
introspect,index}), rename cryptic locals, JSDoc the public API, and
extract helpers so no function exceeds the complexity gate (createApp
187 → <15, listen 113 → 6). Public import paths are unchanged (barrels).
On that structure, five features that close the biggest gaps vs
Express/Fastify/Nest for a comparable beta:
- routing: `:name*` catch-all, specificity precedence (static ▸ param ▸
catch-all, not registration order), and 405 + Allow when a path exists
under a different method (was 404)
- visible degradation: optional providers that fail boot are summarized on
listen() and queryable via app.degraded(), instead of a silent warn
- mesh is alpha — gated behind `experimental: true`; createApp throws if
`mesh` is configured without it
- multipart moves to the optional `busboy` peer dependency (clear 501 when
absent), keeping the core at one runtime dependency
- `@header('name')` as a singular alias of `@headers`
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-07 12:00:15 -05:00
chrnx
9d79972f62
chore(release): dual ESM/CJS build via tsup; fix packaging; 26.07.0-beta.0
...
Packaging was broken for consumers: `main` resolved to a nonexistent
dist/index.js (tsc emitted dist/src/index.js), and the tarball shipped
tests, benches and sources. Build with tsup to emit CJS + ESM (+ types)
behind an `exports` map so `require` and `import` both resolve; a
createRequire banner keeps the lazy require('ws')/require('busboy') working
under ESM. Add the `files` allowlist and a `prepublishOnly` gate.
Bump to the first CalVer beta, published under the npm `beta` dist-tag.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-07 11:59:57 -05:00
chrnx
67133ca4ce
feat(bench): pure stats aggregate + BENCHMARKS.md renderer
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 22:31:47 -05:00
chrnx
456dd52df8
refactor(app): type RoutePlan.run as async; add validation e2e tests
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 21:37:22 -05:00
chrnx
eb494ff254
feat(params): schema-aware arg decorators; async validating resolveArgs
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 21:33:13 -05:00
chrnx
101833d52d
feat(validation): ValidationError → 422 with source + issues (before HttpError)
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 21:29:27 -05:00
chrnx
81dc9d3a70
feat(validation): vendor Standard Schema types + isStandardSchema/flattenPath
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 21:26:55 -05:00
chrnx
34017f6ab2
feat(routes): per-endpoint duplicates override via @Post/@Get opts
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 20:16:46 -05:00
chrnx
ec2e3a0e62
feat(http): configurable bodyDuplicates policy for urlencoded + multipart fields
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 20:13:52 -05:00
chrnx
5808da8012
feat(http): parse multipart/form-data; readBody yields Buffer, text fallthrough preserved
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 20:11:10 -05:00
chrnx
0f7932c696
feat(multipart): pure binary-safe multipart/form-data parser
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 20:07:32 -05:00
chrnx
cb77216a53
feat(http): configurable CORS with guarded OPTIONS preflight
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 19:16:48 -05:00
chrnx
0982873462
fix(http): make injected security/CORS headers authoritative over case-variant handler keys
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 19:14:17 -05:00
chrnx
04da79721f
feat(http): inject security headers on every response via writeHead patch
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 19:06:58 -05:00
chrnx
0dba41606a
feat(http): trustProxy + ctx.protocol/ctx.ip from socket or X-Forwarded-*
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 19:02:11 -05:00
chrnx
b8ee1b14a5
feat(http): native TLS termination → https/wss via tls option
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 18:58:40 -05:00
chrnx
b87bdc698f
fix(security): reject all control bytes in Origin validation
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 18:56:07 -05:00
chrnx
881bc59419
feat(security): pure CORS + security-header computation module
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-07-06 18:52:24 -05:00
chrnx
c39eb667ac
feat(example): minimal GraphQL with query/mutation and an SSE subscription over rooms
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:37:37 -05:00
chrnx
8335ff2875
feat(example): WS chat with rooms and handshake auth (no socket.io)
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:30:16 -05:00
chrnx
3842271c4d
feat(example): in-memory CRUD with query and JSON/urlencoded bodies
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:28:42 -05:00
chrnx
9050a7e5d9
feat: WS connections rejected by an HttpError close with 4000+status
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:25:24 -05:00
chrnx
6171e5e6bd
feat: rooms broadcast-hub primitive, auto-provided to handlers
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:23:54 -05:00
chrnx
2bbc43505e
feat: parse application/x-www-form-urlencoded request bodies
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 13:22:01 -05:00
chrnx
9d8088d0a9
feat: 'did you mean' boot hint, flow compile-time type-test, and demos
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 02:36:37 -05:00
chrnx
cc0044ba6a
feat: createApp overrides — swap any provider/step by token in one line
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 02:33:52 -05:00
chrnx
73cd874cae
feat: opt-in GET /__graph__ dev endpoint rendering the live graph
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 02:31:52 -05:00
chrnx
f5136e35d0
feat: app.graph/explain/toMermaid/toDOT — inspect the dependency graph
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 02:30:22 -05:00
chrnx
d67a4080dd
feat: pure Mermaid/DOT/HTML graph renderers
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 02:28:39 -05:00
chrnx
a25c9752a2
fix: always-run observer steps receive their declared needs under slicing
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 01:14:20 -05:00
chrnx
df01bbfc41
feat: per-route subgraph slicing — routes run only their needed providers/steps
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 01:09:47 -05:00
chrnx
68caca2cc1
feat: graceful shutdown via app.close() force-closing streams and connections
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 01:07:42 -05:00
chrnx
ddca3fd74b
feat: request body-size limit (413) and configurable server timeouts
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-28 01:05:09 -05:00
chrnx
e8a63e8d41
feat(mesh): wire remote scopes and proxy routes through the graph
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:36:56 -05:00
chrnx
a1e8f73e64
feat(mesh): teacup remote node and proxy-route builder
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:33:15 -05:00
chrnx
f151da4bd7
feat(mesh): route reserved control path to meshControl on upgrade
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:31:48 -05:00
chrnx
1174d14754
feat(mesh): teacup WS link client with id-correlated RPC
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:30:08 -05:00
chrnx
c4f220f431
feat(mesh): teapot manifest builder and control-channel dispatcher
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:28:21 -05:00
chrnx
ec1214e9e5
feat(mesh): export flag on providers, steps, and routes
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:25:53 -05:00
chrnx
31f91ee61f
feat(mesh): RPC frame protocol and codec
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 20:23:58 -05:00
chrnx
04688ab621
feat: wire SSE/WS routes through the graph with stream lifecycle events
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:32:17 -05:00
chrnx
abc4603050
feat: WebSocket upgrade path with lazy optional ws dependency
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:29:14 -05:00
chrnx
0eaefd0053
feat: SSE/ndjson streaming responses with backpressure and cleanup
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:22:18 -05:00
chrnx
fdbba5f06d
feat: @inbound and @abort handler argument decorators
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:18:38 -05:00
chrnx
732e1eb636
feat: Sse/Ws/Stream/Post route decorators with transport metadata
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:17:08 -05:00
chrnx
a94a987a35
feat: pipeline returns StreamResult for async-iterable handlers
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:15:05 -05:00
chrnx
a3dad32384
feat: SSE and ndjson stream encoders
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:13:09 -05:00
chrnx
f96d349c74
feat: multicast channel primitive + isAsyncIterable guard
...
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com >
2026-06-27 15:11:28 -05:00
chrnx
ccaacb9a02
fix: stream errors -> 500, guard non-object body picks, test @query e2e
2026-06-26 01:51:02 -05:00
chrnx
7114bf685e
feat: handlers declare deps via arg decorators, graph-validated at boot
2026-06-26 01:44:57 -05:00