feat(core): add @choojs/core — ESM port of choo with consolidated nano* internals

Same public API as choo 7.1.0 (use/route/start/mount/toString/emit; choo()
callable with or without new, Choo exported). nanobus, nanorouter+wayfarer,
nanolru+component cache, nanoraf, nanohref, nanotiming, document-ready and
scroll-to-anchor are ported into lib/ with per-file attribution; nanoquery
is replaced by URLSearchParams. The v7 node test suite is ported from tape
to node:test and passes unchanged in behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NgfSjHE11oFpoSnLVKLXd
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-08 15:59:26 +02:00
co-authored by Claude Fable 5
parent 90cca611c9
commit 4ad3d02207
12 changed files with 1322 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// Minimal assertions in the spirit of nanoassert (MIT).
// These guard the public API in development; a production bundler can strip
// them by replacing this module with no-ops.
export function ok (value, message) {
if (!value) throw new Error(message || 'assertion failed')
}
/* eslint-disable eqeqeq */
export function equal (a, b, message) {
if (a != b) throw new Error(message || `${a} != ${b}`)
}
export function notEqual (a, b, message) {
if (a == b) throw new Error(message || `${a} == ${b}`)
}
/* eslint-enable eqeqeq */
export default ok