feat: add transform for useMergerefs#531
Merged
adrienzheng-cb merged 5 commits intocds-v9from Apr 1, 2026
Merged
Conversation
210d818 to
1da79b2
Compare
61b696b to
ef54a48
Compare
hcopp
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Summary
This PR extends the CDS migrator for the v8 → v9 workflow: a new
useMergeRefs→mergeRefscodemod,button-variant-valuesmoved undertransforms/v9/with scope-agnostic import matching, and an optional npm package scope flag so consumers can limit rewrites without hard-coding internal registry names.What changed
New:
migrate-use-merge-refs(v9)useMergeRefsimports from@<scope>/cds-common/hooks/useMergeRefstomergeRefsfrom@<scope>/cds-common/utils/mergeRefs(scope is preserved).@<any-scope>/cds-common/...so the open-source migrator does not depend on a specific org prefix.button-variant-values(v9)packages/migrator/src/transforms/v9/.@<scope>/cds-weband@<scope>/cds-mobile(any scope), not a fixed list of scoped package names.CLI: package scope (
-ps/--package-scope)--package-scope <scope>(shorthand-ps) limits scope-aware transforms to a single npm scope (e.g.coinbaseor@coinbase).--packageScope=…to jscodeshift; transforms readoptions.packageScope.packages/migrator/src/utils/package-scope.tscentralizes normalization (coinbase→@coinbase) and reading options.Docs & tooling
CLI_REFERENCE.mdupdated for package scope and shorthand.Usage examples
Root cause (required for bugfixes)
UI changes
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false