Skip to content

Commit c2648bc

Browse files
authored
Merge pull request #778 from heygen-com/fix/ci-format-and-windows-esbuild
fix(ci): unbreak format check on main + skip cli build:fonts when present
2 parents 86c5fd2 + de94649 commit c2648bc

11 files changed

Lines changed: 68 additions & 104 deletions

File tree

.github/workflows/windows-render.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,16 @@ jobs:
150150

151151
- name: Install dependencies
152152
shell: pwsh
153-
run: bun install --frozen-lockfile
153+
# Force the pre-1.3 "hoisted" linker on Windows. Bun 1.3.x's default
154+
# "isolated" linker creates nested workspace junctions that don't
155+
# materialize reliably on Windows GHA runners — manifests as
156+
# `Cannot find package 'esbuild'` walking up from
157+
# `packages/producer/build.mjs` and `EPERM stat` on
158+
# `packages/producer/node_modules/@fontsource/*` from generators.
159+
# See oven-sh/bun#23615, #18354, #10146. Linux CI keeps isolated;
160+
# the lockfile is linker-agnostic so this flag is safe with
161+
# --frozen-lockfile.
162+
run: bun install --frozen-lockfile --linker=hoisted
154163

155164
- name: Build all packages
156165
shell: pwsh
@@ -371,7 +380,16 @@ jobs:
371380

372381
- name: Install dependencies
373382
shell: pwsh
374-
run: bun install --frozen-lockfile
383+
# Force the pre-1.3 "hoisted" linker on Windows. Bun 1.3.x's default
384+
# "isolated" linker creates nested workspace junctions that don't
385+
# materialize reliably on Windows GHA runners — manifests as
386+
# `Cannot find package 'esbuild'` walking up from
387+
# `packages/producer/build.mjs` and `EPERM stat` on
388+
# `packages/producer/node_modules/@fontsource/*` from generators.
389+
# See oven-sh/bun#23615, #18354, #10146. Linux CI keeps isolated;
390+
# the lockfile is linker-agnostic so this flag is safe with
391+
# --frozen-lockfile.
392+
run: bun install --frozen-lockfile --linker=hoisted
375393

376394
- name: Build
377395
shell: pwsh

bun.lock

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

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test": "vitest run",
1919
"dev": "tsx src/cli.ts",
2020
"build": "bun run build:fonts && tsup && bun run build:runtime && bun run build:copy",
21-
"build:fonts": "cd ../producer && tsx scripts/generate-font-data.ts",
21+
"build:fonts": "node -e \"const fs=require('fs');if(!fs.existsSync('../producer/src/services/fontData.generated.ts')){const {execSync}=require('child_process');execSync('cd ../producer && tsx scripts/generate-font-data.ts',{stdio:'inherit'})}else{console.log('[build:fonts] skipped — fontData.generated.ts already exists')}\"",
2222
"build:runtime": "tsx scripts/build-runtime.ts",
2323
"build:copy": "node scripts/build-copy.mjs",
2424
"typecheck": "tsc --noEmit"
@@ -29,7 +29,7 @@
2929
"adm-zip": "^0.5.16",
3030
"citty": "^0.2.1",
3131
"compare-versions": "^6.1.1",
32-
"esbuild": "^0.25.0",
32+
"esbuild": "^0.25.12",
3333
"giget": "^3.2.0",
3434
"hono": "^4.0.0",
3535
"mime-types": "^3.0.2",
@@ -48,7 +48,7 @@
4848
"@hyperframes/studio": "workspace:*",
4949
"@types/adm-zip": "^0.5.7",
5050
"@types/mime-types": "^3.0.1",
51-
"@types/node": "^22.0.0",
51+
"@types/node": "^25.0.10",
5252
"linkedom": "^0.18.12",
5353
"picocolors": "^1.1.1",
5454
"tsup": "^8.0.0",

packages/cli/src/commands/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function patchVideoSrc(
296296
): void {
297297
const htmlFiles = readdirSync(dir, { withFileTypes: true, recursive: true })
298298
.filter((e) => e.isFile() && e.name.endsWith(".html"))
299-
.map((e) => join(e.parentPath ?? e.path, e.name));
299+
.map((e) => join(e.parentPath, e.name));
300300

301301
for (const file of htmlFiles) {
302302
let content = readFileSync(file, "utf-8");

packages/cli/src/whisper/normalize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export function patchCaptionHtml(dir: string, words: Word[]): void {
332332
try {
333333
htmlFiles = readdirSync(dir, { withFileTypes: true, recursive: true })
334334
.filter((e) => e.isFile() && e.name.endsWith(".html"))
335-
.map((e) => join(e.parentPath ?? e.path, e.name));
335+
.map((e) => join(e.parentPath, e.name));
336336
} catch {
337337
return;
338338
}

packages/core/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
"./schemas/registry-item.json": "./schemas/registry-item.json"
6363
},
6464
"publishConfig": {
65-
"main": "./dist/index.js",
66-
"types": "./dist/index.d.ts",
65+
"access": "public",
6766
"exports": {
6867
".": {
6968
"import": "./dist/index.js",
@@ -109,7 +108,8 @@
109108
"./schemas/registry.json": "./schemas/registry.json",
110109
"./schemas/registry-item.json": "./schemas/registry-item.json"
111110
},
112-
"access": "public"
111+
"main": "./dist/index.js",
112+
"types": "./dist/index.d.ts"
113113
},
114114
"scripts": {
115115
"build": "bun run build:hyperframes-runtime && tsc",
@@ -139,7 +139,7 @@
139139
},
140140
"devDependencies": {
141141
"@types/jsdom": "^28.0.0",
142-
"@types/node": "^24.10.13",
142+
"@types/node": "^25.0.10",
143143
"@vitest/coverage-v8": "^3.2.4",
144144
"jsdom": "^29.0.0",
145145
"tsx": "^4.21.0",

packages/core/src/studio-api/routes/files.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,21 @@ export function registerFileRoutes(api: Hono, adapter: StudioApiAdapter): void {
306306
const skipped: string[] = [];
307307
const invalid: Array<{ name: string; reason: string }> = [];
308308

309-
for (const [, value] of formData.entries()) {
310-
if (!(value instanceof File)) continue;
309+
// @types/node v25 narrows the ambient `FormData.entries()` to
310+
// `[string, string]` in workspaces where another dep declares an
311+
// `onmessage` global (it trips the worker branch of v25's conditional
312+
// File type). At runtime the value is still `File | string` — cast the
313+
// iterator so the rest of this block keeps type-checking on every
314+
// bun-install layout (hoisted on Windows surfaces this; isolated on
315+
// Linux happens to keep v24 in scope).
316+
type FileLike = {
317+
readonly name: string;
318+
readonly size: number;
319+
arrayBuffer(): Promise<ArrayBuffer>;
320+
};
321+
const entries = formData.entries() as unknown as Iterable<[string, FileLike | string]>;
322+
for (const [, value] of entries) {
323+
if (typeof value === "string") continue;
311324

312325
// Strip path separators — browsers may include directory components
313326
const name = value.name.split("/").pop()?.split("\\").pop() ?? "";

packages/engine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"puppeteer-core": "^24.39.1"
2828
},
2929
"devDependencies": {
30-
"@types/node": "^22.10.1",
30+
"@types/node": "^25.0.10",
3131
"@webgpu/types": "^0.1.69",
3232
"typescript": "^5.7.2",
3333
"vitest": "^3.2.4"

packages/producer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
"@fontsource/poppins": "^5.2.7",
7676
"@fontsource/roboto": "^5.2.10",
7777
"@fontsource/source-code-pro": "^5.2.7",
78-
"@types/node": "^22.10.1",
78+
"@types/node": "^25.0.10",
7979
"@webgpu/types": "^0.1.69",
80-
"esbuild": "^0.27.2",
81-
"tsx": "^4.7.0",
80+
"esbuild": "^0.25.12",
81+
"tsx": "^4.21.0",
8282
"typescript": "^5.7.2"
8383
},
8484
"engines": {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4f419db5ff8a944712be32eb03215e0111a539d7c15da1feffd5cc6e85d6de03
3+
size 159786

0 commit comments

Comments
 (0)