Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
The fslib didn't account for some families of functions (
appendFile
,readFile
,writeFile
) being allowed to consume file descriptors.It also didn't implement
appendFile
at all.How did you fix it?
I've added a new type,
FSPath<T>
, which encompassesT | number
. This type is then used as input for the specific functions referenced above. Since most fake fs layers are abstracted under theProxiedFS
abstract, most of them don't have to deal with this as the fds will just be forwarded untransformed.Of note: TypeScript doesn't prevent a subclass from implementing a subset of an abstract method, meaning that it'll not report it if a subclass of
FakeFS<T>
usesT
as parameter for the relevant functions rather thanFSPath<T>
. It'll crash at runtime, however, as they'll still receive integers.Which packages would need a new release (if any)?
berry-fslib, berry-pnp, berry-core, berry-cli
Have you run
yarn version [major|minor|patch] --deferred
in those packages?