Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TS 5.5 ${configDir} template variable #81

Closed
2 tasks
zanminkian opened this issue Jul 14, 2024 · 15 comments
Closed
2 tasks

Add support for TS 5.5 ${configDir} template variable #81

zanminkian opened this issue Jul 14, 2024 · 15 comments
Labels

Comments

@zanminkian
Copy link

Feature request

TS 5.5 support ${configDir} template variable. See here.

import { parseTsconfig } from "get-tsconfig";
const tsconfig = parseTsconfig('/path/to/tsconfig.json');
console.log(tsconfig.compileOptions.outDir) // if there is `${configDir}` template variable in `outDir`, the output result is incorrect in TS 5.5

Motivations

To support TS 5.5 ${configDir} template variable.

Alternatives

No response

Additional context

No response

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work financially will speed up resolution

  • I'm willing to offer financial support
@SukkaW
Copy link
Contributor

SukkaW commented Jul 28, 2024

@privatenumber I'd like to create a PR for ${configDir} support, but I can't get existing test cases to pass after upgrading to TS 5.5 (it seems that there is a behavior change with --showConfig). You might wanna take a look at that first.

@privatenumber
Copy link
Owner

Yeah the tests need to be updated when you upgrade typescript. I'm not sure when I'll get around to this right now.

@SukkaW
Copy link
Contributor

SukkaW commented Jul 28, 2024

Yeah the tests need to be updated when you upgrade typescript. I'm not sure when I'll get around to this right now.

It seems that the latest tsc --showConfig now prints explicit config instead of the original config, hence the extra fields.

@privatenumber
Copy link
Owner

Yep, it's a good thing. get-tsconfig should match this behavior and build-in this logic.

@SukkaW
Copy link
Contributor

SukkaW commented Jul 28, 2024

Yep, it's a good thing. get-tsconfig should match this behavior and build-in this logic.

Though tsc --showConfig now makes the "hidden" default more explicit, I am not sure whether the get-tsconfig should do the same, this looks like a breaking change to me.

@privatenumber
Copy link
Owner

Before, it was up to the consumer of get-tsconfig's output to determine what configs are implicitly enabled, but now get-tsconfig does it for you. In terms of behavior, there's no breaking change, but there is a breaking change in terms of API output. I don't mind doing a major release for this.

@privatenumber
Copy link
Owner

privatenumber commented Aug 27, 2024

@SukkaW
RE: dominikg/tsconfck#183

I'm quite occupied with work these days but if it's a priority, I'm happy to support you to get this in.

For now, we can upgrade TypeScript and suppress the extra output. Would you be willing to open a PR?

@SukkaW
Copy link
Contributor

SukkaW commented Aug 27, 2024

For now, we can upgrade TypeScript and suppress the extra output. Would you be willing to open a PR?

I already had a branch going. Lemme see what I can do.

Actually I suggest that we makes the tests passed first, that's to say, let's switch from toBeStrictEqual to loosely equal toMatchObject. And we can work on new behavior then.

@privatenumber
Copy link
Owner

Sounds good!

@privatenumber
Copy link
Owner

🎉 This issue has been resolved in version 4.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SukkaW
Copy link
Contributor

SukkaW commented Aug 29, 2024

@privatenumber You might want to re-open this issue. #83 only fixes the test cases are doesn't actually implement the ${configDir} feature.

@privatenumber
Copy link
Owner

See eba8538

@SukkaW
Copy link
Contributor

SukkaW commented Aug 29, 2024

See eba8538

Oh I missed that!

@trikadin

This comment was marked as spam.

Repository owner locked and limited conversation to collaborators Sep 8, 2024
@privatenumber
Copy link
Owner

This is a closed issue, please open another one.

Looks like I missed rootDirs and others (declarationDir, typeRoots, baseUrl). Feel free to open a PR

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

No branches or pull requests

4 participants