Skip to content

Commit

Permalink
Experimental ESM support for node >=13 (#1010)
Browse files Browse the repository at this point in the history
* Initial commit

* fix exports declaration in package.json; update example readme

* add missing file to package files array

* Add missing .js extension to ESM resolver

* WIP to support EmitFlavor, which I'm going to undo since actually we don't need to support 2x emit flavors

* Add foo.js -> foo.ts resolution, remove compileEsm codepath, add support for experimental-specifier-resolution=node

* Add testing on node 14 to CI

* Add ESM header to README

* Add ESM test

* ESM loader factory accepts RegisterOptions

* Add copy of node's ESM loader to make diffing easier.

* Fix tests

* Fix tests

* type annotation in esm.mjs

* fix tests on ts 2.7

* Conditionally run esm tests on node >= 13
  • Loading branch information
cspotcode authored May 3, 2020
1 parent 8372d4d commit f6cd5d4
Show file tree
Hide file tree
Showing 29 changed files with 1,751 additions and 31 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
flavor: [1, 2, 3, 4]
flavor: [1, 2, 3, 4, 5, 6, 7]
include:
- flavor: 1
node: 6
Expand All @@ -21,6 +21,15 @@ jobs:
- flavor: 4
node: 13
typescript: typescript@next
- flavor: 5
node: 14
typescript: typescript@latest
- flavor: 6
node: 14
typescript: [email protected]
- flavor: 7
node: 14
typescript: typescript@next
steps:
# checkout code
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

> TypeScript execution and REPL for node.js, with source map support. **Works with `typescript@>=2.7`**.
### *Experimental ESM support*

Native ESM support is currently experimental. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007).

## Installation

```sh
Expand Down
Loading

0 comments on commit f6cd5d4

Please sign in to comment.