@homepages/template-kit 0.9.0-dev-20260719224319 → 0.9.0

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 (129) hide show
  1. package/CHANGELOG.md +29 -59
  2. package/README.md +14 -4
  3. package/dist/contracts/fill-treatments.d.ts +23 -0
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/islands/discover.js +1 -1
  7. package/dist/islands/esbuild-plugin.js +1 -1
  8. package/dist/islands/wrap.d.ts +9 -1
  9. package/dist/media/resolve-fixture-media.d.ts +22 -0
  10. package/dist/package.js +1 -1
  11. package/dist/schema/resolve-section-ref.d.ts +4 -0
  12. package/dist/schema/rows.d.ts +9 -0
  13. package/dist/schema/section-nav.d.ts +5 -1
  14. package/dist/schema/slot-types.d.ts +1 -1
  15. package/dist/ssr.d.ts +7 -2
  16. package/dist/ssr.js +6 -2
  17. package/guide/INDEX.md +5 -0
  18. package/guide/check.md +1 -0
  19. package/guide/dev.md +1 -0
  20. package/guide/llms.txt +11 -3
  21. package/guide/upgrading.md +12 -8
  22. package/package.json +4 -16
  23. package/dist/canvas-core/chrome-css.d.ts +0 -24
  24. package/dist/canvas-core/chrome-css.js +0 -403
  25. package/dist/canvas-core/chrome.d.ts +0 -49
  26. package/dist/canvas-core/chrome.js +0 -147
  27. package/dist/canvas-core/frame.d.ts +0 -20
  28. package/dist/canvas-core/frame.js +0 -23
  29. package/dist/canvas-core/hidden-tabs.d.ts +0 -16
  30. package/dist/canvas-core/hidden-tabs.js +0 -84
  31. package/dist/canvas-core/resolve-target.js +0 -55
  32. package/dist/canvas-core/scroll.d.ts +0 -10
  33. package/dist/canvas-core/scroll.js +0 -15
  34. package/dist/canvas-core/section-dom.d.ts +0 -6
  35. package/dist/canvas-core/section-dom.js +0 -43
  36. package/dist/canvas-core/srcdoc.d.ts +0 -8
  37. package/dist/canvas-core/srcdoc.js +0 -77
  38. package/dist/canvas-core/types.d.ts +0 -76
  39. package/dist/canvas-core.d.ts +0 -9
  40. package/dist/canvas-core.js +0 -9
  41. package/dist/cli/check/config.js +0 -41
  42. package/dist/cli/check/css.js +0 -131
  43. package/dist/cli/check/diagnostics.js +0 -37
  44. package/dist/cli/check/index.js +0 -94
  45. package/dist/cli/check/loader.js +0 -149
  46. package/dist/cli/check/paths.js +0 -15
  47. package/dist/cli/check/relativize.js +0 -18
  48. package/dist/cli/check/render-invariants.js +0 -24
  49. package/dist/cli/check/resolve-tool.js +0 -38
  50. package/dist/cli/check/section-assets.js +0 -58
  51. package/dist/cli/check/stages/deps.js +0 -337
  52. package/dist/cli/check/stages/lint.js +0 -46
  53. package/dist/cli/check/stages/render.js +0 -98
  54. package/dist/cli/check/stages/size.js +0 -274
  55. package/dist/cli/check/stages/tree.js +0 -206
  56. package/dist/cli/check/stages/typecheck.js +0 -46
  57. package/dist/cli/check/stages/validate/catalog-exhaustiveness.js +0 -18
  58. package/dist/cli/check/stages/validate/facts.js +0 -19
  59. package/dist/cli/check/stages/validate/formatter-contract.js +0 -14
  60. package/dist/cli/check/stages/validate/group-contract.js +0 -21
  61. package/dist/cli/check/stages/validate/index.js +0 -66
  62. package/dist/cli/check/stages/validate/list-scalar-contract.js +0 -22
  63. package/dist/cli/check/stages/validate/nav-contract.js +0 -93
  64. package/dist/cli/check/stages/validate/nested-slot-contract.js +0 -12
  65. package/dist/cli/check/stages/validate/object-list-contract.js +0 -31
  66. package/dist/cli/check/stages/validate/orchestrator.js +0 -241
  67. package/dist/cli/check/stages/validate/produced-by-contract.js +0 -18
  68. package/dist/cli/check/stages/validate/row-contract.js +0 -31
  69. package/dist/cli/check/stages/validate/select-contract.js +0 -13
  70. package/dist/cli/check/stages/validate/source-contract.js +0 -21
  71. package/dist/cli/check/stages/validate/variant-contract.js +0 -15
  72. package/dist/cli/check/workspace.js +0 -99
  73. package/dist/cli/dev/build-css.js +0 -97
  74. package/dist/cli/dev/catalog.js +0 -35
  75. package/dist/cli/dev/compose-template.js +0 -39
  76. package/dist/cli/dev/content-override.js +0 -58
  77. package/dist/cli/dev/diagnostics.js +0 -68
  78. package/dist/cli/dev/discover.js +0 -35
  79. package/dist/cli/dev/fill-state.js +0 -77
  80. package/dist/cli/dev/index.js +0 -42
  81. package/dist/cli/dev/inspect.js +0 -38
  82. package/dist/cli/dev/island-bootstrap.js +0 -38
  83. package/dist/cli/dev/island-canvas-bootstrap.js +0 -204
  84. package/dist/cli/dev/island-map.js +0 -35
  85. package/dist/cli/dev/island-transform.js +0 -31
  86. package/dist/cli/dev/manifest-instances.js +0 -31
  87. package/dist/cli/dev/render-section.js +0 -24
  88. package/dist/cli/dev/screenshot-target.js +0 -24
  89. package/dist/cli/dev/section-page.js +0 -91
  90. package/dist/cli/dev/server.js +0 -511
  91. package/dist/cli/dev/slot-schema.js +0 -12
  92. package/dist/cli/dev/structure-summary.js +0 -119
  93. package/dist/cli/dev/tailwind.js +0 -32
  94. package/dist/cli/dev/tsconfig-paths-plugin.js +0 -90
  95. package/dist/cli/dev/vite-server.js +0 -39
  96. package/dist/cli/dev/workspace.js +0 -63
  97. package/dist/cli/link/index.js +0 -74
  98. package/dist/cli/link/overlay.js +0 -59
  99. package/dist/cli/link/watch.js +0 -25
  100. package/dist/cli/new/emit.js +0 -48
  101. package/dist/cli/new/index.js +0 -69
  102. package/dist/cli/new/scaffold/section/_Renderer.tsx +0 -20
  103. package/dist/cli/new/scaffold/section/_fill-spec.ts +0 -18
  104. package/dist/cli/new/scaffold/section/_fixtures.ts +0 -13
  105. package/dist/cli/new/scaffold/section/_schema.ts +0 -24
  106. package/dist/cli/new/scaffold/template/_manifest.json +0 -9
  107. package/dist/cli/new/scaffold/template/sections/hero/ExpandableText.tsx +0 -45
  108. package/dist/cli/new/scaffold/template/sections/hero/Renderer.tsx +0 -40
  109. package/dist/cli/new/scaffold/template/sections/hero/components/Feature.tsx +0 -14
  110. package/dist/cli/new/scaffold/template/sections/hero/fill-spec.ts +0 -29
  111. package/dist/cli/new/scaffold/template/sections/hero/fixtures.ts +0 -41
  112. package/dist/cli/new/scaffold/template/sections/hero/schema.ts +0 -60
  113. package/dist/cli/new/scaffold/template/theme.css +0 -24
  114. package/dist/cli/new/scaffold/template/theme.ts +0 -27
  115. package/dist/cli/new/scaffold-assets.js +0 -20
  116. package/dist/cli/pack/collect.js +0 -44
  117. package/dist/cli/pack/guards.js +0 -57
  118. package/dist/cli/pack/index.js +0 -66
  119. package/dist/cli/pack/manifest.js +0 -15
  120. package/dist/cli/pack/zip.js +0 -86
  121. package/dist/cli/theme/generate.js +0 -43
  122. package/dist/cli/theme/index.js +0 -33
  123. package/dist/cli/theme/load-theme.js +0 -69
  124. package/dist/cli.d.ts +0 -1
  125. package/dist/cli.js +0 -138
  126. package/dist/dev-client/assets/index-CJa9G1Na.css +0 -1
  127. package/dist/dev-client/assets/index-C_1atZs4.js +0 -450
  128. package/dist/dev-client/index.html +0 -13
  129. package/dist/tokens.css +0 -21
package/dist/cli.js DELETED
@@ -1,138 +0,0 @@
1
- #!/usr/bin/env node
2
- import { KIT_VERSION } from "./index.js";
3
- import { runCheck } from "./cli/check/index.js";
4
- import { runDev } from "./cli/dev/index.js";
5
- import { rebuildOverlay, runLinkOnce, runStatus, runUnlink } from "./cli/link/index.js";
6
- import { watchAndRebuild } from "./cli/link/watch.js";
7
- import { runNew, runNewSection } from "./cli/new/index.js";
8
- import { runPack } from "./cli/pack/index.js";
9
- import { runTheme } from "./cli/theme/index.js";
10
-
11
- //#region src/cli/index.ts
12
- /**
13
- * Commands the CLI will grow, declared now so they exit 1 with a real message
14
- * instead of "unknown command". Deliberately carries no issue IDs: this text is
15
- * printed to template authors outside HomePages. The command → issue map is in
16
- * CLAUDE.md, which does not ship in the tarball.
17
- */
18
- const NOT_IMPLEMENTED = /* @__PURE__ */ new Set();
19
- const USAGE = `template-kit ${KIT_VERSION}
20
-
21
- Usage: template-kit <command>
22
-
23
- Commands:
24
- dev Start the local preview server
25
- check Typecheck, lint, and validate a template
26
- new Add a template to the workspace
27
- new-section Add a section to a template
28
- theme Generate a template's theme CSS from its theme.ts
29
- pack Build a template's submission zip
30
- link Overlay a local kit build into a consumer (kit devs)
31
- unlink Restore the registry install (kit devs)
32
- status Show overlay state (kit devs)
33
-
34
- Options:
35
- -v, --version Print the kit version
36
- -h, --help Print this message
37
- `;
38
- async function main(argv) {
39
- const cmd = argv[0];
40
- if (cmd === "--version" || cmd === "-v") {
41
- process.stdout.write(`${KIT_VERSION}\n`);
42
- return 0;
43
- }
44
- if (cmd === void 0 || cmd === "--help" || cmd === "-h") {
45
- process.stdout.write(USAGE);
46
- return 0;
47
- }
48
- if (cmd === "check") try {
49
- const { code, output } = await runCheck(argv.slice(1), process.cwd());
50
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
51
- return code;
52
- } catch (cause) {
53
- process.stderr.write(`template-kit check: ${cause instanceof Error ? cause.message : String(cause)}\n`);
54
- return 1;
55
- }
56
- if (cmd === "dev") try {
57
- return await runDev(argv.slice(1), process.cwd());
58
- } catch (cause) {
59
- process.stderr.write(`template-kit dev: ${cause instanceof Error ? cause.message : String(cause)}\n`);
60
- return 1;
61
- }
62
- if (cmd === "theme") try {
63
- const { code, output } = await runTheme(argv.slice(1), process.cwd());
64
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
65
- return code;
66
- } catch (cause) {
67
- process.stderr.write(`template-kit theme: ${cause instanceof Error ? cause.message : String(cause)}\n`);
68
- return 1;
69
- }
70
- if (cmd === "pack") try {
71
- const { code, output } = await runPack(argv.slice(1), process.cwd());
72
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
73
- return code;
74
- } catch (cause) {
75
- process.stderr.write(`template-kit pack: ${cause instanceof Error ? cause.message : String(cause)}\n`);
76
- return 1;
77
- }
78
- if (cmd === "status" || cmd === "unlink") {
79
- const run = cmd === "status" ? runStatus : runUnlink;
80
- try {
81
- const { code, output } = await run(argv.slice(1), process.cwd());
82
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
83
- return code;
84
- } catch (cause) {
85
- process.stderr.write(`template-kit ${cmd}: ${cause instanceof Error ? cause.message : String(cause)}\n`);
86
- return 1;
87
- }
88
- }
89
- if (cmd === "link") try {
90
- const result = await runLinkOnce(argv.slice(1), process.cwd());
91
- process.stdout.write(`${result.output}\n`);
92
- const { kitSrcDir, kitRoot, workspaceRoot } = result.watch;
93
- process.stdout.write(" watching for kit changes — Ctrl-C to stop\n");
94
- let watchFailed = false;
95
- await new Promise((resolvePromise) => {
96
- const stop = watchAndRebuild(kitSrcDir, () => {
97
- rebuildOverlay(kitRoot, workspaceRoot).then(() => process.stdout.write(" rebuilt + recopied\n"), (err) => process.stderr.write(` rebuild failed: ${err instanceof Error ? err.message : String(err)}\n`));
98
- }, (err) => {
99
- watchFailed = true;
100
- process.stderr.write(` watch error — stopping: ${err instanceof Error ? err.message : String(err)}\n`);
101
- resolvePromise();
102
- });
103
- process.on("SIGINT", () => {
104
- stop();
105
- resolvePromise();
106
- });
107
- });
108
- return watchFailed ? 1 : 0;
109
- } catch (cause) {
110
- process.stderr.write(`template-kit link: ${cause instanceof Error ? cause.message : String(cause)}\n`);
111
- return 1;
112
- }
113
- if (cmd === "new") try {
114
- const { code, output } = await runNew(argv.slice(1), process.cwd());
115
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
116
- return code;
117
- } catch (cause) {
118
- process.stderr.write(`template-kit new: ${cause instanceof Error ? cause.message : String(cause)}\n`);
119
- return 1;
120
- }
121
- if (cmd === "new-section") try {
122
- const { code, output } = await runNewSection(argv.slice(1), process.cwd());
123
- process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
124
- return code;
125
- } catch (cause) {
126
- process.stderr.write(`template-kit new-section: ${cause instanceof Error ? cause.message : String(cause)}\n`);
127
- return 1;
128
- }
129
- if (NOT_IMPLEMENTED.has(cmd)) {
130
- process.stderr.write(`template-kit ${cmd}: not implemented yet.\nThis 0.0.x release ships the package skeleton only.\n`);
131
- return 1;
132
- }
133
- process.stderr.write(`template-kit: unknown command '${cmd}'\n\n${USAGE}`);
134
- return 1;
135
- }
136
- process.exit(await main(process.argv.slice(2)));
137
-
138
- //#endregion
@@ -1 +0,0 @@
1
- @theme inline{ --color-canvas: #ffffff; --color-line: #ebebe6; }:root{--frame: clamp(1px, calc(1px + (100vw - 1536px) * .0006076), 1.41667px);--content-follow: .25;--content: calc(1px + (var(--frame) - 1px) * var(--content-follow))}*{box-sizing:border-box}html,body,#root{margin:0;padding:0;height:100%;background:#0f1115;color:#e6e7eb;font:14px/1.5 ui-sans-serif,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif}a{color:inherit;text-decoration:none}button,select,input,textarea{font:inherit;color:inherit;background:#1a1d24;border:1px solid #2c313a;border-radius:4px;padding:6px 10px}button{cursor:pointer}button:hover{background:#232831}button:disabled{opacity:.4;cursor:default}.empty{padding:40px;color:#9ca0a8;text-align:center}.boot-error{padding:24px;color:#ff8b8b;font:13px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap}.canvas-mirror{display:flex;flex-direction:column;height:100%;min-height:0}.canvas-iframe{width:100%;height:100%;border:0;background:#fff}.home{max-width:880px;margin:0 auto;padding:40px 24px}.home-header{margin-bottom:28px}.home-title{font-size:15px;font-weight:600}.home-tagline{font-size:13px;color:#9ca0a8;margin-top:4px}.home-template{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:#9ca0a8;margin-bottom:24px}.home-template select{min-width:160px}.home-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tool-card{display:flex;flex-direction:column;gap:12px;background:#14171c;border:1px solid #21252d;border-radius:8px;padding:20px}.tool-card h2{font-size:14px;font-weight:600;margin:0}.tool-card p{font-size:13px;color:#9ca0a8;margin:0;line-height:1.5}.tool-card .controls{display:flex;flex-direction:column;gap:8px}.tool-card label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:#9ca0a8}.tool-card label select{min-width:140px}.open-btn{margin-top:auto;text-align:center;padding:8px 12px;border:1px solid #2c313a;border-radius:6px;background:#1a1d24;color:inherit;cursor:pointer}.open-btn:hover{background:#232831}.open-btn:disabled{opacity:.4;cursor:default}.home-hint{font-size:12px;color:#6b7280}.canvas-mirror__stage{position:relative;min-height:0;flex:1;overflow:hidden}.canvas-mirror__stage .canvas-iframe{position:absolute;top:0;right:0;bottom:0;left:0}.canvas-mirror__sidebar{position:absolute;top:20px;right:20px;bottom:20px;z-index:20;width:calc(400 * var(--frame));display:flex;flex-direction:column;min-height:0}@media(max-width:1100px){.canvas-mirror__sidebar{width:388px}}.instance-panel{flex:1 1 auto;min-height:0;overflow-y:auto;border-left:1px solid #e5e7eb;padding:12px;background:#fff;font:13px system-ui,sans-serif;display:flex;flex-direction:column;gap:10px}.instance-panel__head{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;padding-bottom:10px;border-bottom:1px solid #e5e7eb}.instance-panel__slot{display:flex;align-items:center;gap:8px}.instance-panel__type{color:#6b7280}.instance-panel__fill{margin-left:auto;padding:1px 7px;border-radius:999px;font-size:11px}.instance-panel__fill--filled{background:#dcfce7;color:#166534}.instance-panel__fill--empty{background:#f3f4f6;color:#6b7280}.instance-panel__fill--missing{background:#fee2e2;color:#991b1b}.instance-panel__fixture{display:flex;flex-direction:column;gap:3px;color:#6b7280}.instance-panel__json{width:100%;min-height:180px;font:12px ui-monospace,monospace;resize:vertical}.instance-panel__error{color:#b91c1c;white-space:pre-wrap}.instance-panel__actions{display:flex;gap:8px}.instance-panel__slot-editor{display:flex;flex-direction:column;gap:8px;padding:10px 0;border-top:1px solid #f0f1f3}.instance-panel__slot-editor:first-of-type{border-top:0;padding-top:0}.instance-panel__slot-editor--selected{border-left:3px solid #b8860b;padding-left:9px;margin-left:-12px}