diff --git a/.changeset/gamut-codemods-deep-imports.md b/.changeset/gamut-codemods-deep-imports.md new file mode 100644 index 0000000000..9c62c709cd --- /dev/null +++ b/.changeset/gamut-codemods-deep-imports.md @@ -0,0 +1,5 @@ +--- +'@skillsoft/gamut-codemods': minor +--- + +`scope-swap` now rewrites `/dist/` deep imports that have a public replacement to the package root, and merges them into an existing import from the same package. Renamed exports keep their local name, so `import { List } from '@codecademy/gamut/dist/Menu/elements'` becomes `import { MenuList as List } from '@skillsoft/gamut'`. Imports of names that stayed internal, deep imports with no public replacement (`ButtonBase`), unknown deep imports, and deep paths in mocks or `require()` get a warning. diff --git a/.changeset/gamut-codemods-scope-swap.md b/.changeset/gamut-codemods-scope-swap.md new file mode 100644 index 0000000000..e6581a6692 --- /dev/null +++ b/.changeset/gamut-codemods-scope-swap.md @@ -0,0 +1,5 @@ +--- +'@skillsoft/gamut-codemods': minor +--- + +Add `@skillsoft/gamut-codemods`, a CLI for moving a repo from `@codecademy/gamut*` to `@skillsoft/gamut*`. Run `npx @skillsoft/gamut-codemods scope-swap .` from a clean working tree. This release adds the runner and the `scope-swap` preset with no migrations yet: a run lists every line that still names an old package and prints next steps. Pass `--dry` to preview, `--only=a,b` to pick migrations, and `--no-report` to skip the leftovers list. diff --git a/.changeset/gamut-root-exports.md b/.changeset/gamut-root-exports.md new file mode 100644 index 0000000000..e61364305e --- /dev/null +++ b/.changeset/gamut-root-exports.md @@ -0,0 +1,22 @@ +--- +'@skillsoft/gamut': minor +--- + +**Breaking:** export Menu's list elements and SelectDropdown's option component from the package root, under new names that don't collide with the public `List` component and `IconOption` type. + +| Old (`dist/Menu/elements`, `dist/Form/SelectDropdown/elements`) | New (`@skillsoft/gamut`) | +| --------------------------------------------------------------- | ----------------------------------- | +| `List`, `ListProps` | `MenuList`, `MenuListProps` | +| `ListItem`, `ListItemProps` | `MenuListItem`, `MenuListItemProps` | +| `ListLink`, `ListLinkProps` | `MenuListLink`, `MenuListLinkProps` | +| `ListButton` | `MenuListButton` | +| `IconOption` (the component) | `IconOptionComponent` | + +`MenuToolTipWrapper` is now exported from the root too. The `IconOption` type is unchanged. + +Also new at the root: + +- `formFieldStyles`, `formFieldPaddingStyles`, and `conditionalStyles`, for custom inputs that should look like `Input`, such as third-party hosted payment fields. The rest of `Form/styles` stays internal. +- The `HTMLToReactNode` and `ButtonBaseProps` types. + +Coming from `@codecademy/gamut`, `npx @skillsoft/gamut-codemods scope-swap .` rewrites imports of all of these, including from their old `/dist/` paths. diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index 4b130ca39c..cdf0c44d2f 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -56,6 +56,7 @@ Every skillsoft-gamut pull request publishes installable previews through pkg.pr | Migration | What it does | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Menu's `List*` and SelectDropdown's `IconOption` component were renamed on the way to the root. | | `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | | `markdown-video-overrides` | Markdown no longer renders `