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
@@ -0,0 +1,339 @@
1
+ /**
2
+ * Handbook Template
3
+ *
4
+ * Extends minimal with structured sections for team handbooks.
5
+ * Sections: Overview, Guides, Reference
6
+ */
7
+
8
+ import type { TemplateContext, TemplateDef } from "./schema.ts";
9
+
10
+ export const handbook: TemplateDef = {
11
+ id: "handbook",
12
+ name: "Handbook",
13
+ description: "Team handbook with overview, guides, and reference sections",
14
+ version: 1,
15
+ extends: "minimal",
16
+ sections: [
17
+ { name: "Overview", path: "content/overview", description: "High-level introduction" },
18
+ { name: "Guides", path: "content/guides", description: "How-to guides and tutorials" },
19
+ { name: "Reference", path: "content/reference", description: "Technical reference docs" },
20
+ ],
21
+ files: [
22
+ {
23
+ path: "site.yaml",
24
+ content: (ctx: TemplateContext) => `# ${ctx.branding.siteName} - Site Configuration
25
+ # Documentation: https://github.com/3leaps/kitfly
26
+
27
+ title: "${ctx.branding.siteName}"
28
+
29
+ # ← CUSTOMIZE: Your brand settings
30
+ brand:
31
+ name: "${ctx.branding.brandName}"
32
+ url: "${ctx.branding.brandUrl}"
33
+ # external: false # Set true if brand URL is external
34
+
35
+ # Content sections
36
+ sections:
37
+ - name: "Overview"
38
+ path: "content/overview"
39
+ - name: "Guides"
40
+ path: "content/guides"
41
+ - name: "Reference"
42
+ path: "content/reference"
43
+
44
+ # Home page
45
+ home: "index.md"
46
+ `,
47
+ },
48
+ {
49
+ path: "index.md",
50
+ content: (ctx: TemplateContext) => `---
51
+ title: Home
52
+ description: ${ctx.branding.siteName} - Team Handbook
53
+ ---
54
+
55
+ # ${ctx.branding.siteName}
56
+
57
+ Welcome to the ${ctx.branding.brandName} handbook. This is your central resource for documentation, guides, and reference material.
58
+
59
+ ## Sections
60
+
61
+ ### [Overview](/content/overview/introduction)
62
+ Start here for an introduction to ${ctx.branding.brandName} and high-level concepts.
63
+
64
+ ### [Guides](/content/guides/getting-started)
65
+ Step-by-step tutorials and how-to guides for common tasks.
66
+
67
+ ### [Reference](/content/reference/glossary)
68
+ Technical reference documentation and specifications.
69
+
70
+ ---
71
+
72
+ *Last updated: ${new Date().toISOString().split("T")[0]}*
73
+ `,
74
+ },
75
+ {
76
+ path: "content/overview/introduction.md",
77
+ content: (ctx: TemplateContext) => `---
78
+ title: Introduction
79
+ description: Introduction to ${ctx.branding.siteName}
80
+ ---
81
+
82
+ # Introduction
83
+
84
+ <!-- ← CUSTOMIZE: Replace this content with your overview -->
85
+
86
+ Welcome to ${ctx.branding.siteName}. This section provides a high-level introduction to help you understand the fundamentals.
87
+
88
+ ## What is ${ctx.branding.brandName}?
89
+
90
+ Describe your project, team, or organization here.
91
+
92
+ ## Key Concepts
93
+
94
+ - **Concept 1**: Brief description
95
+ - **Concept 2**: Brief description
96
+ - **Concept 3**: Brief description
97
+
98
+ ## Next Steps
99
+
100
+ - Continue to the [Guides](/content/guides/getting-started) for hands-on tutorials
101
+ - Check the [Reference](/content/reference/glossary) for detailed specifications
102
+ `,
103
+ },
104
+ {
105
+ path: "content/guides/getting-started.md",
106
+ content: (ctx: TemplateContext) => `---
107
+ title: Getting Started
108
+ description: Get started with ${ctx.branding.siteName}
109
+ ---
110
+
111
+ # Getting Started
112
+
113
+ <!-- ← CUSTOMIZE: Replace this content with your getting started guide -->
114
+
115
+ This guide walks you through the initial setup and first steps.
116
+
117
+ ## Prerequisites
118
+
119
+ Before you begin, ensure you have:
120
+
121
+ - [ ] Requirement 1
122
+ - [ ] Requirement 2
123
+ - [ ] Requirement 3
124
+
125
+ ## Step 1: Installation
126
+
127
+ Describe the installation process here.
128
+
129
+ \`\`\`bash
130
+ # Example command
131
+ echo "Hello, ${ctx.branding.brandName}!"
132
+ \`\`\`
133
+
134
+ ## Step 2: Configuration
135
+
136
+ Explain initial configuration steps.
137
+
138
+ ## Step 3: Verify Setup
139
+
140
+ Show how to verify everything is working.
141
+
142
+ ## Next Steps
143
+
144
+ Now that you're set up, explore the other guides in this section.
145
+ `,
146
+ },
147
+ {
148
+ path: "content/reference/glossary.md",
149
+ content: (ctx: TemplateContext) => `---
150
+ title: Glossary
151
+ description: ${ctx.branding.siteName} terminology and definitions
152
+ ---
153
+
154
+ # Glossary
155
+
156
+ <!-- ← CUSTOMIZE: Add your project-specific terminology -->
157
+
158
+ Key terms and definitions used throughout this handbook.
159
+
160
+ ## A
161
+
162
+ **API**
163
+ : Application Programming Interface - a way for software components to communicate.
164
+
165
+ ## B
166
+
167
+ **Build**
168
+ : The process of compiling source files into deployable artifacts.
169
+
170
+ ## C
171
+
172
+ **Configuration**
173
+ : Settings that control how a system behaves.
174
+
175
+ ---
176
+
177
+ *Add more terms as your documentation grows.*
178
+ `,
179
+ },
180
+ {
181
+ path: "CUSTOMIZING.md",
182
+ content: (ctx: TemplateContext) => `---
183
+ template: handbook
184
+ template_version: 1
185
+ created: ${new Date().toISOString().split("T")[0]}
186
+ ---
187
+
188
+ # Customizing ${ctx.branding.siteName}
189
+
190
+ This guide helps you (and AI assistants) understand how to customize this site.
191
+
192
+ ## Site Structure
193
+
194
+ \`\`\`
195
+ ${ctx.name}/
196
+ ├── site.yaml # Site configuration (sections, branding)
197
+ ├── theme.yaml # Theme customization (colors, fonts) - create if needed
198
+ ├── index.md # Home page
199
+ ├── CUSTOMIZING.md # This file
200
+ ├── content/ # Your documentation
201
+ │ ├── overview/ # High-level concepts
202
+ │ ├── guides/ # How-to tutorials
203
+ │ └── reference/ # Look-up information
204
+ └── assets/
205
+ └── brand/ # Logo, favicon
206
+ ├── logo.png # Site logo (recommended: 200x50px)
207
+ └── favicon.ico
208
+ \`\`\`
209
+
210
+ ## Configuration Files
211
+
212
+ ### site.yaml - Site Configuration
213
+
214
+ \`\`\`yaml
215
+ title: "${ctx.branding.siteName}"
216
+
217
+ brand:
218
+ name: "${ctx.branding.brandName}" # Shown in header
219
+ url: "/" # Logo link destination
220
+ # external: true # Set if URL is external
221
+
222
+ sections:
223
+ - name: "Overview" # Display name in nav
224
+ path: "content/overview" # Folder path
225
+ # Add more sections here
226
+ \`\`\`
227
+
228
+ ### theme.yaml - Visual Customization (optional)
229
+
230
+ Create \`theme.yaml\` to customize colors and typography:
231
+
232
+ \`\`\`yaml
233
+ colors:
234
+ primary: "#2563eb" # Links, accents
235
+ background: "#ffffff" # Page background
236
+ text: "#1f2937" # Body text
237
+
238
+ fonts:
239
+ body: "system-ui, sans-serif"
240
+ code: "ui-monospace, monospace"
241
+ \`\`\`
242
+
243
+ ## Header and Footer
244
+
245
+ - **Header**: Shows brand name/logo from \`site.yaml\` + navigation
246
+ - **Footer**: Auto-generated with copyright. Customize via \`theme.yaml\`:
247
+
248
+ \`\`\`yaml
249
+ footer:
250
+ text: "© ${ctx.year} ${ctx.branding.brandName}. All rights reserved."
251
+ links:
252
+ - label: "Privacy"
253
+ url: "/privacy"
254
+ \`\`\`
255
+
256
+ ## Adding Content
257
+
258
+ ### New Page in Existing Section
259
+
260
+ 1. Create markdown file in the section folder:
261
+ \`\`\`
262
+ content/guides/new-guide.md
263
+ \`\`\`
264
+
265
+ 2. Add frontmatter:
266
+ \`\`\`markdown
267
+ ---
268
+ title: My New Guide
269
+ description: Brief description for SEO
270
+ ---
271
+
272
+ # My New Guide
273
+
274
+ Content here...
275
+ \`\`\`
276
+
277
+ ### New Section
278
+
279
+ 1. Create folder under \`content/\`:
280
+ \`\`\`
281
+ content/tutorials/
282
+ \`\`\`
283
+
284
+ 2. Add section to \`site.yaml\`:
285
+ \`\`\`yaml
286
+ sections:
287
+ - name: "Tutorials"
288
+ path: "content/tutorials"
289
+ \`\`\`
290
+
291
+ 3. Add at least one markdown file in the new section.
292
+
293
+ ## Linking and References
294
+
295
+ ### Internal Links
296
+
297
+ Link to other pages using root-relative paths:
298
+
299
+ \`\`\`markdown
300
+ See the [Getting Started](/content/guides/getting-started) guide.
301
+ \`\`\`
302
+
303
+ ### External Links
304
+
305
+ \`\`\`markdown
306
+ Visit [Kitfly](https://github.com/3leaps/kitfly) for documentation.
307
+ \`\`\`
308
+
309
+ ### Images
310
+
311
+ Place images in \`assets/\` and reference them:
312
+
313
+ \`\`\`markdown
314
+ ![Diagram](/assets/images/architecture.png)
315
+ \`\`\`
316
+
317
+ ## Important Limitations
318
+
319
+ - **Content must be inside this folder** - kitfly cannot include files from outside the site root
320
+ - **External files**: Link via URL rather than copying
321
+ - **Binary files** (PDFs, images): Place in \`assets/\` and link to them
322
+ - **No server-side includes**: This generates static HTML
323
+
324
+ ## Brand Assets
325
+
326
+ | Asset | Location | Recommended Size |
327
+ |-------|----------|------------------|
328
+ | Logo | \`assets/brand/logo.png\` | 200x50px (or SVG) |
329
+ | Favicon | \`assets/brand/favicon.ico\` | 32x32px |
330
+ | Social image | \`assets/brand/social.png\` | 1200x630px |
331
+
332
+ ## Getting Help
333
+
334
+ - [Kitfly Documentation](https://github.com/3leaps/kitfly)
335
+ - [Markdown Guide](https://www.markdownguide.org/)
336
+ `,
337
+ },
338
+ ],
339
+ };
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Minimal Template
3
+ *
4
+ * Base template that all others extend.
5
+ * Creates: site.yaml, index.md, .gitignore, README.md
6
+ */
7
+
8
+ import type { TemplateContext, TemplateDef } from "./schema.ts";
9
+
10
+ export const minimal: TemplateDef = {
11
+ id: "minimal",
12
+ name: "Minimal",
13
+ description: "Bare-bones site with just the essentials",
14
+ version: 1,
15
+ sections: [
16
+ { name: "Content", path: "content", description: "Your documentation content" },
17
+ { name: "Assets", path: "assets/brand", description: "Brand assets (logo, favicon)" },
18
+ ],
19
+ files: [
20
+ {
21
+ path: "site.yaml",
22
+ content: (ctx: TemplateContext) => `# ${ctx.branding.siteName} - Site Configuration
23
+ # Documentation: https://github.com/3leaps/kitfly
24
+
25
+ title: "${ctx.branding.siteName}"
26
+
27
+ # ← CUSTOMIZE: Your brand settings
28
+ brand:
29
+ name: "${ctx.branding.brandName}"
30
+ url: "${ctx.branding.brandUrl}"
31
+ # external: false # Set true if brand URL is external
32
+
33
+ # ← CUSTOMIZE: Define your content sections
34
+ # sections:
35
+ # - name: "Guide"
36
+ # path: "content/guide"
37
+ # - name: "Reference"
38
+ # path: "content/reference"
39
+
40
+ # ← CUSTOMIZE: Set a dedicated home page (optional)
41
+ # home: "index.md"
42
+ `,
43
+ },
44
+ {
45
+ path: "index.md",
46
+ content: (ctx: TemplateContext) => `---
47
+ title: Welcome
48
+ description: ${ctx.branding.siteName} documentation
49
+ ---
50
+
51
+ # Welcome to ${ctx.branding.siteName}
52
+
53
+ This is your documentation site, powered by [Kitfly](https://github.com/3leaps/kitfly).
54
+
55
+ ## Getting Started
56
+
57
+ 1. Edit this file (\`index.md\`) to customize your home page
58
+ 2. Add markdown files to \`content/\` directory
59
+ 3. Configure sections in \`site.yaml\`
60
+ 4. Run \`kitfly dev\` to preview locally
61
+ 5. Run \`kitfly build\` to generate static HTML
62
+
63
+ ## Quick Links
64
+
65
+ - [Kitfly Documentation](https://github.com/3leaps/kitfly)
66
+ - [Markdown Guide](https://www.markdownguide.org/)
67
+ `,
68
+ },
69
+ {
70
+ path: ".gitignore",
71
+ content: () => `# Build output
72
+ dist/
73
+
74
+ # Dependencies (if using kitfly as dependency)
75
+ node_modules/
76
+
77
+ # OS files
78
+ .DS_Store
79
+ Thumbs.db
80
+
81
+ # Editor
82
+ .idea/
83
+ .vscode/
84
+ *.swp
85
+ *~
86
+
87
+ # Logs
88
+ *.log
89
+ `,
90
+ },
91
+ {
92
+ path: "README.md",
93
+ content: (ctx: TemplateContext) => `# ${ctx.branding.siteName}
94
+
95
+ Documentation site built with [Kitfly](https://github.com/3leaps/kitfly).
96
+
97
+ ## Development
98
+
99
+ \`\`\`bash
100
+ # Preview locally with hot reload
101
+ kitfly dev
102
+
103
+ # Build static site
104
+ kitfly build
105
+
106
+ # Create offline bundle
107
+ kitfly bundle
108
+ \`\`\`
109
+
110
+ ## Structure
111
+
112
+ \`\`\`
113
+ ${ctx.name}/
114
+ ├── site.yaml # Site configuration
115
+ ├── index.md # Home page
116
+ ├── content/ # Documentation content
117
+ └── assets/brand/ # Logo, favicon, etc.
118
+ \`\`\`
119
+
120
+ ## Customization
121
+
122
+ - Edit \`site.yaml\` to configure sections and branding
123
+ - Add a \`theme.yaml\` for color/typography customization
124
+ - Replace \`assets/brand/\` files with your logo
125
+
126
+ ---
127
+ © ${ctx.year} ${ctx.branding.brandName}
128
+ `,
129
+ },
130
+ {
131
+ path: "content/.gitkeep",
132
+ content: () => "",
133
+ },
134
+ {
135
+ path: "assets/brand/.gitkeep",
136
+ content: () => "",
137
+ },
138
+ ],
139
+ };