Repository navigation
Conversation
…ectDropdown elements Exports formFieldStyles, formFieldPaddingStyles, conditionalStyles, ButtonBaseProps, HTMLToReactNode, MenuToolTipWrapper, and Menu's list elements from the root. The list elements and SelectDropdown's option component are renamed (MenuList*, MenuListButton, IconOptionComponent) so they don't collide with the public List component and IconOption type. The deep-imports codemod rewrites known /dist/ paths to the root, keeps local names across renames, merges into existing imports, and warns on paths with no public replacement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp
marked this pull request as ready for review
October 20, 2026 15:48
LinKCoding
approved these changes
Oct 26, 2026
LinKCoding
left a comment
Contributor
There was a problem hiding this comment.
running scope-swap prints:
All done.
Results:
0 errors
0 unmodified
1 skipped
1 ok
Time elapsed: 0.759seconds
— package.json and .eslintrc —
0 file(s) changed
— leftovers (0) —
— next steps —
1. Run your formatter and lint autofix (prettier --write, then eslint --fix). Split imports come out in recast style, `@skillsoft` sorts differently from `@codecademy` for import-order rules like simple-import-sort, and the shorter scope lets some wrapped imports fit on one line.
2. Reinstall (yarn), then type-check and run your tests.
3. Work through the warnings above and the leftovers list.
and checked SelectDD's icon and Menu stories and they load and working just as intended
| import { ListItem } from '@codecademy/gamut/dist/Menu/elements'; | ||
| import type { BoxProps } from '@codecademy/gamut'; | ||
| import type { PopoverContainerProps } from '@codecademy/gamut/dist/PopoverContainer/types'; | ||
| import { Box as Again } from '@codecademy/gamut/dist/Box/props'; |
Contributor
There was a problem hiding this comment.
just curious, why are we testing this?
my main gripe is that this repo is re-importing Box, where it seems like there should be a warning about that.
I guess if this is already done in practice, in order for the codemod to not break the code, then this is the path of least resistance. However, it still seems like a warning would be nice here (although I doubt it'd be hit, or I so really hope it doesn't get hit lol)
This branch has not been deployed
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.
Overview
Breaking change:
/dist/deep imports that have a public replacement are promoted to the package root. Menu's list elements and SelectDropdown's option component are renamed along the way, so they don't collide with the publicListcomponent andIconOptiontype.Stack (split from #28, merge in order):
mainmain@skillsoft/gamutdist/Menu/elements,dist/Form/SelectDropdown/elements)@skillsoft/gamut)List,ListPropsMenuList,MenuListPropsListItem,ListItemPropsMenuListItem,MenuListItemPropsListLink,ListLinkPropsMenuListLink,MenuListLinkPropsListButtonMenuListButtonIconOption(the component)IconOptionComponentMenuToolTipWrapper,formFieldStyles,formFieldPaddingStyles,conditionalStyles, and theHTMLToReactNodeandButtonBasePropstypes. The rest ofForm/stylesstays internal.Codemod
deep-importsrewrites known/dist/paths to the root and merges them into an existing import from the same package.import { List } from '.../dist/Menu/elements'becomesimport { MenuList as List } from '@skillsoft/gamut'.Form/styles)ButtonBase, which has no public replacementrequire()manifest.test.tsfails if a row could send a name to a target that doesn't export it.PR Checklist
Testing Instructions
yarn nx test gamut-codemods. Expect 73 tests to pass, includingmanifest.test.tsagainst the built dist.yarn nx test gamut. The export snapshot is updated, and Menu and SelectDropdown tests pass with the renames.yarn nx run gamut:verify.Build and run on a throwaway repo:
Expect
import { Box, MenuList as List } from '@skillsoft/gamut';, and a[deep-imports]warning thatButtonBaseis not public.Storybook: Menu and SelectDropdown stories look and behave as before.
PR Links and Envs
🤖 Generated with Claude Code