fix(packages/cli): package manager bun error#222
fix(packages/cli): package manager bun error#222GitTuanKiet wants to merge 1 commit intostefan-karger:mainfrom
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.
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
|
Can confirm this occurs on bun: |
Error caused by #181.
Run
bunx solidui-cli@latest add button, error:ExecaError: Command failed with exit code 1: bun add '' '@kobalte/core'