kitfly 0.2.1 → 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.
- package/CHANGELOG.md +56 -0
- package/README.md +25 -10
- package/VERSION +1 -1
- package/dist/_raw/content/guide/branding.md +146 -0
- package/dist/_raw/content/guide/data-driven-content.md +204 -0
- package/dist/_raw/content/reference/configuration.md +145 -7
- package/dist/_raw/content/reference/environment-variables.md +26 -1
- package/dist/_raw/content/reference/glossary.md +25 -1
- package/dist/_raw/content/reference/key-concepts.md +30 -2
- package/dist/_raw/content/reference/plugins.md +14 -0
- package/dist/_raw/docs/decisions/ADR-0006-data-driven-content.md +350 -0
- package/dist/content/deployment/preflight.html +10 -6
- package/dist/content/deployment/recipes/aws-s3.html +10 -6
- package/dist/content/deployment/recipes/cloudflare-pages.html +10 -6
- package/dist/content/deployment/recipes/cloudflare-r2.html +10 -6
- package/dist/content/deployment/recipes/fly-io.html +10 -6
- package/dist/content/deployment/recipes/github-pages.html +10 -6
- package/dist/content/deployment/recipes/netlify.html +10 -6
- package/dist/content/deployment/recipes/vercel.html +10 -6
- package/dist/content/deployment/secrets-and-env-vars.html +10 -6
- package/dist/content/deployment.html +10 -6
- package/dist/content/guide/approaches.html +10 -6
- package/dist/content/guide/branding.html +510 -0
- package/dist/content/guide/data-driven-content.html +543 -0
- package/dist/content/guide/features.html +10 -6
- package/dist/content/guide/getting-started.html +10 -6
- package/dist/content/guide/kitfly-overview.html +10 -6
- package/dist/content/reference/configuration.html +135 -9
- package/dist/content/reference/design-catalog.html +10 -6
- package/dist/content/reference/environment-variables.html +50 -8
- package/dist/content/reference/glossary.html +24 -8
- package/dist/content/reference/key-concepts.html +33 -9
- package/dist/content/reference/plugins.html +22 -7
- package/dist/content/reference/slides-authoring-guidelines.html +10 -6
- package/dist/content/reference/structure.html +10 -6
- package/dist/content/reference.html +10 -6
- package/dist/content/templates/crucible.html +10 -6
- package/dist/content/templates/handbook.html +10 -6
- package/dist/content/templates/minimal.html +10 -6
- package/dist/content/templates/overview.html +10 -6
- package/dist/content/templates/pipeline.html +10 -6
- package/dist/content/templates/productbook.html +10 -6
- package/dist/content/templates/runbook.html +10 -6
- package/dist/content/templates/servicebook.html +10 -6
- package/dist/content-index.json +29 -2
- package/dist/docs/decisions/ADR-0001-minimalist-site-code.html +10 -6
- package/dist/docs/decisions/ADR-0002-ai-accessibility.html +10 -6
- package/dist/docs/decisions/ADR-0003-single-file-bundle.html +10 -6
- package/dist/docs/decisions/ADR-0004-bun-runtime.html +10 -6
- package/dist/docs/decisions/ADR-0005-plugin-contract-and-distribution.html +10 -6
- package/dist/docs/decisions/ADR-0006-data-driven-content.html +752 -0
- package/dist/docs/decisions/DDR-0001-viewport-locked-layout.html +10 -6
- package/dist/docs/decisions/DDR-0002-theme-system.html +10 -6
- package/dist/docs/decisions/DDR-0003-bounded-logo-slot.html +10 -6
- package/dist/docs/decisions/DDR-0004-slides-rendering-model.html +10 -6
- package/dist/docs/decisions/DDR-0005-deterministic-layout-boundary.html +10 -6
- package/dist/docs/userguide/cli/build.html +10 -6
- package/dist/docs/userguide/cli/bundle.html +10 -6
- package/dist/docs/userguide/cli/dev.html +10 -6
- package/dist/docs/userguide/cli/init.html +10 -6
- package/dist/docs/userguide/cli/servers.html +10 -6
- package/dist/docs/userguide/cli/stop.html +10 -6
- package/dist/docs/userguide/cli/update.html +10 -6
- package/dist/docs/userguide/cli/version.html +10 -6
- package/dist/docs/userguide/cli.html +10 -6
- package/dist/docs/userguide/sharing.html +10 -6
- package/dist/index.html +10 -6
- package/dist/llms.txt +3 -3
- package/dist/provenance.json +4 -4
- package/dist/schemas/plugin-registry.schema.html +10 -6
- package/dist/schemas/plugin-schemas-notes.html +10 -6
- package/dist/schemas/plugin.schema.html +10 -6
- package/dist/schemas/plugins.schema.html +10 -6
- package/dist/schemas/v0/common.schema.html +14 -10
- package/dist/schemas/v0/plugin-registry.schema.html +13 -9
- package/dist/schemas/v0/plugin.schema.html +13 -9
- package/dist/schemas/v0/plugins.schema.html +13 -9
- package/dist/schemas/v0/site.schema.html +67 -7
- package/dist/schemas/v0/theme.schema.html +21 -17
- package/dist/schemas.html +10 -6
- package/dist/styles.css +39 -4
- package/package.json +1 -1
- package/plugins-dist/latex-runtime.js +140 -0
- package/plugins-dist/latex.js +178 -0
- package/plugins-dist/slides-charts-lite-runtime.js +179 -0
- package/plugins-dist/slides-charts-lite.js +198 -0
- package/registry/plugins.yaml +25 -0
- package/schemas/v0/site.schema.json +56 -0
- package/scripts/build.ts +191 -69
- package/scripts/bundle.ts +118 -10
- package/scripts/dev.ts +245 -166
- package/src/__tests__/brief.test.ts +151 -0
- package/src/__tests__/build.test.ts +169 -1
- package/src/__tests__/bundle.test.ts +134 -0
- package/src/__tests__/init.test.ts +51 -2
- package/src/__tests__/latex-runtime.bun.test.ts +35 -0
- package/src/__tests__/shared.test.ts +598 -1
- package/src/__tests__/slides-charts-lite-runtime.bun.test.ts +45 -0
- package/src/cli.ts +11 -4
- package/src/commands/init.ts +1 -1
- package/src/shared.ts +725 -18
- package/src/site/styles.css +39 -4
- package/src/site/template.html +5 -2
- package/src/templates/brief.ts +486 -0
- package/src/templates/deck.ts +59 -0
- package/src/templates/driver.ts +46 -13
- package/src/templates/handbook.ts +32 -0
- 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
|
+
});
|
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
|
|
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
|
|