7 Commits
Author SHA1 Message Date
CatoandClaude Opus 5 753da7aa6f feat(slug): a slug policy seam — two live sites need different anchors (v0.2.4) (#26)
kivvi publishes `Geschäftsmodell` as `#das-geschaeftsmodell` (ASCII, ä→ae);
evig publishes `Kanäle` as `#ein-eingang-vier-kanäle` (unicode preserved, 8
locales). Both are correct for their site, so neither can be "the" behavior.
evig had to write its own re-slugging pass to get the second, because the
ASCII slugger would have renamed every published non-Latin anchor.

So the default does not move — a regression pin asserts today's outputs
byte-for-byte, including the German ä→ae case — and a policy is now an
option instead:

  parseContentBlocks(body, { slugify: unicodeSlugify })
  extractToc(blocks,   { slugify: unicodeSlugify })

`unicodeSlugify` ships ready-made (lowercase, punctuation stripped, letters
/numbers/marks of any script kept), verified byte-identical to evig's local
pass over all 725 headings in its 101 published post files. Any
`(text: string) => string` works as a third policy; de-duplication and the
`section` fallback are applied on top, so consumers compose rather than
reimplement.

Both callers now derive ids through the one `createSlugger`, deleting
extractToc's duplicate dedup loop: a heading's id and the TOC entry linking
to it are the same anchor and can no longer drift — the exact bug evig's
migration had to work around.

README also corrects two things real adopters hit: the slug policy is
documented with a warning that changing it on a published site renames every
anchor, and `parseFrontmatter` is now plainly described as a `key: value`
scanner rather than a YAML parser — quoted titles containing colons,
booleans, numbers and nesting need gray-matter, which is what kivvi keeps it
for. No YAML parser is being rewritten here.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 10:28:00 +00:00
CatoandClaude Opus 5 1adfef61f6 fix(inline): honor backslash escapes, intraword *, and ***bold italic*** (v0.2.2) (#22)
evig's adoption parity check (old react-markdown output vs bip-kit's typed
blocks) found three classes where the inline scanner silently under-parsed
against standard markdown. Fixed here rather than worked around in every
consumer.

The single-pass "find the next matching delimiter" scanner could not express
any of them, so emphasis now runs as CommonMark does it: tokenize the line
into nodes and unresolved delimiter runs, then resolve the runs in a second
pass (process_emphasis — nearest eligible opener, two delimiters for strong,
one for em, rule of three). Escapes, code spans, links and footnote refs are
settled during tokenization, so a `\*` is inert text that can never open
markup and a code span still takes no escapes at all.

- Backslash escapes: the full CommonMark ASCII punctuation set. `\*x\*` is
  literal, `\\` is one backslash, and a backslash before a non-escapable
  character stays a backslash (`C:\path\to`).
- Intraword emphasis: `*` may open and close intraword (`foo*bar*baz`), `_`
  may not — `snake_case_name` and friends stay literal, pinned by test.
- `***x***`, `___x___`, `**_x_**`, `_**x**_` produce nested strong+em instead
  of a literal run of asterisks.

Zero new dependencies; still a hand-rolled scanner over one line. Unmatched
and dangling delimiters stay literal exactly as before.

ONE existing test pinned the old, non-CommonMark behavior and is updated:
"intraword underscores and asterisks are not emphasis" asserted that
`2*3*4 = 24` stayed literal text. Under CommonMark's flanking rules that is
`2<em>3</em>4 = 24`, which is what react-markdown and every other reader
emits, and what the parity check flagged. The underscore half of that
assertion is untouched and now has more cases around it.

Tests 116 -> 126.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:48:28 +00:00
CatoandClaude Fable 5 7c06cbea7a fix: survive oklch tokens in MermaidBlock, make shiki loading traceable (v0.2.1) (#21)
Two fixes from fleetcrown's adoption of the v0.2 renderer:

- MermaidBlock: resolved CSS-var colors are normalized through a canvas
  round-trip before reaching mermaid, whose color parser rejects
  oklch()/lab() — it threw inside initialize(), BEFORE render()'s .catch(),
  blanking every diagram for consumers with modern-color tokens. An
  initialize() failure now costs the reader the theme, never the diagram.
  Theme detection is tolerant: data-theme attr wins, then a light/dark
  class (next-themes attribute="class", Tailwind .dark), then the OS —
  re-rendering live on all three signals.

- Optional-peer loading is now traceable: setHighlighterLoader(() =>
  import("shiki")) (or a `highlighter` prop on ArticleBody/CodeBlock) puts
  the literal specifier in consumer code, so bundlers resolve it and
  Next.js output tracing copies shiki into output:"standalone" deploys.
  The Function-hidden import stays as the zero-config fallback — a bare
  import("shiki") inside bip-kit breaks every no-shiki consumer build
  (verified empirically against turbopack, Next 16.3.4: "Module not found:
  Can't resolve 'shiki'"). Both paths verified with real consumer builds,
  with and without shiki, turbopack and webpack; the traced standalone
  output contains shiki and the prerendered page carries --shiki vars.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-07 04:30:42 +00:00
CatoandClaude Fable 5 a711d1834e feat: v0.2 — inline model, extended block vocabulary, react reference renderer (#18)
One vocabulary + one reference renderer so every fleet site reads long-form
at the same standard, while typography tokens stay per-site.

Parser (root export, still zero-dep; the v0.1 ten block types unchanged):
- Inline model: parseInline → text/strong/em/code/link/footnoteRef spans;
  every text-bearing block keeps `text` and gains additive `spans`.
- New blocks: h4, hr, figure (caption title), gallery (adjacent images
  merge), callout (GitHub > [!NOTE] syntax, nestable), pullquote (>> with
  — cite), mermaid, chart (tiny declarative spec; malformed specs THROW),
  math ($$), footnote defs, stats fence.
- Headings gain slugified, de-duplicated, umlaut-aware ids (kivvi's scheme).
- parseFrontmatter learns YAML arrays (inline + block lists), still dep-free.
- Helpers: extractToc, readingTime, slugify/createSlugger, parseChartSpec.

Renderer (new bip-kit/react subpath + bip-kit/styles.css):
- ArticleBody: async RSC that pre-awaits shiki/katex, then emits a fully
  synchronous tree (renderToString-safe). Server components for every block;
  client islands: Toc (scroll-spy, hidden under 3 headings), ReadingProgress,
  Lightbox, CopyButton. MermaidBlock on its own bip-kit/react/mermaid subpath
  so the mermaid peer never enters uninterested bundles (components override).
- shiki/katex are optional peers loaded via bundler-invisible dynamic import;
  honest degradation without them (mono <pre>, TeX source with data-math).
- styles.css: complete neutral theme — 70ch measure, real vertical rhythm,
  dark mode via vars only (data-theme wins over prefers-color-scheme),
  mobile-first, print-safe; every color/radius/font is a --bp-* custom
  property (theming contract documented in the README).

CI: ci.yml gains workflow_dispatch (re-arm strand — a GITHUB_TOKEN merge
cannot trigger workflows on its own; threadkit#28 pattern).

96 tests: v0.1 compat goldens (original shapes byte-identical after
stripping additive fields), goldens for every new syntax form and edge case,
renderToString smoke tests for every block type with and without the
optional peers (BIPKIT_DISABLE_PEERS seam), consumer-install pack test now
probing ./react, ./react/mermaid and ./styles.css.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-05 16:03:53 +00:00
GandClaude Opus 5 a5362991de chore: add a formatter (#12)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (7 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 09:41:59 +02:00
GandClaude Fable 5 24a5506496 feat: make bip-kit an installable package (#1)
- Single unscoped package `bip-kit` (was @bip-kit/core in a workspace):
  tsc build to dist/, exports map with types, files allowlist, provenance.
- NodeNext module resolution with explicit .js specifiers.
- Real test suite (32 tests): parser block semantics incl. CRLF, unterminated
  fences, table/paragraph ambiguity, embed allowlisting; frontmatter quoting
  and colon-in-value; video allowlist rejections incl. lookalike hosts; and a
  tarball-consumer test that imports the packed package by bare specifier so
  the exports map and files list are what gets tested, not relative paths.
- CI (verify) + reconciler publish workflow: merging a version bump to main
  is the release; auth is npm trusted publishing (OIDC), no token anywhere.
- README rewritten around the content contract; templates now reference
  `bip-kit`. The cp-based "sync from studio" model is gone: FleetCrown and
  AOZ will consume this package from npm instead of vendored copies.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 01:57:25 +02:00
Mao NakamotoandClaude Fable 5 347ccbf02a chore: import Building-in-Public kit, flattened to a single package
Extracted from FleetCrown packages/bip (dogfooded in production there and
in AOZ Wohnen). Monorepo scaffold collapsed: one package, one tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 01:52:46 +02:00