Commit Graph
3 Commits
Author SHA1 Message Date
chrnx a4c9df9a74 test(edge): edgeHandler HTTP + WebSocket on real workerd via Miniflare
Boots the actual workerd engine locally (miniflare devDep, no CF account
needed) and round-trips HTTP (app.fetch) + WebSocket (WebSocketPair +
app.upgrade) through edgeHandler's real request path, mirroring the Deno/Bun
adapter tests' assertion shape.

workerd's nodejs_compat genuinely does not implement node:http/node:https
(confirmed in isolation against the real runtime; node:crypto, node:stream,
node:net, node:tls, node:events, node:util, node:buffer all load fine under
the same flags). The barrel statically imports them for the Node listen()
path even though edgeHandler never touches it, so the bundler stubs those
two modules at test-bundle time (inert createServer that throws if ever
called) purely to let the worker load — edgeHandler itself is untouched.
See project-docs/.superpowers/sdd/task-2-report.md for the full writeup and
the suggested core follow-up (lazy-defer those imports behind listen()).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 23:34:19 -05:00
chrnx 3ca4c8680e chore(qa): add ESLint, Prettier, and a cognitive-complexity gate
The project shipped no linting or formatting; add both ahead of the first
npm publish. ESLint (flat config, typescript-eslint) + Prettier enforce a
consistent style, and a cognitive-complexity gate (ccts, threshold 25)
keeps any function from regressing into the unreadable.

Both run in CI and in a pre-commit hook (.githooks, enabled via
core.hooksPath + the `prepare` script). Cyclomatic complexity stays
advisory-only — its ??-chain false positives make it a poor gate.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-07 11:59:42 -05:00
chrnx 04e4ae5c54 chore: scaffold @green-tea/core with vitest and strict ts 2026-06-26 00:29:40 -05:00