feat(cli): expand MCP editor detection coverage#883
feat(cli): expand MCP editor detection coverage#883joneidejohnsen wants to merge 6 commits intomainfrom
Conversation
Co-authored-by: Jon Eide Johnsen <joneidejohnsen@gmail.com>
|
Claude finished @drewlyton's task in 2m 46s —— View job Code Review
Two issues found: 1.
process.env.APPDATA = originalAppData // originalAppData is `undefined` on Linux/macOS
Fix: Fix this → if (originalAppData === undefined) {
delete process.env.APPDATA
} else {
process.env.APPDATA = originalAppData
}2.
async function detectCline(): Promise<string | null> {
const vscodeUserDir = getVSCodeUserDir() // only 'stable'Cline installed in VS Code Insiders stores its settings at the Insiders path ( |
📦 Bundle Stats —
|
| Metric | Value | vs main (9748ee9) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.95 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 837ms | -9ms, -1.1% |
bin:sanity
| Metric | Value | vs main (9748ee9) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.99s | -11ms, -0.5% |
🗺️ 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 main (9748ee93)
| Metric | Value | vs main (9748ee9) |
|---|---|---|
| Internal (raw) | 92.3 KB | - |
| Internal (gzip) | 21.6 KB | - |
| Bundled (raw) | 21.53 MB | - |
| Bundled (gzip) | 3.41 MB | - |
| Import time | 802ms | -2ms, -0.2% |
🗺️ 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 main (9748ee93)
| Metric | Value | vs main (9748ee9) |
|---|---|---|
| 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.
Coverage Delta
Comparing 2 changed files against main @ Overall Coverage
|
…#886) 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.
Summary
sanity mcp configureeditor support against Neonadd-mcpand VercelskillsExternal comparison
Compared against:
add-mcpsupported agents list (README.md,src/agents.ts)skillssupported agents list (README.md,src/agents.ts)Coverage now aligned with
add-mcpCovered in Sanity CLI after this change:
Remaining from
add-mcpnot added in this PR:add-mcp; not part of current HTTP tokenized Sanity MCP setup)skillsincludes many additional agents, but most are skills-directory ecosystems rather than direct MCP-config targets forsanity mcp configure.Follow-up fixes from review comments
detectClineClito detect based on Cline home root (CLINE_DIR/~/.cline) so fresh installs are detected beforedata/settingsexistsmcporter.jsonbranchmcporter.jsonnormcporter.jsoncexists, defaults tomcporter.json)CI follow-up fixes
~/.gemini/settings.json(instead of only~/.gemini)settings.jsonspecificallydefaultHttpConfigdirectly\tmp\...vsC:\tmp\...)Testing
pnpm --filter @sanity/cli exec vitest run src/commands/mcp/__tests__/configure.test.ts src/actions/mcp/__tests__/editorConfigs.test.ts --config vitest.config.ts✅pnpm --filter @sanity/cli check:types✅pnpm --filter @sanity/cli exec eslint src/actions/mcp/editorConfigs.ts src/actions/mcp/__tests__/editorConfigs.test.ts src/commands/mcp/__tests__/configure.test.ts src/commands/mcp/configure.ts✅ (warnings only in pre-existing test import style)pnpm check:format✅Slack Thread