Skip to content

Added a transpile-only ESM loader (#1101) - #1102

Merged
cspotcode merged 7 commits into
TypeStrong:masterfrom
concision:ab/1101
Aug 12, 2020
Merged

Added a transpile-only ESM loader (#1101)#1102
cspotcode merged 7 commits into
TypeStrong:masterfrom
concision:ab/1101

Conversation

@concision

Copy link
Copy Markdown
Contributor

This resolves the feature request #1101: A new ESM loader equivalent of 'ts-node/register/transpile-only'

@codecov

codecovBot commented Aug 10, 2020

Copy link
Copy Markdown

Codecov Report

Merging #1102 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #1102 +/- ##
=======================================
Coverage 75.49% 75.49% =======================================
Files 7 7 Lines 657 657 Branches 148 148 =======================================
Hits 496 496 Misses 107 107 Partials 54 54 
FlagCoverage Δ
#node_1072.15% <ø> (ø)
#node_12_1572.53% <ø> (ø)
#node_12_1672.53% <ø> (ø)
#node_1375.19% <ø> (ø)
#node_1475.19% <ø> (ø)
#typescript_2_775.03% <ø> (ø)
#typescript_latest74.27% <ø> (ø)
#typescript_next74.12% <ø> (ø)
#ubuntu75.19% <ø> (ø)
#windows75.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce7c323...525b730. Read the comment docs.

@coveralls

coveralls commented Aug 10, 2020

Copy link
Copy Markdown

Coverage Status

Coverage increased (+1.0%) to 83.175% when pulling 525b730 on concision:ab/1101 into ce7c323 on TypeStrong:master.

@cspotcode

Copy link
Copy Markdown
Collaborator

Looks good but it'll need tests before being merged, and our package.json will need to be updated.

You can probably copy-paste an existing ESM test, but add a deliberate type error to make sure it gets ignored.

We also have tests that each entrypoint can be resolved, which will validate the changes to package.json.

@cspotcodecspotcode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs package.json updates and tests; otherwise looks good.

@concision

Copy link
Copy Markdown
ContributorAuthor

I have added esm/transpile-only.mjs to the package.json exports and corresponding resolution tests.

I also added two tests to verify the loader should behave as expected:

  • verify that the transpile-only ESM loader skips type checks in the presence of type errors
  • verify that the transpile-only ESM loader throws a type error in the presence of type errors

Are there any other needed changes I need to make?

@cspotcodecspotcode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great; just a couple questions.

Comment threadtests/esm-transpile-only/index.ts Outdated
Comment threadsrc/index.spec.ts
@cspotcode
cspotcode merged commit e29ae04 into TypeStrong:masterAug 12, 2020
@cspotcode

Copy link
Copy Markdown
Collaborator

@concision looks great, thanks. It's merged. I need a review of #970 before making our next release, but hopefully we can get that done this weekend. It'll be 9.0.0

Sign up for freeto 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.

3 participants

@concision@coveralls@cspotcode