refactor(cli): use defaults-with-overrides pattern for EDITOR_CONFIGS#886
Conversation
Introduce EDITOR_DEFAULTS constant with the most common EditorConfig values (defaultHttpConfig, mcpServers, jsonc, readTokenFromHeaders). Each EDITOR_CONFIGS entry now spreads the defaults and only declares detect + any overrides, making deviations immediately visible. Remove 5 pass-through buildServerConfig wrappers that just returned defaultHttpConfig(token): buildClaudeCodeServerConfig, buildCursorServerConfig, buildGeminiCliServerConfig, buildVSCodeServerConfig, buildVSCodeInsidersServerConfig. Reduces editorConfigs.ts from 350 to 267 lines with no behavioral change.
|
Claude finished @drewlyton's task in 27s —— View job Review
The Looking at the diff more carefully — |
📦 Bundle Stats —
|
| Metric | Value | vs cursor/ai-dev-tools-support-2783 (dc59192) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.95 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 741ms | +0ms, +0.0% |
bin:sanity
| Metric | Value | vs cursor/ai-dev-tools-support-2783 (dc59192) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.75s | +1ms, +0.1% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against cursor/ai-dev-tools-support-2783 (dc59192e)
| Metric | Value | vs cursor/ai-dev-tools-support-2783 (dc59192) |
|---|---|---|
| Internal (raw) | 92.3 KB | - |
| Internal (gzip) | 21.6 KB | - |
| Bundled (raw) | 21.53 MB | - |
| Bundled (gzip) | 3.41 MB | - |
| Import time | 691ms | -4ms, -0.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against cursor/ai-dev-tools-support-2783 (dc59192e)
| Metric | Value | vs cursor/ai-dev-tools-support-2783 (dc59192) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
ada91a8
into
cursor/ai-dev-tools-support-2783
Summary
EDITOR_DEFAULTSconstant with the most commonEditorConfigvalues (defaultHttpConfig,mcpServers,jsonc,readTokenFromHeaders)EDITOR_CONFIGSentry now spreads the defaults and only declaresdetect+ any overrides, making deviations from the norm immediately visiblebuildServerConfigwrappers that just returneddefaultHttpConfig(token)Reduces
editorConfigs.tsfrom 350 to 267 lines (-24%) with no behavioral change. Types, lint, and all direct unit tests pass.