Skip to content

Add movePropToNewChildElement utility and formControls migration#36

Merged
origami-z merged 5 commits intomainfrom
claude/expand-edge-case-coverage-bYW7x
Jan 25, 2026
Merged

Add movePropToNewChildElement utility and formControls migration#36
origami-z merged 5 commits intomainfrom
claude/expand-edge-case-coverage-bYW7x

Conversation

@origami-z
Copy link
Owner

  • Add movePropToNewChildElement function to utils.js for moving JSX props to new child elements
  • Create formControls.js migration to migrate FormField from @salt-ds/lab to @salt-ds/core
    • Moves label prop to FormFieldLabel child
    • Moves helperText prop to FormFieldHelperText child
    • Migrates FormField import from @salt-ds/lab to @salt-ds/core
  • Add comprehensive edge case tests (41 new tests):
    • Basic prop migration (string literals, JSX expressions, template literals)
    • Import handling (adding to existing, creating new, avoiding duplicates)
    • Component aliasing support
    • Multiple instances, nested components, spread props
    • Parameter validation and error handling

- Add movePropToNewChildElement function to utils.js for moving JSX props to new child elements
- Create formControls.js migration to migrate FormField from @salt-ds/lab to @salt-ds/core
  - Moves label prop to FormFieldLabel child
  - Moves helperText prop to FormFieldHelperText child
  - Migrates FormField import from @salt-ds/lab to @salt-ds/core
- Add comprehensive edge case tests (41 new tests):
  - Basic prop migration (string literals, JSX expressions, template literals)
  - Import handling (adding to existing, creating new, avoiding duplicates)
  - Component aliasing support
  - Multiple instances, nested components, spread props
  - Parameter validation and error handling
- Add migrateFormControls boolean option (default: false) to args.js
- Import and conditionally call formControls migration in index.js
- Migration only runs when explicitly enabled with --migrateFormControls flag
Copy link
Owner Author

@origami-z origami-z left a comment

Choose a reason for hiding this comment

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

LGTM

@origami-z origami-z merged commit 4d243d5 into main Jan 25, 2026
1 check passed
@origami-z origami-z deleted the claude/expand-edge-case-coverage-bYW7x branch January 25, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants