chore: local support for node --strip-types
#158
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.
Note
This PR doesn't affect the published
dist
code nor any file that's published to npm whatsoever. Its only purpose is to improve the experience of working withfdir
's typescript source code, for people who clone the repo to contribute to it.Currently, whenever you want to locally do a small test on
fdir
(to see if the code is working etc), you have to rebuild each time you change the source code, unless you use something likets-node
. This works, but it's far from ideal.Now that important PRs are merged, I'm proposing a small change that would greatly improve DX for anyone contributing to this project. Months ago, node released support for natively running typescript code, but it requires the code to specify type imports, do not make use of any non-erasable syntax (such as enums) and specify the
.ts
extension when importing typescript files.This PR makes the necessary changes to the source code to allow you to allow you to import
fdir
's typescript files directly in node:This PR doesn't remove support for anything, all tools still work fine, like
ts-node
orvitest
It also prevents
tsc
from emitting any code, since we're supposed to build withtsdown
now, removes theforceConsistentCasingInFileNames
config option (since it's on by default) and adds a typecheck workflow (the test workflow never did any typechecking) with dependency caching to significantly reduce CI times.I haven't removed
ts-node
from the dev dependencies since you still might want to use it when benchmarking on node versions that don't have--strip-types
.This PR affects many files and I'd completely understand if it doesn't get accepted. It would just really improve the experience of contributing to
fdir
.