Repository navigation
feat(gamut-codemods): move Video imports and add Markdown video overrides - #40
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>
…ides moved-exports moves Video and VideoProps from the root to @Codecademy/gamut/Video (scope-rename then swaps the scope). markdown-video-overrides adds explicit iframeOverride/videoOverride to each <Markdown>, since it no longer renders video through Video by default, and drops the removed skipDefaultOverrides keys. tsconfig-dom warns about tsconfigs without "dom", which Video used to supply. On the Gamut side, a Video/package.json stub makes the subpath resolve under node10, MarkdownVideo no longer passes NaN sizes, and a one-line <video> is no longer wrapped in a <p>. 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>
…rkdown # Conflicts: # packages/gamut-codemods/src/presets/scope-swap/index.ts
dreamwasp
marked this pull request as ready for review
October 20, 2026 15:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinKCoding
approved these changes
Oct 26, 2026
LinKCoding
left a comment
Contributor
There was a problem hiding this comment.
Looking good!
I also ran scope-swap on this and got these in next steps:
— next steps —
- Video needs two peer dependencies that Gamut no longer installs for you:
@vidstack/reactandreact-player. Gamut supports @vidstack/react 1.12.x only (its npmlatesttag is 0.6.x). Install them:yarn add @vidstack/react@~1.12.12 react-player@^3.4.0. - Some tsconfig files set "lib" without "dom" (see the tsconfig-dom warnings). Video no longer loads with the root import, and it was supplying the DOM types. Add "dom" to those files if type-checking fails on document, HTMLElement, ResizeObserver, and so on.
- Run your formatter and lint autofix (prettier --write, then eslint --fix). Split imports come out in recast style,
@skillsoftsorts differently from@codecademyfor import-order rules like simple-import-sort, and the shorter scope lets some wrapped imports fit on one line. - Reinstall (yarn), then type-check and run your tests.
- Work through the warnings above and the leftovers list.
^ steps 1 + 2 is 👍
The video + markdown pages in SB loads and works - I didn't see any <video> elements in <p> elements
Keep Video on the /Video subpath (moved-exports, markdown-video-overrides, tsconfig-dom) and take main's codemods rename and gamut-kit changes. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 89.54% 90.22% +0.68%
==========================================
Files 426 296 -130
Lines 7497 6732 -765
Branches 2406 2250 -156
==========================================
- Hits 6713 6074 -639
+ Misses 774 648 -126
Partials 10 10
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:
VideoandVideoPropsare no longer on the root export, and<Markdown>no longer renders<iframe>and<video>throughVideoby default. This PR has the codemod for both, plus the Gamut-side Video and Markdown fixes.Stack (split from #28, merge in order):
mainmainCodemod
moved-exportsmovesVideo/VideoPropsimports to@skillsoft/gamut/Video. It splits mixed imports and merges into an existing/Videoimport. Namespace imports,export *, and mocks that stubVideoget a warning instead.markdown-video-overridesaddsiframeOverride/videoOverride, withIframeandMarkdownVideoimported from/Video, to each<Markdown>that didn't opt out, so output stays the same.skipDefaultOverrides.iframe/.videokeys, writingiframeOverride={undefined}where a skip wastrue.@codecademy/gamutrange in the repo is already 74.0.0 or newer.tsconfig-dom(report only) warns about tsconfigs whoselibhas no"dom". Video used to supply the DOM types through the root import.@vidstack/reactandreact-playerpeers to install.@skillsoft/gamutVideo/package.jsonstub makes@skillsoft/gamut/Videoresolve undermoduleResolution: "node". The attwno-resolutionignore that was hiding this is removed.MarkdownVideo: no longer passesNaNwidth or height when the<video>has none.<video>:<video>...</video>on one line is no longer wrapped in a<p>./Videoimport path).PR Checklist
Testing Instructions
yarn nx test gamut-codemods. Expect 83 tests to pass.yarn nx test gamut. That includes the two new Markdown tests.yarn nx run gamut:verify-package. attw now runs without theno-resolutionignore.Build and run on a throwaway repo:
a.tsxshould importVideo,Iframe, andMarkdownVideofrom@skillsoft/gamut/Video, and<Markdown>should have both overrides. The next steps should list the Video peers and the tsconfigdomitem.Storybook: the Markdown stories with video still render, and a one-line
<video>isn't inside a<p>.Stacked PRs don't publish pkg.pr.new previews, because
preview.ymlonly runs for PRs intomain.PR Links and Envs
🤖 Generated with Claude Code