Skip to content

Commit 789ea8b

Browse files
Brian M Huntclaude
authored andcommitted
deps(tko.io): bump astro 5.18.1 β†’ 6.1.8, starlight 0.37.7 β†’ 0.38.3
Fixes dependabot advisory: Astro XSS in define:vars via incomplete </script> tag sanitization (supersedes #354). Migrations: - content.config.ts: add docsLoader() β€” Astro 6 requires Content Layer loaders; file-based auto-discovery removed. - Header.astro + tests.astro: resolve sibling/public paths from process.cwd() instead of import.meta.url. Astro 6's prerender bundles into dist/.prerender/chunks/, breaking ../-relative URLs. - Remove patch-package: upstream starlight already includes the head.ts fix the patch carried, and Bun has native patching. Verified: bun run build β†’ 66 pages, clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4780dfe commit 789ea8b

6 files changed

Lines changed: 71 additions & 268 deletions

File tree

β€Žtko.io/bun.lockβ€Ž

Lines changed: 60 additions & 243 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žtko.io/package.jsonβ€Ž

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"type": "module",
55
"description": "TKO documentation site",
66
"scripts": {
7-
"postinstall": "patch-package",
87
"prebuild": "bun ./scripts/generate-verified-behaviors.mjs && mkdir -p public/lib && cd ../builds/knockout && bun run build && cp dist/browser.min.js ../../tko.io/public/lib/ko.js && cd ../reference && bun run build && cp dist/browser.min.js ../../tko.io/public/lib/tko.js && cd ../../tko.io && bun ./scripts/bundle-tests.mjs",
98
"predev": "bun run prebuild",
109
"dev": "ASTRO_TELEMETRY_DISABLED=1 bun --bun astro dev",
@@ -16,10 +15,9 @@
1615
"author": "",
1716
"license": "MIT",
1817
"devDependencies": {
19-
"@astrojs/starlight": "0.37.7",
20-
"@astrojs/check": "0.9.6",
21-
"astro": "5.18.1",
22-
"patch-package": "^8.0.1",
18+
"@astrojs/starlight": "0.38.3",
19+
"@astrojs/check": "0.9.8",
20+
"astro": "6.1.8",
2321
"typescript": "^5.9.3"
2422
}
2523
}

β€Žtko.io/patches/@astrojs+starlight+0.37.7.patchβ€Ž

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

β€Žtko.io/src/components/Header.astroβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import config from 'virtual:starlight/user-config';
33
import { readFileSync } from 'node:fs';
4+
import { join } from 'node:path';
45
56
import LanguageSelect from 'virtual:starlight/components/LanguageSelect';
67
import Search from 'virtual:starlight/components/Search';
@@ -11,7 +12,7 @@ import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
1112
const shouldRenderSearch =
1213
config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro';
1314
14-
const pkg = JSON.parse(readFileSync(new URL('../../../builds/knockout/package.json', import.meta.url), 'utf8'));
15+
const pkg = JSON.parse(readFileSync(join(process.cwd(), '../builds/knockout/package.json'), 'utf8'));
1516
const version = pkg.version;
1617
---
1718

β€Žtko.io/src/content.config.tsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineCollection } from 'astro:content';
2+
import { docsLoader } from '@astrojs/starlight/loaders';
23
import { docsSchema } from '@astrojs/starlight/schema';
34

45
export const collections = {
5-
docs: defineCollection({ schema: docsSchema() })
6+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() })
67
};

β€Žtko.io/src/pages/tests.astroβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { fileURLToPath } from 'node:url'
2+
import { join } from 'node:path'
33
44
// Read the source-mode chunk list at SSR time so the HTML ships
55
// with <link rel="modulepreload"> for every shared chunk already
@@ -9,7 +9,9 @@ import { fileURLToPath } from 'node:url'
99
// iframes with the opaque "Importing a module script failed."
1010
// error. `prebuild` always runs bundle-tests.mjs before Astro
1111
// builds the site, so manifest.json is guaranteed to exist.
12-
const manifestPath = fileURLToPath(new URL('../../public/tests/source/manifest.json', import.meta.url))
12+
// Resolve from cwd (project root) β€” import.meta.url points into
13+
// dist/.prerender/chunks/ under Astro 6's prerender bundler.
14+
const manifestPath = join(process.cwd(), 'public/tests/source/manifest.json')
1315
const sourceChunks: string[] = (await Bun.file(manifestPath).json()).chunks ?? []
1416
1517
// TKO Browser Test Runner β€” written in TKO itself.

0 commit comments

Comments
Β (0)