Skip to content

Commit 4e6b5cc

Browse files
chris-yyauclaudehappy-otter
authored
fix(install): add rust, cpp, csharp to legacy language alias map (anomalyco#747)
* 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 anomalyco#694 by @mpiton. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <[email protected]> Co-Authored-By: Happy <[email protected]> * 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 <[email protected]> Co-Authored-By: Happy <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Happy <[email protected]>
1 parent 4f6f587 commit 4e6b5cc

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

‎manifests/install-components.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@
210210
"framework-language"
211211
]
212212
},
213+
{
214+
"id": "lang:csharp",
215+
"family": "language",
216+
"description": "C# coding standards and patterns guidance. Currently resolves through the shared framework-language module.",
217+
"modules": [
218+
"framework-language"
219+
]
220+
},
213221
{
214222
"id": "framework:laravel",
215223
"family": "framework",

‎scripts/lib/install-manifests.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const LEGACY_COMPAT_BASE_MODULE_IDS_BY_TARGET = Object.freeze({
3737
],
3838
});
3939
const LEGACY_LANGUAGE_ALIAS_TO_CANONICAL = Object.freeze({
40+
cpp: 'cpp',
41+
csharp: 'csharp',
4042
go: 'go',
4143
golang: 'go',
4244
java: 'java',
@@ -45,15 +47,19 @@ const LEGACY_LANGUAGE_ALIAS_TO_CANONICAL = Object.freeze({
4547
perl: 'perl',
4648
php: 'php',
4749
python: 'python',
50+
rust: 'rust',
4851
swift: 'swift',
4952
typescript: 'typescript',
5053
});
5154
const LEGACY_LANGUAGE_EXTRA_MODULE_IDS = Object.freeze({
55+
cpp: ['framework-language'],
56+
csharp: ['framework-language'],
5257
go: ['framework-language'],
5358
java: ['framework-language'],
5459
perl: [],
5560
php: [],
5661
python: ['framework-language'],
62+
rust: ['framework-language'],
5763
swift: [],
5864
typescript: ['framework-language'],
5965
});

‎tests/lib/install-manifests.test.js‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ function runTests() {
8585
assert.ok(languages.includes('go'));
8686
assert.ok(languages.includes('golang'));
8787
assert.ok(languages.includes('kotlin'));
88+
assert.ok(languages.includes('rust'));
89+
assert.ok(languages.includes('cpp'));
90+
assert.ok(languages.includes('csharp'));
8891
})) passed++; else failed++;
8992

9093
if (test('resolves a real project profile with target-specific skips', () => {
@@ -155,6 +158,39 @@ function runTests() {
155158
assert.ok(selection.moduleIds.includes('framework-language'));
156159
})) passed++; else failed++;
157160

161+
if (test('resolves rust legacy compatibility into framework-language module', () => {
162+
const selection = resolveLegacyCompatibilitySelection({
163+
target: 'cursor',
164+
legacyLanguages: ['rust'],
165+
});
166+
167+
assert.ok(selection.moduleIds.includes('rules-core'));
168+
assert.ok(selection.moduleIds.includes('framework-language'),
169+
'rust should resolve to framework-language module');
170+
})) passed++; else failed++;
171+
172+
if (test('resolves cpp legacy compatibility into framework-language module', () => {
173+
const selection = resolveLegacyCompatibilitySelection({
174+
target: 'cursor',
175+
legacyLanguages: ['cpp'],
176+
});
177+
178+
assert.ok(selection.moduleIds.includes('rules-core'));
179+
assert.ok(selection.moduleIds.includes('framework-language'),
180+
'cpp should resolve to framework-language module');
181+
})) passed++; else failed++;
182+
183+
if (test('resolves csharp legacy compatibility into framework-language module', () => {
184+
const selection = resolveLegacyCompatibilitySelection({
185+
target: 'cursor',
186+
legacyLanguages: ['csharp'],
187+
});
188+
189+
assert.ok(selection.moduleIds.includes('rules-core'));
190+
assert.ok(selection.moduleIds.includes('framework-language'),
191+
'csharp should resolve to framework-language module');
192+
})) passed++; else failed++;
193+
158194
if (test('keeps antigravity legacy compatibility selections target-safe', () => {
159195
const selection = resolveLegacyCompatibilitySelection({
160196
target: 'antigravity',

0 commit comments

Comments
 (0)