Skip to content

feat: add npm publish workflow with multi-platform binary distribution#4

Merged
betegon merged 2 commits intomainfrom
feat/npm-publish-workflow
Jan 14, 2026
Merged

feat: add npm publish workflow with multi-platform binary distribution#4
betegon merged 2 commits intomainfrom
feat/npm-publish-workflow

Conversation

@betegon
Copy link
Member

@betegon betegon commented Jan 14, 2026

Summary

  • Add CI workflow for PR builds (typecheck + build + smoke test)
  • Add publish workflow for merging to main (auto version bump + publish to npm)
  • Add Node.js launcher script for cross-platform binary distribution
  • Update build scripts for npm package structure

How it works

On PR:

  • CI runs: install → typecheck → build (Linux only) → smoke test

On merge to main:

  • Publish runs: bump version (0.X → 0.X+1) → build all platforms → publish 6 packages to npm → commit version back

Packages published

Package Description
@betegon/sentry Main package with Node.js launcher
sentry-darwin-arm64 macOS Apple Silicon binary
sentry-darwin-x64 macOS Intel binary
sentry-linux-arm64 Linux ARM64 binary
sentry-linux-x64 Linux x64 binary
sentry-windows-x64 Windows x64 binary

Required secrets

Add these to GitHub repo settings → Secrets:

  • SENTRY_CLIENT_ID - OAuth client ID for auth
  • NPM_TOKEN - npm automation token for publishing

Usage

npm install -g @betegon/sentry
sentry auth login

- Add CI workflow for PR builds (typecheck + build + smoke test)
- Add publish workflow for merging to main (auto version bump + publish)
- Add bin/sentry Node.js launcher script for platform detection
- Update build.ts to create npm package structure per platform
- Add package.ts to create main @betegon/sentry package with optionalDependencies
- Remove old fossilize-based build.yml

The CLI is published as @betegon/sentry with platform-specific binaries:
- sentry-darwin-arm64
- sentry-darwin-x64
- sentry-linux-arm64
- sentry-linux-x64
- sentry-windows-x64
@betegon betegon merged commit 76569df into main Jan 14, 2026
1 check passed
@betegon betegon deleted the feat/npm-publish-workflow branch January 14, 2026 11:02
BYK added a commit that referenced this pull request Mar 4, 2026
…parallelize cleanup

Review Round 3 — 15 human review comments addressed:

#1: login.ts — Replace await .catch() with proper try/await/catch blocks
#2: whoami.ts + all commands — Export FRESH_ALIASES constant from list-command.ts
    to reduce boilerplate; update 15 command files to use it
#3: response-cache.ts — Bump immutable TTL from 1hr to 24hr (events/traces
    never change once created)
#4–6: response-cache.ts — Restructure URL_TIER_PATTERNS as Record<TtlTier, RegExp[]>,
    combine duplicate regex patterns into single alternations
#7: response-cache.ts — Replace localeCompare with simple < comparison for
    ASCII URL query param sorting
#8: response-cache.ts — Remove try-catch in normalizeUrl (URLs reaching the
    cache already came from a fetch, always valid)
#9: response-cache.ts — Link immutableMinTimeToLive to FALLBACK_TTL_MS.immutable
    instead of hardcoded magic number
#10: response-cache.ts — Use Object.fromEntries(headers.entries()) instead of
    manual forEach loop
#11: response-cache.ts — Remove unnecessary await on fire-and-forget unlink in
    catch block
#12: response-cache.ts — Add expiresAt field to CacheEntry for O(1) expiry
    checks during cleanup (no CachePolicy deserialization needed)
#13–15: response-cache.ts — Parallelize cache I/O (collectEntryMetadata,
    deleteExpiredEntries, evictExcessEntries) using p-limit-style concurrency
    limiter (max 8 concurrent)
BYK added a commit that referenced this pull request Mar 4, 2026
…pans

Review comments addressed:

#1: issue/list.ts FRESH_ALIASES — verified no conflict, only log/list.ts
    has f: 'follow' and it doesn't use FRESH_ALIASES
#2: cacheHeuristic 0.1 vs CLEANUP_PROBABILITY — different semantics,
    not shared (RFC heuristic vs probabilistic cleanup trigger)
#3: Simplified parallel() — replaced custom wrapper with p-limit's
    built-in .map() method (cacheIO.map(items, fn)) at all 3 call sites
#4: evictExcessEntries/deleteExpiredEntries — run both in parallel via
    Promise.all() since they operate on disjoint file sets
#5: Added Sentry instrumentation — withCacheSpan() helper in telemetry.ts,
    cache.lookup and cache.store spans in response-cache.ts with URL attrs
BYK added a commit that referenced this pull request Mar 4, 2026
…pans

Review comments addressed:

#1: issue/list.ts FRESH_ALIASES — verified no conflict, only log/list.ts
    has f: 'follow' and it doesn't use FRESH_ALIASES
#2: cacheHeuristic 0.1 vs CLEANUP_PROBABILITY — different semantics,
    not shared (RFC heuristic vs probabilistic cleanup trigger)
#3: Simplified parallel() — replaced custom wrapper with p-limit's
    built-in .map() method (cacheIO.map(items, fn)) at all 3 call sites
#4: evictExcessEntries/deleteExpiredEntries — run both in parallel via
    Promise.all() since they operate on disjoint file sets
#5: Added Sentry instrumentation — withCacheSpan() helper in telemetry.ts,
    cache.lookup and cache.store spans in response-cache.ts with URL attrs
BYK added a commit that referenced this pull request Mar 4, 2026
…pans

Review comments addressed:

#1: issue/list.ts FRESH_ALIASES — verified no conflict, only log/list.ts
    has f: 'follow' and it doesn't use FRESH_ALIASES
#2: cacheHeuristic 0.1 vs CLEANUP_PROBABILITY — different semantics,
    not shared (RFC heuristic vs probabilistic cleanup trigger)
#3: Simplified parallel() — replaced custom wrapper with p-limit's
    built-in .map() method (cacheIO.map(items, fn)) at all 3 call sites
#4: evictExcessEntries/deleteExpiredEntries — run both in parallel via
    Promise.all() since they operate on disjoint file sets
#5: Added Sentry instrumentation — withCacheSpan() helper in telemetry.ts,
    cache.lookup and cache.store spans in response-cache.ts with URL attrs
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