Skip to content

Add support for bun catalogs #309

@PaulRBerg

Description

@PaulRBerg

Problem

Bun recently added support for catalogs, a feature analogous to pnpm catalogs. However, ni does not currently support this feature for bun workspaces.

This is analogous to #274, which requests pnpm catalog support.

Solution

Add a --catalog flag for bun workspaces that:

  1. Updates the bunfig.toml file to add the dependency under a catalog
  2. References the cataloged version in package.json

Example - Named Catalog:

ni lodash --catalog prod

Should update the catalogs in package.json.

And reference in package.json:

{
  "dependencies": {
    "lodash": "catalog:prod"
  }
}

Example - Default Catalog:

ni lodash --catalog

Should use the default catalog in bunfig.toml.

Note

This feature was introduced in Bun v1.2.9.

nup

It would be helpful if the feature also worked for nup (updating packages) not just ni.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions