Thanks for your interest! This guide is for people working on the StatikAPI repository itself. If you are using StatikAPI in your own project, start with README.md and the docs site.
- Requirements: Node 22, pnpm, git
- Install:
pnpm install - Build/Type: JavaScript (ESM) for the repo packages. The showcase example also includes TypeScript routes.
- Packages:
packages/cli– CLI (statikapi)packages/core– minimal shared package namespacepackages/ui– preview React UIexample/*– sample projectsdocs/– OSS docs content (MDX files consumed by the website later)
- Lint:
pnpm -w lint - Format check:
pnpm -w format - Format write:
pnpm -w format:fix - Tests:
pnpm -w test
- Use Node 22 (
.nvmrcprovided). - All packages are ESM—avoid CJS unless tests need it.
- Keep CLI stdout stable (tests parse messages).
Use clear, conventional-ish messages. Prefer the format:
type(scope): subject
Scope is usually a package or subsystem (e.g. cli, core, ui, create-statikapi, router, loader, manifest, preview, config).
| Type | Purpose | Examples |
|---|---|---|
| feat | New user-visible feature | feat(cli): add --pretty flag to build outputfeat(ui): JSON tree / pretty / raw tabs |
| fix | Bug fix | fix(router): ignore underscored files and _private dirsfix(loader): reject circular structures |
| perf | Performance improvement | perf(build): stream writes for large JSON endpoints |
| refactor | Non-functional internal change | refactor(core): extract serializeGuard()refactor(cli): split preview into subcommands |
| build | Build system or external dependency changes | build(ui): vite proxy for /_ui/eventsbuild(repo): bump pnpm to v9 |
| ci | CI/CD pipeline or automation | ci: release workflow with provenance + pnpm cache |
| docs | Documentation only | docs: add dynamic routes guidedocs(create-statikapi): quickstart examples |
| style | Code style / formatting only | style(ui): run prettier on src/components |
| test | Add or fix tests | test(cli): manifest smoke test for "/" entrytest(create-statikapi): scaffold dynamic template |
| chore | Maintenance / tooling | chore(repo): align .editorconfig + prettier config |
| security | Security patch | security(cli): sanitize route param printing |
| deps | Dependency bump | deps(ui): upgrade react to 18.3.1 |
| release | Version tags and changelog updates | release: v0.6.4 |
- Packages:
cli,core,ui,create-statikapi - Subsystems:
router,loader,manifest,preview,config,errors,dev,build,sse,snippets
- Use imperative mood, lowercase after colon, ≤ 72 characters.
- ✅
fix(cli): handle CJS default export in loader - ❌
Fixed the loader issue
- ✅
- No ending punctuation.
- Be concise and clear.
Use the body to explain what and why, not the how.
Wrap lines around 72 chars.
Example:
feat(cli): write manifest with bytes & hash
- Include mtime as number for stable comparisons
- Hash is a hex of content to drive cache busting
Use ! after type/scope or include a BREAKING CHANGE: footer.
feat(cli)!: rename --watch to dev
BREAKING CHANGE: The old `statikapi build --watch` is removed.
Use `statikapi dev` for incremental rebuilds.
Closes #123Refs #456Co-authored-by: Name <email>
| Emoji | Type | Example |
|---|---|---|
| ✨ | feat | ✨ feat(cli): add pretty output |
| 🐛 | fix | 🐛 fix(loader): reject invalid JSON |
| 🧪 | test | 🧪 test(router): stable route order |
| 🔧 | chore | 🔧 chore(repo): update pnpm lockfile |
| 🛠️ | build | 🛠️ build(ui): add vite alias |
| 🚀 | release | 🚀 release: v0.6.4 |
cli(build): write manifest with bytes & hashui: pretty/raw toggle + copy buttondocs: add dynamic routes guidefix(loader): error on non-finite numbersfeat(create-statikapi): add --template dynamicperf(preview): cache manifest in memoryci: publish order core → cli → create-statikapitest(router): stable ordering for static/dynamic/catchallchore(repo): add pnpm-workspace.yamlrelease: v0.6.4
You can enable a commit message template for consistency:
git config commit.template .gitmessage
Example .gitmessage:
type(scope): subject
# Explain WHAT and WHY
# - Bullet point 1
# - Bullet point 2
# (Wrap to ~72 chars)
# Closes #
✅ TL;DR:
Keep commits small, scoped, imperative, and meaningful.
Example:
feat(cli): add dev command with live reload
- Fork & branch:
feat/<short-name>orfix/<short-name>. - Add tests when possible (CLI behavior is covered by
node:test). pnpm -w lint && pnpm -w testmust pass.- Describe what changed and why. Link issues.
- Use the provided templates (bug/feature).
- Repro steps and expected behavior are essential for bug reports.
- UI is embedded into CLI on publish via
packages/cli/scripts/embed-ui.js. - Do not break
/_ui/index,/_ui/file,/_ui/events.
See CODE_OF_CONDUCT.md.