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

Expose TypeScript-specific globbing behavior #34545

Open
DanielRosenwasser opened this issue Oct 17, 2019 · 4 comments
Open

Expose TypeScript-specific globbing behavior #34545

DanielRosenwasser opened this issue Oct 17, 2019 · 4 comments
Labels
API Relates to the public API for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Oct 17, 2019

Today, TypeScript's globber uses a custom strategy that acts differently from other tools. This is an issue for 3rd party users who need to consume TypeScript's APIs, but need to validate that a file belongs to a compilation. #32564 dives into some of the discussion around this.

This API doesn't have to be the same as matchFiles - but it needs to compose well with the rest of our API.

@DanielRosenwasser DanielRosenwasser added In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Oct 17, 2019
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 3.8.0 milestone Oct 17, 2019
@DanielRosenwasser DanielRosenwasser added the API Relates to the public API for TypeScript label Oct 17, 2019
@weswigham
Copy link
Member

weswigham commented Oct 17, 2019

@DanielRosenwasser should this be part of a meta-issue along the lines of "tsc.js should be implementable/implemented using only public APIs"? (Since that's what API consumers are essentially trying to do.) So we audit other possible concerns?

@DanielRosenwasser
Copy link
Member Author

Sure, a minimal core of tsc.js at the very least makes sense. Letting API consumers drive these requests seems like a reasonable way of getting there.

@AviVahl
Copy link

AviVahl commented Oct 18, 2019

Happy to see this discussion, although I'm quite sure there's an open issue regarding this API (lost and forgotten by time and indexes). I might have even commented in one.

Anyhow, it's not just about powering tsc-like builds programmatically. I personally wanted to create a language service using a custom host around my own in-memory fs implementation. The only way I got the globbing behavior to match typescript's default node host was to expose this internal API:
https://github.com/wixplosives/file-services/blob/master/packages/typescript/src/typescript-internals.d.ts

Needed it to provide a readDirectory implementation, which is basically a proxy to this function. I needed other internal APIs as well, but this is a good start, heh. :)

@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Aug 31, 2020
@AviVahl
Copy link

AviVahl commented Dec 23, 2020

Better late than never: #13793

@andrewbranch andrewbranch added this to the TypeScript 4.5.0 milestone Aug 31, 2021
@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature and removed In Discussion Not yet reached consensus Rescheduled This issue was previously scheduled to an earlier milestone labels Feb 4, 2022
@RyanCavanaugh RyanCavanaugh removed this from the TypeScript 4.6.1 milestone Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Relates to the public API for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

6 participants