Skip to content

fix(nx-knip): make Bun runtime selection explicit #46

Description

@christopher-buss

Problem

The nx-knip executor runs bun --version and automatically selects knip-bun whenever Bun happens to be available on the host PATH. The same Nx target can therefore execute differently across developer machines and CI, even though its configuration is identical.

This is especially surprising when Bun is installed for unrelated tooling: nx-knip begins using the Bun-specific Knip entry point without the workspace opting in.

Proposed behavior

Add a runtime executor/plugin option with these values:

  • node (default): run the regular knip entry point without probing for Bun.
  • bun: run knip-bun explicitly and report an actionable failure when Bun is unavailable.

Apply the option consistently to inferred targets, single-project execution, and batch execution. Document it in the executor schema and package README.

Acceptance criteria

  • Ambient Bun availability does not change the default runtime.
  • Explicit runtime: "bun" selects knip-bun in single and batch execution.
  • An explicit Bun request fails with a clear message if Bun is unavailable.
  • Plugin inference propagates the configured runtime.
  • Tests cover the schema, inferred targets, single executor, and batch executor behavior.

Generated with Codex.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions