Skip to content

Commit 72d5993

Browse files
fix(deps): upgrade happy-dom to v20 + pin rollup/postcss CVEs (#20)
- Upgrade @happy-dom/global-registrator from ^15.11.0 to 20.9.0 - Pin rollup to 3.30.0 and postcss to 8.5.10 via overrides - Add { url: 'http://localhost/' } to GlobalRegistrator.register() (required by happy-dom v20 API) - Add .devcontainer/ to .gitignore - Fix pre-existing biome lint issues in viewport/iris test files (import order, Number.parseInt) Inspired-by: coder#167 Co-authored-by: Brent Rockwood <brent@brentrockwood.com>
1 parent 7050803 commit 72d5993

9 files changed

Lines changed: 176 additions & 110 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ ghostty-vt.wasm
1212
.claude/
1313
.worktrees/
1414
_tasks/
15+
16+
# Local dev container config (not part of the project)
17+
.devcontainer/

bun.lock

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

happydom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { GlobalRegistrator } from '@happy-dom/global-registrator';
1313

1414
// Register Happy DOM globals (window, document, etc.)
15-
GlobalRegistrator.register();
15+
GlobalRegistrator.register({ url: 'http://localhost/' });
1616

1717
// Mock Canvas 2D Context
1818
// Happy DOM doesn't provide canvas rendering APIs, so we mock them for testing.

lib/iris-repro-final.test.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*/
2121

2222
import { describe, expect, test } from 'bun:test';
23-
import { createIsolatedTerminal } from './test-helpers';
2423
import type { Terminal } from './terminal';
24+
import { createIsolatedTerminal } from './test-helpers';
2525

2626
const ESC = '\x1b';
2727

@@ -62,7 +62,9 @@ function generateTestOutput(): Uint8Array {
6262

6363
// Section 3: Text attributes
6464
lines.push(`${ESC}[1m── ATTRIBUTES ──${ESC}[0m`);
65-
lines.push(` ${ESC}[1mBold${ESC}[0m ${ESC}[3mItalic${ESC}[0m ${ESC}[4mUnderline${ESC}[0m ${ESC}[7mReverse${ESC}[0m`);
65+
lines.push(
66+
` ${ESC}[1mBold${ESC}[0m ${ESC}[3mItalic${ESC}[0m ${ESC}[4mUnderline${ESC}[0m ${ESC}[7mReverse${ESC}[0m`
67+
);
6668

6769
// Section 4: Unicode box drawing
6870
lines.push(`${ESC}[1m── UNICODE ──${ESC}[0m`);
@@ -138,7 +140,9 @@ describe('WASM ring buffer corruption — self-contained reproduction', () => {
138140
for (let i = 1; i < sbLengths.length; i++) {
139141
if (sbLengths[i] < sbLengths[i - 1]) {
140142
drops++;
141-
console.log(`Drop at rep ${i}: ${sbLengths[i-1]}${sbLengths[i]} (delta ${sbLengths[i] - sbLengths[i-1]})`);
143+
console.log(
144+
`Drop at rep ${i}: ${sbLengths[i - 1]}${sbLengths[i]} (delta ${sbLengths[i] - sbLengths[i - 1]})`
145+
);
142146
}
143147
}
144148

@@ -204,7 +208,10 @@ describe('WASM ring buffer corruption — self-contained reproduction', () => {
204208
for (let row = 0; row < term.rows; row++) {
205209
const line = term.wasmTerm?.getLine(row);
206210
if (!line) continue;
207-
const lnText = line.map(c => String.fromCodePoint(c.codepoint || 32)).join('').trimEnd();
211+
const lnText = line
212+
.map((c) => String.fromCodePoint(c.codepoint || 32))
213+
.join('')
214+
.trimEnd();
208215
if (vpText[row] === lnText) matches++;
209216
}
210217

@@ -234,10 +241,14 @@ describe('WASM ring buffer corruption — self-contained reproduction', () => {
234241
term.wasmTerm!.update();
235242
sbLengths.push(term.wasmTerm!.getScrollbackLength());
236243
const text = getViewportText(term);
237-
if (!baseline) { baseline = text; }
238-
else {
244+
if (!baseline) {
245+
baseline = text;
246+
} else {
239247
for (let i = 0; i < Math.max(text.length, baseline.length); i++) {
240-
if ((text[i] || '') !== (baseline[i] || '')) { vpCorrupt = true; break; }
248+
if ((text[i] || '') !== (baseline[i] || '')) {
249+
vpCorrupt = true;
250+
break;
251+
}
241252
}
242253
}
243254
}

lib/iris-repro-fix-verify.test.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
*/
1111

1212
import { describe, expect, test } from 'bun:test';
13-
import { createIsolatedTerminal } from './test-helpers';
1413
import type { Terminal } from './terminal';
14+
import { createIsolatedTerminal } from './test-helpers';
1515

1616
const ESC = '\x1b';
1717

@@ -39,7 +39,9 @@ function generateTestOutput(): Uint8Array {
3939
lines.push(line);
4040
}
4141
lines.push(`${ESC}[1m── ATTRIBUTES ──${ESC}[0m`);
42-
lines.push(` ${ESC}[1mBold${ESC}[0m ${ESC}[3mItalic${ESC}[0m ${ESC}[4mUnderline${ESC}[0m ${ESC}[7mReverse${ESC}[0m`);
42+
lines.push(
43+
` ${ESC}[1mBold${ESC}[0m ${ESC}[3mItalic${ESC}[0m ${ESC}[4mUnderline${ESC}[0m ${ESC}[7mReverse${ESC}[0m`
44+
);
4345
lines.push(`${ESC}[1m── UNICODE ──${ESC}[0m`);
4446
lines.push(' ┌──────────┬──────────┐');
4547
lines.push(' │ Cell A │ Cell B │');
@@ -147,10 +149,14 @@ describe('Scrollback bytes fix verification', () => {
147149
term.wasmTerm!.update();
148150
sbLengths.push(term.wasmTerm!.getScrollbackLength());
149151
const text = getViewportText(term);
150-
if (!baseline) { baseline = text; }
151-
else {
152+
if (!baseline) {
153+
baseline = text;
154+
} else {
152155
for (let i = 0; i < Math.max(text.length, baseline.length); i++) {
153-
if ((text[i] || '') !== (baseline[i] || '')) { vpCorrupt = true; break; }
156+
if ((text[i] || '') !== (baseline[i] || '')) {
157+
vpCorrupt = true;
158+
break;
159+
}
154160
}
155161
}
156162
}
@@ -160,7 +166,9 @@ describe('Scrollback bytes fix verification', () => {
160166
if (sbLengths[i] < sbLengths[i - 1]) sbDrops++;
161167
}
162168

163-
console.log(`cols=${cols}: viewport=${vpCorrupt ? 'CORRUPT' : 'OK'} scrollback_drops=${sbDrops} sbLens=[${sbLengths.join(',')}]`);
169+
console.log(
170+
`cols=${cols}: viewport=${vpCorrupt ? 'CORRUPT' : 'OK'} scrollback_drops=${sbDrops} sbLens=[${sbLengths.join(',')}]`
171+
);
164172
term.dispose();
165173
}
166174
});

0 commit comments

Comments
 (0)