Skip to content

Commit 295acfc

Browse files
authored
docs: add yellow-sdk-codemod reference to compat SDK pages (#127)
## Summary - Adds a callout box to the [TypeScript Compat Overview](https://docs.yellow.org/docs/build/sdk/typescript-compat/overview) page with scan/run usage examples and a link to the codemod repo. - Adds a tip admonition to the [Migration Overview](https://docs.yellow.org/docs/build/sdk/typescript-compat/migration-overview) page pointing developers to the codemod before they start migrating manually. The codemod tool lives at https://github.com/layer-3/yellow-sdk-codemod and automates the bulk of the `@erc7824/nitrolite` (v0.4-v0.5.3) to `@yellow-org/sdk-compat` migration. ## Screengrabs ![ScreenRecording2026-03-13at3 36 09PM-ezgif com-video-to-gif-converter](https://github.com/user-attachments/assets/6c048a08-54b2-4d30-9bcb-d699981f8088) <img width="1302" height="774" alt="image" src="https://github.com/user-attachments/assets/5f9e8782-01ab-4fb8-9ff6-7e821b6f9858" /> ## Test plan - [ ] Verify the Docusaurus `:::tip` admonition renders correctly on both pages - [ ] Confirm the codemod repo link resolves (currently private to the org) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new "Automate with Codemod" tip and a collapsible note for users already on older Nitrolite packages, guiding automated migration steps. * Documented that the codemod automates imports, client constructor updates, and auth field renames, included example scan/apply commands and a TODO pointer to follow-up checks and codemod README. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a1fb886 commit 295acfc

3 files changed

Lines changed: 26 additions & 32 deletions

File tree

docs/build/sdk/typescript-compat/migration-overview.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ This guide explains how to migrate your Nitrolite dApp from the v0.5.3 SDK to th
1212

1313
A direct migration from v0.5.3 to v1.0.0 touches **20+ files** per app with deep, scattered rewrites. The compat layer reduces this to **~5 file changes** per app.
1414

15+
:::tip Automate with Codemod
16+
Before migrating manually, try the [yellow-sdk-codemod](https://github.com/layer-3/yellow-sdk-codemod). It rewrites imports, renames auth fields, migrates client constructors, updates `package.json`, and flags RPC patterns with `// TODO [codemod]` comments for the remaining manual steps.
17+
:::
18+
1519
## Installation
1620

1721
```bash

docs/build/sdk/typescript-compat/overview.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ sidebar_position: 1
88

99
Compatibility layer that bridges the Nitrolite SDK **v0.5.3 API** to the **v1.0.0 runtime**, letting existing dApps upgrade to the new protocol with minimal code changes.
1010

11+
<details>
12+
<summary><strong>Already integrated with <code>@erc7824/nitrolite</code> or <code>@layer-3/nitrolite</code>?</strong></summary>
13+
14+
If your app is already built on `@erc7824/nitrolite` (v0.4 through v0.5.3) or `@layer-3/nitrolite`, you can speed up the migration using the [yellow-sdk-codemod](https://github.com/layer-3/yellow-sdk-codemod) tool. It handles the repetitive parts of the upgrade automatically: rewriting imports, migrating client constructors, renaming auth fields, and updating your `package.json`. Where the change requires context (collapsing RPC call chains, removing manual WebSocket setup), the codemod leaves a `// TODO [codemod]` comment with the exact replacement so you know what to do.
15+
16+
```bash
17+
# Clone the codemod and install its dependencies
18+
git clone https://github.com/layer-3/yellow-sdk-codemod.git
19+
cd yellow-sdk-codemod && npm install
20+
21+
# Scan your project to see what needs changing (no files are modified)
22+
npx tsx src/cli.ts scan --path /path/to/your-app/src
23+
24+
# Apply all transforms and update dependencies
25+
npx tsx src/cli.ts run --path /path/to/your-app --update-deps
26+
```
27+
28+
After running, search for `TODO [codemod]` in your codebase and work through the remaining items. See the [codemod README](https://github.com/layer-3/yellow-sdk-codemod#readme) for the full list of transforms and CLI options.
29+
30+
</details>
31+
1132
## Why Use the Compat Layer
1233

1334
The v1.0.0 protocol introduces breaking changes across 14 dimensions — wire format, authentication, WebSocket lifecycle, unit system, asset resolution, and more. A direct migration touches 20+ files per app with deep, scattered rewrites.

package-lock.json

Lines changed: 1 addition & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)