Skip to content

Publish prebuilt scripts binaries through npm #2

Description

@mbullington

Problem

Node monorepos cannot adopt scripts as a pinned project tool without requiring every developer and CI image to install Rust or run a separate global cargo install scripts_runner step.

A project-local npm dependency would make installation automatic, keep the version in the lockfile, and allow package scripts to invoke pnpm exec scripts.

Proposal

Publish a small npm launcher package plus platform-specific packages containing prebuilt scripts binaries. Follow the packaging model used by tools such as esbuild:

  • The launcher exposes the scripts command through package.json#bin.
  • Platform packages contain one native binary and declare matching os and cpu fields.
  • The launcher lists platform packages as optional dependencies and selects the installed binary at runtime.
  • All packages use the same version and are published from the existing tag release workflow.
  • Unsupported platforms receive an actionable error that lists supported targets and the cargo install scripts_runner fallback.
  • Avoid a postinstall network download. Let npm, pnpm, or Yarn fetch and verify the platform package.

Initial targets can match the existing GitHub release support, with architecture made explicit. At minimum, consider macOS ARM64, macOS x64, and Linux x64 if CI can build them reliably.

Acceptance criteria

  • pnpm add -D <package> installs a pinned project-local scripts executable without Rust.
  • pnpm exec scripts --version runs on every published target.
  • Only the package for the current operating system and architecture is installed.
  • npm package versions match the Rust crate and GitHub release tag.
  • The release workflow tests each packaged binary before publication.
  • Installation works in CI without a global install step.
  • The README documents npm, pnpm, and Yarn usage alongside Cargo installation.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions