mirror of
https://github.com/cline/cline.git
synced 2026-09-18 09:24:17 +08:00
* Use the host bridge in utils/path.ts Update utils/path.ts to use the host bridge to get the workspace folders, instead of the vscode SDK. Update callers to use await as the functions are now async. * Replace vscode workspaceFolders in WorkspaceTracker Make the cwd an instance property because await cannot be used at the top level. * Use the host bridge getWorkspacePaths in FileContextTracker Replace the vscode SDK getWorkspaceFolders with the util function getCwd (this is already switched to the host bridge). * Fix test failure Update the rootDir for the tests to be "." instead of "src". The changes to path.ts pull in new dependencies from the extension, which indirectly include files from the webview-ui. ``` Run npm run pretest > claude-dev@3.18.0 pretest > npm run compile-tests && npm run compile && npm run compile-standalone && npm run lint > claude-dev@3.18.0 compile-tests > node ./scripts/build-tests.js node:child_process:957 throw err; ^ Error: Command failed: tsc -p ./tsconfig.test.json --outDir out at genericNodeError (node:internal/errors:983:15) at wrappedFn (node:internal/errors:537:14) at checkExecSyncError (node:child_process:882:11) at execSync (node:child_process:954:15) at Object.<anonymous> (/home/runner/work/cline/cline/scripts/build-tests.js:55:1) at Module._compile (node:internal/modules/cjs/loader:1730:14) at Object..js (node:internal/modules/cjs/loader:1895:10) at Module.load (node:internal/modules/cjs/loader:1465:32) at Function._load (node:internal/modules/cjs/loader:1282:12) at TracingChannel.traceSync (node:diagnostics_channel:322:14) { status: 2, signal: null, output: [ null, "src/services/test/TestServer.ts(8,35): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/services/grpc-client.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n" + "webview-ui/src/services/grpc-client-base.ts(1,24): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/utils/vscode.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n" + "webview-ui/src/services/grpc-client.ts(4,34): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/services/grpc-client-base.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n", '' ], pid: 2496, stdout: "src/services/test/TestServer.ts(8,35): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/services/grpc-client.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n" + "webview-ui/src/services/grpc-client-base.ts(1,24): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/utils/vscode.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n" + "webview-ui/src/services/grpc-client.ts(4,34): error TS6059: File '/home/runner/work/cline/cline/webview-ui/src/services/grpc-client-base.ts' is not under 'rootDir' '/home/runner/work/cline/cline/src'. 'rootDir' is expected to contain all source files.\n", stderr: '' } ``` * Build the protos before compiling the tests. The tests depend on generated files now, so compile the extension before the tests so that the protos are built. * Set up the host providers in the integration test FileContextTracker.test.ts * Reduce the amount of logging in grpc-service.ts Just log the service registration, instead of every rpc. * In the `clean` build target, also remove the compiled test code. * Correct the alias mapping for the compiled test files.
19 lines
810 B
JSON
19 lines
810 B
JSON
{
|
|
// This separate tsconfig is necessary because VS Code's test runner requires CommonJS modules,
|
|
// while our main project uses ES Modules (ESM). This config inherits most settings from the base
|
|
// tsconfig.json but overrides the module system for test files only. This doesn't affect how
|
|
// tests interact with the main codebase - it only changes how the test files themselves are
|
|
// compiled to make them compatible with VS Code's test runner.
|
|
"extends": "./tsconfig.json",
|
|
"compilerOptions": {
|
|
"module": "commonjs",
|
|
"moduleResolution": "node",
|
|
"types": ["node", "mocha", "should", "vscode", "chai"],
|
|
"typeRoots": ["./node_modules/@types", "./src/test/types"],
|
|
"outDir": "out",
|
|
"rootDir": "."
|
|
},
|
|
"include": ["src/**/*.test.ts"],
|
|
"exclude": ["src/test/**/*.js", "src/**/__tests__/*"]
|
|
}
|