Moves from ts-node to babel-register, fixes the local sdk #332
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.
This diff does two things:
First, we move from
ts-node
tobabel-register
for running our TS files. We don't need to typecheck them since they'll be typechecked later as part oftsc
, and Babel is a generally mature tool that we already use for the Jest integration.Second, the local sdk now instantiates
babel-register
before instantiating PnPify. This allows us to run PnPify directly from its sources, without having to build it beforehand or to use an outdated build (as it would be the case if we were using a version from npm, for example).As an implementation detail, I've abstracted the TypeScript setup inside
@berry/monorepo
, so all packages can now usesetup-ts-execution
if needed.Note that this diff will make our own sdk code slightly different from the one used by our consumers, since we'll need to setup babel-register before. This means that we won't be able to update it just by running
yarn pnpify --sdk
; we'll have to make the changes manually (or reapply the custom parts after each update).