Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support stylus contracts publish and deploy #6495

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Mar 18, 2025


PR-Codex overview

This PR introduces new features and improvements in the thirdweb package, including the addition of a publish-stylus command, enhancements to contract deployment options with extraData, and improvements in fetching compiler metadata.

Detailed summary

  • Added publishStylus function in packages/thirdweb/src/cli/commands/publish-stylus/publish-stylus.ts.
  • Introduced secretKey handling in packages/thirdweb/src/cli/bin.ts.
  • Enhanced deployment options in deployContract to include extraData.
  • Improved fetching of compiler metadata in getCompilerMetadata.
  • Updated deploy-with-abi.ts to handle extraData in contract deployment.
  • Introduced new imports for handling metadata and RPC fetching in various files.
  • Added new dependencies in package.json including chalk, open, and ora.

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

@kumaryash90 kumaryash90 requested review from a team as code owners March 18, 2025 21:21
Copy link

changeset-bot bot commented Mar 18, 2025

⚠️ No Changeset found

Latest commit: 62f629c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 11:43pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 11:43pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 11:43pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 11:43pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2025 11:43pm

@kumaryash90 kumaryash90 marked this pull request as draft March 18, 2025 21:21
Copy link
Contributor

graphite-app bot commented Mar 18, 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.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Mar 18, 2025
@vercel vercel bot temporarily deployed to Preview – login March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground March 18, 2025 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui March 18, 2025 21:22 Inactive
Copy link

socket-security bot commented Mar 18, 2025

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment +8 86.7 kB sindresorhus
npm/[email protected] Transitive: environment +16 243 kB sindresorhus

View full report↗︎

Comment on lines +164 to +167
const url = new URL(
`${THIRDWEB_URL}
/contracts/${command}/
${encodeURIComponent(hash.replace("ipfs://", ""))}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

The URL template string contains newlines and whitespace that will be included in the final URL, which will cause navigation issues. This should be rewritten as a single-line string:

const url = new URL(`${THIRDWEB_URL}/contracts/${command}/${encodeURIComponent(hash.replace("ipfs://", ""))}`);
Suggested change
const url = new URL(
`${THIRDWEB_URL}
/contracts/${command}/
${encodeURIComponent(hash.replace("ipfs://", ""))}`,
const url = new URL(
`${THIRDWEB_URL}/contracts/${command}/${encodeURIComponent(hash.replace("ipfs://", ""))}`,

Spotted by Diamond

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

});

const url = getUrl(publishUri, "publish").toString();
spinner.succeed(`Upload complete:, ${url}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a small typo in the success message - the comma after "Upload complete:" is unnecessary and makes the message read awkwardly. Consider changing to:

spinner.succeed(`Upload complete: ${url}`);

This will display a cleaner message to users when their upload finishes.

Suggested change
spinner.succeed(`Upload complete:, ${url}`);
spinner.succeed(`Upload complete: ${url}`);

Spotted by Diamond

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

Copy link
Contributor

github-actions bot commented Mar 18, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47 KB (+0.12% 🔺) 940 ms (+0.12% 🔺) 140 ms (+62.9% 🔺) 1.1 s
thirdweb (cjs) 127.19 KB (+0.01% 🔺) 2.6 s (+0.01% 🔺) 281 ms (+14.06% 🔺) 2.9 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 74 ms (+979.89% 🔺) 186 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 16 ms (+685.93% 🔺) 26 ms
thirdweb/react (minimal + tree-shaking) 19.42 KB (+0.4% 🔺) 389 ms (+0.4% 🔺) 74 ms (+381.79% 🔺) 463 ms

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.82%. Comparing base (71f83a8) to head (0169660).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6495      +/-   ##
==========================================
- Coverage   54.82%   54.82%   -0.01%     
==========================================
  Files         875      875              
  Lines       54851    54849       -2     
  Branches     3740     3737       -3     
==========================================
- Hits        30071    30069       -2     
- Misses      24685    24686       +1     
+ Partials       95       94       -1     
Flag Coverage Δ
packages 54.82% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
...thirdweb/src/contract/actions/compiler-metadata.ts 86.20% <100.00%> (-0.89%) ⬇️

... and 3 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.

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