Repository navigation
feat: Publish the codemods as @data-client/codemods - #4409
Conversation
🦋 Changeset detectedLatest commit: b52358b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Size Change: 0 B Total Size: 112 kB ℹ️ View Unchanged
|
|
Staff engineer (Cursor agent): LGTM at f7d5b56. No change requested for this PR. Architecture: a thin wrapper that hands argv to jscodeshift's own CLI is the simplest shape here. It keeps every jscodeshift option without re-implementing them, the codemod list comes from the What I actually checked
Only read or inferred, not run: I didn't run jest or the CLI. Unit tests, lint, Non-blocking note: the transform headers already say |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4409 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 161 161
Lines 3072 3072
Branches 604 604
=======================================
Hits 3022 3022
Misses 10 10
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Docs preview: https://docs-site-pr-4409-data-client.vercel.app Built from b52358b merged into |
💡 Codex Reviewdata-client/packages/codemods/src/cli.js Lines 30 to 31 in f7d5b56 When users run the documented command Changing this source also changes the symlinked AGENTS.md reference: AGENTS.md:L46-L47 These relative links resolve while located at data-client/packages/codemods/src/cli.js Line 31 in f7d5b56 The ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Re the Codex review of f7d5b56:
Generated by Claude Code |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
npx @data-client/codemods <codemod> <path> runs a migration codemod from npm, so skills can reference a versioned command instead of shipping scripts. The transforms move to packages/codemods, and dataclient.io/codemods/*.js stays available through symlinks. Their tests now run in jest (they never ran before), with three stale expectations fixed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
check-dts-parse skips packages that publish no declarations, coverage thresholds leave out the dev-time codemods like other tooling, and the skill bundling the axios codemod picks up its new usage comment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
… return the source Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
…sion-bodied arrow schema methods Under the tsx parser these were skipped or, for an arrow with an expression body, got new params while the body kept calling the removed unvisit/visit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
…forms Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
69708f9 to
9eb91cc
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…s before parsing The transforms always parse with tsx, so ESTree and Flow node types never appear. v0.16, v0.18 and axios-to-rest return early when the source can't contain the import they need. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AVZVL3iq5Cc9b6W2Q3V7G
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Requested by Nathaniel · project thread
Motivation
Migration codemods are fetched from dataclient.io at run time, so they aren't versioned with releases, and the only way for a skill to run one offline is to ship the script itself. Package security reviewers flag scripts inside packages. A dedicated codemods package lets skills just name a command.
Before:
After:
Solution
@data-client/codemodspackage (CommonJS, no build) with adata-client-codemodsbin. It validates the codemod name, lists the available ones, skipsnode_modules, and passes every other jscodeshift option (--dry,--print,--extensions) through to jscodeshift's own CLI.v0.15,v0.16,v0.18,axios-to-rest) move fromwebsite/static/codemods/topackages/codemods/src/transforms/. The old dataclient.io URLs keep working through symlinks, since released blog posts and docs link them.v0.15returnedundefinedon files it didn't change, which failsdefineInlineTest(it now returns the source, likev0.18), and twoaxios-to-restexpectations didn't match its current output (source order and blank lines). A CLI test covers the usage error and a real run that skipsnode_modules.jscodeshiftmoves from the root devDependencies to the package's dependencies.minorfor the first release (0.0.0 to 0.1.0), with a no-agent-impact reason since nothing existing changes.Open questions
npx @data-client/codemodsin a follow-up once the package is on npm, so the docs never point at a package that isn't published yet.Generated by Claude Code
Note
Low Risk
New dev-time migration package; runtime library behavior is unchanged, with backward-compatible website symlinks for old codemod URLs.
Overview
Introduces
@data-client/codemods, a versioned npm package so migrations run asnpx @data-client/codemods <codemod> <path>instead of fetching scripts from dataclient.io. A small CLI (data-client-codemods) discovers transforms underpackages/codemods/src/transforms/, validates the codemod name, sets--ignore-pattern=node_modules, and forwards other jscodeshift flags (--dry,--print, etc.).The four transforms (
v0.15,v0.16,v0.18,axios-to-rest) move fromwebsite/static/codemods/into the package; symlinks at the old website paths keep existing dataclient.io URLs working.jscodeshiftmoves from the repo root into the package dependency.Tests and tooling: Jest Node project covers transform inline tests plus a CLI integration test; codemods are excluded from coverage floors. ESLint treats
packages/codemods/**/*.jsas CommonJS/Node.scripts/check-dts-parse.mjsskips packages with notypesfield. The v0.18 migration skill’s codemod source link points at the new package path.Reviewed by Cursor Bugbot for commit b52358b. Bugbot is set up for automated code reviews on this repo. Configure here.