feat(ui-codemods): add codemod to support versioned import updates#2513
Merged
joyenjoyer merged 2 commits intomasterfrom Apr 23, 2026
Merged
Conversation
67cd411 to
2800cc5
Compare
|
2800cc5 to
a129ec6
Compare
a129ec6 to
b2a270a
Compare
matyasf
reviewed
Apr 15, 2026
b2a270a to
81662ed
Compare
git-nandor
approved these changes
Apr 15, 2026
matyasf
requested changes
Apr 17, 2026
Collaborator
matyasf
left a comment
There was a problem hiding this comment.
See my comments. Overall it looks OK
ce06caa to
7da8378
Compare
joyenjoyer
commented
Apr 21, 2026
| @@ -1,5 +1,4 @@ | |||
| #! /usr/bin/env node | |||
| /* eslint-disable no-console */ | |||
Contributor
Author
There was a problem hiding this comment.
Linter complained about this, I removed it.
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.
Summary
updateInstUIImportVersionsjscodeshift codemod that rewrites@instructure/*import paths to a specific version subpath (e.g.
@instructure/ui-buttons/v11_7)them into two declarations rather than blindly rewriting everything
generateVersionedExportsscript that reads the latest version summary file in@instructure/uito auto-generate the list of known versioned components; wiredinto
prepare-buildso it stays up to dateTest Plan
pnpm run test:vitest ui-codemodsEither you test the new commands in a chosen path or I recommend using the canvas-lms project. Check out the canvas repo from this link: https://github.com/instructure/canvas-lms
Diagnose command
Diagnose — all versioned components (no files written)
already-migrated files, [oldest] for legacy unversioned JSX files)
Diagnose — filter to specific components:
Update command
Update — all versioned components to v11.7:
Update — only imports pinned to a specific version (--versionFrom):
Update — specific components only (--components):