|
6 | 6 | * source of truth — never edit the generated docs page directly. |
7 | 7 | */ |
8 | 8 |
|
9 | | -import { readFileSync, writeFileSync } from 'node:fs'; |
10 | | -import { resolve, dirname } from 'node:path'; |
11 | | -import { fileURLToPath } from 'node:url'; |
| 9 | +import { readFileSync, writeFileSync } from "node:fs"; |
| 10 | +import { dirname, resolve } from "node:path"; |
| 11 | +import { fileURLToPath } from "node:url"; |
12 | 12 |
|
13 | 13 | const __dirname = dirname(fileURLToPath(import.meta.url)); |
14 | | -const source = resolve(__dirname, '../../container/.devcontainer/CHANGELOG.md'); |
15 | | -const dest = resolve(__dirname, '../src/content/docs/reference/changelog.md'); |
| 14 | +const source = resolve(__dirname, "../../container/.devcontainer/CHANGELOG.md"); |
| 15 | +const dest = resolve(__dirname, "../src/content/docs/reference/changelog.md"); |
16 | 16 |
|
17 | | -const content = readFileSync(source, 'utf-8'); |
| 17 | +const content = readFileSync(source, "utf-8"); |
18 | 18 |
|
19 | 19 | // Strip the H1 heading — Starlight generates one from the frontmatter title |
20 | | -const body = content.replace(/^# .+\n+/, ''); |
| 20 | +const body = content.replace(/^# .+\n+/, ""); |
21 | 21 |
|
22 | 22 | // Convert [vX.Y.Z] link-style headings to plain ## vX.Y.Z headings |
23 | 23 | // Source uses ## [v1.14.0] - 2026-02-24, docs need ## v1.14.0 |
24 | | -const cleaned = body.replace(/^(##) \[v([\d.]+)\] - (\d{4}-\d{2}-\d{2})/gm, '$1 v$2\n\n**Release date:** $3'); |
| 24 | +const cleaned = body.replace( |
| 25 | + /^(##) \[v([\d.]+)\] - (\d{4}-\d{2}-\d{2})/gm, |
| 26 | + "$1 v$2\n\n**Release date:** $3", |
| 27 | +); |
25 | 28 |
|
26 | 29 | const frontmatter = `--- |
27 | 30 | title: Changelog |
@@ -75,4 +78,4 @@ For minor and patch updates, you can usually just rebuild the container. Check t |
75 | 78 | `; |
76 | 79 |
|
77 | 80 | writeFileSync(dest, frontmatter + cleaned); |
78 | | -console.log('✓ Changelog synced from container/.devcontainer/CHANGELOG.md'); |
| 81 | +console.log("✓ Changelog synced from container/.devcontainer/CHANGELOG.md"); |
0 commit comments