Skip to content

feat: add runtime detection - #38

Merged
obany merged 3 commits into
nextfrom
feature/runtime-detection
Oct 25, 2026
Merged

obany merged 3 commits into
nextfrom
feature/runtime-detection

Conversation

@obany

@obany obany commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Adds a Runtime class to @3sixty/core for detecting the JavaScript runtime, its version and the operating system, and fixes tstransform failing under Bun on Linux and macOS.

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • ⚡ Performance improvement
  • ♻️ Code refactoring
  • 📦 Dependencies update

🛠️ Changes Made

  • Add Runtime.engine(), Runtime.version() and Runtime.os() to @3sixty/core, with the RuntimeEngine (node, bun, deno, workerd, browser, webWorker, unknown) and RuntimeOs (windows, mac, linux, unknown) types
  • Check Bun, Deno and Cloudflare Workers before Node, as they all provide a Node compatible process global
  • Replace the IS_BUN test helper in @3sixty/crypto with Runtime.engine()
  • Switch tsTransform to the async native TypeScript API, as the sync API reads Node internal pipe handles on POSIX that Bun does not provide; tsTransform now returns Promise<string> and the tstransform bin awaits it
  • Add a Runtime example to the core examples and workerd to the spelling dictionary

🧪 Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change manually
  • Testing not required for changes

@obany
obany merged commit a35787c into next Oct 25, 2026
1 check passed
@obany
obany deleted the feature/runtime-detection branch October 25, 2026 23:55
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