Skip to content

Conversation

@luxscious
Copy link
Contributor

Reverts #539

Copilot AI review requested due to automatic review settings November 6, 2025 18:50
@luxscious luxscious requested a review from a team as a code owner November 6, 2025 18:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the auto-alias transformation feature that attempted to resolve variable aliases by transforming constant names (e.g., MY_VARIABLE -> my-variable). The change simplifies alias resolution to rely solely on direct matches from the generated types file.

  • Inlined the keyToConstant utility function directly into the types generator
  • Removed the fallback transformation logic from the diff command's alias resolution
  • Cleaned up test fixtures and test cases related to the auto-alias transformation feature

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-utils/fixtures/diff/auto-alias-transform Removed test fixture file for auto-alias transformation feature
test-utils/fixtures/configs/mockTypes.ts Removed mock types file used for testing auto-alias transformation
test-utils/fixtures/configs/autoAliasConfig.yml Removed configuration file for auto-alias transformation tests
src/utils/keyToConstant.ts Removed utility function as it's now inlined in the types generator
src/commands/generate/types.ts Inlined the transformation logic and added lodash import
src/commands/diff/index.ts Simplified alias resolution by removing transformation fallback
src/commands/diff/diff.test.ts Removed test case for auto-alias transformation feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
Object.values(matchesBySdk).forEach((matches) => {
matches.forEach((m) => {
const match = { ...m }
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the keyToConstant transformation fallback means that aliases must now match exactly. Consider documenting this behavior change in the codebase or user-facing documentation to help users understand that the generated constant names from the types file must be used directly, without any automatic kebab-case transformation.

Suggested change
const match = { ...m }
const match = { ...m }
// NOTE: The removal of the keyToConstant transformation fallback means that aliases must now match exactly.
// The generated constant names from the types file must be used directly, without any automatic kebab-case transformation.

Copilot uses AI. Check for mistakes.

getVariableGeneratedName(variable: Variable) {
let constantName = keyToConstant(variable.key)
let constantName = upperCase(variable.key).replace(/\s/g, '_')
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This logic is now duplicated from the removed keyToConstant utility. While the utility was only used in one other place, consider extracting this transformation to a helper function within this file (e.g., private keyToConstant(key: string)) to make the transformation logic more explicit and maintainable, especially since it's a critical part of the variable name generation.

Copilot uses AI. Check for mistakes.
@luxscious luxscious merged commit 94d4b15 into main Nov 6, 2025
15 checks passed
@luxscious luxscious deleted the revert-539-tso-317-diff-is-not-matching-the-valuesalias-from-the-generated branch November 6, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants