feat: migrate from TypeScript compilation to type stripping#239
Merged
Conversation
Breaking changes: - Remove TypeScript compilation (tsc) in favor of Node.js native type stripping - Require Node.js >= 22.6.0 (type stripping support) - Remove --no-typescript (-T) and --post-compile (-P) CLI options - Remove outDir/prefix handling - tests run directly from source - Remove source map support - not needed with type stripping - Update all TypeScript imports to use .ts extensions - Remove fixtures that relied on compilation (ts-cjs, post-compile, source-map, src-to-dist, monorepo) - Reimplement watch mode using Node.js --watch flag Benefits: - Faster test execution (no compilation step) - Simpler architecture (~100 lines removed) - Native Node.js TypeScript support - Source maps not needed (line numbers preserved) Other changes: - Update README with new TypeScript documentation - Add .pi and .githuman to .gitignore - Delete plan.md
- Remove TypeScript compilation in favor of Node.js native type stripping - Remove --no-typescript and --post-compile CLI options - Rename runWithTypeScript to runTests - Fix ignore patterns for auto-discovery - Update CI to test Node 22.x and 24.x (drop 18, 20, 21, 23) - Update README with new TypeScript documentation - Add .pi and .githuman to .gitignore
Owner
Author
|
cc @jsumners |
jsumners
approved these changes
Feb 3, 2026
jsumners
left a comment
Contributor
There was a problem hiding this comment.
I use borp to solve missing features of node --test. I don't have any opinion on the TypeScript aspects of the tool.
Comment on lines
+63
to
+64
| process.stderr.write(`parsed config: ${foundConfig.join(' ')} | ||
| `) |
Contributor
There was a problem hiding this comment.
This is way less clear than \n.
Address review comment: using template literal with a literal newline is less clear than using \n for the newline character. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates borp from TypeScript compilation (tsc) to Node.js native type stripping, simplifying the architecture and improving test execution speed.
Breaking Changes
Removed CLI Options
--no-typescript/-T- No longer needed, type stripping is always used--post-compile/-P- No compilation step exists to hook intoRemoved Features
outDirhandling - tests run directly from sourcetsconfig.jsonproject references /--buildsupportRemoved Fixtures
The following fixtures that relied on compilation were removed:
ts-cjs- no CJS transformation supportts-cjs-post-compile- post-compile hook obsoletets-esm-post-compile- post-compile hook obsoletets-esm-source-map- source maps not neededsrc-to-dist- outDir pattern not applicablemonorepo- project references not supportedRequirements
Benefits
.tsline numbers preservedArchitecture Changes
Simplified Core (
lib/run.js)runWithTypeScript→runTests--watch)node:test run()Updated CLI (
borp.js)Updated Imports
All TypeScript test files now use
.tsextensions:TypeScript Constraints
Type stripping has some limitations. Code must follow these rules:
import type { Foo }orimport { type Foo }as constinstead.tsfiles with.tsextensionSee Node.js TypeScript documentation for full details.
Migration Guide for Users
.jsto.tsin TypeScript import statementsoutDir: Tests run from source, notdist/foldernoEmit: truefor type checking onlyCI Updates
Updated test matrix to focus on Node versions with type stripping support:
Test Results
Documentation Updates