Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funny-cars-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

[CLI] create-stylus fixes
4 changes: 2 additions & 2 deletions packages/thirdweb/src/cli/commands/stylus/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function createStylusProject() {

// Step 2: Install stylus etc.
spinner.start("Installing Stylus...");
const install = spawnSync("cargo", ["install", "--force", "cargo-stylus"], {
const install = spawnSync("cargo", ["install", "cargo-stylus"], {
stdio: "inherit",
});
if (install.status !== 0) {
Expand All @@ -33,7 +33,7 @@ export async function createStylusProject() {
}
spinner.succeed("Stylus installed.");

spawnSync("rustup", ["default", "1.87"], {
spawnSync("rustup", ["default", "stable"], {
stdio: "inherit",
});
Comment on lines +36 to 38
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 rustup default stable command has no error handling. If this command fails (e.g., rustup not installed, network issues), the script will silently continue without setting the correct Rust toolchain, potentially causing subsequent commands to fail with unclear errors.

Should add status check similar to the cargo install command:

const rustupDefault = spawnSync("rustup", ["default", "stable"], {
  stdio: "inherit",
});
if (rustupDefault.status !== 0) {
  spinner.fail("Failed to set Rust toolchain to stable.");
  process.exit(1);
}
Suggested change
spawnSync("rustup", ["default", "stable"], {
stdio: "inherit",
});
const rustupDefault = spawnSync("rustup", ["default", "stable"], {
stdio: "inherit",
});
if (rustupDefault.status !== 0) {
spinner.fail("Failed to set Rust toolchain to stable.");
process.exit(1);
}

Spotted by Graphite

Fix in Graphite


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

spawnSync("rustup", ["target", "add", "wasm32-unknown-unknown"], {
Expand Down
Loading