-
Notifications
You must be signed in to change notification settings - Fork 619
Stylus modules #8383
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
Stylus modules #8383
Conversation
🦋 Changeset detectedLatest commit: 16fc56d The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
WalkthroughAdds Stylus-specific handling across runtime, UI, CLI, explore data, docs, and tests: conditional Stylus deployment path, dashboard compatibility short-circuit for Stylus modules, expanded Stylus CLI templates, new Stylus modular category and docs, an awaited chain check, and previously-skipped tests enabled. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant installPublishedModule
participant deployPublishedContract
participant getOrDeployInfra
participant Result
Caller->>installPublishedModule: install module(metadata)
installPublishedModule->>installPublishedModule: inspect module name (case-insensitive)
alt name contains "stylus"
installPublishedModule->>deployPublishedContract: deployPublishedContract(...)
deployPublishedContract-->>installPublishedModule: implementationAddress
installPublishedModule->>installPublishedModule: set implementationAddress
Note over installPublishedModule: TODO: switch to deterministic/create2
else other modules
installPublishedModule->>getOrDeployInfra: getOrDeployInfraForPublishedContract(...)
getOrDeployInfra-->>installPublishedModule: deployedModule
installPublishedModule->>installPublishedModule: implementationAddress = deployedModule.address
end
installPublishedModule->>Result: moduleContract = implementationAddress
Result-->>Caller: return deployed module info
sequenceDiagram
participant UserUI
participant InstallModuleForm
participant isModuleCompatible
participant ThirdwebClient
UserUI->>InstallModuleForm: select module
InstallModuleForm->>InstallModuleForm: compute isStylus (metadata.compilers length)
InstallModuleForm->>isModuleCompatible: isModuleCompatible(..., isStylus)
alt isStylus == true
isModuleCompatible-->>InstallModuleForm: return true (short-circuit)
else
isModuleCompatible->>ThirdwebClient: fetch/compare bytecodes
ThirdwebClient-->>isModuleCompatible: installedModuleBytecodes
isModuleCompatible-->>InstallModuleForm: compatibility result
end
InstallModuleForm-->>UserUI: enable/disable install flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (8.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8383 +/- ##
==========================================
+ Coverage 54.64% 54.79% +0.15%
==========================================
Files 919 919
Lines 60704 60719 +15
Branches 4112 4119 +7
==========================================
+ Hits 33171 33272 +101
+ Misses 27431 27345 -86
Partials 102 102
🚀 New features to boost your workflow:
|
size-limit report 📦
|
…js into yash/stylus-deploy-modules
There was a problem hiding this 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
🧹 Nitpick comments (3)
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx (1)
38-38: Consider hyphenating compound adjective.Static analysis suggests using "Rust/Stylus-specific" instead of "Rust / Stylus specific" for better readability.
Apply this diff:
-Here's a list of prebuilt Rust / Stylus specific modules provided by thirdweb: +Here's a list of prebuilt Rust/Stylus-specific modules provided by thirdweb:apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx (1)
142-142: Consider hyphenating compound adjective.Static analysis suggests using "above-described" instead of "above described" for grammatical correctness.
Apply this diff:
-The above described logic for ZK verification of user balance is provided as a template. You can modify the logic and write your own custom ZK verification code and circuits as described below. +The above-described logic for ZK verification of user balance is provided as a template. You can modify the logic and write your own custom ZK verification code and circuits as described below.packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (1)
52-59: Document the expected extensions for clarity.The assertion expects exactly 4 extensions but doesn't clarify which ones. Consider adding a comment explaining what these 4 extensions are (e.g., 3 base extensions + 1 newly installed "DirectListingsLogic"), or verify the extension names explicitly to make the test more maintainable and self-documenting.
Example:
const extensions = await readContract({ contract, method: resolveMethod("getAllExtensions"), params: [], }); +// Base EvolvingNFT contract comes with 3 extensions, +// plus the newly installed DirectListingsLogic expect(extensions.length).toEqual(4);
📜 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.
📒 Files selected for processing (5)
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx(1 hunks)apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx(1 hunks)apps/portal/src/app/contracts/sidebar.tsx(1 hunks)packages/thirdweb/src/contract/deployment/deploy-dynamic.test.ts(1 hunks)packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/thirdweb/src/contract/deployment/deploy-dynamic.test.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless 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@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless 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/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.tsapps/portal/src/app/contracts/sidebar.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.test.{ts,tsx}: Place tests alongside code:foo.ts↔foo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
UseFORKED_ETHEREUM_CHAINfor mainnet interactions andANVIL_CHAINfor isolated tests
**/*.test.{ts,tsx}: Co‑locate tests asfoo.test.ts(x)next to the implementation
Use real function invocations with stub data; avoid brittle mocks
Use MSW to intercept HTTP calls for network interactions; mock only hard‑to‑reproduce scenarios
Keep tests deterministic and side‑effect free; use Vitest
Files:
packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.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/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.tsapps/portal/src/app/contracts/sidebar.tsx
packages/thirdweb/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling@exampleand a custom tag (@beta,@internal,@experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g.,const { jsPDF } = await import("jspdf"))
Files:
packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.stories.tsx : Add Storybook stories (`*.stories.tsx`) alongside new UI components
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.{ts,tsx} : Use Tailwind CSS for styling; no inline styles
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Tailwind CSS is the styling system – avoid inline styles or CSS modules.
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use Tailwind CSS only – no inline styles or CSS modules
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 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/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 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/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts
🧬 Code graph analysis (1)
packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (2)
packages/thirdweb/src/extensions/prebuilts/deploy-published.ts (1)
deployPublishedContract(87-123)packages/thirdweb/src/exports/thirdweb.ts (1)
resolveMethod(188-188)
🪛 LanguageTool
apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx
[grammar] ~142-~142: Use a hyphen to join words.
Context: ... ## Customizing the ZK Logic The above described logic for ZK verification of u...
(QB_NEW_EN_HYPHEN)
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx
[grammar] ~38-~38: Use a hyphen to join words.
Context: ... Here's a list of prebuilt Rust / Stylus specific modules provided by thirdweb: -...
(QB_NEW_EN_HYPHEN)
⏰ 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: Size
- GitHub Check: Unit Tests
🔇 Additional comments (4)
apps/portal/src/app/contracts/sidebar.tsx (1)
59-66: LGTM! Navigation entries added correctly.The new Arbitrum Stylus navigation entries follow the existing pattern and properly link to the corresponding MDX documentation pages.
apps/portal/src/app/contracts/arbitrum-stylus/minting-modules/page.mdx (1)
1-11: LGTM! Metadata structure is correct.The metadata export follows the established pattern using
createMetadatawith appropriate title, description, and image fields.apps/portal/src/app/contracts/arbitrum-stylus/zk-mint/page.mdx (1)
1-11: LGTM! Metadata structure is correct.The metadata export follows the established pattern using
createMetadatawith appropriate title, description, and image fields, consistent with other documentation pages.packages/thirdweb/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts (1)
14-14: Verify the test is stable and passing consistently.The test was previously skipped and is now enabled as part of the Stylus module support. Ensure that the underlying issue that caused the skip has been resolved and that the test passes reliably in CI/CD.
PR-Codex overview
This PR focuses on enhancing the
thirdwebplatform by adding support for Stylus modules, including minting and transfer functionalities for ERC20, ERC721, and ERC1155 tokens. It also improves documentation for Stylus contracts and updates tests for dynamic contracts.Detailed summary
sidebar.tsxto include links for Stylus minting options.installPublishedModule.ts.Summary by CodeRabbit