Thanks for your interest! knitkit is an npm-workspaces monorepo. Issues, discussion, and PRs are welcome — especially around the negotiation algorithm, SSR, and edge composition.
git clone https://github.com/minipekka25/knitkit.git
cd knitkit
npm ciNode 18+ is required (CI runs on 22, on Linux, Windows, and macOS).
npm run typecheck # builds @knitkit/runtime first, then type-checks every package
npm run build # build all packages (runtime first — its .d.ts is consumed by the rest)
npm test # run every package's unit tests
# per package
npm run --workspace=@knitkit/runtime test
npm run --workspace=@knitkit/runtime size # enforces the <5 KB runtime budgetExamples have their own self-booting smoke tests (Playwright / Node); they are run locally,
not in CI (they're network- and browser-dependent). See each examples/*/README.md.
These aren't bureaucracy — they're what keeps knitkit small and predictable:
- The core stays < 5 KB and zero-dependency.
@knitkit/runtimehas no runtime deps, and CI fails if it exceeds the size budget. New runtime deps will be declined; put optional features in their own package. - The negotiation function is the most-tested code in the repo. Changes to
packages/runtime/src/negotiate.ts(orsemver.ts) need tests first. - Everything is typed and errors are coded. Throw
KnitkitErrorwith acodeand asuggestion, not bareErrors. - No bundler plugins, no cross-remote HMR, no automatic transitive sharing. These are deliberate non-goals — see the roadmap. PRs adding them won't be merged.
- Branch off
main. - Make the change with tests; ensure
npm run typecheck,npm test, and (for runtime)npm run --workspace=@knitkit/runtime sizepass. - Add a changeset describing the change for the release notes:
Pick the affected packages and a bump type (patch = fix, minor = feature or breaking while pre-1.0). Commit the generated file with your change.
npm run changeset
- Open a PR. CI runs typecheck/build/test/size on all three OSes.
On merge to main, a "Version Packages" PR is opened automatically from the pending
changesets; merging it publishes the new versions to npm (with provenance).
By contributing, you agree your contributions are licensed under the MIT License.