Skip to content

feat: add --package-json flag to deno add/install/remove/uninstall#33199

Open
bartlomieju wants to merge 1 commit intomainfrom
feature/add-packagejson-flag
Open

feat: add --package-json flag to deno add/install/remove/uninstall#33199
bartlomieju wants to merge 1 commit intomainfrom
feature/add-packagejson-flag

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Adds a --package-json flag to deno add, deno install, deno remove, and deno uninstall subcommands
  • When set, forces all dependency management to use package.json instead of deno.json, bypassing the distance-based config file heuristic
  • Creates a new package.json if one doesn't exist
  • JSR packages are converted to their npm-compatible form (npm:@jsr/...) when written to package.json

Test plan

  • New spec test tests/specs/add/package_json_flag — verifies both npm and jsr deps go to package.json, and that package.json is created when missing
  • New spec test tests/specs/remove/package_json_flag — verifies removal from package.json
  • Existing flag parsing unit tests updated and passing
  • Existing spec tests for add/remove still pass

🤖 Generated with Claude Code

Add a `--package-json` flag that forces dependency management to use
package.json instead of deno.json, bypassing the distance-based config
file heuristic. When set, all packages (including jsr: prefixed) are
written to package.json, and a new package.json is created if one
doesn't exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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