kitfly 0.2.0 → 0.2.3

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 (126) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +25 -10
  3. package/VERSION +1 -1
  4. package/dist/_raw/content/guide/branding.md +146 -0
  5. package/dist/_raw/content/guide/data-driven-content.md +204 -0
  6. package/dist/_raw/content/reference/configuration.md +145 -7
  7. package/dist/_raw/content/reference/environment-variables.md +26 -1
  8. package/dist/_raw/content/reference/glossary.md +25 -1
  9. package/dist/_raw/content/reference/key-concepts.md +30 -2
  10. package/dist/_raw/content/reference/plugins.md +14 -0
  11. package/dist/_raw/content/reference/slides-authoring-guidelines.md +129 -0
  12. package/dist/_raw/content/reference.md +1 -0
  13. package/dist/_raw/docs/decisions/ADR-0006-data-driven-content.md +350 -0
  14. package/dist/content/deployment/preflight.html +10 -6
  15. package/dist/content/deployment/recipes/aws-s3.html +10 -6
  16. package/dist/content/deployment/recipes/cloudflare-pages.html +10 -6
  17. package/dist/content/deployment/recipes/cloudflare-r2.html +10 -6
  18. package/dist/content/deployment/recipes/fly-io.html +10 -6
  19. package/dist/content/deployment/recipes/github-pages.html +10 -6
  20. package/dist/content/deployment/recipes/netlify.html +10 -6
  21. package/dist/content/deployment/recipes/vercel.html +10 -6
  22. package/dist/content/deployment/secrets-and-env-vars.html +10 -6
  23. package/dist/content/deployment.html +10 -6
  24. package/dist/content/guide/approaches.html +10 -6
  25. package/dist/content/guide/branding.html +510 -0
  26. package/dist/content/guide/data-driven-content.html +543 -0
  27. package/dist/content/guide/features.html +10 -6
  28. package/dist/content/guide/getting-started.html +10 -6
  29. package/dist/content/guide/kitfly-overview.html +10 -6
  30. package/dist/content/reference/configuration.html +135 -9
  31. package/dist/content/reference/design-catalog.html +10 -6
  32. package/dist/content/reference/environment-variables.html +50 -8
  33. package/dist/content/reference/glossary.html +24 -8
  34. package/dist/content/reference/key-concepts.html +33 -9
  35. package/dist/content/reference/plugins.html +22 -7
  36. package/dist/content/reference/slides-authoring-guidelines.html +422 -0
  37. package/dist/content/reference/structure.html +10 -6
  38. package/dist/content/reference.html +11 -6
  39. package/dist/content/templates/crucible.html +10 -6
  40. package/dist/content/templates/handbook.html +10 -6
  41. package/dist/content/templates/minimal.html +10 -6
  42. package/dist/content/templates/overview.html +10 -6
  43. package/dist/content/templates/pipeline.html +10 -6
  44. package/dist/content/templates/productbook.html +10 -6
  45. package/dist/content/templates/runbook.html +10 -6
  46. package/dist/content/templates/servicebook.html +10 -6
  47. package/dist/content-index.json +38 -2
  48. package/dist/docs/decisions/ADR-0001-minimalist-site-code.html +10 -6
  49. package/dist/docs/decisions/ADR-0002-ai-accessibility.html +10 -6
  50. package/dist/docs/decisions/ADR-0003-single-file-bundle.html +10 -6
  51. package/dist/docs/decisions/ADR-0004-bun-runtime.html +10 -6
  52. package/dist/docs/decisions/ADR-0005-plugin-contract-and-distribution.html +10 -6
  53. package/dist/docs/decisions/ADR-0006-data-driven-content.html +752 -0
  54. package/dist/docs/decisions/DDR-0001-viewport-locked-layout.html +10 -6
  55. package/dist/docs/decisions/DDR-0002-theme-system.html +10 -6
  56. package/dist/docs/decisions/DDR-0003-bounded-logo-slot.html +10 -6
  57. package/dist/docs/decisions/DDR-0004-slides-rendering-model.html +10 -6
  58. package/dist/docs/decisions/DDR-0005-deterministic-layout-boundary.html +10 -6
  59. package/dist/docs/userguide/cli/build.html +10 -6
  60. package/dist/docs/userguide/cli/bundle.html +10 -6
  61. package/dist/docs/userguide/cli/dev.html +10 -6
  62. package/dist/docs/userguide/cli/init.html +10 -6
  63. package/dist/docs/userguide/cli/servers.html +10 -6
  64. package/dist/docs/userguide/cli/stop.html +10 -6
  65. package/dist/docs/userguide/cli/update.html +10 -6
  66. package/dist/docs/userguide/cli/version.html +10 -6
  67. package/dist/docs/userguide/cli.html +10 -6
  68. package/dist/docs/userguide/sharing.html +10 -6
  69. package/dist/index.html +10 -6
  70. package/dist/llms.txt +3 -3
  71. package/dist/provenance.json +4 -4
  72. package/dist/schemas/plugin-registry.schema.html +10 -6
  73. package/dist/schemas/plugin-schemas-notes.html +10 -6
  74. package/dist/schemas/plugin.schema.html +10 -6
  75. package/dist/schemas/plugins.schema.html +10 -6
  76. package/dist/schemas/v0/common.schema.html +14 -10
  77. package/dist/schemas/v0/plugin-registry.schema.html +13 -9
  78. package/dist/schemas/v0/plugin.schema.html +13 -9
  79. package/dist/schemas/v0/plugins.schema.html +13 -9
  80. package/dist/schemas/v0/site.schema.html +67 -7
  81. package/dist/schemas/v0/theme.schema.html +21 -17
  82. package/dist/schemas.html +10 -6
  83. package/dist/styles.css +39 -4
  84. package/package.json +1 -1
  85. package/plugins-dist/latex-runtime.js +140 -0
  86. package/plugins-dist/latex.js +178 -0
  87. package/plugins-dist/slides-charts-lite-runtime.js +179 -0
  88. package/plugins-dist/slides-charts-lite.js +198 -0
  89. package/plugins-dist/slides-visuals.css +166 -0
  90. package/plugins-dist/slides-visuals.js +124 -33
  91. package/registry/plugins.yaml +30 -5
  92. package/schemas/v0/site.schema.json +56 -0
  93. package/scripts/build.ts +195 -70
  94. package/scripts/bundle.ts +122 -11
  95. package/scripts/dev.ts +345 -178
  96. package/src/__tests__/brief.test.ts +151 -0
  97. package/src/__tests__/build.test.ts +234 -4
  98. package/src/__tests__/bundle.test.ts +134 -0
  99. package/src/__tests__/dev-plugin-errors.test.ts +20 -0
  100. package/src/__tests__/fixtures/fences/slides-visuals/invalid/flow-branching-no-source.md +5 -0
  101. package/src/__tests__/fixtures/fences/slides-visuals/invalid/flow-converging-no-target.md +6 -0
  102. package/src/__tests__/fixtures/fences/slides-visuals/invalid/staircase-empty-steps.md +3 -0
  103. package/src/__tests__/fixtures/fences/slides-visuals/invalid/timeline-horizontal-no-events.md +2 -0
  104. package/src/__tests__/fixtures/fences/slides-visuals/valid/flow-branching-no-split.md +7 -0
  105. package/src/__tests__/fixtures/fences/slides-visuals/valid/flow-branching.md +8 -0
  106. package/src/__tests__/fixtures/fences/slides-visuals/valid/flow-converging-no-merge.md +7 -0
  107. package/src/__tests__/fixtures/fences/slides-visuals/valid/flow-converging.md +8 -0
  108. package/src/__tests__/fixtures/fences/slides-visuals/valid/staircase-down.md +7 -0
  109. package/src/__tests__/fixtures/fences/slides-visuals/valid/staircase.md +8 -0
  110. package/src/__tests__/fixtures/fences/slides-visuals/valid/timeline-horizontal.md +9 -0
  111. package/src/__tests__/fixtures/fences/slides-visuals/valid/timeline-vertical.md +10 -0
  112. package/src/__tests__/init.test.ts +51 -2
  113. package/src/__tests__/latex-runtime.bun.test.ts +35 -0
  114. package/src/__tests__/shared.test.ts +621 -1
  115. package/src/__tests__/slides-charts-lite-runtime.bun.test.ts +45 -0
  116. package/src/__tests__/slides-visuals-runtime-regressions.bun.test.ts +33 -0
  117. package/src/cli.ts +11 -4
  118. package/src/commands/init.ts +1 -1
  119. package/src/shared.ts +761 -18
  120. package/src/site/styles.css +39 -4
  121. package/src/site/template.html +5 -2
  122. package/src/templates/brief.ts +486 -0
  123. package/src/templates/deck.ts +59 -0
  124. package/src/templates/driver.ts +46 -13
  125. package/src/templates/handbook.ts +32 -0
  126. package/src/templates/runbook.ts +32 -0
@@ -0,0 +1,45 @@
1
+ import { expect, test } from "bun:test";
2
+
3
+ type ChartsLiteHooks = {
4
+ parseSpec: (text: string) => {
5
+ kind: string;
6
+ labels: string[];
7
+ data: number[];
8
+ title: string;
9
+ color: string;
10
+ height: number;
11
+ } | null;
12
+ };
13
+
14
+ async function loadHooks(): Promise<ChartsLiteHooks> {
15
+ // @ts-expect-error JS plugin helper file
16
+ await import("../../plugins-dist/slides-charts-lite-runtime.js");
17
+ const hooks = (globalThis as any).__kitflyChartsLiteTest as ChartsLiteHooks | undefined;
18
+ if (!hooks) throw new Error("slides-charts-lite test hooks not found on globalThis");
19
+ return hooks;
20
+ }
21
+
22
+ test("slides-charts-lite: parses valid chart block", async () => {
23
+ const hooks = await loadHooks();
24
+ const spec = hooks.parseSpec(`kind: bar\nlabels: ["Q1","Q2"]\ndata: [10, 20]\nheight: 400`);
25
+ expect(spec).toEqual({
26
+ kind: "bar",
27
+ labels: ["Q1", "Q2"],
28
+ data: [10, 20],
29
+ title: "",
30
+ color: "primary",
31
+ height: 400,
32
+ });
33
+ });
34
+
35
+ test("slides-charts-lite: rejects mismatched labels/data", async () => {
36
+ const hooks = await loadHooks();
37
+ const spec = hooks.parseSpec(`kind: line\nlabels: ["A","B"]\ndata: [1]`);
38
+ expect(spec).toBeNull();
39
+ });
40
+
41
+ test("slides-charts-lite: rejects unknown kind", async () => {
42
+ const hooks = await loadHooks();
43
+ const spec = hooks.parseSpec(`kind: scatter\nlabels: ["A"]\ndata: [1]`);
44
+ expect(spec).toBeNull();
45
+ });
@@ -112,3 +112,36 @@ test("slides-visuals: rowCells parses JSON array strings", async () => {
112
112
  const hooks = await loadHooks();
113
113
  expect(hooks.rowCells('["A", "B", "C"]')).toEqual(["A", "B", "C"]);
114
114
  });
115
+
116
+ test("slides-visuals: absorbed scalar marker preserves preceding item (flow-converging)", async () => {
117
+ const { parseBodyNodesWithFirstLines } = await loadHooks();
118
+
119
+ const out = parseBodyNodesWithFirstLines(
120
+ ["sources:"],
121
+ [],
122
+ new FakeElement("UL", "", [
123
+ new FakeElement("LI", "Frontend Logs\ntarget: Dashboard"),
124
+ new FakeElement("LI", "API Logs"),
125
+ ]),
126
+ "flow-converging",
127
+ );
128
+
129
+ expect(out.target).toBe("Dashboard");
130
+ expect(out.sources).toEqual(["Frontend Logs", "API Logs"]);
131
+ });
132
+
133
+ test("slides-visuals: parses object list items for timeline events", async () => {
134
+ const { parseBodyNodesWithFirstLines } = await loadHooks();
135
+
136
+ const out = parseBodyNodesWithFirstLines(
137
+ ["events:"],
138
+ [],
139
+ new FakeElement("UL", "", [
140
+ new FakeElement("LI", "label: Kickoff\ndate: Jan 2026"),
141
+ new FakeElement("LI", "label: Alpha"),
142
+ ]),
143
+ "timeline-horizontal",
144
+ );
145
+
146
+ expect(out.events).toEqual([{ label: "Kickoff", date: "Jan 2026" }, { label: "Alpha" }]);
147
+ });
package/src/cli.ts CHANGED
@@ -82,17 +82,20 @@ Usage:
82
82
  Dev options:
83
83
  --port <n> Server port [env: KITFLY_DEV_PORT] (default: 3333)
84
84
  --host <h> Server host [env: KITFLY_DEV_HOST] (default: localhost)
85
+ --profile <p> Active content profile [env: KITFLY_PROFILE]
85
86
  --daemon, -d Run in background, return immediately
86
87
  --json Output JSON (implies --daemon)
87
88
  --no-open Don't open browser
88
89
 
89
90
  Build options:
90
91
  --out <dir> Output directory [env: KITFLY_BUILD_OUT] (default: dist)
92
+ --profile <p> Active content profile [env: KITFLY_PROFILE]
91
93
  --no-raw Don't include raw markdown
92
94
 
93
95
  Bundle options:
94
96
  --out <dir> Output directory [env: KITFLY_BUNDLE_OUT] (default: bundles)
95
97
  --name <file> Bundle filename (default: bundle.html)
98
+ --profile <p> Active content profile [env: KITFLY_PROFILE]
96
99
  --no-raw Don't include raw markdown [env: KITFLY_BUNDLE_RAW]
97
100
 
98
101
  Stop options:
@@ -204,6 +207,7 @@ async function main() {
204
207
  }
205
208
 
206
209
  const host = (flags.host as string) || "localhost";
210
+ const profile = (flags.profile as string | undefined) ?? process.env.KITFLY_PROFILE;
207
211
 
208
212
  // Warn if binding to all interfaces
209
213
  if (host === "0.0.0.0" || host === "::") {
@@ -284,7 +288,8 @@ async function main() {
284
288
  // Build command with shell redirection for logging
285
289
  // Pass --log-format structured so dev.ts enables structured request logging
286
290
  // Use nohup to prevent SIGHUP on terminal close
287
- const shellCmd = `nohup bun run "${devScript}" "${folder}" --port ${port} --host "${host}" --no-open --log-format structured > "${logPath}" 2>&1 &`;
291
+ const profileArg = profile ? ` --profile "${profile}"` : "";
292
+ const shellCmd = `nohup bun run "${devScript}" "${folder}" --port ${port} --host "${host}"${profileArg} --no-open --log-format structured > "${logPath}" 2>&1 &`;
288
293
 
289
294
  const proc = Bun.spawn(["sh", "-c", shellCmd], {
290
295
  cwd: process.cwd(),
@@ -348,7 +353,7 @@ async function main() {
348
353
  } else {
349
354
  // Foreground mode: run directly
350
355
  const { dev } = await import("../scripts/dev.ts");
351
- await dev({ folder, port, host, open });
356
+ await dev({ folder, port, host, open, profile });
352
357
  }
353
358
  break;
354
359
  }
@@ -357,8 +362,9 @@ async function main() {
357
362
  const folder = positional[0] || ".";
358
363
  const out = (flags.out as string) || "dist";
359
364
  const raw = flags.raw !== false; // --no-raw disables raw markdown
365
+ const profile = (flags.profile as string | undefined) ?? process.env.KITFLY_PROFILE;
360
366
  const { build } = await import("../scripts/build.ts");
361
- await build({ folder, out, raw });
367
+ await build({ folder, out, raw, profile });
362
368
  break;
363
369
  }
364
370
 
@@ -367,8 +373,9 @@ async function main() {
367
373
  const out = (flags.out as string) || "bundles";
368
374
  const name = (flags.name as string) || "bundle.html";
369
375
  const raw = flags.raw !== false; // --no-raw disables raw markdown
376
+ const profile = (flags.profile as string | undefined) ?? process.env.KITFLY_PROFILE;
370
377
  const { bundleSite } = await import("../scripts/bundle.ts");
371
- await bundleSite({ folder, out, name, raw });
378
+ await bundleSite({ folder, out, name, raw, profile });
372
379
  break;
373
380
  }
374
381
 
@@ -4,7 +4,7 @@
4
4
  * Usage:
5
5
  * kitfly init <name> [--template <type>] [--no-git]
6
6
  *
7
- * Templates: minimal, handbook (more coming)
7
+ * Templates: minimal, handbook, brief (more coming)
8
8
  */
9
9
 
10
10
  import { readdir, stat } from "node:fs/promises";