Skip to content

Commit 04f65f3

Browse files
authored
Migrate core render util to use xterm.js as part of the rendering loop. (#19044)
1 parent 04c5251 commit 04f65f3

213 files changed

Lines changed: 7064 additions & 3851 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

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

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"pre-commit": "node scripts/pre-commit.js"
6565
},
6666
"overrides": {
67-
"ink": "npm:@jrichman/ink@6.4.10",
67+
"ink": "npm:@jrichman/ink@6.4.11",
6868
"wrap-ansi": "9.0.2",
6969
"cliui": {
7070
"wrap-ansi": "7.0.0"
@@ -107,7 +107,6 @@
107107
"globals": "^16.0.0",
108108
"google-artifactregistry-auth": "^3.4.0",
109109
"husky": "^9.1.7",
110-
"ink-testing-library": "^4.0.0",
111110
"json": "^11.0.0",
112111
"lint-staged": "^16.1.6",
113112
"memfs": "^4.42.0",
@@ -127,7 +126,7 @@
127126
"yargs": "^17.7.2"
128127
},
129128
"dependencies": {
130-
"ink": "npm:@jrichman/ink@6.4.10",
129+
"ink": "npm:@jrichman/ink@6.4.11",
131130
"latest-version": "^9.0.0",
132131
"proper-lockfile": "^4.1.2",
133132
"simple-git": "^3.28.0"

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"fzf": "^0.5.2",
4949
"glob": "^12.0.0",
5050
"highlight.js": "^11.11.1",
51-
"ink": "npm:@jrichman/ink@6.4.10",
51+
"ink": "npm:@jrichman/ink@6.4.11",
5252
"ink-gradient": "^3.0.0",
5353
"ink-spinner": "^5.0.0",
5454
"latest-version": "^9.0.0",
@@ -80,7 +80,7 @@
8080
"@types/shell-quote": "^1.7.5",
8181
"@types/ws": "^8.5.10",
8282
"@types/yargs": "^17.0.32",
83-
"ink-testing-library": "^4.0.0",
83+
"@xterm/headless": "^5.5.0",
8484
"typescript": "^5.3.3",
8585
"vitest": "^3.1.1"
8686
},

packages/cli/src/config/extensions/github.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ describe('github.ts', () => {
269269

270270
it('should return NOT_UPDATABLE if local extension config cannot be loaded', async () => {
271271
vi.mocked(mockExtensionManager.loadExtensionConfig).mockImplementation(
272-
() => {
272+
async () => {
273273
throw new Error('Config not found');
274274
},
275275
);

packages/cli/src/config/trustedFolders.test.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -491,25 +491,33 @@ describe('Trusted Folders', () => {
491491
});
492492
});
493493

494+
const itif = (condition: boolean) => (condition ? it : it.skip);
495+
494496
describe('Symlinks Support', () => {
495497
const mockSettings: Settings = {
496498
security: { folderTrust: { enabled: true } },
497499
};
498500

499-
it('should trust a folder if the rule matches the realpath', () => {
500-
// Create a real directory and a symlink
501-
const realDir = path.join(tempDir, 'real');
502-
const symlinkDir = path.join(tempDir, 'symlink');
503-
fs.mkdirSync(realDir);
504-
fs.symlinkSync(realDir, symlinkDir);
505-
506-
// Rule uses realpath
507-
const config = { [realDir]: TrustLevel.TRUST_FOLDER };
508-
fs.writeFileSync(trustedFoldersPath, JSON.stringify(config), 'utf-8');
509-
510-
// Check against symlink path
511-
expect(isWorkspaceTrusted(mockSettings, symlinkDir).isTrusted).toBe(true);
512-
});
501+
// TODO: issue 19387 - Enable symlink tests on Windows
502+
itif(process.platform !== 'win32')(
503+
'should trust a folder if the rule matches the realpath',
504+
() => {
505+
// Create a real directory and a symlink
506+
const realDir = path.join(tempDir, 'real');
507+
const symlinkDir = path.join(tempDir, 'symlink');
508+
fs.mkdirSync(realDir);
509+
fs.symlinkSync(realDir, symlinkDir);
510+
511+
// Rule uses realpath
512+
const config = { [realDir]: TrustLevel.TRUST_FOLDER };
513+
fs.writeFileSync(trustedFoldersPath, JSON.stringify(config), 'utf-8');
514+
515+
// Check against symlink path
516+
expect(isWorkspaceTrusted(mockSettings, symlinkDir).isTrusted).toBe(
517+
true,
518+
);
519+
},
520+
);
513521
});
514522

515523
describe('Verification: Auth and Trust Interaction', () => {

packages/cli/src/test-utils/AppRig.test.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { describe, it, afterEach, expect } from 'vitest';
8+
import { act } from 'react';
89
import { AppRig } from './AppRig.js';
910
import path from 'node:path';
1011
import { fileURLToPath } from 'node:url';
@@ -68,7 +69,11 @@ describe('AppRig', () => {
6869
);
6970
rig = new AppRig({ fakeResponsesPath });
7071
await rig.initialize();
71-
rig.render();
72+
await act(async () => {
73+
rig!.render();
74+
// Allow async initializations (like banners) to settle within the act boundary
75+
await new Promise((resolve) => setTimeout(resolve, 0));
76+
});
7277

7378
// Wait for initial render
7479
await rig.waitForIdle();

packages/cli/src/test-utils/AppRig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export class AppRig {
501501

502502
get lastFrame() {
503503
if (!this.renderResult) return '';
504-
return stripAnsi(this.renderResult.lastFrame() || '');
504+
return stripAnsi(this.renderResult.lastFrame({ allowEmpty: true }) || '');
505505
}
506506

507507
getStaticOutput() {

0 commit comments

Comments
 (0)