Skip to content

[CLI] fix stylus abi exports#8726

Merged
0xFirekeeper merged 1 commit intomainfrom
firekeeper/stylus-abi
Mar 26, 2026
Merged

[CLI] fix stylus abi exports#8726
0xFirekeeper merged 1 commit intomainfrom
firekeeper/stylus-abi

Conversation

@0xFirekeeper
Copy link
Copy Markdown
Member

@0xFirekeeper 0xFirekeeper commented Mar 26, 2026


PR-Codex overview

This PR focuses on improving the stylus command in the thirdweb CLI by removing unnecessary checks for the solc compiler, enhancing ABI generation, and refining interface parsing.

Detailed summary

  • Removed checks for solc compiler in create.ts and builder.ts.
  • Updated ABI generation to not require solc.
  • Added parseAbiItem import for better ABI parsing.
  • Enhanced interface parsing to handle structs and errors.
  • Improved user prompts for contract selection.

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

Summary by CodeRabbit

  • Bug Fixes

    • Fixed Stylus ABI export functionality for improved compatibility.
  • Chores

    • Removed Solc as a required prerequisite for Stylus operations, streamlining the setup process.

@0xFirekeeper 0xFirekeeper requested review from a team as code owners March 26, 2026 11:53
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

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

Project Deployment Actions Updated (UTC)
docs-v2 Ready Ready Preview, Comment Mar 26, 2026 0:06am
nebula Ready Ready Preview, Comment Mar 26, 2026 0:06am
thirdweb_playground Ready Ready Preview, Comment Mar 26, 2026 0:06am
thirdweb-www Ready Ready Preview, Comment Mar 26, 2026 0:06am
wallet-ui Ready Ready Preview, Comment Mar 26, 2026 0:06am

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

🦋 Changeset detected

Latest commit: 2aeb001

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

This PR includes changesets to release 4 packages
Name Type
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

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Mar 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

The changes remove Solidity compiler (solc) prerequisite checks from Stylus CLI commands and refactor the ABI export process. The buildStylus function now runs cargo stylus export-abi without the --json flag, parses raw Solidity interface text via a new parseSolidityInterfaces helper, and selects interfaces by index rather than splitting JSON output.

Changes

Cohort / File(s) Summary
Changeset
.changeset/poor-laws-live.md
New changeset marking thirdweb package for patch release with note "fix stylus abi exports".
Stylus CLI Commands
packages/thirdweb/src/cli/commands/stylus/builder.ts
Removed solc prerequisite checks from publishStylus and deployStylus functions. Modified buildStylus to parse raw Solidity interface text from cargo stylus export-abi (without --json flag) using new parseSolidityInterfaces helper. Changed interface/entrypoint selection from JSON splitting to index-based approach. Updated ABI assembly logic to handle parsed interface data and constructor detection.
Stylus Project Creation
packages/thirdweb/src/cli/commands/stylus/create.ts
Removed solc prerequisite check from createStylusProject() function.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely empty, containing only template comments with no substantive details about changes, testing approach, or reviewer notes. Provide a detailed description following the template structure: clarify changes, add testing instructions, and include any important notes for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title '[CLI] fix stylus abi exports' directly matches the main change: fixing ABI export functionality in the stylus CLI commands.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch firekeeper/stylus-abi

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

function parseSolidityInterfaces(source: string): ParsedInterface[] {
const results: ParsedInterface[] = [];

const ifaceRegex = /interface\s+(I?[A-Za-z0-9_]+)\s*\{([\s\S]*?)\n\}/g;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The interface regex requires a newline before the closing brace (\n}), which will fail to match interfaces that don't have this specific formatting. For example, interface IFoo { function bar(); } or interfaces with spaces/tabs before the closing brace will not be detected.

Impact: Valid interfaces will be silently skipped, potentially resulting in zero interfaces found and process exit with error "No interfaces found in ABI output."

Fix: Remove the newline requirement from the regex:

const ifaceRegex = /interface\s+(I?[A-Za-z0-9_]+)\s*\{([\s\S]*?)\}/g;
Suggested change
const ifaceRegex = /interface\s+(I?[A-Za-z0-9_]+)\s*\{([\s\S]*?)\n\}/g;
const ifaceRegex = /interface\s+(I?[A-Za-z0-9_]+)\s*\{([\s\S]*?)\}/g;

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@0xFirekeeper 0xFirekeeper merged commit 3a18c6e into main Mar 26, 2026
19 of 23 checks passed
@0xFirekeeper 0xFirekeeper deleted the firekeeper/stylus-abi branch March 26, 2026 11:58
@joaquim-verges joaquim-verges mentioned this pull request Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.73%. Comparing base (fdd8c17) to head (2aeb001).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8726   +/-   ##
=======================================
  Coverage   52.73%   52.73%           
=======================================
  Files         934      934           
  Lines       62968    62968           
  Branches     4136     4138    +2     
=======================================
  Hits        33204    33204           
  Misses      29666    29666           
  Partials       98       98           
Flag Coverage Δ
packages 52.73% <ø> (ø)
🚀 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.

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.

1 participant