-
Notifications
You must be signed in to change notification settings - Fork 55
fix(packages/cli): package manager bun error #222
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
base: main
Are you sure you want to change the base?
Conversation
Error caused by stefan-karger#181. Run bunx solidui-cli@latest add button, error: ExecaError: Command failed with exit code 1: bun add '' '@kobalte/core'
|
|
@GitTuanKiet is attempting to deploy a commit to the Stefan EK's projects Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryFixes the bug introduced in PR #181 where non-deno package managers (npm, yarn, pnpm, bun) received an empty string argument, causing command execution failures. Key Changes:
Issues Found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as add command
participant PM as Package Manager Detection
participant Execa as Command Executor
User->>CLI: bunx solidui-cli@latest add button
CLI->>PM: getPackageManager(cwd)
PM-->>CLI: "bun"
Note over CLI: Before fix (PR #181):<br/>["add", ...dependencies]
Note over CLI: After PR #181 (broken):<br/>["add", "", ...dependencies]
Note over CLI: After this fix:<br/>["add", ...dependencies]<br/>(empty string filtered)
CLI->>CLI: Build command array:<br/>["add", packageManager === "deno" ? "--npm" : "", ...dependencies]
CLI->>CLI: .filter(Boolean) removes empty string
CLI->>Execa: execa("bun", ["add", "@kobalte/core"], {cwd})
Execa-->>CLI: Success
CLI-->>User: Component installed
|
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.
Additional Comments (1)
-
packages/cli/src/commands/add.ts, line 151-155 (link)logic: Same bug exists in
packages/cli/src/commands/init.ts:100-104- the empty string from the ternary operator isn't filtered there. Apply the same.filter(Boolean)fix toinit.tsto prevent the same error during initialization.
1 file reviewed, 1 comment
Error caused by #181.
Run
bunx solidui-cli@latest add button, error:ExecaError: Command failed with exit code 1: bun add '' '@kobalte/core'