Microsoft/TypeScript

Expose ts.matchFiles as public API to make implementing readDirectory easier.

Open

#13 793 ouverte le 31 janv. 2017

Voir sur GitHub
 (10 commentaires) (5 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: APIExperience EnhancementHelp WantedSuggestion

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

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

Guide contributeur