kitfly 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/LICENSE +21 -0
  3. package/README.md +136 -0
  4. package/VERSION +1 -0
  5. package/package.json +63 -0
  6. package/schemas/README.md +32 -0
  7. package/schemas/site.schema.json +5 -0
  8. package/schemas/theme.schema.json +5 -0
  9. package/schemas/v0/site.schema.json +172 -0
  10. package/schemas/v0/theme.schema.json +210 -0
  11. package/scripts/build-all.ts +121 -0
  12. package/scripts/build.ts +601 -0
  13. package/scripts/bundle.ts +781 -0
  14. package/scripts/dev.ts +777 -0
  15. package/scripts/generate-checksums.sh +78 -0
  16. package/scripts/release/export-release-key.sh +28 -0
  17. package/scripts/release/release-guard-tag-version.sh +79 -0
  18. package/scripts/release/sign-release-assets.sh +123 -0
  19. package/scripts/release/upload-release-assets.sh +76 -0
  20. package/scripts/release/upload-release-provenance.sh +52 -0
  21. package/scripts/release/verify-public-key.sh +48 -0
  22. package/scripts/release/verify-signatures.sh +117 -0
  23. package/scripts/version-sync.ts +82 -0
  24. package/src/__tests__/build.test.ts +240 -0
  25. package/src/__tests__/bundle.test.ts +786 -0
  26. package/src/__tests__/cli.test.ts +706 -0
  27. package/src/__tests__/crucible.test.ts +1043 -0
  28. package/src/__tests__/engine.test.ts +157 -0
  29. package/src/__tests__/init.test.ts +450 -0
  30. package/src/__tests__/pipeline.test.ts +1087 -0
  31. package/src/__tests__/productbook.test.ts +1206 -0
  32. package/src/__tests__/runbook.test.ts +974 -0
  33. package/src/__tests__/server-registry.test.ts +1251 -0
  34. package/src/__tests__/servicebook.test.ts +1248 -0
  35. package/src/__tests__/shared.test.ts +2005 -0
  36. package/src/__tests__/styles.test.ts +14 -0
  37. package/src/__tests__/theme-schema.test.ts +47 -0
  38. package/src/__tests__/theme.test.ts +554 -0
  39. package/src/cli.ts +582 -0
  40. package/src/commands/init.ts +92 -0
  41. package/src/commands/update.ts +444 -0
  42. package/src/engine.ts +20 -0
  43. package/src/logger.ts +15 -0
  44. package/src/migrations/0000_schema_versioning.ts +67 -0
  45. package/src/migrations/0001_server_port.ts +52 -0
  46. package/src/migrations/0002_brand_logo.ts +49 -0
  47. package/src/migrations/index.ts +26 -0
  48. package/src/migrations/schema.ts +24 -0
  49. package/src/server-registry.ts +405 -0
  50. package/src/shared.ts +1239 -0
  51. package/src/site/styles.css +931 -0
  52. package/src/site/template.html +193 -0
  53. package/src/templates/crucible.ts +1163 -0
  54. package/src/templates/driver.ts +876 -0
  55. package/src/templates/handbook.ts +339 -0
  56. package/src/templates/minimal.ts +139 -0
  57. package/src/templates/pipeline.ts +966 -0
  58. package/src/templates/productbook.ts +1032 -0
  59. package/src/templates/runbook.ts +829 -0
  60. package/src/templates/schema.ts +119 -0
  61. package/src/templates/servicebook.ts +1242 -0
  62. package/src/theme.ts +245 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,60 @@
1
+ # Changelog
2
+
3
+ All notable changes to Kitfly are documented here.
4
+
5
+ ## [0.1.2] - 2026-02-10
6
+
7
+ ### Added
8
+
9
+ - Configurable sidebar width via `theme.yaml` `layout.sidebarWidth` (default `280px`)
10
+ - Site version in footer provenance: reads from `site.yaml` `version` field, falls back to git tag
11
+ - Schema support for `version` field in `site.schema.json`
12
+ - Schema support for `layout.sidebarWidth` in `theme.schema.json`
13
+ - Comprehensive test coverage: 466 → 1174 tests, 56.9% → 68.7% statements, 42.3% → 79.6% functions
14
+ - Template test suites: crucible, pipeline, productbook, runbook, servicebook (all 100% coverage)
15
+ - Bundle test suite: parseArgs, imageMime, rewriteContentLinks, fileToDataUri, inlineLocalImages
16
+
17
+ ### Fixed
18
+
19
+ - Footer provenance now displays site version instead of kitfly engine version
20
+ - Sidebar folder indicators: replaced tiny `▸`/`▾` triangles with `›` chevron + 150ms rotation transition
21
+ - Test suite: removed fs mocks from theme tests (eliminated cross-file mock contamination)
22
+ - Test suite: fixed Bun/Node dual-runtime compatibility for coverage runs
23
+ - Lint: eliminated 541 non-null assertion warnings across test files
24
+
25
+ ## [0.1.1] - 2026-02-10
26
+
27
+ ### Added
28
+
29
+ - Three-zone footer layout with configurable copyright, links, and attribution
30
+ - `footer.copyright` — override auto-generated copyright text
31
+ - `footer.copyrightUrl` — make copyright text a clickable link
32
+ - `footer.links` — custom footer links (max 10); empty array suppresses all center links
33
+ - `footer.attribution` — toggle "Built with Kitfly" (default: true)
34
+ - Immutable `KitflyBrand` constant — tool identity separate from user's `SiteBrand`
35
+ - Bundle footer parity via shared `buildBundleFooter()`
36
+ - HTML escaping for all user-provided config strings in footer output
37
+ - Platform binary releases: Linux x64/arm64, macOS arm64, Windows x64/arm64
38
+ - Provenance label: `Published YYYY-MM-DD` (was bare date)
39
+ - Copyright year derived from publish date, not runtime
40
+
41
+ ### Fixed
42
+
43
+ - `brand.url: "/"` (relative URL) now displays `brand.name` as footer link text
44
+ - Footer wrapping on narrow viewports: `min-height` replaces fixed `height`
45
+
46
+ ## [0.1.0] - 2026-02-05
47
+
48
+ ### Added
49
+
50
+ - Initial release
51
+ - `kitfly init` — scaffold documentation sites (minimal, handbook templates)
52
+ - `kitfly dev` — development server with hot reload
53
+ - `kitfly build` — static site generation
54
+ - `kitfly bundle` — single-file HTML output
55
+ - Auto-discovered navigation from folder structure
56
+ - Brand logo/favicon support with bounded responsive slot
57
+ - Dark mode with system preference detection
58
+ - YAML-based config with JSON schema validation
59
+ - Cross-platform CI: Linux x64/arm64, macOS arm64, Windows x64/arm64
60
+ - Dual-format release signing: minisign + GPG
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 3 Leaps LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ <p align="center">
2
+ <img src="assets/brand/kitfly-logo-512.png" alt="Kitfly" width="180">
3
+ </p>
4
+
5
+ <h1 align="center">Kitfly</h1>
6
+
7
+ <p align="center"><strong>Turn your writing into a website.</strong></p>
8
+
9
+ <p align="center">~500 lines of code. One dependency. Zero config required.</p>
10
+
11
+ <p align="center">No SaaS subscriptions. No 500MB node_modules. Just your docs, rendered clean.</p>
12
+
13
+ ---
14
+
15
+ ## Three Ways to Use Kitfly
16
+
17
+ | Approach | Best For | What You Get |
18
+ |----------|----------|--------------|
19
+ | **`kitfly init`** | New projects | Standalone site with your own copy of the code |
20
+ | **`kitfly dev ./folder`** | Existing docs | Quick preview without changing anything |
21
+ | **Clone this repo** | Contributors | The kitfly engine itself |
22
+
23
+ ### Create a Standalone Site (Recommended)
24
+
25
+ ```bash
26
+ kitfly init my-docs
27
+ cd my-docs
28
+ bun install
29
+ bun run dev
30
+ ```
31
+
32
+ You get a complete, self-contained site: rendering code, template, styles, config. It's yours — modify it, version it, own it. No kitfly CLI required after setup.
33
+
34
+ ### Preview Existing Docs
35
+
36
+ ```bash
37
+ kitfly dev ./path/to/markdown
38
+ kitfly build ./docs --out ./dist
39
+ kitfly bundle ./docs --name docs.html
40
+ ```
41
+
42
+ Render any folder of markdown instantly. Great for docs that live in another repo.
43
+
44
+ ### Clone for Development
45
+
46
+ ```bash
47
+ git clone https://github.com/3leaps/kitfly
48
+ cd kitfly
49
+ bun install
50
+ bun run dev
51
+ ```
52
+
53
+ The `content/` folder is the actual kitfly documentation. What you see is what you get.
54
+
55
+ See [Kitfly Overview](content/guide/kitfly-overview.md) for the full picture.
56
+
57
+ ---
58
+
59
+ ## Two Ways to Share
60
+
61
+ **Send it** — Single HTML file you can email, Slack, or drop in a shared drive. Works offline.
62
+
63
+ **Host it** — Static site you deploy to GitHub Pages, Netlify, S3, anywhere.
64
+
65
+ ---
66
+
67
+ ## What You Get
68
+
69
+ | Feature | How |
70
+ |---------|-----|
71
+ | Hot reload | Edit markdown, see changes instantly |
72
+ | Navigation | Auto-generated from folder structure |
73
+ | Table of contents | Extracted from headings |
74
+ | Dark mode | System preference + toggle |
75
+ | Diagrams | Mermaid via CDN |
76
+ | Syntax highlighting | Prism.js via CDN |
77
+ | Offline-ready | Static HTML, no server required |
78
+
79
+ ## What You Don't Get
80
+
81
+ - Component libraries
82
+ - Client-side routing
83
+ - Build pipelines to learn
84
+ - Framework lock-in
85
+ - Subscription fees
86
+
87
+ If you need those features, use [Astro](https://astro.build), [VitePress](https://vitepress.dev), or [Docusaurus](https://docusaurus.io). They're excellent. Kitfly is for when you don't.
88
+
89
+ ---
90
+
91
+ ## Configuration
92
+
93
+ Create `site.yaml` (optional):
94
+
95
+ ```yaml
96
+ docroot: "content"
97
+ title: "My Documentation"
98
+ home: "index.md"
99
+
100
+ brand:
101
+ name: "My Project"
102
+ url: "/"
103
+
104
+ sections:
105
+ - name: "Guide"
106
+ path: "guide"
107
+ - name: "Reference"
108
+ path: "reference"
109
+ ```
110
+
111
+ Or just drop markdown files in `content/` — sections auto-discover.
112
+
113
+ ---
114
+
115
+ ## Philosophy
116
+
117
+ > **Rule of thumb**: If it can't be done with CSS, vanilla JS under 50 lines, or a marked plugin, it doesn't belong here.
118
+
119
+ Kitfly is intentionally limited. The goal is a doc site that stays simple and maintainable. When you outgrow it, migrate — your content is just markdown.
120
+
121
+ ---
122
+
123
+ ## Name
124
+
125
+ **Kit** + **Fly**
126
+
127
+ - **Kit**: Your handbook, runbook, notebook — a collection of docs
128
+ - **Fly**: Fast, instant, launching to the web
129
+
130
+ *Pack your docs. Watch them fly.*
131
+
132
+ ---
133
+
134
+ **License:** MIT
135
+
136
+ Made by [3 Leaps](https://3leaps.net)
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "kitfly",
3
+ "version": "0.1.2",
4
+ "type": "module",
5
+ "description": "Turn your writing into a website",
6
+ "bin": {
7
+ "kitfly": "./src/cli.ts"
8
+ },
9
+ "files": [
10
+ "src/",
11
+ "scripts/",
12
+ "schemas/",
13
+ "dist/",
14
+ "!dist/release/",
15
+ "VERSION",
16
+ "LICENSE",
17
+ "README.md",
18
+ "CHANGELOG.md"
19
+ ],
20
+ "scripts": {
21
+ "dev": "bun run scripts/dev.ts",
22
+ "build": "bun run scripts/build.ts",
23
+ "bundle": "bun run scripts/bundle.ts",
24
+ "cli": "bun run src/cli.ts",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "test:coverage": "vitest run --coverage",
28
+ "lint": "biome check src/ scripts/",
29
+ "lint:ci": "biome check --no-errors-on-unmatched src/ scripts/",
30
+ "fmt": "biome check --write src/ scripts/",
31
+ "format:check": "biome check --no-errors-on-unmatched src/ scripts/",
32
+ "typecheck": "tsc --noEmit",
33
+ "build:all": "bun scripts/build-all.ts",
34
+ "build:local": "bun build src/cli.ts --compile --outfile dist/kitfly",
35
+ "version:sync": "bun run scripts/version-sync.ts",
36
+ "version:check": "bun run scripts/version-sync.ts --check"
37
+ },
38
+ "dependencies": {
39
+ "@3leaps/sysprims": "^0.1.12",
40
+ "@fulmenhq/tsfulmen": "^0.2.7",
41
+ "marked": "^15.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@biomejs/biome": "^2.2.5",
45
+ "@types/bun": "^1.2.0",
46
+ "@vitest/coverage-v8": "^4.0.18",
47
+ "prettier": "^3.6.2",
48
+ "typescript": "^5.7.2",
49
+ "vitest": "^4.0.18"
50
+ },
51
+ "author": "3 Leaps <hello@3leaps.net>",
52
+ "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "https://github.com/3leaps/kitfly"
56
+ },
57
+ "keywords": [
58
+ "documentation",
59
+ "markdown",
60
+ "static-site",
61
+ "docs"
62
+ ]
63
+ }
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: "Kitfly Schemas"
3
+ description: "Schema versioning policy for site.yaml and theme.yaml"
4
+ last_updated: "2026-02-05"
5
+ ---
6
+
7
+ # Schemas
8
+
9
+ Kitfly ships JSON Schemas for editor validation and migration detection.
10
+
11
+ ## Versioned Folders
12
+
13
+ Schemas live under versioned folders:
14
+
15
+ - `schemas/v0/` - alpha schemas (Kitfly v0.x.x)
16
+ - `schemas/v1/` - stable schemas (when Kitfly reaches v1.x.x)
17
+
18
+ The `v0/` folder name indicates the maturity track, not the exact schema content version.
19
+
20
+ ## Embedded Version
21
+
22
+ Each schema includes:
23
+
24
+ - `$id` - canonical identity (absolute URI)
25
+ - `$version` - schema content version (semver string)
26
+
27
+ Standalone sites are detached copies, so schemas must be self-describing.
28
+
29
+ ## Backward Compatibility
30
+
31
+ For convenience, `schemas/site.schema.json` and `schemas/theme.schema.json` remain as thin wrappers
32
+ that `$ref` the latest `schemas/v0/*` schemas.
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kitfly.app/schemas/site.schema.json",
4
+ "$ref": "./v0/site.schema.json"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kitfly.app/schemas/theme.schema.json",
4
+ "$ref": "./v0/theme.schema.json"
5
+ }
@@ -0,0 +1,172 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kitfly.app/schemas/v0/site.schema.json",
4
+ "$version": "0.1.0",
5
+ "title": "Site Configuration",
6
+ "description": "Configuration for Kitfly static site generator",
7
+ "type": "object",
8
+ "required": ["title", "brand", "sections"],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "type": "string",
12
+ "description": "Schema version this config targets (for migration detection)",
13
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
14
+ "default": "0.1.0"
15
+ },
16
+ "docroot": {
17
+ "type": "string",
18
+ "description": "Root directory for content (relative to repo root)",
19
+ "default": "."
20
+ },
21
+ "title": {
22
+ "type": "string",
23
+ "description": "Site title shown in browser tab and header",
24
+ "maxLength": 60
25
+ },
26
+ "version": {
27
+ "type": "string",
28
+ "description": "Site version displayed in footer provenance",
29
+ "examples": ["1.0.0", "2024.03", "draft"]
30
+ },
31
+ "home": {
32
+ "type": "string",
33
+ "description": "Home page file (rendered as index.html, not in nav)"
34
+ },
35
+ "brand": {
36
+ "type": "object",
37
+ "description": "Brand configuration for logo and links",
38
+ "required": ["name", "url"],
39
+ "properties": {
40
+ "name": {
41
+ "type": "string",
42
+ "description": "Brand name shown in sidebar",
43
+ "maxLength": 30
44
+ },
45
+ "url": {
46
+ "type": "string",
47
+ "description": "URL for brand logo link"
48
+ },
49
+ "external": {
50
+ "type": "boolean",
51
+ "description": "Open brand link in new tab (target=_blank)",
52
+ "default": false
53
+ },
54
+ "logo": {
55
+ "type": "string",
56
+ "description": "Path to logo image (relative to site root)",
57
+ "default": "assets/brand/logo.png"
58
+ },
59
+ "favicon": {
60
+ "type": "string",
61
+ "description": "Path to favicon image (relative to site root)",
62
+ "default": "assets/brand/favicon.png"
63
+ },
64
+ "logoType": {
65
+ "type": "string",
66
+ "description": "Logo type: icon (square) or wordmark (wide)",
67
+ "enum": ["icon", "wordmark"],
68
+ "default": "icon"
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "sections": {
74
+ "type": "array",
75
+ "description": "Navigation sections and their content sources",
76
+ "minItems": 1,
77
+ "items": {
78
+ "type": "object",
79
+ "required": ["name", "path"],
80
+ "properties": {
81
+ "name": {
82
+ "type": "string",
83
+ "description": "Section name shown in navigation",
84
+ "maxLength": 20
85
+ },
86
+ "path": {
87
+ "type": "string",
88
+ "description": "Directory path relative to docroot"
89
+ },
90
+ "files": {
91
+ "type": "array",
92
+ "description": "Specific files to include (for root-level sections)",
93
+ "items": { "type": "string" }
94
+ },
95
+ "maxDepth": {
96
+ "type": "integer",
97
+ "description": "Maximum directory depth for auto-discovery",
98
+ "minimum": 0,
99
+ "maximum": 10,
100
+ "default": 4
101
+ },
102
+ "exclude": {
103
+ "type": "array",
104
+ "description": "Glob patterns to exclude from auto-discovery",
105
+ "items": { "type": "string" }
106
+ }
107
+ },
108
+ "additionalProperties": false
109
+ }
110
+ },
111
+ "footer": {
112
+ "type": "object",
113
+ "description": "Footer configuration for copyright, links, and attribution",
114
+ "properties": {
115
+ "copyright": {
116
+ "type": "string",
117
+ "description": "Override footer copyright text"
118
+ },
119
+ "copyrightUrl": {
120
+ "type": "string",
121
+ "description": "Make copyright text a clickable link to this URL"
122
+ },
123
+ "links": {
124
+ "type": "array",
125
+ "description": "Custom footer links (replaces default brand URL link)",
126
+ "maxItems": 10,
127
+ "items": {
128
+ "type": "object",
129
+ "required": ["text", "url"],
130
+ "properties": {
131
+ "text": {
132
+ "type": "string",
133
+ "description": "Footer link label"
134
+ },
135
+ "url": {
136
+ "type": "string",
137
+ "description": "Footer link destination URL"
138
+ }
139
+ },
140
+ "additionalProperties": false
141
+ }
142
+ },
143
+ "attribution": {
144
+ "type": "boolean",
145
+ "description": "Show Built with Kitfly attribution",
146
+ "default": true
147
+ }
148
+ },
149
+ "additionalProperties": false
150
+ },
151
+ "server": {
152
+ "type": "object",
153
+ "description": "Development server configuration",
154
+ "properties": {
155
+ "port": {
156
+ "type": "integer",
157
+ "description": "Default port for dev server",
158
+ "minimum": 1,
159
+ "maximum": 65535,
160
+ "default": 3333
161
+ },
162
+ "host": {
163
+ "type": "string",
164
+ "description": "Default host for dev server",
165
+ "default": "localhost"
166
+ }
167
+ },
168
+ "additionalProperties": false
169
+ }
170
+ },
171
+ "additionalProperties": false
172
+ }