Skip to content

Fix bun template generation command#1678

Open
Samisha68 wants to merge 1 commit into
solana-foundation:mainfrom
Samisha68:issue-1549-bun-command-on-windows-doesnt-work-anymore
Open

Fix bun template generation command#1678
Samisha68 wants to merge 1 commit into
solana-foundation:mainfrom
Samisha68:issue-1549-bun-command-on-windows-doesnt-work-anymore

Conversation

@Samisha68

Copy link
Copy Markdown

Title

Fix Bun template generation command

Body

### Problem

The generated Bun command on the Solana templates page is incorrect for creating a Solana dApp template.

Before this change, selecting Bun fell through to the default package manager command format:

```bash
bun create solana-dapp@latest -t ...

That command does not work reliably for Bun users, especially in Windows/PowerShell environments.

Fixes #1549

Summary of Changes

Updated the templates command generator so the Bun option explicitly uses:

bunx create-solana-dapp@latest -t ...

This matches Bun’s package execution flow and avoids the broken generated command.

Verification

Commit signature:

  • GitHub commit verification: verified: true
  • Verification reason: valid

Local checks run:

corepack pnpm --filter ./apps/templates lint
corepack pnpm --filter ./apps/templates check-types
corepack pnpm --filter ./apps/templates build

Bun smoke test:

bunx create-solana-dapp@latest bun-smoke-app -t solana-foundation/templates/kit/nextjs --dry-run --skip-version-check --skip-install --skip-git --skip-init

The Bun dry run resolved the external template successfully and made no filesystem changes because --dry-run was used.

Change classification (SDLC §2)

  • Critical — auth, secrets/key handling, fund movement, deploy/CI security gates, or anything that changes who can do what
  • Standard — production-facing, non-critical
  • Low — no security impact; UI command generation only

Security checklist

  • No secrets, tokens, or credentials added.
  • No new dependencies added.
  • No user input handling or trust-boundary behavior changed.
  • No production execution path changed beyond generated command text.
  • Commit is signed and verified on GitHub.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@Samisha68 is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds an explicit case "bun": branch to getCommand so that Bun users receive bunx create-solana-dapp@latest -t ... instead of the default bun create solana-dapp@latest -t ..., which did not work reliably (especially on Windows/PowerShell).

  • Adds case "bun": return \bunx create-solana-dapp@latest -t ${template}`; — a single-line change that mirrors the pattern already used for npm (npx -y create-solana-dapp@latest`).
  • No other logic, dependencies, or execution paths are affected.

Confidence Score: 5/5

Safe to merge — the change is a single-line command string fix with no impact on security, data flow, or runtime behavior.

The only change is adding one case to a client-side switch that builds a display/copy-paste command string. It corrects the generated Bun command to use bunx (consistent with how the npm case uses npx) and does not touch any auth, data, or execution path.

No files require special attention.

Important Files Changed

Filename Overview
apps/templates/src/components/templates/templates-ui-generate-command.tsx Added case "bun" to return bunx create-solana-dapp@latest -t ${template} — correct and consistent with the npm/npx pattern already present.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User selects package manager] --> B{getCommand switch}
    B -->|npm| C["npx -y create-solana-dapp@latest -t template"]
    B -->|yarn| D["yarn create solana-dapp -t template"]
    B -->|bun| E["bunx create-solana-dapp@latest -t template ✅ NEW"]
    B -->|pnpm / default| F["pm create solana-dapp@latest -t template"]
    C --> G[Display & copy command]
    D --> G
    E --> G
    F --> G
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User selects package manager] --> B{getCommand switch}
    B -->|npm| C["npx -y create-solana-dapp@latest -t template"]
    B -->|yarn| D["yarn create solana-dapp -t template"]
    B -->|bun| E["bunx create-solana-dapp@latest -t template ✅ NEW"]
    B -->|pnpm / default| F["pm create solana-dapp@latest -t template"]
    C --> G[Display & copy command]
    D --> G
    E --> G
    F --> G
Loading

Reviews (1): Last reviewed commit: "Fix bun template generation command" | Re-trigger Greptile

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.

Bun command on windows doesn't work anymore

1 participant