Skip to content

Conversation

@jnsdls
Copy link
Member

@jnsdls jnsdls commented Oct 29, 2025


PR-Codex overview

This PR introduces several updates to the thirdweb and @thirdweb-dev/nexus packages, including minor version changes, new features, configuration updates, and various enhancements to the codebase.

Detailed summary

  • Updated @thirdweb-dev/nexus to minor version.
  • Updated thirdweb to patch version, exposing ERC20 extensions.
  • Increased bundle size limits.
  • Added new configuration files for biome and knip.
  • Enhanced ERC20 extensions with new functions.
  • Improved TypeScript configurations.
  • Added payment encoding and decoding functions.
  • Updated CI workflow to report bundle sizes for both thirdweb and nexus.
  • Added new types and schemas for payment processing.

The following files were skipped due to too many changes: pnpm-lock.yaml

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Introduced the Nexus package: payment facilitator APIs (verify/settle), request encode/decode, payment verification/settlement flows, public types/schemas, and utilities for bigint/amount handling. Added ERC20 permit/authorization extension exports.
  • Chores

    • Added package metadata, TypeScript configs, build/dev scripts, size-limit and CI reporting for Nexus, changesets for releases, and adjusted a task key and size threshold.

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

🦋 Changeset detected

Latest commit: bf26725

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@thirdweb-dev/nexus Minor
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

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

@vercel
Copy link

vercel bot commented Oct 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 29, 2025 10:52pm
nebula Ready Ready Preview Comment Oct 29, 2025 10:52pm
thirdweb_playground Ready Ready Preview Comment Oct 29, 2025 10:52pm
thirdweb-www Ready Ready Preview Comment Oct 29, 2025 10:52pm
wallet-ui Ready Ready Preview Comment Oct 29, 2025 10:52pm

Copy link
Member Author

jnsdls commented Oct 29, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Walkthrough

Adds a new @thirdweb-dev/nexus package (types, Zod schemas, encode/decode, facilitator HTTP client, verify/settle flows, bigint/decimal utils), TypeScript and package configs, size limits and CI reporting for nexus; updates thirdweb exports, turbo task key, and adds changesets.

Changes

Cohort / File(s) Summary
Nexus package metadata & tooling
packages/nexus/biome.json, packages/nexus/knip.json, packages/nexus/package.json, packages/nexus/.size-limit.json
Adds Biome and Knip configs, package.json for @thirdweb-dev/nexus (exports, scripts, deps, engines, files), and size-limit entries for ESM/CJS.
Nexus TypeScript configs
packages/nexus/tsconfig.base.json, packages/nexus/tsconfig.build.json, packages/nexus/tsconfig.json
Adds shared base TS config and build/dev tsconfigs (compilerOptions, includes/excludes, module settings).
Schemas & types
packages/nexus/src/schemas.ts, packages/nexus/src/types.ts
Introduces Zod schemas and TS types for facilitator payloads/responses, supported assets, RequestedPaymentPayload/Requirements, networkToChainId conversion, and x402Version constant.
Encoding / base64 utilities
packages/nexus/src/encode.ts
Adds encodePayment/decodePayment and cross-environment base64 helpers; handles bigint stringification and schema validation on decode.
Utilities
packages/nexus/src/utils.ts
Adds stringify (bigint-safe JSON stringify) and toUnits (decimal string → bigint with rounding and scientific-notation support).
Facilitator HTTP client
packages/nexus/src/facilitator.ts
Implements createFacilitator, ThirdwebX402Facilitator interface, DEFAULT_BASE_URL, auth header creation, and verify, settle, supported HTTP methods.
Payment flows
packages/nexus/src/common.ts, packages/nexus/src/verify-payment.ts, packages/nexus/src/settle-payment.ts
Adds decodePaymentRequest, verifyPayment, and settlePayment flows: price-to-atomic conversion, payment validation/decoding, facilitator interaction, and structured 200/402 responses with headers.
Nexus barrel export
packages/nexus/src/exports/nexus.ts
Adds re-export barrel exposing types and functions (encode/decode, createFacilitator, verifyPayment, settlePayment, and related types).
Changesets
.changeset/neat-squids-go.md, .changeset/witty-spies-know.md
Adds initial minor changeset for @thirdweb-dev/nexus and a patch changeset for thirdweb.
Monorepo task & CI updates
turbo.json, .github/workflows/CI.yml
Renames turbo task key thirdweb#update-versionupdate-version; CI workflow adds separate "Report bundle size (nexus)" step alongside thirdweb reporting.
Thirdweb exports & extensions
packages/thirdweb/src/exports/contract.ts, packages/thirdweb/src/exports/extensions/erc20.ts, packages/thirdweb/.size-limit.json
Re-exports Abi type; adds ERC20 permit/USDC exports (nonces, isPermitSupported, isTransferWithAuthorizationSupported); increases CJS size limit from 375kB to 380kB.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Verify as verifyPayment()
    participant Decode as decodePaymentRequest()
    participant Facilitator

    Client->>Verify: PaymentArgs
    Verify->>Decode: args
    Decode->>Decode: networkToChainId(network)
    Decode->>Decode: processPriceToAtomicAmount(price)
    Decode->>Decode: Validate paymentData header
    Decode->>Decode: decodePayment(base64)
    Decode->>Decode: Match requirements by scheme/network
    Decode-->>Verify: 200 + decoded info or 402 + accepts

    alt Decode success (200)
        Verify->>Facilitator: verify(decodedPayment, selectedRequirements)
        alt Verify success
            Facilitator-->>Verify: VerifyResponse (200)
            Verify-->>Client: 200 + decodedPayment + selectedRequirements
        else Verify fails
            Facilitator-->>Verify: error
            Verify-->>Client: 402 + errorMessage + accepts
        end
    else Decode failed (402)
        Verify-->>Client: 402 + errorMessage + accepts
    end
Loading
sequenceDiagram
    participant Client
    participant Settle as settlePayment()
    participant Decode as decodePaymentRequest()
    participant Facilitator

    Client->>Settle: SettlePaymentArgs
    Settle->>Decode: args
    Decode-->>Settle: 200 + decoded info or 402 + accepts

    alt Decode success (200)
        Settle->>Facilitator: settle(decodedPayment, selectedRequirements, waitUntil)
        alt Settle success
            Facilitator-->>Settle: FacilitatorSettleResponse (200)
            Settle-->>Client: 200 + paymentReceipt + X-PAYMENT-RESPONSE header
        else Settle fails
            Facilitator-->>Settle: error
            Settle-->>Client: 402 + errorMessage + accepts
        end
    else Decode failed (402)
        Settle-->>Client: 402 + errorMessage + accepts
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Focus review on:
    • packages/nexus/src/utils.ts — correctness of decimal parsing, rounding, scientific-notation handling in toUnits().
    • packages/nexus/src/facilitator.ts — auth header construction, HTTP request/response handling, query param building and error propagation.
    • packages/nexus/src/schemas.ts — Zod schemas and networkToChainId parsing/validation (edge cases, Solana rejection).
    • packages/nexus/src/common.ts — price→atomic conversion, default asset detection, and consistent error response shapes.
    • verify/settle flows — header population, base64 encoding/decoding, and consistent status/response formats.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ⚠️ Warning The pull request description lacks the required information from the specified template. While the description contains an autogenerated PR-Codex overview that provides a helpful summary of changes (package updates, new configuration files, payment processing code, and ERC20 extensions), the three required template sections are completely empty: the title in the prescribed format with an optional Linear issue tag, "Notes for the reviewer," and "How to test." The author provided no manual documentation, testing instructions, or specific notes for reviewers, relying entirely on the autogenerated summary. This represents a largely incomplete description compared to the template requirements. The author should fill in the required template sections: add a PR title in the format "[SDK/Dashboard/Portal] Feature/Fix: Concise title" (with an optional Linear issue tag if applicable), provide notes for reviewers explaining any important considerations or design decisions, and include specific testing instructions (unit tests, manual testing steps, playground verification, etc.). The autogenerated PR-Codex summary can complement but should not replace these required manual sections.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "setup @thirdweb-dev/nexus package" directly and clearly summarizes the primary objective of the changeset. The title is concise and specific, accurately reflecting that this PR's main focus is establishing a new package with all necessary configurations, type definitions, and utilities. The title is fully related to the most significant change—introducing the complete nexus package infrastructure—rather than focusing on secondary changes like minor ERC20 extension updates or configuration adjustments.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-29-setup_thirdweb-dev_nexus_package

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.52 KB (-0.06% 🔽) 1.3 s (-0.06% 🔽) 1.6 s (+34.22% 🔺) 2.9 s
thirdweb (cjs) 366.9 KB (+0.2% 🔺) 7.4 s (+0.2% 🔺) 11.1 s (+5.61% 🔺) 18.5 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 55 ms (+24.67% 🔺) 169 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 88 ms (+270.19% 🔺) 98 ms
thirdweb/react (minimal + tree-shaking) 19.09 KB (0%) 382 ms (0%) 82 ms (+44.82% 🔺) 464 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
packages/nexus/scripts/version.mjs (1)

3-9: Add error handling for robustness.

The script lacks error handling for file operations and JSON parsing. Consider adding try-catch blocks to provide helpful error messages if package.json is missing, malformed, or if the write operation fails.

Apply this diff to add error handling:

 import { readFile, writeFile } from "node:fs/promises";
 
-const packageVersion = JSON.parse(await readFile("./package.json")).version;
+let packageVersion;
+try {
+	const packageJson = JSON.parse(
+		await readFile("./package.json", "utf-8")
+	);
+	packageVersion = packageJson.version;
+	if (!packageVersion) {
+		throw new Error("version field not found in package.json");
+	}
+} catch (error) {
+	console.error("Failed to read version from package.json:", error);
+	process.exit(1);
+}
 
-await writeFile(
-	"./src/version.ts",
-	`// this file is auto-generated by the version.mjs script
+try {
+	await writeFile(
+		"./src/version.ts",
+		`// this file is auto-generated by the version.mjs script
 export const version = "${packageVersion}";\n`,
-);
+	);
+	console.log(`Generated version.ts with version ${packageVersion}`);
+} catch (error) {
+	console.error("Failed to write version.ts:", error);
+	process.exit(1);
+}
packages/nexus/tsconfig.base.json (1)

4-5: Reconcile contradictory incremental builds documentation.

The comments on lines 4–5 suggest that incremental builds speed up tsc and recommend enabling them, yet line 17 sets "incremental": false. Either enable incremental builds or update the comment to explain why they are disabled (e.g., cache reliability concerns outweigh performance gains in this context).

Also applies to: 17-17

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f790c9f and c368b03.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • packages/nexus/biome.json (1 hunks)
  • packages/nexus/knip.json (1 hunks)
  • packages/nexus/package.json (1 hunks)
  • packages/nexus/scripts/version.mjs (1 hunks)
  • packages/nexus/src/exports/nexus.ts (1 hunks)
  • packages/nexus/src/version.ts (1 hunks)
  • packages/nexus/tsconfig.base.json (1 hunks)
  • packages/nexus/tsconfig.build.json (1 hunks)
  • packages/nexus/tsconfig.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Track bundle budgets via package.json#size-limit

Files:

  • packages/nexus/package.json
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/nexus/src/version.ts
  • packages/nexus/src/exports/nexus.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/nexus/src/version.ts
  • packages/nexus/src/exports/nexus.ts
🧠 Learnings (22)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to biome.json : Biome governs formatting and linting; project rules live in biome.json

Applied to files:

  • packages/nexus/knip.json
  • packages/nexus/biome.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Re‑use shared types from `@/types` where applicable

Applied to files:

  • packages/nexus/tsconfig.build.json
  • packages/nexus/tsconfig.base.json
  • packages/nexus/tsconfig.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from `@/types` or local `types.ts` barrels

Applied to files:

  • packages/nexus/tsconfig.build.json
  • packages/nexus/tsconfig.base.json
  • packages/nexus/tsconfig.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Place tests alongside code: `foo.ts` ↔ `foo.test.ts`

Applied to files:

  • packages/nexus/tsconfig.build.json
  • packages/nexus/tsconfig.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via `exports/` directory, grouped by feature in the SDK public API

Applied to files:

  • packages/nexus/package.json
  • packages/nexus/src/exports/nexus.ts
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/exports/** : Export all public API via `packages/thirdweb/exports/`, grouped by feature

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-06-17T18:30:52.976Z
Learnt from: MananTank
PR: thirdweb-dev/js#7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.

Applied to files:

  • packages/nexus/package.json
  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Use explicit function declarations and explicit return types in TypeScript

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Write idiomatic TypeScript with explicit function declarations and return types

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Avoid `any` and `unknown` unless unavoidable; narrow generics when possible

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Choose composition over inheritance; leverage utility types (`Partial`, `Pick`, etc.)

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to {.vscode/**,.idea/**} : Avoid editor‑specific configs; rely on shared settings

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Applied to files:

  • packages/nexus/tsconfig.base.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/types.ts : Provide and re‑use local type barrels in a `types.ts` file

Applied to files:

  • packages/nexus/tsconfig.base.json
  • packages/nexus/tsconfig.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in `src/exports/react.native.ts`

Applied to files:

  • packages/nexus/src/exports/nexus.ts
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to biome.json : Biome is the primary linter/formatter; rules are defined in `biome.json`

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Run `pnpm biome check --apply` before committing

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.test.{ts,tsx} : Co‑locate tests as `foo.test.ts(x)` next to the implementation

Applied to files:

  • packages/nexus/tsconfig.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.test.{ts,tsx} : Use MSW to intercept HTTP calls for network interactions; mock only hard‑to‑reproduce scenarios

Applied to files:

  • packages/nexus/tsconfig.json
🧬 Code graph analysis (1)
packages/nexus/src/exports/nexus.ts (1)
packages/nexus/src/version.ts (1)
  • version (2-2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (7)
packages/nexus/knip.json (1)

1-12: LGTM!

The Knip configuration is well-structured and appropriate for the new Nexus package. The entry points, ignores, and rule overrides align with the package structure and build scripts.

packages/nexus/package.json (1)

17-18: Verify Node.js version requirement.

The package requires Node.js >=22, which is very recent. Please confirm this strict requirement is intentional, as it may limit adoption. If the package doesn't use Node 22-specific features, consider lowering to Node 18 or 20 LTS.

packages/nexus/biome.json (1)

4-15: LGTM!

The override to disable key sorting for package.json is appropriate, as it allows manual control of field ordering for better readability and conventional structure.

packages/nexus/tsconfig.json (1)

1-13: LGTM!

The TypeScript configuration for local development is well-structured. The path alias for test utilities and the inclusion of both source and test directories are appropriate.

packages/nexus/tsconfig.build.json (1)

1-16: LGTM!

The build configuration correctly excludes test and benchmark files while enabling source maps and setting the root directory appropriately.

packages/nexus/tsconfig.base.json (2)

1-48: Configuration looks solid overall.

The base configuration enforces strict type checking (strict: true), unused variable/parameter detection, and explicit module syntax (verbatimModuleSyntax), which aligns well with the retrieved learnings on using explicit TypeScript and narrowing types. The empty include array is appropriate for a base config intended to be extended by tsconfig.build.json and tsconfig.json.

Verify that downstream configs that extend this base properly configure include, rootDir, and other build-specific settings to avoid silent compilation issues.


2-2: Remove duplicate comments to reduce redundancy.

Lines 2 and 46 contain identical comments, and lines 4–5 and 15–16 both document the incremental builds note. Consolidate these into a single comment block at the top to maintain clarity and follow the DRY principle.

Apply this diff to consolidate comments:

{
+ // This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config.
+ // Incremental builds: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes.
  "compilerOptions": {
-   // Incremental builds
-   // NOTE: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes.
    "allowJs": false,
    ...
    // Interop constraints
    "esModuleInterop": false,
    "exactOptionalPropertyTypes": false,
    "forceConsistentCasingInFileNames": true,
    "importHelpers": true,
-   // Incremental builds
-   // NOTE: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes.
    "incremental": false,
    ...
-  // This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config.
  "include": []
}

Also applies to: 15-16, 46-46

⛔ Skipped due to learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Re‑use shared types from `@/types` where applicable
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Avoid `any` and `unknown` unless unavoidable; narrow generics when possible
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Avoid `any` and `unknown` unless unavoidable; narrow generics when possible
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Every public symbol must have comprehensive TSDoc with at least one compiling `example` and a custom tag (`beta`, `internal`, `experimental`, etc.)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Choose composition over inheritance; leverage utility types (`Partial`, `Pick`, etc.)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from `@/types` or local `types.ts` barrels

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.91%. Comparing base (6c318f8) to head (bf26725).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8332   +/-   ##
=======================================
  Coverage   54.90%   54.91%           
=======================================
  Files         920      920           
  Lines       60715    60715           
  Branches     4130     4134    +4     
=======================================
+ Hits        33336    33340    +4     
+ Misses      27278    27273    -5     
- Partials      101      102    +1     
Flag Coverage Δ
packages 54.91% <ø> (+<0.01%) ⬆️
see 2 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/nexus/package.json (1)

56-57: Fix invalid TypeScript compiler flag --noCheck.

The --noCheck flag is not recognized by TypeScript. Replace it with --skipLibCheck to skip type checking of declaration files, or remove it if not needed.

Apply this diff:

-	"build:cjs": "tsc --noCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
-	"build:esm": "tsc --noCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
+	"build:cjs": "tsc --skipLibCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
+	"build:esm": "tsc --skipLibCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",

Also apply the same fix to lines 61–62 for the dev:cjs and dev:esm scripts:

-	"dev:cjs": "printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json && tsc --noCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false --watch",
-	"dev:esm": "printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json && tsc --noCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm --watch",
+	"dev:cjs": "printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json && tsc --skipLibCheck --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false --watch",
+	"dev:esm": "printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json && tsc --skipLibCheck --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm --watch",

Also applies to: 61-62

🧹 Nitpick comments (2)
packages/nexus/package.json (2)

13-15: Add bundle size budget configuration.

The size-limit package is listed as a devDependency but there is no sizeLimit configuration in package.json. As per the coding guidelines, bundle budgets should be tracked via package.json#size-limit.

Add a sizeLimit field to define your bundle size budget:

+	"sizeLimit": [
+		{
+			"path": "./dist/esm/exports/nexus.js",
+			"limit": "100 B"
+		}
+	],

Adjust the limit value based on your actual bundle size expectations.


17-19: Node >=22 is a very strict version constraint.

Requiring Node >=22 significantly limits adoption, especially for projects using LTS versions. Consider relaxing this to a more permissive constraint like >=20 (which covers both Node 20 LTS and 22), or >=18 if you need broader compatibility.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1c0905c and 0d79a0a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • packages/nexus/biome.json (1 hunks)
  • packages/nexus/knip.json (1 hunks)
  • packages/nexus/package.json (1 hunks)
  • packages/nexus/scripts/version.mjs (1 hunks)
  • packages/nexus/src/exports/nexus.ts (1 hunks)
  • packages/nexus/src/version.ts (1 hunks)
  • packages/nexus/tsconfig.base.json (1 hunks)
  • packages/nexus/tsconfig.build.json (1 hunks)
  • packages/nexus/tsconfig.json (1 hunks)
  • turbo.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/nexus/tsconfig.json
  • packages/nexus/tsconfig.build.json
  • packages/nexus/biome.json
  • packages/nexus/knip.json
  • packages/nexus/src/exports/nexus.ts
  • packages/nexus/src/version.ts
  • packages/nexus/scripts/version.mjs
  • packages/nexus/tsconfig.base.json
🧰 Additional context used
📓 Path-based instructions (1)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Track bundle budgets via package.json#size-limit

Files:

  • packages/nexus/package.json
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via `exports/` directory, grouped by feature in the SDK public API
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/exports/** : Export all public API via `packages/thirdweb/exports/`, grouped by feature
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Build all packages using `pnpm build` and specific packages with dependencies using `turbo run build --filter=./packages/*`

Applied to files:

  • turbo.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Lazy‑load heavy dependencies inside async paths (e.g., `const { jsPDF } = await import("jspdf")`)

Applied to files:

  • turbo.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via `exports/` directory, grouped by feature in the SDK public API

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Avoid `any` and `unknown` unless unavoidable; narrow generics when possible

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Use explicit function declarations and explicit return types in TypeScript

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side-effect free

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Comment only ambiguous logic; avoid restating TypeScript in prose

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.test.{ts,tsx} : Keep tests deterministic and side‑effect free; use Vitest

Applied to files:

  • packages/nexus/package.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/exports/** : Export all public API via `packages/thirdweb/exports/`, grouped by feature

Applied to files:

  • packages/nexus/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Size
🔇 Additional comments (1)
turbo.json (1)

99-102: Turbo task rename looks appropriate.

The task renaming from thirdweb#update-version to update-version aligns with the new Nexus package versioning setup. The inputs and outputs are correctly configured.

@jnsdls jnsdls force-pushed the 10-29-setup_thirdweb-dev_nexus_package branch from b0b0991 to a3751a5 Compare October 29, 2025 22:31
@jnsdls jnsdls force-pushed the 10-29-setup_thirdweb-dev_nexus_package branch from a3751a5 to 59be482 Compare October 29, 2025 22:33
@jnsdls jnsdls force-pushed the 10-29-setup_thirdweb-dev_nexus_package branch from 59be482 to fe37319 Compare October 29, 2025 22:35
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/nexus/biome.json (1)

3-3: Fix invalid extends path.

The extends field contains "//" which is a placeholder or invalid path. This will cause Biome configuration to fail.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0d79a0a and fe37319.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • .changeset/neat-squids-go.md (1 hunks)
  • .changeset/witty-spies-know.md (1 hunks)
  • .github/workflows/CI.yml (1 hunks)
  • packages/nexus/.size-limit.json (1 hunks)
  • packages/nexus/biome.json (1 hunks)
  • packages/nexus/knip.json (1 hunks)
  • packages/nexus/package.json (1 hunks)
  • packages/nexus/src/common.ts (1 hunks)
  • packages/nexus/src/encode.ts (1 hunks)
  • packages/nexus/src/exports/nexus.ts (1 hunks)
  • packages/nexus/src/facilitator.ts (1 hunks)
  • packages/nexus/src/schemas.ts (1 hunks)
  • packages/nexus/src/settle-payment.ts (1 hunks)
  • packages/nexus/src/types.ts (1 hunks)
  • packages/nexus/src/utils.ts (1 hunks)
  • packages/nexus/src/verify-payment.ts (1 hunks)
  • packages/nexus/tsconfig.base.json (1 hunks)
  • packages/nexus/tsconfig.build.json (1 hunks)
  • packages/nexus/tsconfig.json (1 hunks)
  • packages/thirdweb/.size-limit.json (1 hunks)
  • packages/thirdweb/src/exports/contract.ts (1 hunks)
  • packages/thirdweb/src/exports/extensions/erc20.ts (2 hunks)
  • turbo.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/witty-spies-know.md
🚧 Files skipped from review as they are similar to previous changes (12)
  • packages/nexus/knip.json
  • .changeset/neat-squids-go.md
  • packages/nexus/tsconfig.base.json
  • packages/nexus/src/verify-payment.ts
  • packages/nexus/package.json
  • packages/nexus/src/types.ts
  • packages/nexus/tsconfig.json
  • packages/thirdweb/.size-limit.json
  • packages/nexus/src/encode.ts
  • packages/thirdweb/src/exports/extensions/erc20.ts
  • packages/thirdweb/src/exports/contract.ts
  • packages/nexus/src/exports/nexus.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/nexus/src/settle-payment.ts
  • packages/nexus/src/common.ts
  • packages/nexus/src/schemas.ts
  • packages/nexus/src/utils.ts
  • packages/nexus/src/facilitator.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/nexus/src/settle-payment.ts
  • packages/nexus/src/common.ts
  • packages/nexus/src/schemas.ts
  • packages/nexus/src/utils.ts
  • packages/nexus/src/facilitator.ts
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/exports/** : Export all public API via `packages/thirdweb/exports/`, grouped by feature
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via `exports/` directory, grouped by feature in the SDK public API
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Lazy‑load heavy dependencies inside async paths (e.g., `const { jsPDF } = await import("jspdf")`)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to biome.json : Biome governs formatting and linting; project rules live in biome.json

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to biome.json : Biome is the primary linter/formatter; rules are defined in `biome.json`

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Run `pnpm biome check --apply` before committing

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Run `pnpm biome check --apply` before committing (pre-commit hook)

Applied to files:

  • packages/nexus/biome.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Build all packages using `pnpm build` and specific packages with dependencies using `turbo run build --filter=./packages/*`

Applied to files:

  • turbo.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/**/*.{ts,tsx} : Lazy‑load heavy dependencies inside async paths (e.g., `const { jsPDF } = await import("jspdf")`)

Applied to files:

  • turbo.json
  • packages/nexus/.size-limit.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to package.json : Track bundle budgets via `package.json#size-limit`

Applied to files:

  • packages/nexus/.size-limit.json
  • .github/workflows/CI.yml
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/package.json : Track bundle budgets via `package.json#size-limit`

Applied to files:

  • packages/nexus/.size-limit.json
  • .github/workflows/CI.yml
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to packages/thirdweb/exports/** : Export all public API via `packages/thirdweb/exports/`, grouped by feature

Applied to files:

  • packages/nexus/.size-limit.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/exports/** : Export everything via `exports/` directory, grouped by feature in the SDK public API

Applied to files:

  • packages/nexus/.size-limit.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Applied to files:

  • packages/nexus/.size-limit.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Applied to files:

  • packages/nexus/.size-limit.json
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to **/*.{ts,tsx} : Re‑use shared types from `@/types` where applicable

Applied to files:

  • packages/nexus/tsconfig.build.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.{ts,tsx} : Re-use shared types from `@/types` or local `types.ts` barrels

Applied to files:

  • packages/nexus/tsconfig.build.json
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.test.{ts,tsx} : Place tests alongside code: `foo.ts` ↔ `foo.test.ts`

Applied to files:

  • packages/nexus/tsconfig.build.json
📚 Learning: 2025-08-28T20:50:33.170Z
Learnt from: joaquim-verges
PR: thirdweb-dev/js#7922
File: apps/playground-web/src/app/ai/ai-sdk/components/chat-container.tsx:167-181
Timestamp: 2025-08-28T20:50:33.170Z
Learning: The thirdweb-dev/ai-sdk-provider schemas use snake_case field naming convention (e.g., chain_id, transaction_hash) rather than camelCase, as defined in the zod schemas in packages/ai-sdk-provider/src/tools.ts.

Applied to files:

  • packages/nexus/src/schemas.ts
📚 Learning: 2025-06-26T19:46:04.024Z
Learnt from: gregfromstl
PR: thirdweb-dev/js#7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (`packages/thirdweb/src/bridge/Webhook.ts`), the `currencyAmount` field is intentionally typed as `z.number()` while other amount fields use `z.string()` because `currencyAmount` represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (`currencyAmount` vs `amount`) reflects this intentional distinction.

Applied to files:

  • packages/nexus/src/schemas.ts
📚 Learning: 2025-06-13T21:59:58.910Z
Learnt from: MananTank
PR: thirdweb-dev/js#7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nfts-grid.tsx:347-351
Timestamp: 2025-06-13T21:59:58.910Z
Learning: Intl.NumberFormat.prototype.format supports bigint values in modern JavaScript (ES2020+), so bigint values can be passed directly to formatter.format() without conversion to number.

Applied to files:

  • packages/nexus/src/utils.ts
🧬 Code graph analysis (4)
packages/nexus/src/settle-payment.ts (5)
packages/nexus/src/exports/nexus.ts (3)
  • settlePayment (14-14)
  • SettlePaymentArgs (19-19)
  • SettlePaymentResult (20-20)
packages/nexus/src/types.ts (2)
  • SettlePaymentArgs (39-41)
  • SettlePaymentResult (68-77)
packages/nexus/src/common.ts (1)
  • decodePaymentRequest (31-182)
packages/nexus/src/encode.ts (1)
  • safeBase64Encode (57-65)
packages/nexus/src/utils.ts (1)
  • stringify (17-33)
packages/nexus/src/common.ts (5)
packages/nexus/src/schemas.ts (3)
  • RequestedPaymentRequirements (28-30)
  • RequestedPaymentPayload (20-22)
  • networkToChainId (86-109)
packages/nexus/src/types.ts (6)
  • PaymentArgs (20-37)
  • PaymentRequiredResult (43-61)
  • ERC20TokenAmount (97-108)
  • x402Version (13-13)
  • DefaultAsset (110-110)
  • SupportedSignatureType (93-95)
packages/nexus/src/encode.ts (1)
  • decodePayment (39-49)
packages/nexus/src/facilitator.ts (2)
  • ThirdwebX402Facilitator (24-46)
  • supported (206-231)
packages/nexus/src/utils.ts (1)
  • toUnits (48-93)
packages/nexus/src/schemas.ts (1)
packages/thirdweb/src/x402/schemas.ts (1)
  • RequestedPaymentRequirementsSchema (32-35)
packages/nexus/src/facilitator.ts (2)
packages/nexus/src/schemas.ts (5)
  • RequestedPaymentPayload (20-22)
  • RequestedPaymentRequirements (28-30)
  • FacilitatorVerifyResponse (44-46)
  • FacilitatorSettleResponse (36-38)
  • FacilitatorSupportedResponse (82-84)
packages/nexus/src/utils.ts (1)
  • stringify (17-33)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
🔇 Additional comments (4)
packages/nexus/tsconfig.build.json (1)

1-16: Verify build output settings are properly configured in the build process.

The base config at packages/nexus/tsconfig.base.json exists and is comprehensive, but it's missing critical build settings: declaration: true, outDir, and declarationMap.

This is a monorepo-wide pattern—identical minimal configs exist in packages/api/, packages/engine/, and other packages. This appears intentional, suggesting the build process is configured elsewhere (likely in build scripts, package.json, or a build tool like esbuild).

Before proceeding, confirm:

  1. How the build process handles TypeScript compilation (check package.json build scripts or build tool configuration)
  2. Whether declaration and outDir are passed via CLI flags or configured in a build tool
  3. Whether this pattern is intentional across the monorepo

Additionally, consider moving the extends property (line 14) to the top of the config, before compilerOptions, to follow TypeScript configuration conventions—though this is a minor style improvement since JSON property order doesn't affect parsing.

.github/workflows/CI.yml (1)

191-203: Bundle size reporting properly split per-package.

The workflow correctly separates bundle size reporting for thirdweb and nexus packages with independent directory isolation. Verification confirms both packages have .size-limit.json configurations in place and build scripts defined. The changes enable independent bundle tracking per package as intended.

packages/nexus/.size-limit.json (1)

1-13: Size-limit configuration is appropriate—no changes needed.

The 110 kB ESM and 350 kB CJS limits are justified. The x402 Payment Protocol implementation and Zod schema validation are the primary size drivers. The ~3.2× CJS/ESM ratio is expected since CommonJS lacks tree-shaking and includes the full x402 protocol stack and Zod dependencies. The configuration correctly tracks these essential modules.

turbo.json (1)

99-99: Task rename successfully verified — no broken references.

The renaming from "thirdweb#update-version" to "update-version" is complete and correct:

  • Task properly defined in turbo.json with inputs/outputs configured
  • All references in package.json scripts (release, release:nightly) correctly use turbo run update-version
  • No lingering references to the old task name remain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants