Skip to content

Conversation

@jdalton
Copy link
Contributor

@jdalton jdalton commented Nov 14, 2025

Summary

Fixes coana receiving --silent as filepath argument when using pnpm dlx.

Changes

  • Move --silent before dlx in pnpm commands
  • Add unit tests with 6 test cases
  • Add .env.local to .gitignore

Test

pnpm test:unit src/utils/dlx.test.mts

Note

Moves --silent before dlx for pnpm execution, adds targeted unit tests, and ignores .env.local.

  • Utilities (src/utils/dlx.mts):
    • For pnpm, place --silent before dlx when building spawn args; adjust arg construction accordingly.
    • Preserve existing behaviors: force sets npm_config_dlx_cache_max_age=0; npm uses --yes (and --silent when set); Yarn Berry unchanged.
  • Tests (src/utils/dlx.test.mts):
    • Add unit tests (6 cases) covering pnpm flag ordering, default silent behavior for pinned/unpinned versions, npm flag order, and pnpm force env var.
  • Repo:
    • Add .env.local to .gitignore.

Written by Cursor Bugbot for commit 017a220. Configure here.

… filepath

When using pnpm dlx with the --silent flag, the flag was incorrectly placed
after 'dlx' in the command, causing it to be passed to the target package
(e.g., @coana-tech/cli) as a positional argument. Coana's 'run' command
interpreted --silent as the filepath argument instead of the actual directory.

This fix moves --silent before 'dlx' so pnpm correctly interprets it:
- Before: pnpm dlx --silent @coana-tech/cli run /path (incorrect)
- After: pnpm --silent dlx @coana-tech/cli run /path (correct)

Also adds comprehensive unit tests to prevent regression and adds .env.local
to .gitignore.
Copy link
Contributor

@mtorp mtorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👏

@jdalton jdalton merged commit afbe90a into v1.x Nov 15, 2025
8 of 11 checks passed
@jdalton jdalton deleted the jdalton/coana-silent branch November 15, 2025 17:39
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.

4 participants