From 4e6b5cc19fb034f59210e0da242670ab315383ed Mon Sep 17 00:00:00 2001 From: Chris Yau Date: Mon, 23 Mar 2026 06:39:27 +0800 Subject: [PATCH] fix(install): add rust, cpp, csharp to legacy language alias map (#747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(install): add rust, cpp, csharp to legacy language alias map The legacy installer compatibility layer in install-manifests.js was missing entries for rust, cpp, and csharp — languages that have rules/ directories and (for rust/cpp) install-components.json entries. Running `./install.sh rust` fails with "Unknown legacy language: rust" because LEGACY_LANGUAGE_ALIAS_TO_CANONICAL and LEGACY_LANGUAGE_EXTRA_MODULE_IDS didn't include these languages. Fixes the issue reported in #694 by @mpiton. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy * fix(install): complete csharp legacy support and add resolution tests - Add lang:csharp component to install-components.json with framework-language module (matching cpp/rust pattern) - Update csharp mapping in LEGACY_LANGUAGE_EXTRA_MODULE_IDS from empty array to ['framework-language'] - Add end-to-end resolution tests for rust, cpp, and csharp verifying framework-language module is included in resolved moduleIds Addresses review feedback from Copilot, Greptile, CodeRabbit, and Cubic. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --------- Co-authored-by: Claude Co-authored-by: Happy --- manifests/install-components.json | 8 +++++++ scripts/lib/install-manifests.js | 6 +++++ tests/lib/install-manifests.test.js | 36 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/manifests/install-components.json b/manifests/install-components.json index ef6ccf01..8f3d7306 100644 --- a/manifests/install-components.json +++ b/manifests/install-components.json @@ -210,6 +210,14 @@ "framework-language" ] }, + { + "id": "lang:csharp", + "family": "language", + "description": "C# coding standards and patterns guidance. Currently resolves through the shared framework-language module.", + "modules": [ + "framework-language" + ] + }, { "id": "framework:laravel", "family": "framework", diff --git a/scripts/lib/install-manifests.js b/scripts/lib/install-manifests.js index a935ac68..16b1fbc1 100644 --- a/scripts/lib/install-manifests.js +++ b/scripts/lib/install-manifests.js @@ -37,6 +37,8 @@ const LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET = Object.freeze({ ], }); const LEGACY_LANGUAGE_ALIAS_TO_CANONICAL = Object.freeze({ + cpp: 'cpp', + csharp: 'csharp', go: 'go', golang: 'go', java: 'java', @@ -45,15 +47,19 @@ const LEGACY_LANGUAGE_ALIAS_TO_CANONICAL = Object.freeze({ perl: 'perl', php: 'php', python: 'python', + rust: 'rust', swift: 'swift', typescript: 'typescript', }); const LEGACY_LANGUAGE_EXTRA_MODULE_IDS = Object.freeze({ + cpp: ['framework-language'], + csharp: ['framework-language'], go: ['framework-language'], java: ['framework-language'], perl: [], php: [], python: ['framework-language'], + rust: ['framework-language'], swift: [], typescript: ['framework-language'], }); diff --git a/tests/lib/install-manifests.test.js b/tests/lib/install-manifests.test.js index 596cadde..7e6c743a 100644 --- a/tests/lib/install-manifests.test.js +++ b/tests/lib/install-manifests.test.js @@ -85,6 +85,9 @@ function runTests() { assert.ok(languages.includes('go')); assert.ok(languages.includes('golang')); assert.ok(languages.includes('kotlin')); + assert.ok(languages.includes('rust')); + assert.ok(languages.includes('cpp')); + assert.ok(languages.includes('csharp')); })) passed++; else failed++; if (test('resolves a real project profile with target-specific skips', () => { @@ -155,6 +158,39 @@ function runTests() { assert.ok(selection.moduleIds.includes('framework-language')); })) passed++; else failed++; + if (test('resolves rust legacy compatibility into framework-language module', () => { + const selection = resolveLegacyCompatibilitySelection({ + target: 'cursor', + legacyLanguages: ['rust'], + }); + + assert.ok(selection.moduleIds.includes('rules-core')); + assert.ok(selection.moduleIds.includes('framework-language'), + 'rust should resolve to framework-language module'); + })) passed++; else failed++; + + if (test('resolves cpp legacy compatibility into framework-language module', () => { + const selection = resolveLegacyCompatibilitySelection({ + target: 'cursor', + legacyLanguages: ['cpp'], + }); + + assert.ok(selection.moduleIds.includes('rules-core')); + assert.ok(selection.moduleIds.includes('framework-language'), + 'cpp should resolve to framework-language module'); + })) passed++; else failed++; + + if (test('resolves csharp legacy compatibility into framework-language module', () => { + const selection = resolveLegacyCompatibilitySelection({ + target: 'cursor', + legacyLanguages: ['csharp'], + }); + + assert.ok(selection.moduleIds.includes('rules-core')); + assert.ok(selection.moduleIds.includes('framework-language'), + 'csharp should resolve to framework-language module'); + })) passed++; else failed++; + if (test('keeps antigravity legacy compatibility selections target-safe', () => { const selection = resolveLegacyCompatibilitySelection({ target: 'antigravity',