Skip to content

feat(packaging): distribute szr via npm and PyPI#58

Merged
alxxjohn merged 1 commit into
mainfrom
feat/npm-pypi-packaging
Jul 3, 2026
Merged

feat(packaging): distribute szr via npm and PyPI#58
alxxjohn merged 1 commit into
mainfrom
feat/npm-pypi-packaging

Conversation

@alxxjohn

@alxxjohn alxxjohn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds wrapper packaging so szr is installable from npm and PyPI using the prebuilt GoReleaser binaries — no Go toolchain and no install-time network for users.

  • npmnpm install -g @devr-tools/szr. esbuild-style optionalDependencies: the launcher package resolves and execs the matching @devr-tools/szr-<os>-<cpu> platform package. No postinstall.
  • PyPIpip install szr. One wheel per platform, each bundling the binary as a data-script so pip drops szr onto PATH (no Python shim). Linux ships manylinux2014 + musllinux_1_1.
  • CIpublish-npm and publish-pypi jobs in release.yml, gated stable-only (matching the Homebrew job), both via OIDC trusted publishing (no long-lived tokens; npm job upgrades to npm ≥ 11.5.1 and sets id-token: write).

Files

  • packaging/extract-binaries.sh — stage release binaries per platform (shared by both builders)
  • packaging/npm/ — launcher source, build.sh, one-time bootstrap-publish.sh
  • packaging/pypi/build_wheels.py — stdlib-only per-platform wheel builder
  • packaging/README.md — architecture + one-time registry setup
  • .gitignore — ignore build artifacts, keep the launcher source tracked
  • README.md — npm/pip install instructions

Verification

  • npm launcher runs on host (szr 0.16.0); clear error when the platform package is absent
  • npm publish --dry-run clean for launcher + platform packages
  • wheels install executable into a venv and run; twine check PASSED on all 7
  • Live: bootstrapped all 6 npm packages at 0.16.0 and confirmed npm install -g @devr-tools/szrszr 0.16.0 from the public registry
  • Trusted publishers configured for all 6 npm packages and the PyPI project; next stable release publishes via OIDC automatically

🤖 Generated with Claude Code

Add wrapper packaging that ships the prebuilt GoReleaser binaries through npm
and PyPI, so users can `npm install -g @devr-tools/szr` or `pip install szr`
without a Go toolchain and without any network access at install time.

- npm: esbuild-style optionalDependencies. A launcher package
  (@devr-tools/szr) resolves and execs the matching
  @devr-tools/szr-<os>-<cpu> platform package. No postinstall.
- PyPI: one wheel per platform, each bundling the binary as a data-script so
  pip drops `szr` onto PATH. Stdlib-only builder; ships manylinux2014 +
  musllinux_1_1 for Linux.
- release.yml: publish-npm and publish-pypi jobs, stable-only (matching the
  Homebrew gate), both via OIDC trusted publishing (no long-lived tokens).
- extract-binaries.sh stages release binaries; bootstrap-publish.sh handles
  the one-time npm publish required before trusted publishers can be added.

Verified end-to-end against v0.16.0: launcher run, npm publish --dry-run,
wheel install (executable) + twine check, and a live `npm install -g
@devr-tools/szr` from the registry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alxxjohn alxxjohn merged commit 23157e0 into main Jul 3, 2026
19 checks passed
@alxxjohn alxxjohn deleted the feat/npm-pypi-packaging branch July 3, 2026 16:47
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