mirror of
https://github.com/bitbaum/bip-kit.git
synced 2026-12-04 05:17:05 +01:00
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>
99 lines
2.3 KiB
JSON
99 lines
2.3 KiB
JSON
{
|
|
"name": "bip-kit",
|
|
"version": "0.2.0",
|
|
"description": "Building in Public, as a content contract: parse markdown into typed blocks and render them with a reference React renderer (bip-kit/react) — blog, roadmap, changelog on your product site, bring your own design tokens.",
|
|
"license": "MIT",
|
|
"author": "Mao Nakamoto",
|
|
"homepage": "https://github.com/bitbaum/bip-kit#readme",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/bitbaum/bip-kit.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/bitbaum/bip-kit/issues"
|
|
},
|
|
"keywords": [
|
|
"build-in-public",
|
|
"blog",
|
|
"roadmap",
|
|
"changelog",
|
|
"markdown",
|
|
"headless",
|
|
"content",
|
|
"nextjs",
|
|
"react",
|
|
"rsc",
|
|
"renderer"
|
|
],
|
|
"type": "module",
|
|
"sideEffects": false,
|
|
"packageManager": "pnpm@11.25.0",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"provenance": true
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"styles.css"
|
|
],
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"./react": {
|
|
"types": "./dist/react/index.d.ts",
|
|
"default": "./dist/react/index.js"
|
|
},
|
|
"./react/mermaid": {
|
|
"types": "./dist/react/mermaid.d.ts",
|
|
"default": "./dist/react/mermaid.js"
|
|
},
|
|
"./styles.css": "./styles.css"
|
|
},
|
|
"scripts": {
|
|
"build": "tsc -p tsconfig.json",
|
|
"lint": "eslint .",
|
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
"test": "node --test test/*.test.js",
|
|
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test",
|
|
"prepare": "pnpm run build",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check ."
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@types/node": "^26.4.0",
|
|
"@types/react": "^19.2.18",
|
|
"eslint": "^10.9.1",
|
|
"globals": "^17.11.0",
|
|
"katex": "^0.16.47",
|
|
"prettier": "^3.9.6",
|
|
"react": "^19.2.8",
|
|
"react-dom": "^19.2.8",
|
|
"shiki": "^3.23.0",
|
|
"typescript": "^6.0.3",
|
|
"typescript-eslint": "^8.68.0"
|
|
},
|
|
"peerDependencies": {
|
|
"react": ">=18",
|
|
"shiki": ">=1",
|
|
"mermaid": ">=10",
|
|
"katex": ">=0.16"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"shiki": {
|
|
"optional": true
|
|
},
|
|
"mermaid": {
|
|
"optional": true
|
|
},
|
|
"katex": {
|
|
"optional": true
|
|
}
|
|
}
|
|
}
|