Skip to content

fix: replace postinstall download with optional platform packages#17

Open
smorimoto wants to merge 1 commit into
upstash:masterfrom
smorimoto:fix/optional-platform-packages
Open

fix: replace postinstall download with optional platform packages#17
smorimoto wants to merge 1 commit into
upstash:masterfrom
smorimoto:fix/optional-platform-packages

Conversation

@smorimoto
Copy link
Copy Markdown

@smorimoto smorimoto commented May 6, 2026

Summary

  • Replaces the unreliable postinstall-based binary download (which silently fails under bunx / pnpx because their dlx hooks are disabled by default for security — see issue running the cli using bunx #6 and bug: Bus error when using pnpm on Linux #9) with the optional platform packages pattern used by esbuild, biome, and similar tooling.
  • Adds a small CommonJS launcher at bin/qstash that resolves the platform-specific binary via require.resolve and execs it, propagating the exit code and signal.
  • Adds six platform packages (@upstash/qstash-cli-<platform>-<arch>) under packages/ with os / cpu filters and their own publishConfig, so access and provenance behaviour stays consistent locally and in CI.
  • Rewrites the release workflow to publish all six platform packages in a matrix, then publish the main package with optionalDependencies pinned to the same version.
  • Drops install.ts, tsconfig.json, bun.lockb, bin/.gitkeep, and the now-unused tar / unzipper dependencies.

Closes #6
Closes #9

The previous `postinstall` approach silently fails under `bunx` and `pnpx`
(issues upstash#6 and upstash#9), where dlx-style install hooks are disabled by default
for security. Migrate to the optional platform packages pattern used by
esbuild, biome, and similar tooling.

- Add a small CommonJS launcher at `bin/qstash` that resolves the
  platform-specific binary via `require.resolve` and execs it,
  propagating the exit code and any terminating signal.
- Introduce six platform packages under `packages/` with `os` / `cpu`
  filters so that npm installs only the matching binary. Each declares
  its own `publishConfig`, so access and provenance behaviour stays
  consistent whether published from CI or locally.
- Rewrite the release workflow to publish all six platform packages in
  a matrix, then publish the main package with `optionalDependencies`
  pinned to the same version.
- Drop `install.ts`, `tsconfig.json`, `bun.lockb`, and `bin/.gitkeep`
  along with the now-unused `tar` and `unzipper` dependencies.

Closes upstash#6
Closes upstash#9
@smorimoto smorimoto force-pushed the fix/optional-platform-packages branch from 1aef881 to ef556d7 Compare May 6, 2026 16:19
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.

bug: Bus error when using pnpm on Linux issue running the cli using bunx

1 participant