refactor(ui-codemods): add ui metapackage to icon codemod and simplif…#2472
Open
joyenjoyer wants to merge 1 commit intomasterfrom
Open
refactor(ui-codemods): add ui metapackage to icon codemod and simplif…#2472joyenjoyer wants to merge 1 commit intomasterfrom
joyenjoyer wants to merge 1 commit intomasterfrom
Conversation
31ecc9a to
ad08c25
Compare
joyenjoyer
commented
Mar 18, 2026
| printWarning, | ||
| renameElements, | ||
| renameImportAndUsages | ||
| } from './utils/codemodHelpers' |
Contributor
Author
There was a problem hiding this comment.
I refactored the codemod and used these helper functions.
joyenjoyer
commented
Mar 18, 2026
| const IMPORT_PATHS = [ | ||
| '@instructure/ui-icons', | ||
| '@instructure/ui-icons/es/svg', | ||
| '@instructure/ui' |
Contributor
Author
There was a problem hiding this comment.
This is the key part of this PR.
ad08c25 to
a650273
Compare
|
matyasf
requested changes
Mar 19, 2026
Comment on lines
+70
to
+75
| function warnUnmappedIcons( | ||
| j: JSCodeshift, | ||
| root: Collection, | ||
| filePath: string | ||
| ): void { | ||
| // findEveryImport only accepts a single path, so flatMap collects results across all paths |
Collaborator
There was a problem hiding this comment.
When can this happen? We have icons which have no mappings?
Contributor
Author
There was a problem hiding this comment.
This may happen, when the mapping file changes so I believe it is worth preparing for this case (we get a new mapping.json and a line gets deleted mistakenly).
a650273 to
147f9e5
Compare
matyasf
approved these changes
Mar 20, 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.
CLOSES INSTUI-4935
During refactoring I added already existing helper functions to the icon migration codemod and added the
uimetapackage with new test fixtures.Test: Run
pnpm -w run test:vitest ui-codemodsand check for any errors