Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

feat(ts-node): register with module: "commonjs" #156

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hasparus
Copy link

@hasparus hasparus commented Apr 15, 2021

Closes #155.

What did you implement:

I registered ts-node configuring TypeScript to compile import and export to CommonJS.

How did you implement it:

How can we verify it:

Tasks:

  • Write tests — This could be tested in a e2e manner with mock user-projects, but it's not a trivial setup.
  • Write documentation — I'm not sure it needs to be documented.
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@hasparus hasparus requested a review from a team as a code owner April 15, 2021 21:57
@tobiasdiez
Copy link

@hassankhan It would be awesome if this PR could be merged and a new version released. Thanks!

@hassankhan
Copy link
Collaborator

Hi @tobiasdiez, apologies I've only just had my commit privileges restored and realised that Travis CI doesn't work any more; going to need to switch over to GitHub Actions before the Ci can release a new version. I've created a new issue for that: #185

@MichalPodeszwa
Copy link

@hassankhan @hasparus Is there any chance this could be merged and new version released? Seems like it's been a while and it's currently blocking our workflow.

@hasparus
Copy link
Author

hasparus commented Nov 15, 2021

Cześć @MichalPodeszwa, this isn't a question for me, but I can offer you a workaround:

I'm using the following patch with patch-package in Theme UI, as one of its dependencies uses cosmiconfig.

theme-ui/patches/@endemolshinegroup+cosmiconfig-typescript-loader+3.0.2.patch

Due to this PR not being merged and a few other reasons, in my recent work I've decided not to use cosmiconfig and go with tsNode.register(); require(configPath) instead. (eth-sdk/pull/33/commits/7fbcf5d#diff-95b597R14-R16)


Edit: Actually, I didn't try it yet, but you might be able to work around this problem by setting process.env.TS_NODE_COMPILER_OPTIONS.

@Codex- Codex- mentioned this pull request Nov 16, 2021
7 tasks
@Codex-
Copy link

Codex- commented Nov 16, 2021

Having issues that this PR would resolve too, created this to try get things moving again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Misleading TypeScriptCompileError when user's tsconfig.json "module" is set to "es2015"
5 participants