Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .cursor/worktrees.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"setup-worktree": [
"yarn install"
]
"setup-worktree": ["yarn install"]
}
1 change: 1 addition & 0 deletions src/commands/diff/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ describe('diff', () => {
expect(ctx.stdout).toContain('removed-variable')
},
)

test.stdout()
.command([
'diff',
Expand Down
3 changes: 1 addition & 2 deletions src/commands/diff/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ export default class Diff extends Base {
// Try to find alias by direct match first, then by transformed constant name
// This handles cases where the generated types file creates constants like MY_VARIABLE
// for a variable key like 'my-variable'
const aliasedName =
aliasMap[match.name] || aliasMap[keyToConstant(match.name)]
const aliasedName = aliasMap[match.name]
if (match.isUnknown && aliasedName) {
match.alias = match.name
match.name = aliasedName
Expand Down
4 changes: 0 additions & 4 deletions test-utils/fixtures/configs/autoAliasConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ org:
typeGenerator:
outputPath: "./test-utils/fixtures/configs/mockTypes.ts"

codeInsights:
matchPatterns:
ts:
- ":\\s*([a-z][a-z0-9-]*)"

20 changes: 8 additions & 12 deletions test-utils/fixtures/diff/auto-alias-transform
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
diff --git a/test-utils/fixtures/diff/sampleDiff b/test-utils/fixtures/diff/sampleDiff
new file mode 100644
index 00000000..e69de29b
diff --git a/test-utils/fixtures/diff/sampleDiff.ts b/test-utils/fixtures/diff/sampleDiff.ts
new file mode 100644
index 00000000..ed8ee4ab
index 00000000..e69de29b
--- /dev/null
+++ b/test-utils/fixtures/diff/sampleDiff.ts
<insert>+++ b/test-utils/fixtures/diff/sampleDiff.ts
@@ -1,1 +1,21 @@
+const config = {
+ feature: my-test-variable,
+ beta: enable-feature
+}
-const old = {
- feature: removed-variable
-}

+const featureIsEnabled = useVariableValue('my-test-variable', true)
+const betaFeatureEnabled = useVariableValue('enable-feature', true)
+const removedFeatureIsEnabled = useVariableValue(REMOVED_VARIABLE, true)
-const betaFeatureDisabled = useVariableValue('my-test-variable', false)
-const featureIsDisabled = useVariableValue('my-test-variable', false)
-const removedFeatureIsDisabled = useVariableValue(REMOVED_VARIABLE, false)