ts-node icon indicating copy to clipboard operation
ts-node copied to clipboard

Add support for TS 5.0 "extends" array

Open cspotcode opened this issue 3 years ago • 13 comments

TS 5.0 adds support for "extends" to be an array of one or more extended configs, not just a single config.

https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#supporting-multiple-configuration-files-in-extends

We can do the same, also merging ts-node options from multiple tsconfigs.

cspotcode avatar Feb 09 '23 19:02 cspotcode

is it possible to add some warning that current released version does not support tsconfig extensions ?

evantill avatar Apr 09 '23 18:04 evantill

Thank you for addressing this issue! Would it be possible to release this fix when time allows?

Kurt-von-Laven avatar Apr 22 '23 20:04 Kurt-von-Laven

Let me know if I can help with anything in regard to releasing!

simenandre avatar Apr 25 '23 12:04 simenandre

This is really needed! Any releases in the horizon?

ghost avatar Apr 25 '23 19:04 ghost

For anyone finding this issue and wanting a fix while we wait, plan, work or try to find time to work on a release.

It is possible to install ts-node from git, as @cspotcode noted in #1958.

There's a snippet and instructions here: https://github.com/TypeStrong/ts-node/discussions/1977

simenandre avatar Apr 27 '23 06:04 simenandre

@simenandre Were you able to get that to work? It doesn't work for me because the repo is downloaded and there's no dist files.

BryceBarbara avatar May 04 '23 22:05 BryceBarbara

@simenandre Were you able to get that to work? It doesn't work for me because the repo is downloaded and there's no dist files.

There are others having some issues with yarn, etc. Maybe you could repost your setup in the issue I referenced?

simenandre avatar May 05 '23 04:05 simenandre

There has been a new release 10.9.2, but from https://github.com/TypeStrong/ts-node/compare/v10.9.1...v10.9.2 it looks like this change isn't included?

alexeyr-ci avatar Feb 17 '24 15:02 alexeyr-ci

still same issue with v10.9,2

tylim88 avatar Mar 27 '24 14:03 tylim88

seriously? a year passed and this is still not released. please release a new version

enisdenjo avatar Mar 28 '24 13:03 enisdenjo

can be solved now by using

pnpm i -D [email protected]

worked for me with this version

don't forget to rm node_modules or rm old ts-node before

yogrr avatar Jul 08 '24 09:07 yogrr

when is this going be released? is there something can do to help? thanks

rrooddooxx avatar Feb 19 '25 19:02 rrooddooxx

In case anyone ends up here from Google, have been debugging various jest issues, and was hitting:

Error: Jest: Failed to parse the TypeScript config file /var/home/[…]/storybook/jest.config.ts
  TypeError: value.replace is not a function
    at readConfigFileAndSetRootDir (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:2269:13)
    at async readInitialOptions (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:1147:13)
    at async readConfig (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:918:7)
    at async readConfigs (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:1168:26)
    at async runCLI (/var/home/[…]/storybook/node_modules/@jest/core/build/index.js:1393:7)
    at async Object.run (/var/home/[…]/storybook/node_modules/jest-cli/build/index.js:656:9)

and led here by https://github.com/jestjs/jest/issues/14096

but the above solution

@yogrr on on Jul 8, 2024

can be solved now by using

pnpm i -D [email protected]

just leads to another problem:

Error: Jest: Failed to parse the TypeScript config file /var/home/[…]/storybook/jest.config.ts
  TypeError: state.conditions.includes is not a function
    at readConfigFileAndSetRootDir (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:2269:13)
    at async readInitialOptions (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:1147:13)
    at async readConfig (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:918:7)
    at async readConfigs (/var/home/[…]/storybook/node_modules/jest-config/build/index.js:1168:26)
    at async runCLI (/var/home/[…]/storybook/node_modules/@jest/core/build/index.js:1393:7)
    at async Object.run (/var/home/[…]/storybook/node_modules/jest-cli/build/index.js:656:9)

that was fixed in the more-recent stable version 10.9.2 so the beta version is older and does not include the fix 😖

there is a patch available but a new beta release is definitely in order. https://github.com/TypeStrong/ts-node/issues/2076#issuecomment-2072081161

heyakyra avatar Aug 23 '25 23:08 heyakyra