Repository navigation
feat(gamut-codemods): warn about esmExternals: false in next.config - #43
Merged
Merged
Conversation
…eset Adds @skillsoft/gamut-codemods: the CLI (clean-tree guard, --dry, --only, --no-report, --force), the runner for ast, splice, and file migrations, the shared helpers (module-string finder, leftovers report, version-range checks, flat ESLint config detection), the preset registry, and the fixture harness. The scope-swap preset has its package map but no migrations yet, so a run only reports the lines that still name an old package. Each breaking change lands its migration in its own PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
@skillsoft/gamut ships strict-ESM .mjs. With experimental.esmExternals off, Next require()s server externals and default imports from @emotion/styled and react-select break while it collects page data. next-config is report-only: dropping the flag can take other config with it, so it warns and adds a checklist item instead of rewriting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Merged
CodeQL read `migration.match(file)` in cli.ts as String.prototype.match on a command-line argument and flagged js/regex-injection. Nothing builds a regex from the path; the method just had the same name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…migrations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
# Conflicts: # packages/gamut-codemods/src/presets/scope-swap/index.ts
dreamwasp
marked this pull request as ready for review
October 20, 2026 16:56
LinKCoding
approved these changes
Oct 27, 2026
LinKCoding
left a comment
Contributor
There was a problem hiding this comment.
wasn't entirely sure what this one is doing tbh
but testing instructions are working as intended
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-codemods
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
=======================================
Coverage ? 99.15%
=======================================
Files ? 24
Lines ? 952
Branches ? 280
=======================================
Hits ? 944
Misses ? 8
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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: Next.js apps that set
experimental.esmExternals: falsecan fail to build or prerender on@skillsoft/gamut. Gamut ships strict-ESM.mjs. With that flag, Nextrequire()s server externals, so default imports from@emotion/styledandreact-selectget a module object. The result isstyled(...) is not a functionorElement type is invalidwhile Next collects page data.Stack (split from #28, merge in order):
mainmainnext-configis report only. It warns aboutesmExternals: falseinnext.config.*and adds a checklist item to remove it, along with any@emotion/*aliases ortranspilePackagesentries that were working around it.NEXT_EMOTION_INTEROP.md) ships with the agent skill PR.PR Checklist
Testing Instructions
yarn nx test gamut-codemods. Expect 68 tests to pass.Build and run on a throwaway repo:
Expect a
[next-config]warning fornext.config.jsand the "Some next.config files set..." next step.next.config.jsitself is unchanged.PR Links and Envs
🤖 Generated with Claude Code