question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cspotcodecommented, Oct 2, 2018

@AviVahl I’m trying to do the same thing and just encountered readDirectory myself. My goal is to publish an in-memory implementation of ts.System for use in browsers demos, experiments, etc. Do you have a link to what you’re working on?

0reactions
usergeniccommented, Jun 24, 2020

I’m currently having to implement a readDirectory etc and I was really hoping this had been addressed 3 years ago when brought up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Build a Public Facing API
First, users of public APIs are usually developers, so it is important to build APIs that are simple and intuitive for them. Developers...
Read more >
How to build a REST API with TypeScript using only native ...
This guide will demonstrate how to use TypeScript to create a REST API using only the native modules. The project aims to help...
Read more >
How to Create a Simple REST API using TypeScript and ...
This article will be teaching us how to create a simple REST API using TypeScript and Node.js. We will be building a simple...
Read more >
Untitled
23 age flags www ireland dating ts nepali subscription sites column service ... cute via learning find invented public ugandan safe. losers get...
Read more >
Introduction to RESTful APIs with NestJS
Understanding JavaScript and TypeScript will make it easier to follow ... This command will create a new project directory called rest-api .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found