Skip to content

Conversation

joffeoja
Copy link
Contributor

@joffeoja joffeoja commented Sep 22, 2025

Summary

This PR removes support for config.ts and all associated esbuild runtime packaging logic across the repository.

Per discussion in #4173, the only remaining reason for including esbuild in core was to compile config.ts. That feature was deprecated more than 6 months ago, so it is now fully removed.


Changes

Core

  • Removed logic for compiling and importing ~/.continue/config.ts from load.ts.
  • Added fail-fast detection: if a legacy config.ts is present, Continue will stop and instruct the user to migrate to config.yaml or config.json.
  • Dropped getTsConfigPath and other helpers in util/paths.ts.
  • Adjusted comments, error messages, and tests (ConfigHandler.vitest.ts).
  • Cleaned up core/package.json:
    • Removed esbuild runtime dependency.
    • Retained build-time plugins where still required (e.g. @sentry/esbuild-plugin).

Documentation

  • Updated configuration.mdx:
    • Removed all references to config.ts.
    • Clarified that YAML is now the recommended format.
    • Noted that config.ts is fully removed as of 2025.

Motivation

  • Reduce maintenance overhead by removing esbuild from the runtime.
  • Align codebase with current supported configuration formats (config.yaml and config.json).
  • Make future dependency management and security scanning simpler.

Security

This PR removes any embedded esbuild runtime from our VSIX and core. That:

  • Eliminates scanner findings tied to older esbuild executables and their transitive Go stdlib CVEs, which motivated upstream discussion in esbuild#3802.
  • Avoids exposure to the dev server CORS issue (GHSA-67mh-4wv8-2f99) since we do not ship or run esbuild’s dev server in end-user artifacts.
  • Ensures esbuild is used only as a build-time tool, never packaged for end users.

Supersedes #7790, which attempted to mitigate by upgrading the embedded binary; this PR removes the runtime binary entirely.


Related Issue

Refs #4173

- remove logic for compiling and importing ~/.continue/config.ts
- add fail-fast error if a legacy config.ts is detected
- simplify loader to JSON/YAML only
- skip one legacy test and adjust comments/strings

refs continuedev#4173
- drop esbuild and @sentry/esbuild-plugin from core devDependencies
- retypecheck and test after removal
… scaffolding

- drop @esbuild hoist rule in .npmrc
- remove esbuild from runtime dependencies (keep in devDeps for bundling)
- strip esbuild download/copy and validation in prepackage scripts
- remove getTsConfigPath import and config.ts scaffolding from activation
@joffeoja
Copy link
Contributor Author

@Patrick-Erichsen: A first attempt to removing the bundled esbuild executable from the vscode extension. npm run package-all works fine locally but some tests in the ci pipeline still seem to fail. Please let me know your thoughts on the code. My time is somewhat limited even though I used an AI assisted approach here so feel free to rework the code as you see fit.

@joffeoja joffeoja marked this pull request as ready for review September 22, 2025 18:16
@joffeoja joffeoja requested a review from a team as a code owner September 22, 2025 18:16
@joffeoja joffeoja requested review from RomneyDa and removed request for a team September 22, 2025 18:16
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 22, 2025
@Patrick-Erichsen Patrick-Erichsen requested review from Patrick-Erichsen and removed request for RomneyDa September 22, 2025 21:31
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much confusing code removed with this 🙌 Changes all look great aside from a few nitpicks on additional cleanup

As to the failing tests, I would recommend trying to just pass the output to an LLM for a few attempts at bugfixing. At a glance it seems like the issue isn't related to actual config.ts logic in any of the tests but rather some build issues.

If that doesn't work though I'd be happy to take a stab at fixing some of the tests though.

Comment on lines 463 to 465
void this.configHandler.reloadConfig(
"config.yaml updated - fs file watch",
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole fn watcher is not necessary. Also getConfigTsPath should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the watcher but getConfigTsPath() is being used here for fail fast legacy config.ts detection. Would you like me to remove this as well?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 22, 2025
@RomneyDa
Copy link
Collaborator

RomneyDa commented Sep 24, 2025

@TyDunn let's talk about this one, might be other approaches to removing esbuild that don't remove config.ts support.

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joffeoja this is great. Spoke with the team further about this and we're thinking let's remove esbuild module installation while still supporting config.ts by assuming users already have esbuild installed and showing them an error with instructions if they don't e.g. config.ts has been deprecated and esbuild is no longer automatically installed by Continue. To use config.ts, you can run npm i [email protected] in ~/.continue`. Sorry for the partial bait and switch on this

This would look like about half of this PR staying exactly the same and then the actual config loading left in place for now with that message if esbuild isn't found. I added some comments and let me know if you have any thoughts on this!

await copyTreeSitterWasms();

// Copy tree-sitter tag query files
await copyTreeSitterTagQryFiles();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we can remove tree sitter? Not config-ts related

"dbinfoz": "^0.14.0",
"diff": "^7.0.0",
"downshift": "^7.6.0",
"esbuild": "0.17.19",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this esbuild is used for local dev, not the same as the one used for config.ts. Does that make sense? Or is this just unused?

}

// Add necessary files
getTsConfigPath();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one can stay so that legacy users just have to npm i esbuild rather than trying to set up some ts config

}
```

### How to Use `config.ts` for Advanced Configuration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replace with a little deprecation note including how to install esbuild to use existing config.ts files

"@typescript-eslint/eslint-plugin": "^8.40.0",
"@typescript-eslint/parser": "^8.40.0",
"cross-env": "^7.0.3",
"esbuild": "0.17.19",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these esbuild modules are separate from the ones copied for config.ts support? maybe not

import fs from "node:fs";
import path from "node:path";

import { describe, expect, test } from "vitest";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can leave this file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can leave this file as is and add an ide message with instructions on how to install esbuild if it is not found

- [`config.json`](/reference) - The original configuration format which is stored in a file at the same location as `config.yaml`
- [`.continuerc.json`](#how-to-use-continuercjson-for-workspace-configuration) - Workspace-level configuration
- [`config.ts`](#how-to-use-configts-for-advanced-configuration) - Advanced configuration (probably unnecessary) - a TypeScript file in your home directory that can be used to programmatically modify (_merged_) the `config.json` schema:
- `~/.continue/config.ts` (MacOS / Linux)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can leave in place with deprecation notice

console.log("[info] Downloading pre-built ripgrep binary");
rimrafSync("node_modules/@vscode/ripgrep/bin");
fs.mkdirSync("node_modules/@vscode/ripgrep/bin", { recursive: true });
4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

}

async function copyTreeSitterTagQryFiles() {
// ncp(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see, it's empty

@joffeoja
Copy link
Contributor Author

joffeoja commented Sep 27, 2025

@RomneyDa & @Patrick-Erichsen: With these scope changes I think it's better to start over completely, not least for better readability when performing the code review... I'll leave this and the previous PR (#7790) for reference but to have a coherent changeset I feel I have start from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants