microsoft / microsoft/TypeScript
Expose ts.matchFiles as public API to make implementing readDirectory easier.
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo l’implementazione esportata di matchFiles e i file di definizione dei tipi relativi all’API readDirectory del compiler host. Confronta il modo in cui matchFiles viene usato dagli host TypeScript esistenti, quindi determina se esporre pubblicamente matchFiles o aggiungere getFileSystemEntries risponde meglio alle esigenze dei filesystem virtuali personalizzati. Il lavoro è completato quando l’API scelta è disponibile nelle dichiarazioni e supporta un comportamento di readDirectory corrispondente a quello di tsc.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 32/100