Skip to content

YNU-864: Compat layer correctness + cookbooks#148

Merged
ihsraham merged 9 commits into
docs/reorg-for-v1from
feat/ynu-864-compat-correctness-cookbooks
May 15, 2026
Merged

YNU-864: Compat layer correctness + cookbooks#148
ihsraham merged 9 commits into
docs/reorg-for-v1from
feat/ynu-864-compat-correctness-cookbooks

Conversation

@ihsraham
Copy link
Copy Markdown
Collaborator

@ihsraham ihsraham commented May 7, 2026

Summary

This PR updates the TypeScript compat SDK docs for apps migrating from @erc7824/nitrolite@0.5.3 to the v1 runtime through @yellow-org/sdk-compat. It also adds a Build examples page with deployed apps, screenshots, source links, and stack/SDK notes.

Intent

  • Make the compat migration path accurate against the public @yellow-org/sdk-compat and native @yellow-org/sdk surfaces.
  • Replace stale codemod instructions with the current public layer-3/yellow-sdk-codemod source workflow.
  • Keep MCP-assisted migration marked as coming soon until @yellow-org/sdk-mcp is published.
  • Give builders a quick examples index for deployed Nitrolite apps they can inspect and compare.

Files Touched

  • docs/nitrolite/build/sdk/typescript-compat/overview.mdx: compat package purpose, installation, quick start, amount units, supported surface, and limits.
  • docs/nitrolite/build/sdk/typescript-compat/migration-overview.mdx: codemod flow, MCP coming-soon note, client construction, migration matrix, and manual migration review areas.
  • docs/nitrolite/build/sdk/typescript-compat/migration-onchain.mdx: deposits, withdrawals, channel operations, native fallback guidance, and amount handling.
  • docs/nitrolite/build/sdk/typescript-compat/migration-offchain.mdx: auth helpers, app sessions, transfers, ledger queries, EventPoller, and typed error handling.
  • docs/nitrolite/build/sdk/typescript-compat/event-poller.mdx: polling bridge for migrated server-push event handlers.
  • docs/nitrolite/build/sdk/typescript-compat/errors.mdx: typed compat errors and recovery recipes.
  • docs/nitrolite/build/examples.mdx: new Build examples index for Co-Sign Checkout, Nitrolite Store, and Nexus P2P Transfer.
  • static/img/nitrolite/examples/*.png: captured front-page screenshots for the examples cards.
  • src/css/custom.css: horizontal examples-card layout and centered screenshot media frames.

What Changed

  • Documented the codemod as git clone, npm install, npm run build, and node dist/cli.js because the npm package is not published yet.
  • Added a compact MCP-assisted migration preview without tool-specific commands that would not run before publication.
  • Clarified compat amount rules: deposits and withdrawals use raw token-unit bigint, transfers use raw asset-unit strings, app-session allocations use human-readable decimal strings, and direct native SDK calls use Decimal.
  • Reworked the migration overview, on-chain guide, and off-chain guide around the actual compat API behavior.
  • Made the compat limits explicit, including unsupported server-push events and fail-fast checkpointChannel(...).
  • Added EventPoller and errors/recovery cookbooks for the parts migrated apps still need to handle manually.
  • Added a top-level Build examples page with live demo links, source repos, functionality summaries, stack notes, SDK packages, and visible screenshots.

Validation

  • git diff --check
  • npm run build
  • Local browser check for /nitrolite/build/examples in dark mode.
  • Live example URLs returned HTTP 200 for Co-Sign Checkout, Nitrolite Store, and Nexus P2P Transfer.
  • npm view @yellow-org/sdk-mcp version currently returns 404, so the MCP flow remains labeled coming soon.
  • Checked that the docs do not use the unpublished npm codemod command, fake sandbox hostnames, or human-readable transfer amounts where raw asset units are required.
  • GitHub verifies the latest commit signature as valid.

The docs build still reports existing warnings from versioned 0.5.x and Clearnet contract docs. This PR does not add compat-page broken links or anchors.

@ihsraham ihsraham requested a review from dpatsora as a code owner May 7, 2026 11:30
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3a655fc-8762-45ff-8719-74de5ef46bfe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ynu-864-compat-correctness-cookbooks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ihsraham added 8 commits May 8, 2026 13:06
- Fix compat codemod guidance to use @yellow-org/nitrolite-codemod package commands.
- Document raw-unit transfer semantics, app-session decimal strings, and raw bigint token helpers.
- Add EventPoller and compat errors cookbooks for migrated apps.
- Keep Nitronode WS URLs as coming-soon placeholders until the canonical sandbox host is pinned.

Resolves: F-006, F-007, F-008 (compat slice), F-009 (compat slice), F-031, F-032, F-033, F-048, F-049, F-050.
Use the public yellow-sdk-codemod GitHub workflow instead of an unpublished npm package command.

Add a manual migration review checklist for the remaining import, client, auth, event, amount, error, and SSR checks after the codemod runs.
Document the planned @yellow-org/sdk-mcp workflow as coming soon and show how to use its migration prompt and lookup tools after publication.
Add coming-soon setup examples for Claude Code, Claude Desktop, Codex, Cursor, and VS Code from the planned @yellow-org/sdk-mcp package workflow.
Add a top-level Build sidebar page with card summaries for Co-Sign Checkout, Nitrolite Store, and Nexus P2P Transfer, including live demos, source repos, functionality, stack, and SDK usage.
Convert the Build examples page to horizontal screenshot cards, remove version/vendor wording from SDK lists, and add captured front-page screenshots for each deployed example.
@ihsraham ihsraham force-pushed the feat/ynu-864-compat-correctness-cookbooks branch from 67ef9f2 to d6ddb4c Compare May 8, 2026 07:43
Comment thread docs/nitrolite/build/examples.mdx Outdated
Copy link
Copy Markdown
Contributor

@nksazonov nksazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! The migration content is clear and the amount-unit clarifications are a meaningful correctness improvement. A few code snippets in errors.mdx reference methods that aren't in the documented compat surface (getTokenBalance, getOpenChannels) and have a missing import — these will cause copy-paste failures and should be fixed before landing.

Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx
Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx
Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx Outdated
Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx
Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx
Comment thread docs/nitrolite/build/sdk/typescript-compat/errors.mdx Outdated
Comment thread docs/nitrolite/build/sdk/typescript-compat/event-poller.mdx Outdated
Comment thread docs/nitrolite/build/sdk/typescript-compat/migration-overview.mdx Outdated
Comment thread docs/nitrolite/build/examples.mdx Outdated
Comment thread docs/nitrolite/build/sdk/typescript-compat/overview.mdx
Copy link
Copy Markdown
Contributor

@nksazonov nksazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every comment addressed — clean turnaround. The compat docs are in great shape now: accurate API surface, correct amount units, real import paths, typed enum for channel status, and a solid examples index. Ship it! 🚀

@ihsraham ihsraham merged commit 47d9615 into docs/reorg-for-v1 May 15, 2026
4 checks passed
@ihsraham ihsraham deleted the feat/ynu-864-compat-correctness-cookbooks branch May 15, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants