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,210 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kitfly.app/schemas/v0/theme.schema.json",
4
+ "$version": "0.1.0",
5
+ "title": "Kitfly Theme Configuration",
6
+ "description": "Color palette, typography, and code highlighting theme for kitfly sites",
7
+ "type": "object",
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "Schema reference for validation"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "description": "Theme name for identification",
16
+ "maxLength": 50,
17
+ "examples": ["Kitfly Default", "GitHub", "Paper"]
18
+ },
19
+ "layout": {
20
+ "type": "object",
21
+ "description": "Layout dimensions and spacing",
22
+ "properties": {
23
+ "sidebarWidth": {
24
+ "type": "string",
25
+ "description": "Sidebar width (CSS length value)",
26
+ "pattern": "^[0-9]+(px|rem|em|%)$",
27
+ "default": "280px",
28
+ "examples": ["280px", "320px", "18rem"]
29
+ }
30
+ },
31
+ "additionalProperties": false
32
+ },
33
+ "colors": {
34
+ "type": "object",
35
+ "description": "Color palettes for light and dark modes",
36
+ "required": ["light", "dark"],
37
+ "properties": {
38
+ "light": { "$ref": "#/$defs/colorPalette" },
39
+ "dark": { "$ref": "#/$defs/colorPalette" }
40
+ },
41
+ "additionalProperties": false
42
+ },
43
+ "code": {
44
+ "type": "object",
45
+ "description": "Prism.js syntax highlighting themes",
46
+ "properties": {
47
+ "light": {
48
+ "type": "string",
49
+ "description": "Prism theme for light mode",
50
+ "enum": ["default", "coy", "solarized-light", "tomorrow"],
51
+ "default": "default"
52
+ },
53
+ "dark": {
54
+ "type": "string",
55
+ "description": "Prism theme for dark mode",
56
+ "enum": ["okaidia", "tomorrow-night", "nord", "dracula", "one-dark", "synthwave84"],
57
+ "default": "okaidia"
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ },
62
+ "typography": {
63
+ "type": "object",
64
+ "description": "Font settings using system font stacks (no downloads)",
65
+ "properties": {
66
+ "body": {
67
+ "type": "string",
68
+ "description": "Font preset for body text",
69
+ "enum": ["system", "mono", "serif", "readable"],
70
+ "default": "system"
71
+ },
72
+ "headings": {
73
+ "type": "string",
74
+ "description": "Font preset for headings",
75
+ "enum": ["system", "mono", "serif", "readable"],
76
+ "default": "system"
77
+ },
78
+ "code": {
79
+ "type": "string",
80
+ "description": "Font preset for code blocks",
81
+ "enum": ["mono"],
82
+ "default": "mono"
83
+ },
84
+ "baseSize": {
85
+ "type": "string",
86
+ "description": "Base font size",
87
+ "pattern": "^[0-9]+(px|rem|em)$",
88
+ "default": "16px",
89
+ "examples": ["16px", "17px", "1rem"]
90
+ },
91
+ "scale": {
92
+ "type": "string",
93
+ "description": "Type scale ratio for heading sizes",
94
+ "enum": ["1.125", "1.2", "1.25", "1.333", "1.5"],
95
+ "default": "1.25"
96
+ }
97
+ },
98
+ "additionalProperties": false
99
+ }
100
+ },
101
+ "additionalProperties": false,
102
+ "$defs": {
103
+ "colorPalette": {
104
+ "type": "object",
105
+ "description": "Color palette for a single mode (light or dark)",
106
+ "required": ["background", "surface", "text", "heading", "primary", "border"],
107
+ "properties": {
108
+ "background": {
109
+ "type": "string",
110
+ "description": "Page background color",
111
+ "pattern": "^#[0-9a-fA-F]{6}$",
112
+ "examples": ["#ffffff", "#0f1e2b"]
113
+ },
114
+ "surface": {
115
+ "type": "string",
116
+ "description": "Elevated surface color (cards, code blocks)",
117
+ "pattern": "^#[0-9a-fA-F]{6}$",
118
+ "examples": ["#f5f7f8", "#152F46"]
119
+ },
120
+ "text": {
121
+ "type": "string",
122
+ "description": "Primary body text color",
123
+ "pattern": "^#[0-9a-fA-F]{6}$",
124
+ "examples": ["#374151", "#e5e7eb"]
125
+ },
126
+ "textMuted": {
127
+ "type": "string",
128
+ "description": "Secondary/muted text color",
129
+ "pattern": "^#[0-9a-fA-F]{6}$",
130
+ "examples": ["#6b7280", "#9ca3af"]
131
+ },
132
+ "heading": {
133
+ "type": "string",
134
+ "description": "Heading text color",
135
+ "pattern": "^#[0-9a-fA-F]{6}$",
136
+ "examples": ["#152F46", "#f9fafb"]
137
+ },
138
+ "primary": {
139
+ "type": "string",
140
+ "description": "Primary accent color (links, buttons)",
141
+ "pattern": "^#[0-9a-fA-F]{6}$",
142
+ "examples": ["#007182", "#4db8c7"]
143
+ },
144
+ "primaryHover": {
145
+ "type": "string",
146
+ "description": "Primary color hover state",
147
+ "pattern": "^#[0-9a-fA-F]{6}$",
148
+ "examples": ["#005c6a", "#6cc9d6"]
149
+ },
150
+ "accent": {
151
+ "type": "string",
152
+ "description": "Secondary accent color (highlights, CTAs)",
153
+ "pattern": "^#[0-9a-fA-F]{6}$",
154
+ "examples": ["#D17059", "#e8947f"]
155
+ },
156
+ "border": {
157
+ "type": "string",
158
+ "description": "Border and divider color",
159
+ "pattern": "^#[0-9a-fA-F]{6}$",
160
+ "examples": ["#e5e7eb", "#374151"]
161
+ }
162
+ },
163
+ "additionalProperties": false
164
+ }
165
+ },
166
+ "examples": [
167
+ {
168
+ "$schema": "./schemas/v0/theme.schema.json",
169
+ "name": "Kitfly Default",
170
+ "layout": {
171
+ "sidebarWidth": "280px"
172
+ },
173
+ "colors": {
174
+ "light": {
175
+ "background": "#ffffff",
176
+ "surface": "#f5f7f8",
177
+ "text": "#374151",
178
+ "textMuted": "#6b7280",
179
+ "heading": "#152F46",
180
+ "primary": "#007182",
181
+ "primaryHover": "#0a6172",
182
+ "accent": "#D17059",
183
+ "border": "#e5e7eb"
184
+ },
185
+ "dark": {
186
+ "background": "#0f1e2b",
187
+ "surface": "#152F46",
188
+ "text": "#e5e7eb",
189
+ "textMuted": "#9ca3af",
190
+ "heading": "#f9fafb",
191
+ "primary": "#709EA6",
192
+ "primaryHover": "#8fb5bc",
193
+ "accent": "#e8947f",
194
+ "border": "#374151"
195
+ }
196
+ },
197
+ "code": {
198
+ "light": "default",
199
+ "dark": "okaidia"
200
+ },
201
+ "typography": {
202
+ "body": "system",
203
+ "headings": "system",
204
+ "code": "mono",
205
+ "baseSize": "16px",
206
+ "scale": "1.25"
207
+ }
208
+ }
209
+ ]
210
+ }
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env bun
2
+
3
+ /**
4
+ * Cross-platform binary builder using `bun build --compile`.
5
+ *
6
+ * Builds standalone kitfly binaries for all supported platforms.
7
+ * Each binary embeds the Bun runtime (~50-90 MB).
8
+ *
9
+ * Usage:
10
+ * bun scripts/build-all.ts
11
+ */
12
+
13
+ import { execSync } from "node:child_process";
14
+ import { existsSync, mkdirSync, readFileSync, statSync } from "node:fs";
15
+ import { join } from "node:path";
16
+
17
+ interface BuildTarget {
18
+ os: string;
19
+ arch: string;
20
+ bunTarget: string;
21
+ suffix: string;
22
+ }
23
+
24
+ const TARGETS: BuildTarget[] = [
25
+ {
26
+ os: "linux",
27
+ arch: "amd64",
28
+ bunTarget: "bun-linux-x64",
29
+ suffix: "linux-amd64",
30
+ },
31
+ {
32
+ os: "linux",
33
+ arch: "arm64",
34
+ bunTarget: "bun-linux-arm64",
35
+ suffix: "linux-arm64",
36
+ },
37
+ {
38
+ os: "darwin",
39
+ arch: "arm64",
40
+ bunTarget: "bun-darwin-arm64",
41
+ suffix: "darwin-arm64",
42
+ },
43
+ {
44
+ os: "windows",
45
+ arch: "amd64",
46
+ bunTarget: "bun-windows-x64",
47
+ suffix: "windows-amd64",
48
+ },
49
+ // windows-arm64: Bun cannot cross-compile to bun-windows-aarch64 from Linux.
50
+ // Built natively via release-windows-arm64.yml on a windows-arm64 runner.
51
+ ];
52
+
53
+ const BINARY_NAME = "kitfly";
54
+ const ENTRY_POINT = "src/cli.ts";
55
+ const OUT_DIR = "dist/release";
56
+
57
+ function formatSize(bytes: number): string {
58
+ const mb = bytes / (1024 * 1024);
59
+ return `${mb.toFixed(1)} MB`;
60
+ }
61
+
62
+ function getVersion(): string {
63
+ try {
64
+ return readFileSync("VERSION", "utf-8").trim();
65
+ } catch {
66
+ return "0.0.0";
67
+ }
68
+ }
69
+
70
+ function main(): void {
71
+ const version = getVersion();
72
+
73
+ console.log(`Building ${TARGETS.length} binaries for '${BINARY_NAME}' v${version}`);
74
+ console.log(` Entry point: ${ENTRY_POINT}`);
75
+ console.log(` Output dir: ${OUT_DIR}`);
76
+ console.log();
77
+
78
+ if (!existsSync(ENTRY_POINT)) {
79
+ console.error(`Error: entry point ${ENTRY_POINT} not found`);
80
+ process.exit(1);
81
+ }
82
+
83
+ mkdirSync(OUT_DIR, { recursive: true });
84
+
85
+ let succeeded = 0;
86
+ let failed = 0;
87
+
88
+ for (const target of TARGETS) {
89
+ const ext = target.os === "windows" ? ".exe" : "";
90
+ const binaryFile = `${BINARY_NAME}-${target.suffix}${ext}`;
91
+ const outfile = join(OUT_DIR, binaryFile);
92
+ const define = `--define __KITFLY_VERSION__='"${version}"'`;
93
+ const cmd = `bun build ${ENTRY_POINT} --compile --target=${target.bunTarget} ${define} --outfile ${outfile}`;
94
+
95
+ process.stdout.write(` ${target.os}/${target.arch} -> ${binaryFile} ... `);
96
+
97
+ try {
98
+ execSync(cmd, { stdio: "pipe" });
99
+ const size = formatSize(statSync(outfile).size);
100
+ console.log(`ok (${size})`);
101
+ succeeded++;
102
+ } catch (err: unknown) {
103
+ console.log("FAILED");
104
+ const msg =
105
+ err instanceof Error
106
+ ? (err as { stderr?: Buffer }).stderr?.toString().trim() || err.message
107
+ : String(err);
108
+ console.error(` ${msg}`);
109
+ failed++;
110
+ }
111
+ }
112
+
113
+ console.log();
114
+ console.log(`Done: ${succeeded} succeeded, ${failed} failed`);
115
+
116
+ if (failed > 0) {
117
+ process.exit(1);
118
+ }
119
+ }
120
+
121
+ main();