Skip to content

Avoid running bun install during scaffolding#2

Open
mojobeeping wants to merge 1 commit into
VGabriel45:mainfrom
mojobeeping:mojobeep/scaffold-without-bun-install
Open

Avoid running bun install during scaffolding#2
mojobeeping wants to merge 1 commit into
VGabriel45:mainfrom
mojobeeping:mojobeep/scaffold-without-bun-install

Conversation

@mojobeeping

Copy link
Copy Markdown

Summary

create-web3-sdk currently runs bun install during project creation. That makes the npm/npx scaffolding path fail on machines that do not already have Bun installed, even though the README tells users to create the project first and run bun install after cd my-sdk.

This PR leaves dependency installation as the documented next step and lets the CLI finish scaffolding the project files successfully.

Reproduction on the published package

rm -rf /tmp/create-web3-sdk-baseline
mkdir -p /tmp/create-web3-sdk-baseline
cd /tmp/create-web3-sdk-baseline
npm init -y >/dev/null
npm install create-web3-sdk@1.3.2 >/dev/null
./node_modules/.bin/create-web3-sdk sample-sdk

Current output:

- Creating Web3 SDK project...
/bin/sh: bun: command not found
✖ Failed to create project
Error: Command failed: bun install

Fix

The generator still creates the project, writes the same files, and initializes Git when requested. It no longer runs bun install automatically. The existing success message already prints the correct next step:

cd sample-sdk
bun install

Validation

npm install --package-lock=false --ignore-scripts
npm run build
git diff --check
npm pack --pack-destination /tmp/mojobeep-create-web3-sdk-pack --json
cd /tmp/mojobeep-create-web3-sdk-clean
npm init -y >/dev/null
npm install /tmp/mojobeep-create-web3-sdk-pack/create-web3-sdk-1.3.2.tgz >/dev/null
./node_modules/.bin/create-web3-sdk sample-sdk
test ! -d sample-sdk/node_modules
test -f sample-sdk/package.json
test -d sample-sdk/.git

Patched CLI output:

- Creating Web3 SDK project...
✔ Successfully created sample-sdk!

Next steps:
  cd sample-sdk
  bun install     # Install dependencies
  bun run check   # Format and lint code
  bun run test    # Run tests
  bun run build   # Build the SDK

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant