Add @wraith-protocol/codemod package for v1 migrations (#178) - #196
Merged
truthixify merged 2 commits intoAug 28, 2026
Merged
Conversation
|
@Jerryvic911 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Merged. Idempotency verified by a second pass being a no-op, and a pre/post fixture per transform, which is what stops codemods rotting silently. Nice work @Jerryvic911. |
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.
Closes #178
Summary
New workspace package
packages/codemod/with a CLI(
npx @wraith-protocol/codemod v1 <path>) built on jscodeshift, plusa programmatic API (
runCodemod()).Transforms (transforms/v1/)
One transform per breaking change currently documented in
MIGRATING.md:typed-error-catch.cjs— rewritescatch (e) { if (e.message.includes(...)) }message-matching intoe instanceof <TypedError>checks, against a table of known messagefragments sourced directly from
src/errors.ts, and merges in therequired import from
@wraith-protocol/sdk.install-react-native-polyfills.cjs— inserts the requiredinstallReactNativePolyfills()call and import into React Nativeentry files that need it.
Both are conservative: only recognized patterns are rewritten, and
anything ambiguous is left untouched.
Testing
fixtures/, plus ashared
no-op-filefixture confirming non-matching code is leftalone.
Runnerthe CLI uses,against a temp fixture app directory.
transform against its own output) and end-to-end (a full second CLI
pass over the fixture app produces zero changes).
pnpm test,pnpm typecheck, andpnpm buildall pass locally.Docs
Documented in
MIGRATING.md, above the existing manual per-changeinstructions, with usage and a note on what the codemod does and
doesn't cover.
Notes
MIGRATING.mdcurrently documents these two breaking changes under"Upgrading to 2.0.0," not a literal "v0.x → v1.0" section, and
doesn't contain an "import path move" or "Announcement shape drift"
breaking change (mentioned in the issue's context). I built
transforms against what's actually documented and mechanically
automatable — happy to add more if there's a change I'm missing.
pnpm-lock.yamlis updated for the new package's dependencies(jscodeshift, tsup, vitest, etc.) — 124 pure additions, no changes
to existing entries.