Skip to content

feat: Set up Craft-based release workflow for npm and GitHub Releases#28

Merged
BYK merged 23 commits intomainfrom
byk/release-setup
Jan 21, 2026
Merged

feat: Set up Craft-based release workflow for npm and GitHub Releases#28
BYK merged 23 commits intomainfrom
byk/release-setup

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 21, 2026

Summary

Sets up a complete release pipeline using Craft for publishing to npm and GitHub Releases. Flattens the monorepo structure (moves packages/cli/* to root) and consolidates CI workflows into a single ci.yml with lint, test, and multi-platform builds.

npm package: Single-file ESM bundle (~165KB) that works standalone without dependencies. Replaced fast-glob with tinyglobby for ESM compatibility and fixed the bundle to inline all npm packages (external: ["node:*"]). GitHub Releases: Native Bun-compiled binaries for darwin-arm64, darwin-x64, linux-arm64, linux-x64, and windows-x64. Cross-compilation enabled for platforms without available CI runners.

CI improvements: Consolidated test workflows (removed duplicate test.yml), added coverage reporting, proper node_modules caching, and cross-compilation support via --target flag for unavailable runners (macOS-13 retired, ARM runners not available for private repos).

@BYK BYK force-pushed the byk/release-setup branch 2 times, most recently from 8b6306b to 773f46f Compare January 21, 2026 18:48
Configure the project for release as `sentry` package on npm (v0.2.0) using
Craft and the getsentry/publish workflow.

Distribution:
- npm: Single bundled JS file (42KB) via esbuild for fast `npx sentry` startup
- GitHub Releases: Native Bun binaries for all platforms

Key changes:
- Add .craft.yml with npm + github targets
- Add build.yml workflow with matrix builds and smoke tests
- Add release.yml and changelog-preview.yml workflows
- Add esbuild bundler with Bun API polyfills for Node.js compatibility
- Rename package to `sentry`, set version to 0.2.0
- Move all dependencies to devDependencies (bundled at build time)
- Remove old publish.yml and platform package scripts
@BYK BYK force-pushed the byk/release-setup branch from 773f46f to 8c5d442 Compare January 21, 2026 18:52
BYK added 2 commits January 21, 2026 18:56
- Add biome-ignore comments for intentional barrel files
- Add biome-ignore for formatEventDetails complexity (formatting logic)
- Configure biome overrides for test files (regex in assertions, delete, etc.)
- Apply auto-fixes from biome (numeric separators, formatting)
- Add .turbo to .gitignore
- CI workflow now includes lint, test, and build jobs
- Build jobs depend on lint and test passing first
- Revert test.yml to original (main branch) state
- Keep build.yml as reusable workflow for release.yml
- Use v4 for all actions (checkout, setup-node, upload/download-artifact)
@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

Codecov Results 📊

❌ Patch coverage is 14.29%. Project has 654 uncovered lines.
❌ Project coverage is 62.65%. Comparing base (base) to head (head).

Files with missing lines (14)
File Patch % Lines
api-client.ts 12.20% ⚠️ 180 Missing
resolver.ts 3.77% ⚠️ 102 Missing
errors.ts 5.81% ⚠️ 81 Missing
errors.ts 35.34% ⚠️ 75 Missing
fixture.ts 28.74% ⚠️ 62 Missing
api.ts 66.30% ⚠️ 61 Missing
config.ts 75.45% ⚠️ 27 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 86.57% ⚠️ 18 Missing
cache.ts 76.27% ⚠️ 14 Missing
env-file.ts 93.94% ⚠️ 4 Missing
index.ts 97.47% ⚠️ 2 Missing
parser.ts 95.92% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    62.79%    62.65%    -0.14%
==========================================
  Files           26        26         —
  Lines         1747      1751        +4
  Branches         0         0         —
==========================================
+ Hits          1097      1097         —
- Misses         650       654        +4
- Partials         0         0         —

Generated by Codecov Action

BYK added 6 commits January 21, 2026 19:09
- Merge build.yml into ci.yml for simplicity
- Add Bun dependency caching via setup-bun cache option
- Use --frozen-lockfile for reproducible installs
- Update release.yml to use ci.yml workflow
- Delete standalone build.yml
The CLI is useless without OAuth, so fail the build if
SENTRY_CLIENT_ID environment variable is not set.
- Move packages/cli/* to root (src/, test/, script/)
- Merge package.json files, remove turbo dependency
- Remove turbo.json
- Update all workflow files to use root paths
- Update biome.jsonc test overrides path
- Update documentation (AGENTS.md, README.md, DEVELOPMENT.md)

This simplifies the repo since it's not actually a monorepo.
BYK and others added 6 commits January 21, 2026 19:30
These tests can be slow due to network latency. Increase timeout
from default 5s to 15s to prevent flaky test failures.
- darwin-x64: build on macos-latest (ARM) with cross-compilation
- linux-arm64: build on ubuntu-latest (x64) with cross-compilation

macOS-13 runners are retired, and ARM runners aren't available for
private repos. Bun supports cross-compilation natively.
- Add --target flag to build.ts for explicit target specification
- Update CI to use --target instead of --single for matrix builds
- Enables cross-compilation (e.g., build darwin-x64 on darwin-arm64)
Cross-compiled binaries (darwin-x64 on arm64, linux-arm64 on x64) cannot
be executed on the build runner. Add can-test matrix flag to skip smoke
tests for these targets.
@BYK BYK marked this pull request as ready for review January 21, 2026 20:33
@BYK BYK requested a review from betegon January 21, 2026 20:33
cursor[bot]

This comment was marked as outdated.

BYK added 5 commits January 21, 2026 20:40
Remove separate test.yml and merge coverage reporting into ci.yml.
Single test job now handles both CI gating and coverage uploads.
The monorepo was flattened - package.json is now at root.
fast-glob uses CommonJS dynamic require() which fails in ESM bundles.
tinyglobby is a pure ESM alternative that bundles correctly.

Also fixes the bundle to inline all npm packages (external: ['node:*'])
so the CLI works standalone without dependencies installed.
cursor[bot]

This comment was marked as outdated.

BYK added 2 commits January 21, 2026 21:15
Assigning undefined to process.env converts it to string 'undefined'
rather than removing the variable.
cursor[bot]

This comment was marked as outdated.

Setting process.env.X = undefined creates string 'undefined', not unset.
@BYK BYK enabled auto-merge (squash) January 21, 2026 21:28
@BYK BYK merged commit f4d624a into main Jan 21, 2026
13 checks passed
@BYK BYK deleted the byk/release-setup branch January 21, 2026 21:31
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

async *scan(opts?: { cwd?: string }): AsyncIterable<string> {
const results = await glob(this.pattern, {
cwd: opts?.cwd || process.cwd(),
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glob polyfill ignores onlyFiles option from production code

Medium Severity

The BunGlobPolyfill.scan() method only accepts { cwd?: string } as options and only passes cwd to tinyglobby. However, production code in src/lib/dsn/languages/index.ts calls scan({ cwd, onlyFiles: true }). Since tinyglobby supports onlyFiles, this option should be passed through. Currently, the npm package running on Node.js will return both files and directories instead of only files, causing behavior mismatch with native Bun.

Fix in Cursor Fix in Web

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