@spunto/brand-kit 0.16.0 → 0.17.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.
package/README.md CHANGED
@@ -5,7 +5,32 @@ colours it wears (the design system's `data-product` tokens are generated from t
5
5
  may quote (each with its source), **every product's home page as data**, 3D modules, illustrations,
6
6
  heroes, and the templates — social cards, video scenes, stories — that **Brand Studio** fills in.
7
7
 
8
- ## A product's home page, imported
8
+ ## A product's home page, in its own repository
9
+
10
+ The way forward: a product's home lives **in its own repository**, where it is changed without a release of
11
+ the kit. The site copies an edition of the kit (they are examples), keeps it as typed data next to its pages,
12
+ and draws it with the kit's sections — figures written whole, with their source:
13
+
14
+ ```tsx
15
+ import { HomeEditionView, checkEdition, type HomeEdition } from "@spunto/brand-kit/home"
16
+
17
+ export const HOME: HomeEdition = {
18
+ id: "console-home", name: "Home", note: "…", product: "console", date: "2026-12-04",
19
+ sections: [
20
+ { id: "hero", kind: "hero", layout: "split", theme: "night", title: { en: "…", fr: "…" }, scene: { module: "fleet" } },
21
+ { id: "measured", kind: "facts", theme: "paper",
22
+ facts: [{ id: "switch", value: { en: "0 / 8,261", fr: "0 / 8 261" }, label: { en: "…", fr: "…" }, source: "README.md" }] },
23
+ ],
24
+ }
25
+
26
+ <HomeEditionView edition={HOME} locale="fr" slots={{ signup: { label: "…", href: "/login" } }} />
27
+ ```
28
+
29
+ `checkEdition(HOME)` in the site's tests keeps it honest (both languages, sources, real modules).
30
+ `OWN_HOME` (`src/home/editions.ts`) lists the products that have taken their home back — Spunto Cloud's
31
+ console, in `spuntodotnet/cloud`, since 0.17.0.
32
+
33
+ ## A product's home page, imported (the old way)
9
34
 
10
35
  Each product's landing page is composed in the kit (an *edition*: sections, words in both languages,
11
36
  figures quoted from sourced facts) and published by one line (`PUBLISHED` in `src/home/editions.ts`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spunto/brand-kit",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Spunto's brand kit — the centre of the brand: the product family and its paints (the colours the design system renders), the voice, the sourced figures, the home editions, the illustrations and the templates (social cards, video scenes, stories) everything we say about Spunto is made from.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/home/check.ts CHANGED
@@ -86,7 +86,16 @@ export function checkEdition(e: HomeEdition): EditionIssue[] {
86
86
  case "facts":
87
87
  words("title", s.title)
88
88
  if (!s.facts.length) err("no facts", s.id)
89
- for (const f of s.facts) if (!FACT_BY_ID[f]) err(`unknown fact "${f}" — a figure is quoted from FACTS, never typed`, s.id)
89
+ for (const f of s.facts) {
90
+ if (typeof f === "string") {
91
+ if (!FACT_BY_ID[f]) err(`unknown fact "${f}" — quote one of the kit's facts, or write it whole (value, label, source)`, s.id)
92
+ continue
93
+ }
94
+ if (!f.id?.trim()) err("a fact written in the edition needs an id", s.id)
95
+ words(`fact "${f.id}" value`, f.value, true)
96
+ words(`fact "${f.id}" label`, f.label, true)
97
+ if (!f.source?.trim()) err(`fact "${f.id}" has no source — every figure says where it comes from`, s.id)
98
+ }
90
99
  break
91
100
  case "ways":
92
101
  words("title", s.title)
@@ -50,12 +50,19 @@ export const PUBLISHED: Record<BrandProductId, string | null> = {
50
50
  agents: "agents-2026-11-fil",
51
51
  traces: "traces-2026-12-cascade",
52
52
  boiler: "boiler-2026-12-chaudiere",
53
- console: "console-2026-12-gres",
53
+ console: null,
54
54
  search: null,
55
55
  ds: null,
56
56
  foyer: "foyer-2026-11-tablee",
57
57
  }
58
58
 
59
+ /** The products whose site keeps its home in its own repository, and where — the kit's editions are only
60
+ examples for them (a site copies one, then changes it there, without a release of the kit). The direction for
61
+ every product: composing a product's home here and publishing it from the kit is on its way out. */
62
+ export const OWN_HOME: Partial<Record<BrandProductId, { repo: string; file: string }>> = {
63
+ console: { repo: "spuntodotnet/cloud", file: "site/src/home.ts" },
64
+ }
65
+
59
66
  /** What spunto.net's `/` serves (`PUBLISHED.cloud`). */
60
67
  export const PUBLISHED_HOME: string | null = PUBLISHED.cloud
61
68
 
package/src/home/home.tsx CHANGED
@@ -142,11 +142,11 @@ function SectionView({ section, ctx, path: p }: { section: HomeSection; ctx: Ctx
142
142
  <Band s={s} id={section.id}>
143
143
  {section.title && <H2 s={s} title={ctx.t(section.title, `${p}.title`, s.accent)} />}
144
144
  <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(210px, 1fr))", marginTop: section.title ? 48 : 0, borderTop: `1px solid ${s.line}` }}>
145
- {section.facts.map((id) => {
146
- const f = FACT_BY_ID[id]
145
+ {section.facts.map((ref) => {
146
+ const f = typeof ref === "string" ? FACT_BY_ID[ref] : ref
147
147
  if (!f) return null
148
148
  return (
149
- <div key={id} style={{ padding: "28px 24px 28px 0", borderBottom: `1px solid ${s.line}` }}>
149
+ <div key={f.id} style={{ padding: "28px 24px 28px 0", borderBottom: `1px solid ${s.line}` }}>
150
150
  <div
151
151
  style={{
152
152
  fontFamily: FONT.display,
package/src/home/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // @spunto/brand-kit/home — the home page as data: editions, their sections, and the view that draws them.
2
2
  export { HomeEditionView, ProductHome } from "./home"
3
3
  export type { HomeEditionViewProps, HomeSlot } from "./home"
4
- export { HOME_EDITIONS, HOME_EDITION_BY_ID, PUBLISHED, PUBLISHED_HOME, publishedHome } from "./editions"
4
+ export { HOME_EDITIONS, HOME_EDITION_BY_ID, OWN_HOME, PUBLISHED, PUBLISHED_HOME, publishedHome } from "./editions"
5
5
  export { checkEdition } from "./check"
6
6
  export type { EditionIssue } from "./check"
7
7
  export type { HomeEdition, HomeSection, HomeSectionKind, HomeAction, MobileEvent, RosterBadge, Words } from "./types"
@@ -3,8 +3,8 @@
3
3
  //
4
4
  // Every figure comes from spuntodotnet/cloud: its README (« Ce qu'on y fait », « Variables ») and docs/ as of
5
5
  // 2026-12-04, the defaults of its code, and — for the CLI and the MCP — spuntodotnet/cloud#46 (docs/agents.md,
6
- // shared/cli/commands.ts). The product's site (a Spunto Boiler app in that repository) imports its published
7
- // edition: `<ProductHome product="console" />` (PUBLISHED in ../editions.ts).
6
+ // shared/cli/commands.ts). The product's site (a Spunto Boiler app in that repository) keeps its home there
7
+ // (OWN_HOME in ../editions.ts: site/src/home.ts), with its own copy of these figures; « Grès » stays here as an example.
8
8
  //
9
9
  // Not claimed: a price (there is none yet: quotas, no billing), more than one machine or region (« Plusieurs
10
10
  // machines » is in « Ce qui vient ensuite »), standalone volumes, a database reachable from outside other than
package/src/home/types.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  import type { BrandProductId } from "../products"
12
12
  import type { BrandTheme, BrandPalette } from "../theme"
13
13
  import type { IllustrationId } from "../illustrations/catalog"
14
- import type { Words } from "../facts"
14
+ import type { Fact, Words } from "../facts"
15
15
  import type { Module3DRef } from "../three/catalog"
16
16
  import type { MarkId } from "../marks"
17
17
  import type { ShowcaseScreenId } from "./showcase/catalog"
@@ -48,8 +48,9 @@ export type HomeSection =
48
48
  | (Base & {
49
49
  kind: "facts"
50
50
  title?: Words
51
- /** Ids of `FACTS` (facts.ts) — a figure is quoted, never typed. */
52
- facts: string[]
51
+ /** Ids of the kit's facts (facts.ts, products/<id>.ts) — or, on a site that keeps its home in its own
52
+ repository, the fact itself: its value, its label and its source, written there. Sourced either way. */
53
+ facts: (string | Fact)[]
53
54
  })
54
55
  | (Base & {
55
56
  kind: "pillars"