Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
5461a65
perf(filesearch): move recursive crawl + fzf index to worker_threads
callmeYe Apr 19, 2026
c70c58e
fix(filesearch): audit round 1 — worker lifecycle, error paths, and R…
callmeYe Apr 19, 2026
7df087e
fix(filesearch): audit round 2 — ignore fingerprint, dispose, and INS…
callmeYe Apr 19, 2026
ccf9df0
fix(filesearch): audit round 3 — harden worker boundary + graceful pa…
callmeYe Apr 19, 2026
f37a653
fix(filesearch): audit round 4 — release-blocker packaging + stale-ke…
callmeYe Apr 19, 2026
294a79e
fix(filesearch): audit round 5 — revert AbortError on post-dispose sy…
callmeYe Apr 19, 2026
a9915d1
perf(cli): prewarm file index at boot and hide transient loading indi…
callmeYe Apr 19, 2026
ee04405
perf(filesearch): add ripgrep crawl backend (gated; fdir stays default)
callmeYe Apr 19, 2026
3fdc49c
perf(filesearch): restore ripgrep as default after re-benchmarking on ~
callmeYe Apr 19, 2026
b15c289
fix(filesearch): audit round 6 — Windows rg paths + CR follow-ups
callmeYe Apr 20, 2026
6ffe02b
chore(vscode-ide-companion): drop dead glob helper + bracket-access d…
callmeYe Apr 20, 2026
a18a3fb
test(filesearch): Windows — tear down FileIndexService before rmdir'i…
callmeYe Apr 20, 2026
ea82f9d
fix(filesearch): audit round 7 — CR follow-ups from @yiliang114
callmeYe Apr 21, 2026
1f5ea90
merge: upstream/main into feat/filesearch-worker-p1
callmeYe Apr 21, 2026
44fcc11
fix(filesearch): audit round 8 — scoped transport install + unref() t…
callmeYe Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 58 additions & 38 deletions esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,45 +72,65 @@ const external = [
'@teddyzhu/clipboard-win32-arm64-msvc',
];

esbuild
.build({
entryPoints: ['packages/cli/index.ts'],
bundle: true,
outfile: 'dist/cli.js',
platform: 'node',
format: 'esm',
target: 'node20',
external,
packages: 'bundle',
inject: [path.resolve(__dirname, 'scripts/esbuild-shims.js')],
banner: {
js: `// Force strict mode and setup for ESM
const commonBundleOptions = {
bundle: true,
platform: 'node',
format: 'esm',
target: 'node20',
external,
packages: 'bundle',
define: {
'process.env.CLI_VERSION': JSON.stringify(pkg.version),
// Make global available for compatibility
global: 'globalThis',
},
loader: { '.node': 'file' },
plugins: [wasmBinaryPlugin, wasmLoader({ mode: 'embedded' })],
write: true,
keepNames: true,
};

const mainBuild = esbuild.build({
...commonBundleOptions,
entryPoints: ['packages/cli/index.ts'],
outfile: 'dist/cli.js',
inject: [path.resolve(__dirname, 'scripts/esbuild-shims.js')],
banner: {
js: `// Force strict mode and setup for ESM
"use strict";`,
},
alias: {
'is-in-ci': path.resolve(
__dirname,
'packages/cli/src/patches/is-in-ci.ts',
),
'@qwen-code/web-templates': path.resolve(
__dirname,
'packages/web-templates/src/index.ts',
),
// Resolve to userland punycode instead of deprecated node:punycode built-in
punycode: require.resolve('punycode/'),
},
define: {
'process.env.CLI_VERSION': JSON.stringify(pkg.version),
// Make global available for compatibility
global: 'globalThis',
},
loader: { '.node': 'file' },
plugins: [wasmBinaryPlugin, wasmLoader({ mode: 'embedded' })],
metafile: true,
write: true,
keepNames: true,
})
.then(({ metafile }) => {
},
alias: {
'is-in-ci': path.resolve(__dirname, 'packages/cli/src/patches/is-in-ci.ts'),
'@qwen-code/web-templates': path.resolve(
__dirname,
'packages/web-templates/src/index.ts',
),
// Resolve to userland punycode instead of deprecated node:punycode built-in
punycode: require.resolve('punycode/'),
},
metafile: true,
});

// The file-index worker runs in its own worker_threads process and must exist
// as a standalone file next to dist/cli.js so that `new URL('./fileIndexWorker.js',
// import.meta.url)` resolves at runtime (the main bundle's import.meta.url is
// dist/cli.js). We bundle it self-contained so fzf/fdir get inlined and no
// node_modules resolution is required from the published tarball.
const workerBuild = esbuild.build({
...commonBundleOptions,
entryPoints: ['packages/core/src/utils/filesearch/fileIndexWorker.ts'],
outfile: 'dist/fileIndexWorker.js',
// fdir and other transitive CJS deps use require() at runtime, which is
// not available in ESM output without this shim. Same pattern as the main
// CLI bundle above.
inject: [path.resolve(__dirname, 'scripts/esbuild-shims.js')],
banner: {
js: `"use strict";`,
},
});

Promise.all([mainBuild, workerBuild])
.then(([{ metafile }]) => {
if (process.env.DEV === 'true') {
writeFileSync('./dist/esbuild.json', JSON.stringify(metafile, null, 2));
}
Expand Down
Loading
Loading