microsoft / microsoft/TypeScript
Expose ts.matchFiles as public API to make implementing readDirectory easier.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Problem:
When implementing a custom host that virtualizes the file system, the readDirectory method is cumbersome to implement in a way that matches tsc behavior.
If you look at the hosts within typescript, the matchFiles method was added to unify behavior with readDirectory between hosts.
While matchFiles is exported, it isn't in the type definition files so I'm assuming it is "private" API.
Either the host should be able to provide a getFileSystemEntries(path: string) => { files: string[], directories: string[] } to get a readDirectory implementation or expose matchFiles.
I'm working on improving the broccoli-typescript-compiler broccoli plugin to have more parity with tsc and VS Code, but I need to virtualize the FS, since broccoli builds from tmp directory and I want the node_modules/@types discovery, tsconfig extends, etc all to work, I need to pretend the tmp dir is inside the project.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the exported matchFiles implementation and the type definition files around the compiler host's readDirectory API. Compare how matchFiles is used by the existing TypeScript hosts, then determine whether exposing it publicly or adding getFileSystemEntries better addresses custom virtual filesystems. Done means the chosen API is available in the declarations and supports readDirectory behavior matching tsc.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100