Skip to content

feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap - #39

Open
dreamwasp wants to merge 4 commits into
cass-gmt-1790-scaffoldfrom
cass-gmt-1790-scope-rename
Open

dreamwasp wants to merge 4 commits into
cass-gmt-1790-scaffoldfrom
cass-gmt-1790-scope-rename

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Breaking change: every @codecademy/gamut* package moves to @skillsoft/*, and @codecademy/gamut-kit is removed with no replacement.

Stack (split from #28, merge in order):

  1. feat(gamut-codemods): add the codemods CLI and an empty scope-swap preset #38 Scaffold, based on main
  2. feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39 Package scope rename and gamut-kit removal, based on feat(gamut-codemods): add the codemods CLI and an empty scope-swap preset #38 👈 this PR
  3. feat(gamut-codemods): move Video imports and add Markdown video overrides #40 Video and Markdown, based on feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39
  4. feat(gamut)!: promote deep imports to the root, renaming Menu and SelectDropdown elements #41 Deep imports and Menu/SelectDropdown renames, based on feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39
  5. feat(gamut-codemods): rename the ESLint plugin prefix in scope-swap #42 ESLint plugin prefix, based on feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39
  6. feat(gamut-codemods): warn about esmExternals: false in next.config #43 Next.js esmExternals warning, based on feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39
  7. build(deps): make @skillsoft packages easier to install #44 Simpler dependencies (independent), based on main
  8. feat(gamut-agent-tools): add the gamut-scope-swap skill #45 gamut-scope-swap skill (open last), based on feat(gamut-codemods): rename packages and replace gamut-kit in scope-swap #39, includes feat(gamut-codemods): move Video imports and add Markdown video overrides #40–feat(gamut-codemods): warn about esmExternals: false in next.config #43
  • scope-rename swaps the old names in every module position: imports, exports, require, import(), jest.mock/vi.mock, declare module, and import('x').T. It also covers exact package strings like transpilePackages, warning once per file, and package names in comments. It runs last, so every other migration matches on @codecademy names.
  • package-json renames dependencies and sets their versions. It keeps any @skillsoft/* entry that's already listed (such as a preview URL) and keeps * peer ranges. It warns when a range is newer than the upstream release the fork matches (sourceVersions).
  • gamut-kit removal:
    • package-json expands it into the packages it bundled.
    • mf-shared does the same in Module Federation shared config. That makes Gamut a real singleton across host and remotes, and the checklist says to deploy them together.
  • mdx-imports runs the source migrations over .mdx ESM blocks.
  • yarnrc renames or drops old names in .yarnrc.yml lists.

Video, deep imports, ESLint, and Next.js are separate PRs stacked on this one.

PR Checklist

  • Related to designs: N/A
  • Related to JIRA ticket: GMT-1790
  • Changeset added
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions for the code change
  • Package previews from this PR are passing end-to-end tests in all relevant consuming repositories

Testing Instructions

  1. yarn nx test gamut-codemods. Expect 65 tests to pass. That includes the fixtures for each migration and an end-to-end fixture that runs the whole preset.

  2. Build and run on a throwaway repo:

    yarn nx build gamut-codemods
    mkdir -p /tmp/swap && cd /tmp/swap && git init -q
    printf "import { Box } from '@codecademy/gamut';\njest.mock('@codecademy/gamut-styles');\n" > a.tsx
    printf "import { Box } from '@codecademy/gamut';\n\n# Doc\n" > doc.mdx
    echo '{ "dependencies": { "@codecademy/gamut": "^73.0.0", "@codecademy/gamut-kit": "^73.0.0" } }' > package.json
    echo "export const shared = { '@codecademy/gamut-kit': { singleton: true } };" > mf.ts
    git add -A && git commit -qm init
    node <repo>/packages/gamut-codemods/dist/bin.js scope-swap .
  3. Check git diff:

    • imports, mocks, and doc.mdx use @skillsoft/*
    • package.json lists each package that gamut-kit bundled, with no gamut-kit
    • mf.ts shares each package individually
  4. Check that the next steps include the gamut-kit and Module Federation items.

  5. Rerun with --force. Nothing should change.

PR Links and Envs

Repository PR Link
Mono N/A

🤖 Generated with Claude Code

…swap

scope-rename swaps @Codecademy/gamut* and eslint-plugin-gamut for their
@SkillSoft names in every module position and in comments. package-json,
mdx-imports, and yarnrc cover dependencies, MDX ESM blocks, and
.yarnrc.yml lists.

@codecademy/gamut-kit has no replacement, so package-json and mf-shared
expand it into the packages it bundled. In Module Federation config that
makes Gamut a real singleton, which the checklist calls out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp and others added 3 commits October 20, 2026 11:10
…migrations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package-json warning already names each range that's newer than the
fork point, so the extra next step only repeated it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dreamwasp
dreamwasp marked this pull request as ready for review October 20, 2026 15:37
@dreamwasp
dreamwasp requested a review from a team as a code owner October 20, 2026 15:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant