Skip to content

refactor: remove platform npm packages, download from GitHub Releases#173

Merged
rhuanbarreto merged 1 commit into
mainfrom
refactor/remove-platform-npm-packages
Mar 25, 2026
Merged

refactor: remove platform npm packages, download from GitHub Releases#173
rhuanbarreto merged 1 commit into
mainfrom
refactor/remove-platform-npm-packages

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Remove 3 platform-specific npm packages (archgate-darwin-arm64, archgate-linux-x64, archgate-win32-x64) and their optionalDependencies entry
  • npm shim downloads binary from GitHub Releases on first run, caches to ~/.archgate/bin/
  • Simplify release pipeline — CI still builds binaries and uploads to GitHub Releases, but no longer publishes platform npm packages
  • Remove version sync overhead — no more optionalDependencies version sync in .simple-release.js, no more optional-deps-version-sync ADR rule

What changed

File Change
bin/archgate.cjs Download from github.com/archgate/cli/releases instead of registry.npmjs.org; cache to ~/.archgate/bin/
scripts/postinstall.cjs Check ~/.archgate/bin/ instead of node_modules/archgate-*/
package.json Remove optionalDependencies block
.simple-release.js Remove optionalDependencies version sync logic
release-binaries.yml Remove "Copy binary into npm package" and "Publish platform package" steps; remove id-token: write permission
ARCH-013 Remove optional-deps-version-sync rule (21 checks remain)
packages/ Deleted entirely (6 files)
Docs + CLAUDE.md Updated to reflect new distribution model

Why

npm install is not the preferred installation path. The platform packages added complexity (3 extra npm publishes per release, version sync logic, OIDC setup) for a path we don't want to optimize for. The standalone installers (install.sh, install.ps1) and archgate upgrade already download from GitHub Releases.

Test plan

  • bun run validate passes (lint, typecheck, format, 599 tests, 21/21 ADR checks, build)
  • Manual test: npm install archgate on a clean machine triggers postinstall download
  • Manual test: first archgate invocation with empty ~/.archgate/bin/ downloads binary
  • Verify release-binaries.yml still uploads assets to GitHub Releases correctly

…eleases

Replace the 3 platform-specific npm packages (archgate-darwin-arm64,
archgate-linux-x64, archgate-win32-x64) with on-demand binary download
from GitHub Releases. The npm shim now downloads the binary on first run
and caches it to ~/.archgate/bin/.

This simplifies the release pipeline (no more platform npm publishes),
removes optionalDependencies from package.json, and eliminates 3 packages
to maintain.

Changes:
- bin/archgate.cjs: download from GitHub Releases instead of npm registry
- scripts/postinstall.cjs: check ~/.archgate/bin/ instead of node_modules
- package.json: remove optionalDependencies
- .simple-release.js: remove optionalDependencies version sync
- release-binaries.yml: remove npm publish steps, keep GH Release upload
- ARCH-013: remove optional-deps-version-sync rule
- Delete packages/ directory
- Update docs and CLAUDE.md
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 231c212
Status: ✅  Deploy successful!
Preview URL: https://8b2f6192.archgate-cli.pages.dev
Branch Preview URL: https://refactor-remove-platform-npm.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit 9b4cb6c into main Mar 25, 2026
10 checks passed
@rhuanbarreto rhuanbarreto deleted the refactor/remove-platform-npm-packages branch March 25, 2026 01:52
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