Skip to content

Commit 90937e6

Browse files
dnlboxclaude
andauthored
docs: migrate to shared @fhir-toolkit/docs-theme (#3)
* chore(deps): migrate pnpm config from package.json to pnpm-workspace.yaml; bump packageManager to pnpm 11 - Remove `pnpm.onlyBuiltDependencies` from package.json (removed in pnpm 11) - Create pnpm-workspace.yaml with allowBuilds map (esbuild, lefthook) - Bump packageManager to pnpm@11.1.3 - Bump engines.pnpm to >=11.0.0 Removes the pnpm 10 pin that was a tactical measure during the Node 22 engine bump. Reference: https://pnpm.io/migration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: scaffold Astro + Starlight, replace VitePress Replace docs/site/.vitepress/ with Astro 5 + Starlight 0.34. docs/site/ path is preserved so deploy workflow references still work. Stack notes: - Starlight ships Expressive Code (copy buttons, diffs, line highlights), Pagefind search, dark mode, asides, and Tabs out of the box - Uses legacy content collections (src/content/config.ts + legacy.collections: true in astro.config.mjs) — required for Starlight 0.34 SSG compatibility with the static route generator - Sidebar autogenerates from directory rather than explicit slug entries, avoiding a Starlight build-time slug resolution issue on 404 page generation (known Starlight 0.34 limitation with content layers) - Brand colours ported from VitePress custom.css (teal #1ad1b8, dark bg #071019) via Starlight CSS custom property overrides - CommandOutput.astro: labelled two-panel card rather than Tabs — command and output are cause-effect pairs, not alternatives to switch between - Hero.astro shim kept minimal (passes through to Starlight default) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: migrate all VitePress content to Starlight content collection Port 14 pages from docs/site/ flat VitePress layout to the Starlight content collection at docs/site/src/content/docs/: guide/: getting-started, validate, compare, normalize, info, ci-cd, ai-agents, fhir-versions reference/: cli, library-api, output-formats, exit-codes ecosystem.md, index.mdx (splash homepage with CardGrid) Per-page changes: - Added Starlight frontmatter (title, description, sidebar.order) - Updated internal links from /guide/foo to /fhir-resource-diff/guide/foo/ - Homepage converted to MDX to use Starlight <Card>/<CardGrid> components - English Canadian spelling throughout (normalise, organisation, behaviour) - No em dashes in any externally visible text docs.yml: run install/build from docs/site/ working directory (separate package), output path updated from .vitepress/dist to dist, removed VitePress-specific --fetch-depth=0 flag. Build verified: pnpm build in docs/site/ produces 15 pages, Pagefind indexes 14 content pages, sitemap generated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(site): fix double base path, hero styling, and dark-mode contrast Three targeted fixes to the Astro/Starlight migration: 1. Base path duplication (404s): All internal content links used absolute paths like /fhir-resource-diff/guide/... but Starlight/Astro prepends the configured base automatically. Stripped the prefix from every internal link across all 14 content files, astro.config.mjs sidebar entry, and the splash hero CTA. 2. Dark-mode contrast: Active sidebar items rendered solid teal background with near-invisible text. Replaced with a left-border + accent-text treatment using --sl-color-accent-low as a subtle fill, which passes WCAG AA in both modes. Also fixed sidebar hover, right-nav active item, inline code in headings, and body link colours in both themes. 3. Hero aesthetic: Added Space Grotesk Variable (@fontsource-variable) as a display face on the splash hero H1 only, with letter-spacing and a radial teal gradient backdrop behind the hero section. Copy unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * build: remove deprecated compiler options from tsconfig * docs: migrate to shared @fhir-toolkit/docs-theme (Option B sync) - Add shared theme files under docs/site/src/theme/ (tokens, styles, components) synced from packages/docs-theme via scripts/sync.js - Wire theme-teal.css + base.css into astro.config.mjs customCss - Remove local CommandOutput.astro duplicate - Clear custom.css to a placeholder comment (all styles now in shared theme) - Custom landing page (index.astro) already present; theme tokens applied * build: restore paths alias and suppress tsup-injected baseUrl deprecation tsup 8.x injects baseUrl when paths is configured for DTS generation. TypeScript 6.0 treats this as a deprecation error without ignoreDeprecations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c76cae9 commit 90937e6

34 files changed

Lines changed: 6928 additions & 267 deletions

.github/workflows/docs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0 # needed for VitePress git-based last-updated timestamps
2624

2725
- uses: pnpm/action-setup@v4
2826

@@ -31,12 +29,17 @@ jobs:
3129
node-version: "22"
3230
cache: pnpm
3331

34-
- run: pnpm install --frozen-lockfile
35-
- run: pnpm docs:build
32+
- name: Install docs dependencies
33+
working-directory: docs/site
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Build docs
37+
working-directory: docs/site
38+
run: pnpm build
3639

3740
- uses: actions/upload-pages-artifact@v3
3841
with:
39-
path: docs/site/.vitepress/dist
42+
path: docs/site/dist
4043

4144
deploy:
4245
environment:

docs/site/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.astro/

docs/site/.vitepress/config.ts

Lines changed: 0 additions & 99 deletions
This file was deleted.

docs/site/.vitepress/theme/custom.css

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/site/.vitepress/theme/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/site/astro.config.mjs

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import { defineConfig } from "astro/config";
2+
import starlight from "@astrojs/starlight";
3+
4+
const HOSTNAME = "https://dnlbox.github.io/fhir-resource-diff";
5+
const DESCRIPTION =
6+
"FHIR R4/R4B/R5 diff, validation, and comparison. TypeScript CLI and library for CI pipelines and AI agents. No server, no Java runtime.";
7+
8+
export default defineConfig({
9+
site: HOSTNAME,
10+
base: "/fhir-resource-diff",
11+
legacy: {
12+
collections: true,
13+
},
14+
integrations: [
15+
starlight({
16+
title: "fhir-resource-diff",
17+
description: DESCRIPTION,
18+
social: [
19+
{
20+
icon: "github",
21+
label: "GitHub",
22+
href: "https://github.com/dnlbox/fhir-resource-diff",
23+
},
24+
{
25+
icon: "npm",
26+
label: "npm",
27+
href: "https://www.npmjs.com/package/fhir-resource-diff",
28+
},
29+
],
30+
editLink: {
31+
baseUrl:
32+
"https://github.com/dnlbox/fhir-resource-diff/edit/main/docs/site/",
33+
},
34+
customCss: [
35+
"./src/theme/tokens/theme-teal.css",
36+
"./src/theme/styles/base.css",
37+
"./src/styles/custom.css"
38+
],
39+
sidebar: [
40+
{
41+
label: "Guide",
42+
autogenerate: { directory: "guide" },
43+
},
44+
{
45+
label: "Reference",
46+
autogenerate: { directory: "reference" },
47+
},
48+
{
49+
label: "Ecosystem",
50+
link: "/ecosystem/",
51+
},
52+
],
53+
head: [
54+
{
55+
tag: "meta",
56+
attrs: { property: "og:type", content: "website" },
57+
},
58+
{
59+
tag: "meta",
60+
attrs: {
61+
property: "og:site_name",
62+
content: "fhir-resource-diff",
63+
},
64+
},
65+
{
66+
tag: "meta",
67+
attrs: {
68+
property: "og:title",
69+
content: "fhir-resource-diff — FHIR diff, validate & compare CLI",
70+
},
71+
},
72+
{
73+
tag: "meta",
74+
attrs: { property: "og:description", content: DESCRIPTION },
75+
},
76+
{
77+
tag: "meta",
78+
attrs: { property: "og:url", content: HOSTNAME + "/" },
79+
},
80+
{
81+
tag: "meta",
82+
attrs: { name: "twitter:card", content: "summary" },
83+
},
84+
{
85+
tag: "meta",
86+
attrs: {
87+
name: "twitter:title",
88+
content: "fhir-resource-diff — FHIR diff, validate & compare CLI",
89+
},
90+
},
91+
{
92+
tag: "meta",
93+
attrs: { name: "twitter:description", content: DESCRIPTION },
94+
},
95+
{
96+
tag: "meta",
97+
attrs: {
98+
name: "google-site-verification",
99+
content: "Ffbl73Sm-TtkxrvNsLRS417HB-VjOPRmerHZVfhF0QQ",
100+
},
101+
},
102+
{
103+
tag: "script",
104+
attrs: { type: "application/ld+json" },
105+
content: JSON.stringify({
106+
"@context": "https://schema.org",
107+
"@type": "SoftwareApplication",
108+
name: "fhir-resource-diff",
109+
description: DESCRIPTION,
110+
applicationCategory: "DeveloperApplication",
111+
operatingSystem: "Any",
112+
programmingLanguage: "TypeScript",
113+
url: HOSTNAME + "/",
114+
downloadUrl:
115+
"https://www.npmjs.com/package/fhir-resource-diff",
116+
license: "https://opensource.org/licenses/MIT",
117+
codeRepository:
118+
"https://github.com/dnlbox/fhir-resource-diff",
119+
author: { "@type": "Person", name: "Daniel Veronez" },
120+
}),
121+
},
122+
],
123+
expressiveCode: {
124+
themes: ["dark-plus", "github-light"],
125+
},
126+
}),
127+
],
128+
});

docs/site/index.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/site/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "fhir-resource-diff-docs",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview"
10+
},
11+
"dependencies": {
12+
"@astrojs/starlight": "^0.34.3",
13+
"@fontsource-variable/plus-jakarta-sans": "^5.2.8",
14+
"@fontsource-variable/space-grotesk": "^5.2.10",
15+
"astro": "^5.8.1",
16+
"sharp": "^0.33.5"
17+
},
18+
"engines": {
19+
"node": ">=22.0.0",
20+
"pnpm": ">=10.0.0"
21+
},
22+
"pnpm": {
23+
"onlyBuiltDependencies": [
24+
"esbuild",
25+
"sharp"
26+
]
27+
}
28+
}

0 commit comments

Comments
 (0)