Skip to content

Commit f30c0df

Browse files
authored
Merge pull request #355 from knockout/fix/deploy-docs-node-glob
fix(deploy): use Bun.Glob, pin CI Node to 24
2 parents fe8b3c0 + 1e889a7 commit f30c0df

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
- name: Setup Pages
2525
uses: actions/configure-pages@v6
2626

27+
- name: Setup Node
28+
uses: actions/setup-node@v6
29+
with:
30+
node-version: 24.x
31+
2732
- name: Setup Bun
2833
uses: oven-sh/setup-bun@v2
2934
with:

tko.io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "TKO documentation site",
66
"scripts": {
77
"postinstall": "patch-package",
8-
"prebuild": "node ./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 && node ./scripts/bundle-tests.mjs",
8+
"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",
99
"predev": "bun run prebuild",
1010
"dev": "ASTRO_TELEMETRY_DISABLED=1 astro dev",
1111
"build": "ASTRO_TELEMETRY_DISABLED=1 astro build --force",

tko.io/scripts/bundle-tests.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import { promises as fs } from 'node:fs'
2626
import path from 'node:path'
2727
import { fileURLToPath } from 'node:url'
28-
import { glob } from 'node:fs/promises'
2928
import * as esbuild from 'esbuild'
3029

3130
const scriptDir = path.dirname(fileURLToPath(import.meta.url))
@@ -55,16 +54,19 @@ const distToSrcPlugin = {
5554
}
5655
}
5756

57+
// Script runs under Bun (see `prebuild` in tko.io/package.json).
58+
// `Bun.Glob` is portable to both Bun and the dev `bun --watch`
59+
// path, so no Node 22+ dependency.
5860
async function collectSpecs(patterns) {
59-
const specs = []
61+
const specs = new Set()
6062
for (const pattern of patterns) {
61-
for await (const match of glob(pattern, { cwd: repoRoot })) {
63+
const g = new Bun.Glob(pattern)
64+
for await (const match of g.scan({ cwd: repoRoot })) {
6265
if (EXCLUDE.test(match)) continue
63-
specs.push(path.join(repoRoot, match))
66+
specs.add(path.join(repoRoot, match))
6467
}
6568
}
66-
specs.sort()
67-
return specs
69+
return [...specs].sort()
6870
}
6971

7072
function specSlug(absPath) {

0 commit comments

Comments
 (0)