source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
103 stars 167 forks source link

BrowserFS Deprecated #2991

Open james-pre opened 6 months ago

james-pre commented 6 months ago

Hi there, I'm the maintainer of BrowserFS. I've been going through the dependents of browserfs.

Please see the notice in the readme: https://github.com/jvilk/browserfs

Would you be interested in updating your project to use the updated fork, ZenFS?

RichDom2185 commented 6 months ago

Hi, thanks for reaching out and informing us of the notice!

It seems like ZenFS is a simple drop-in replacement, so it seems doable. We are trying to modernize our dependencies as well at the moment so it is a good chance to remove any outdated/deprecated packages.

Are you interested in making a PR for it?

james-pre commented 6 months ago

@RichDom2185,

While I wouldn't mind helping, I've made a lot of issues about this and making PRs for each one is not feasible. However, I'm certainly willing to help out. The ZenFS readme should have enough information to migrate from BrowserFS. If you need any additional information or have any questions, please reach out to me and I will do my best to help.

RichDom2185 commented 6 months ago

@james-pre No worries, I just wanted to check if you perhaps have made a codemod or some equivalent thing to automate the migration process before I started, as I understand you must have made a lot of issues regarding this.

Otherwise, that's fine, I'll work on the PR, thank you!

james-pre commented 6 months ago

For most use cases, it should be straightforward to upgrade so I think it would be better to do the migration manually. That way the programmer can choose how to configure ZenFS.

RichDom2185 commented 6 months ago

@james-pre it seems like @zenfs/core includes its source (TypeScript) code in the published release on NPM, which is causing type errors in our codebase when we run yarn tsc:

image

Not sure if this is something related to our project configuration, but perhaps could you consider only shipping the dist folder?

james-pre commented 6 months ago

@RichDom2185 this is because the tsconfig.json was not published as well. v0.9.6 should fix the issue.

RichDom2185 commented 6 months ago

@james-pre Thanks for the quick response! Unfortunately, despite updating to the latest versions of @zenfs/core and @zenfs/dom, we are still facing issues (also removed node_modules and reran yarn install to be safe).

Judging by the type errors and also cross-checking your tsconfig.json, it seems like strict mode is not enabled, thus causing the issues with null and undefined values, among others.

I'm thinking of just figuring out how to disable the typechecking for node_modules but I thought you might want to take a look as well, full output of yarn tsc below:

yarn run v1.22.21
$ /Users/.../node_modules/.bin/tsc
node_modules/@zenfs/core/src/ApiError.ts(297,4): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(40,4): error TS2322: Type 'undefined' is not assignable to type 'V | null'.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(134,12): error TS2564: Property 'store' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(137,2): error TS2564: Property '_sync' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(144,7): error TS2532: Object is possibly 'undefined'.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(145,31): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
  Type 'undefined' is not assignable to type 'number'.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(185,4): error TS2322: Type 'null' is not assignable to type 'LRUCache<string, bigint> | undefined'.
node_modules/@zenfs/core/src/backends/AsyncStore.ts(186,4): error TS18048: 'c' is possibly 'undefined'.
node_modules/@zenfs/core/src/backends/backend.ts(87,25): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
node_modules/@zenfs/core/src/backends/backend.ts(130,24): error TS2345: Argument of type 'object | undefined' is not assignable to parameter of type 'object'.
  Type 'undefined' is not assignable to type 'object'.
node_modules/@zenfs/core/src/backends/backend.ts(131,53): error TS2345: Argument of type 'object | undefined' is not assignable to parameter of type 'object'.
  Type 'undefined' is not assignable to type 'object'.
node_modules/@zenfs/core/src/backends/Index.ts(137,23): error TS18048: 'parent' is possibly 'undefined'.
node_modules/@zenfs/core/src/backends/Index.ts(187,31): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/@zenfs/core/src/backends/Index.ts(193,4): error TS2322: Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Index.ts(198,4): error TS2322: Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Index.ts(221,3): error TS2322: Type 'string[] | undefined' is not assignable to type 'string[] | null'.
  Type 'undefined' is not assignable to type 'string[] | null'.
node_modules/@zenfs/core/src/backends/Index.ts(235,4): error TS2322: Type 'IndexDirInode<TData> | undefined' is not assignable to type 'IndexInode<TData> | null'.
  Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Index.ts(237,3): error TS2322: Type 'IndexInode<TData> | null | undefined' is not assignable to type 'IndexInode<TData> | null'.
  Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Index.ts(320,3): error TS2322: Type 'IndexInode<TData> | undefined' is not assignable to type 'IndexInode<TData> | null'.
  Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Index.ts(346,4): error TS2322: Type 'undefined' is not assignable to type 'IndexInode<TData> | null'.
node_modules/@zenfs/core/src/backends/Overlay.ts(426,3): error TS2322: Type 'null' is not assignable to type 'ApiError | undefined'.
node_modules/@zenfs/core/src/backends/Overlay.ts(474,10): error TS6133: 'operateOnWritable' is declared but its value is never read.
node_modules/@zenfs/core/src/backends/Overlay.ts(485,16): error TS6133: 'operateOnWritableAsync' is declared but its value is never read.
node_modules/@zenfs/core/src/backends/SyncStore.ts(135,31): error TS2345: Argument of type 'Uint8Array | undefined' is not assignable to parameter of type 'Uint8Array'.
  Type 'undefined' is not assignable to type 'Uint8Array'.
node_modules/@zenfs/core/src/backends/SyncStore.ts(146,31): error TS2345: Argument of type 'Uint8Array | undefined' is not assignable to parameter of type 'Uint8Array'.
  Type 'undefined' is not assignable to type 'Uint8Array'.
node_modules/@zenfs/core/src/backends/SyncStore.ts(448,34): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/backends/SyncStore.ts(459,35): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/backends/SyncStore.ts(463,34): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/config.ts(51,3): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ backend: Backend<FS, TOptions>; }'.
  No index signature with a parameter of type 'string' was found on type '{ backend: Backend<FS, TOptions>; }'.
node_modules/@zenfs/core/src/config.ts(84,33): error TS18048: 'config.uid' is possibly 'undefined'.
node_modules/@zenfs/core/src/config.ts(85,33): error TS18048: 'config.gid' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(55,9): error TS2345: Argument of type '(stats: Stats & BigIntStats) => unknown' is not assignable to parameter of type '(value: Stats | BigIntStats) => unknown'.
  Types of parameters 'stats' and 'value' are incompatible.
    Type 'Stats | BigIntStats' is not assignable to type 'Stats & BigIntStats'.
      Type 'Stats' is not assignable to type 'Stats & BigIntStats'.
        Type 'Stats' is missing the following properties from type 'BigIntStats': atimeNs, mtimeNs, ctimeNs, birthtimeNs
node_modules/@zenfs/core/src/emulation/async.ts(55,87): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(75,64): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(143,22): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(163,23): error TS2769: No overload matches this call.
  Overload 1 of 2, '(filename: string, options?: { flag?: OpenMode | undefined; } | undefined): Promise<Buffer>', gave the following error.
    Argument of type '(ObjectEncodingOptions & Abortable & { mode?: Mode | undefined; flag?: string | undefined; flush?: boolean | undefined; }) | "ascii" | ... 12 more ... | undefined' is not assignable to parameter of type '{ flag?: OpenMode | undefined; } | undefined'.
      Type 'null' is not assignable to type '{ flag?: OpenMode | undefined; } | undefined'.
  Overload 2 of 2, '(filename: string, options: BufferEncoding | (EncodingOption & { flag?: OpenMode | undefined; })): Promise<string>', gave the following error.
    Argument of type '(ObjectEncodingOptions & Abortable & { mode?: Mode | undefined; flag?: string | undefined; flush?: boolean | undefined; }) | "ascii" | ... 12 more ... | undefined' is not assignable to parameter of type 'BufferEncoding | (EncodingOption & { flag?: OpenMode | undefined; })'.
      Type 'undefined' is not assignable to type 'BufferEncoding | (EncodingOption & { flag?: OpenMode | undefined; })'.
node_modules/@zenfs/core/src/emulation/async.ts(164,55): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(190,18): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(210,68): error TS7006: Parameter 'cbEncOpts' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(234,56): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(260,39): error TS7006: Parameter 'lenOrCB' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(318,55): error TS7006: Parameter 'cbPosOff' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(318,66): error TS7006: Parameter 'cbLenEnc' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(318,77): error TS7006: Parameter 'cbPos' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(352,35): error TS2769: No overload matches this call.
  Overload 1 of 3, '(data: FileContents, posOrOff?: number | undefined, lenOrEnc?: number | BufferEncoding | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: FileContents; }>', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
  Overload 2 of 3, '(buffer: Buffer, offset?: number | undefined, length?: number | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: Buffer; }>', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(353,36): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(363,35): error TS2769: No overload matches this call.
  Overload 1 of 3, '(data: FileContents, posOrOff?: number | undefined, lenOrEnc?: number | BufferEncoding | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: FileContents; }>', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
  Overload 2 of 3, '(buffer: Buffer, offset?: number | undefined, length?: number | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: Buffer; }>', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(364,36): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(385,39): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(478,23): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(533,63): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(639,22): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(652,40): error TS7006: Parameter 'cbMode' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(653,8): error TS6133: 'mode' is declared but its value is never read.
node_modules/@zenfs/core/src/emulation/async.ts(667,47): error TS7006: Parameter 'optsListener' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(685,43): error TS7006: Parameter 'options' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/async.ts(703,10): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/async.ts(704,11): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/async.ts(708,10): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/async.ts(714,11): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/async.ts(715,13): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/async.ts(738,5): error TS18048: 'handle.file.position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(775,18): error TS2769: No overload matches this call.
  Overload 1 of 3, '(data: FileContents, posOrOff?: number | undefined, lenOrEnc?: number | BufferEncoding | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: FileContents; }>', gave the following error.
    Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
  Overload 2 of 3, '(buffer: Uint8Array, offset?: number | undefined, length?: number | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: Uint8Array; }>', gave the following error.
    Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
  Overload 3 of 3, '(data: string, position?: number | undefined, encoding?: BufferEncoding | undefined): Promise<{ bytesWritten: number; buffer: string; }>', gave the following error.
    Argument of type 'Uint8Array' is not assignable to parameter of type 'string'.
node_modules/@zenfs/core/src/emulation/async.ts(776,14): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(807,13): error TS2345: Argument of type 'RmOptions | null' is not assignable to parameter of type 'RmOptions | undefined'.
  Type 'null' is not assignable to type 'RmOptions | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(808,24): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(828,59): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(838,24): error TS2345: Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(839,15): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(839,24): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(851,19): error TS2345: Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(852,40): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(864,20): error TS2345: Argument of type 'number | null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(865,43): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(875,18): error TS2345: Argument of type 'OpenDirOptions | null' is not assignable to parameter of type 'OpenDirOptions | undefined'.
  Type 'null' is not assignable to type 'OpenDirOptions | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(876,22): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(886,28): error TS2345: Argument of type 'CopyOptions | null' is not assignable to parameter of type 'CopyOptions | undefined'.
  Type 'null' is not assignable to type 'CopyOptions | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(887,15): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(887,24): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(898,17): error TS2769: No overload matches this call.
  Overload 1 of 3, '(path: string, opts?: (StatFsOptions & { bigint?: false | undefined; }) | undefined): Promise<StatsFs>', gave the following error.
    Argument of type 'StatFsOptions | null | undefined' is not assignable to parameter of type '(StatFsOptions & { bigint?: false | undefined; }) | undefined'.
      Type 'null' is not assignable to type '(StatFsOptions & { bigint?: false | undefined; }) | undefined'.
  Overload 2 of 3, '(path: string, opts: StatFsOptions & { bigint: true; }): Promise<BigIntStatsFs>', gave the following error.
    Argument of type 'StatFsOptions | null | undefined' is not assignable to parameter of type 'StatFsOptions & { bigint: true; }'.
      Type 'undefined' is not assignable to type 'StatFsOptions & { bigint: true; }'.
        Type 'undefined' is not assignable to type 'StatFsOptions'.
  Overload 3 of 3, '(path: string, opts?: StatFsOptions | undefined): Promise<StatsFs | BigIntStatsFs>', gave the following error.
    Argument of type 'StatFsOptions | null | undefined' is not assignable to parameter of type 'StatFsOptions | undefined'.
      Type 'null' is not assignable to type 'StatFsOptions | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(899,67): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/async.ts(910,12): error TS1360: Type '(path: string, options?: OpenAsBlobOptions | undefined) => Promise<Blob>' does not satisfy the expected type '(path: PathLike, options?: OpenAsBlobOptions | undefined) => Promise<Blob>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/dir.ts(54,12): error TS2564: Property '_entries' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/dir.ts(87,3): error TS2322: Type 'Dirent | undefined' is not assignable to type 'Dirent | null'.
  Type 'undefined' is not assignable to type 'Dirent | null'.
node_modules/@zenfs/core/src/emulation/dir.ts(102,33): error TS2345: Argument of type 'null' is not assignable to parameter of type 'ApiError | undefined'.
node_modules/@zenfs/core/src/emulation/dir.ts(117,3): error TS2322: Type 'Dirent | undefined' is not assignable to type 'Dirent | null'.
node_modules/@zenfs/core/src/emulation/promises.ts(73,7): error TS18048: 'len' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(76,29): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
  Type 'undefined' is not assignable to type 'number'.
node_modules/@zenfs/core/src/emulation/promises.ts(108,61): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(120,14): error TS18048: 'position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(135,46): error TS2345: Argument of type 'null' is not assignable to parameter of type 'BufferEncoding | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(161,26): error TS7031: Binding element 'close' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/promises.ts(161,33): error TS7031: Binding element 'enqueue' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/promises.ts(161,42): error TS7031: Binding element 'error' implicitly has an 'any' type.
node_modules/@zenfs/core/src/emulation/promises.ts(169,12): error TS2454: Variable 'result' is used before being assigned.
node_modules/@zenfs/core/src/emulation/promises.ts(186,3): error TS2739: Type 'ReadableStream<Uint8Array | ArrayBufferView | undefined>' is missing the following properties from type 'ReadableStream<Uint8Array>': values, [Symbol.asyncIterator]
node_modules/@zenfs/core/src/emulation/promises.ts(186,55): error TS18048: 'options' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(190,33): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(236,4): error TS2322: Type 'number | null' is not assignable to type 'number | undefined'.
  Type 'null' is not assignable to type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(244,4): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
  Type 'undefined' is not assignable to type 'number'.
node_modules/@zenfs/core/src/emulation/promises.ts(246,4): error TS2322: Type 'number | null' is not assignable to type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(296,64): error TS18048: 'position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(312,64): error TS18048: 'position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(333,6): error TS2532: Object is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(340,33): error TS2345: Argument of type '{ highWaterMark: number; encoding: BufferEncoding | null | undefined; read: (size: number) => Promise<void>; }' is not assignable to parameter of type 'ReadableOptions'.
  Type '{ highWaterMark: number; encoding: BufferEncoding | null | undefined; read: (size: number) => Promise<void>; }' is not assignable to type 'ReadableStateOptions'.
    Types of property 'encoding' are incompatible.
      Type 'BufferEncoding | null | undefined' is not assignable to type 'BufferEncoding | undefined'.
        Type 'null' is not assignable to type 'BufferEncoding | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(341,3): error TS2322: Type 'string | undefined' is not assignable to type 'string | Buffer'.
  Type 'undefined' is not assignable to type 'string | Buffer'.
node_modules/@zenfs/core/src/emulation/promises.ts(358,42): error TS2769: No overload matches this call.
  Overload 1 of 3, '(data: FileContents, posOrOff?: number | undefined, lenOrEnc?: number | BufferEncoding | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: FileContents; }>', gave the following error.
    Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
  Overload 2 of 3, '(buffer: Uint8Array, offset?: number | undefined, length?: number | undefined, position?: number | undefined): Promise<{ bytesWritten: number; buffer: Uint8Array; }>', gave the following error.
    Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
  Overload 3 of 3, '(data: string, position?: number | undefined, encoding?: BufferEncoding | undefined): Promise<{ bytesWritten: number; buffer: string; }>', gave the following error.
    Argument of type 'Uint8Array' is not assignable to parameter of type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(367,3): error TS2322: Type 'string | undefined' is not assignable to type 'string | Buffer'.
node_modules/@zenfs/core/src/emulation/promises.ts(373,50): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/promises.ts(391,26): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(425,8): error TS1360: Type '(oldPath: string, newPath: string) => Promise<void>' does not satisfy the expected type '(oldPath: PathLike, newPath: PathLike) => Promise<void>'.
  Types of parameters 'oldPath' and 'oldPath' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(456,6): error TS1360: Type '{ (path: string, options: BigIntOptions): Promise<BigIntStats>; (path: string, options?: { bigint?: false | undefined; } | undefined): Promise<...>; (path: string, options?: StatOptions | undefined): Promise<...>; }' does not satisfy the expected type '{ (path: PathLike, opts?: (StatOptions & { bigint?: false | undefined; }) | undefined): Promise<Stats>; (path: PathLike, opts: StatOptions & { ...; }): Promise<...>; (path: PathLike, opts?: StatOptions | undefined): Promise<...>; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(471,7): error TS1360: Type '{ (path: string, options?: { bigint?: false | undefined; } | undefined): Promise<Stats>; (path: string, options: { bigint: true; }): Promise<BigIntStats>; }' does not satisfy the expected type '{ (path: PathLike, opts?: (StatOptions & { bigint?: false | undefined; }) | undefined): Promise<Stats>; (path: PathLike, opts: StatOptions & { ...; }): Promise<...>; (path: PathLike, opts?: StatOptions | undefined): Promise<...>; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(488,10): error TS1360: Type '(path: string, len?: number) => Promise<void>' does not satisfy the expected type '(path: PathLike, len?: number | undefined) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(497,8): error TS1360: Type '(path: string) => Promise<void>' does not satisfy the expected type '(path: PathLike) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(559,6): error TS1360: Type '(path: string, flag: string, mode?: Mode) => Promise<FileHandle>' does not satisfy the expected type '(path: PathLike, flags?: string | number | undefined, mode?: Mode | undefined) => Promise<FileHandle>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(599,45): error TS2345: Argument of type 'null' is not assignable to parameter of type 'BufferEncoding | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(608,10): error TS1360: Type '{ (filename: string, options?: { flag?: OpenMode | undefined; } | undefined): Promise<Buffer>; (filename: string, options: BufferEncoding | (EncodingOption & { ...; })): Promise<...>; }' does not satisfy the expected type '{ (path: FileHandle | PathLike, options?: ({ encoding?: null | undefined; flag?: OpenMode | undefined; } & Abortable) | null | undefined): Promise<...>; (path: FileHandle | PathLike, options: BufferEncoding | ({ ...; } & Abortable)): Promise<...>; (path: FileHandle | PathLike, options?: BufferEncoding | ... 2 more ....'.
  Types of parameters 'filename' and 'path' are incompatible.
    Type 'FileHandle | PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(630,11): error TS1360: Type '(filename: string, data: FileContents, _options?: WriteFileOptions | undefined) => Promise<void>' does not satisfy the expected type '(file: FileHandle | PathLike, data: string | ArrayBufferView | Stream | Iterable<string | ArrayBufferView> | AsyncIterable<...>, options?: BufferEncoding | ... 2 more ... | undefined) => Promise<...>'.
  Types of parameters 'filename' and 'file' are incompatible.
    Type 'FileHandle | PathLike' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(639,42): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/promises.ts(671,12): error TS1360: Type '(filename: string, data: FileContents, _options?: BufferEncoding | (EncodingOption & { mode?: Mode | undefined; flag?: OpenMode | undefined; }) | undefined) => Promise<...>' does not satisfy the expected type '(path: FileHandle | PathLike, data: string | Uint8Array, options?: BufferEncoding | (ObjectEncodingOptions & FlagAndOpenMode & { ...; }) | null | undefined) => Promise<...>'.
  Types of parameters 'filename' and 'path' are incompatible.
    Type 'FileHandle | PathLike' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(682,7): error TS1360: Type '(path: string) => Promise<void>' does not satisfy the expected type '(path: PathLike, options?: RmDirOptions | undefined) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(694,7): error TS1360: Type '{ (path: string, mode?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | undefined): Promise<void>; (path: string, mode: MakeDirectoryOptions & { ...; }): Promise<...>; }' does not satisfy the expected type '{ (path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>; (path: PathLike, options?: Mode | ... 2 more ... | undefined): Promise<...>; (path: PathLike, options?: Mode | ... 2 more ... | undefined): Promise<...>; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(726,9): error TS1360: Type '{ (path: string, options?: BufferEncoding | (EncodingOption & { withFileTypes?: false | undefined; }) | undefined): Promise<string[]>; (path: string, options: BufferEncodingOption & { ...; }): Promise<...>; (path: string, options: EncodingOption & { ...; }): Promise<...>; }' does not satisfy the expected type '{ (path: PathLike, options?: BufferEncoding | (ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | null | undefined): Promise<...>; (path: PathLike, options: "buffer" | { ...; }): Promise<...>; (path: PathLike, options?: BufferEncoding | ... 2 more ... | undefined): Pro...'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(739,6): error TS1360: Type '(existing: string, newpath: string) => Promise<void>' does not satisfy the expected type '(existingPath: PathLike, newPath: PathLike) => Promise<void>'.
  Types of parameters 'existing' and 'existingPath' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(760,9): error TS1360: Type '(target: string, path: string, type?: Type) => Promise<void>' does not satisfy the expected type '(target: PathLike, path: PathLike, type?: string | null | undefined) => Promise<void>'.
  Types of parameters 'target' and 'target' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(770,8): error TS2322: Type '"buffer" | BufferEncoding | null | undefined' is not assignable to type '"buffer" | BufferEncoding'.
  Type 'undefined' is not assignable to type '"buffer" | BufferEncoding'.
node_modules/@zenfs/core/src/emulation/promises.ts(770,75): error TS18047: 'options' is possibly 'null'.
node_modules/@zenfs/core/src/emulation/promises.ts(776,10): error TS1360: Type '{ (path: string, options: BufferEncodingOption): Promise<Buffer>; (path: string, options?: ObjectEncodingOptions | ... 13 more ... | undefined): Promise<...>; }' does not satisfy the expected type '{ (path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null | undefined): Promise<string>; (path: PathLike, options: BufferEncodingOption): Promise<...>; (path: PathLike, options?: string | ... 2 more ... | undefined): Promise<...>; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(794,7): error TS1360: Type '(path: string, uid: number, gid: number) => Promise<void>' does not satisfy the expected type '(path: PathLike, uid: number, gid: number) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(810,8): error TS1360: Type '(path: string, uid: number, gid: number) => Promise<void>' does not satisfy the expected type '(path: PathLike, uid: number, gid: number) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(825,7): error TS1360: Type '(path: string, mode: Mode) => Promise<void>' does not satisfy the expected type '(path: PathLike, mode: Mode) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(840,8): error TS1360: Type '(path: string, mode: Mode) => Promise<void>' does not satisfy the expected type '(path: PathLike, mode: Mode) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(856,8): error TS1360: Type '(path: string, atime: string | number | Date, mtime: string | number | Date) => Promise<void>' does not satisfy the expected type '(path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(872,9): error TS1360: Type '(path: string, atime: number | Date, mtime: number | Date) => Promise<void>' does not satisfy the expected type '(path: PathLike, atime: TimeLike, mtime: TimeLike) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(900,10): error TS1360: Type '{ (path: string, options: BufferEncodingOption): Promise<Buffer>; (path: string, options?: ObjectEncodingOptions | ... 13 more ... | undefined): Promise<...>; }' does not satisfy the expected type '{ (path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null | undefined): Promise<string>; (path: PathLike, options: BufferEncodingOption): Promise<...>; (path: PathLike, options?: ObjectEncodingOptions | ... 2 more ... | undefined): Promise<...>; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(906,17): error TS2394: This overload signature is not compatible with its implementation signature.
node_modules/@zenfs/core/src/emulation/promises.ts(910,7): error TS1360: Type '{ (filename: string, options: "buffer" | (WatchOptions & { encoding: "buffer"; })): AsyncIterable<FileChangeInfo<Buffer>>; (filename: string, options?: BufferEncoding | ... 1 more ... | undefined): AsyncIterable<...>; }' does not satisfy the expected type '{ (filename: PathLike, options: "buffer" | (WatchOptions & { encoding: "buffer"; })): AsyncIterable<FileChangeInfo<Buffer>>; (filename: PathLike, options?: BufferEncoding | ... 1 more ... | undefined): AsyncIterable<...>; (filename: PathLike, options: string | WatchOptions): AsyncIterable<...> | AsyncIterable<...>; }'.
  Types of parameters 'filename' and 'filename' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(923,8): error TS1360: Type '(path: string, mode?: number) => Promise<void>' does not satisfy the expected type '(path: PathLike, mode?: number | undefined) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(956,4): error TS1360: Type '(path: string, options?: RmOptions | undefined) => Promise<void>' does not satisfy the expected type '(path: PathLike, options?: RmOptions | undefined) => Promise<void>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(967,49): error TS18047: 'options' is possibly 'null'.
node_modules/@zenfs/core/src/emulation/promises.ts(994,10): error TS1360: Type '(src: string, dest: string, mode?: number | undefined) => Promise<void>' does not satisfy the expected type '(src: PathLike, dest: PathLike, mode?: number | undefined) => Promise<void>'.
  Types of parameters 'src' and 'src' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(1006,9): error TS1360: Type '(path: string, options?: OpenDirOptions | undefined) => Promise<Dir>' does not satisfy the expected type '(path: PathLike, options?: OpenDirOptions | undefined) => Promise<Dir>'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/promises.ts(1060,4): error TS1360: Type '(source: string, destination: string, opts?: CopyOptions | undefined) => Promise<void>' does not satisfy the expected type '(source: string | URL, destination: string | URL, opts?: CopyOptions | undefined) => Promise<void>'.
  Types of parameters 'source' and 'source' are incompatible.
    Type 'string | URL' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/shared.ts(29,2): error TS2322: Type 'File | undefined' is not assignable to type 'File'.
  Type 'undefined' is not assignable to type 'File'.
node_modules/@zenfs/core/src/emulation/streams.ts(15,2): error TS2564: Property 'bytesRead' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/streams.ts(16,2): error TS2564: Property 'path' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/streams.ts(17,2): error TS2564: Property 'pending' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/streams.ts(30,2): error TS2564: Property 'bytesWritten' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/streams.ts(31,2): error TS2564: Property 'path' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/streams.ts(32,2): error TS2564: Property 'pending' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/emulation/sync.ts(15,50): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/emulation/sync.ts(21,23): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(53,12): error TS1360: Type '(oldPath: string, newPath: string) => void' does not satisfy the expected type '(oldPath: PathLike, newPath: PathLike) => void'.
  Types of parameters 'oldPath' and 'oldPath' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(72,12): error TS1360: Type '(path: string) => boolean' does not satisfy the expected type '(path: PathLike) => boolean'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(85,10): error TS1360: Type '{ (path: string, options?: { bigint?: false | undefined; } | undefined): Stats; (path: string, options: { bigint: true; }): BigIntStats; }' does not satisfy the expected type 'StatSyncFn'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(99,11): error TS1360: Type '{ (path: string, options?: { bigint?: false | undefined; } | undefined): Stats; (path: string, options: { bigint: true; }): BigIntStats; }' does not satisfy the expected type 'StatSyncFn'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(114,14): error TS1360: Type '(path: string, len?: number) => void' does not satisfy the expected type '(path: PathLike, len?: number | null | undefined) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(123,12): error TS1360: Type '(path: string) => void' does not satisfy the expected type '(path: PathLike) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(183,44): error TS2345: Argument of type 'Mode | undefined' is not assignable to parameter of type 'Mode'.
  Type 'undefined' is not assignable to type 'Mode'.
node_modules/@zenfs/core/src/emulation/sync.ts(185,10): error TS1360: Type '(path: string, flag: string, mode?: Mode | undefined) => number' does not satisfy the expected type '(path: PathLike, flags: OpenMode, mode?: Mode | null | undefined) => number'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(192,44): error TS2345: Argument of type 'Mode | undefined' is not assignable to parameter of type 'Mode'.
node_modules/@zenfs/core/src/emulation/sync.ts(224,41): error TS2345: Argument of type 'null' is not assignable to parameter of type 'BufferEncoding | undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(232,14): error TS1360: Type '{ (filename: string, options?: { flag?: string | undefined; } | undefined): Buffer; (filename: string, options: BufferEncoding | (EncodingOption & { ...; })): string; }' does not satisfy the expected type '{ (path: PathOrFileDescriptor, options?: { encoding?: null | undefined; flag?: string | undefined; } | null | undefined): Buffer; (path: PathOrFileDescriptor, options: BufferEncoding | { ...; }): string; (path: PathOrFileDescriptor, options?: BufferEncoding | ... 2 more ... | undefined): string | Buffer; }'.
  Types of parameters 'filename' and 'path' are incompatible.
    Type 'PathOrFileDescriptor' is not assignable to type 'string'.
      Type 'number' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(278,15): error TS1360: Type '{ (filename: string, data: FileContents, options?: WriteFileOptions | undefined): void; (filename: string, data: FileContents, encoding?: BufferEncoding | undefined): void; }' does not satisfy the expected type '(file: PathOrFileDescriptor, data: string | ArrayBufferView, options?: WriteFileOptions | undefined) => void'.
  Types of parameters 'filename' and 'file' are incompatible.
    Type 'PathOrFileDescriptor' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(287,40): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(316,16): error TS1360: Type '(filename: string, data: FileContents, _options?: WriteFileOptions | undefined) => void' does not satisfy the expected type '(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions | undefined) => void'.
  Types of parameters 'filename' and 'path' are incompatible.
    Type 'PathOrFileDescriptor' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(330,11): error TS1360: Type '{ (fd: number, options?: { bigint?: false | undefined; } | undefined): Stats; (fd: number, options: { bigint: true; }): BigIntStats; }' does not satisfy the expected type '{ (fd: number, options?: (StatOptions & { bigint?: false | undefined; }) | undefined): Stats; (fd: number, options: StatOptions & { bigint: true; }): BigIntStats; (fd: number, options?: StatOptions | undefined): Stats | BigIntStats; }'.
  Types of parameters 'options' and 'options' are incompatible.
    Type 'StatOptions | undefined' is not assignable to type '{ bigint?: false | undefined; } | undefined'.
      Type 'StatOptions' is not assignable to type '{ bigint?: false | undefined; }'.
        Types of property 'bigint' are incompatible.
          Type 'boolean | undefined' is not assignable to type 'false | undefined'.
            Type 'true' is not assignable to type 'false'.
node_modules/@zenfs/core/src/emulation/sync.ts(353,15): error TS1360: Type '(fd: number, len?: number) => void' does not satisfy the expected type '(fd: number, len?: number | null | undefined) => void'.
  Types of parameters 'len' and 'len' are incompatible.
    Type 'number | null | undefined' is not assignable to type 'number | undefined'.
      Type 'null' is not assignable to type 'number | undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(395,3): error TS2322: Type 'number | null' is not assignable to type 'number'.
  Type 'null' is not assignable to type 'number'.
node_modules/@zenfs/core/src/emulation/sync.ts(403,3): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
  Type 'undefined' is not assignable to type 'number'.
node_modules/@zenfs/core/src/emulation/sync.ts(405,3): error TS2322: Type 'number | null' is not assignable to type 'number'.
  Type 'null' is not assignable to type 'number'.
node_modules/@zenfs/core/src/emulation/sync.ts(414,11): error TS1360: Type '{ (fd: number, data: Uint8Array, offset: number, length: number, position?: number | undefined): number; (fd: number, data: string, position?: number | undefined, encoding?: BufferEncoding | undefined): number; }' does not satisfy the expected type '{ (fd: number, buffer: ArrayBufferView, offset?: number | null | undefined, length?: number | null | undefined, position?: number | null | undefined): number; (fd: number, string: string, position?: number | ... 1 more ... | undefined, encoding?: BufferEncoding | ... 1 more ... | undefined): number; }'.
  Types of parameters 'data' and 'buffer' are incompatible.
    Type 'ArrayBufferView' is not assignable to type 'Uint8Array'.
      Type 'Uint8ClampedArray' is not assignable to type 'Uint8Array'.
        Types of property 'findLast' are incompatible.
          Type '{ <S extends number>(predicate: (value: number, index: number, array: Uint8ClampedArray) => value is S, thisArg?: any): S | undefined; (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): number | undefined; }' is not assignable to type '{ <S extends number>(predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S | undefined; (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number | undefined; }'.
            Types of parameters 'predicate' and 'predicate' are incompatible.
              Type '(value: number, index: number, array: Uint8Array) => unknown' is not assignable to type '(value: number, index: number, array: Uint8ClampedArray) => value is any'.
                Signature '(value: number, index: number, array: Uint8Array): unknown' must be a type predicate.
node_modules/@zenfs/core/src/emulation/sync.ts(435,3): error TS2322: Type 'ReadPosition | null | undefined' is not assignable to type 'number | bigint | undefined'.
  Type 'null' is not assignable to type 'number | bigint | undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(445,10): error TS1360: Type '{ (fd: number, buffer: Uint8Array, opts?: ReadSyncOptions | undefined): number; (fd: number, buffer: Uint8Array, offset: number, length: number, position?: number | undefined): number; }' does not satisfy the expected type '{ (fd: number, buffer: ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; (fd: number, buffer: ArrayBufferView, opts?: ReadSyncOptions | undefined): number; }'.
  Types of parameters 'buffer' and 'buffer' are incompatible.
    Type 'ArrayBufferView' is not assignable to type 'Uint8Array'.
node_modules/@zenfs/core/src/emulation/sync.ts(491,11): error TS1360: Type '(path: string) => void' does not satisfy the expected type '(path: PathLike, options?: RmDirOptions | undefined) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(502,8): error TS2322: Type 'Mode | undefined' is not assignable to type 'Mode'.
node_modules/@zenfs/core/src/emulation/sync.ts(503,8): error TS6133: 'recursive' is declared but its value is never read.
node_modules/@zenfs/core/src/emulation/sync.ts(506,11): error TS1360: Type '{ (path: string, options: MakeDirectoryOptions & { recursive: true; }): string; (path: string, options?: Mode | (MakeDirectoryOptions & { ...; }) | undefined): void; }' does not satisfy the expected type '{ (path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string | undefined; (path: PathLike, options?: Mode | (MakeDirectoryOptions & { ...; }) | null | undefined): void; (path: PathLike, options?: Mode | ... 2 more ... | undefined): string | undefined; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(541,13): error TS1360: Type '{ (path: string, options?: BufferEncoding | { encoding?: BufferEncoding | undefined; withFileTypes?: false | undefined; } | undefined): string[]; (path: string, options: "buffer" | { ...; }): Buffer[]; (path: string, options: { ...; }): Dirent[]; }' does not satisfy the expected type '{ (path: PathLike, options?: BufferEncoding | { encoding: BufferEncoding | null; withFileTypes?: false | undefined; recursive?: boolean | undefined; } | null | undefined): string[]; (path: PathLike, options: "buffer" | { ...; }): Buffer[]; (path: PathLike, options?: BufferEncoding | ... 2 more ... | undefined): stri...'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(554,10): error TS1360: Type '(existing: string, newpath: string) => void' does not satisfy the expected type '(existingPath: PathLike, newPath: PathLike) => void'.
  Types of parameters 'existing' and 'existingPath' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(574,13): error TS1360: Type '(target: string, path: string, type?: Type) => void' does not satisfy the expected type '(target: PathLike, path: PathLike, type?: Type | null | undefined) => void'.
  Types of parameters 'target' and 'target' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(584,8): error TS2322: Type '"buffer" | BufferEncoding | null | undefined' is not assignable to type '"buffer" | BufferEncoding'.
node_modules/@zenfs/core/src/emulation/sync.ts(584,75): error TS18047: 'options' is possibly 'null'.
node_modules/@zenfs/core/src/emulation/sync.ts(590,14): error TS1360: Type '{ (path: string, options?: BufferEncodingOption | undefined): Buffer; (path: string, options: ObjectEncodingOptions | "ascii" | ... 12 more ... | undefined): string; }' does not satisfy the expected type '{ (path: PathLike, options?: EncodingOption): string; (path: PathLike, options: BufferEncodingOption): Buffer; (path: PathLike, options?: EncodingOption): string | Buffer; }'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(605,11): error TS1360: Type '(path: string, uid: number, gid: number) => void' does not satisfy the expected type '(path: PathLike, uid: number, gid: number) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(618,12): error TS1360: Type '(path: string, uid: number, gid: number) => void' does not satisfy the expected type '(path: PathLike, uid: number, gid: number) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(630,11): error TS1360: Type '(path: string, mode: Mode) => void' does not satisfy the expected type '(path: PathLike, mode: Mode) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(642,12): error TS1360: Type '(path: string, mode: string | number) => void' does not satisfy the expected type '(path: PathLike, mode: Mode) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(655,12): error TS1360: Type '(path: string, atime: string | number | Date, mtime: string | number | Date) => void' does not satisfy the expected type '(path: PathLike, atime: TimeLike, mtime: TimeLike) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(668,13): error TS1360: Type '(path: string, atime: string | number | Date, mtime: string | number | Date) => void' does not satisfy the expected type '(path: PathLike, atime: TimeLike, mtime: TimeLike) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(710,12): error TS1360: Type '(path: string, mode?: number) => void' does not satisfy the expected type '(path: PathLike, mode?: number | undefined) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(743,8): error TS1360: Type '(path: string, options?: RmOptions | undefined) => void' does not satisfy the expected type '(path: PathLike, options?: RmOptions | undefined) => void'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(754,49): error TS18047: 'options' is possibly 'null'.
node_modules/@zenfs/core/src/emulation/sync.ts(781,14): error TS1360: Type '(src: string, dest: string, flags?: number | undefined) => void' does not satisfy the expected type '(src: PathLike, dest: PathLike, mode?: number | undefined) => void'.
  Types of parameters 'src' and 'src' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(795,56): error TS18048: 'position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(800,11): error TS1360: Type '(fd: number, buffers: readonly Uint8Array[], position?: number | undefined) => number' does not satisfy the expected type '(fd: number, buffers: readonly ArrayBufferView[], position?: number | undefined) => number'.
  Types of parameters 'buffers' and 'buffers' are incompatible.
    Type 'readonly ArrayBufferView[]' is not assignable to type 'readonly Uint8Array[]'.
      Type 'ArrayBufferView' is not assignable to type 'Uint8Array'.
node_modules/@zenfs/core/src/emulation/sync.ts(814,60): error TS18048: 'position' is possibly 'undefined'.
node_modules/@zenfs/core/src/emulation/sync.ts(819,12): error TS1360: Type '(fd: number, buffers: readonly Uint8Array[], position?: number | undefined) => number' does not satisfy the expected type '(fd: number, buffers: readonly ArrayBufferView[], position?: number | undefined) => number'.
  Types of parameters 'buffers' and 'buffers' are incompatible.
    Type 'readonly ArrayBufferView[]' is not assignable to type 'readonly Uint8Array[]'.
node_modules/@zenfs/core/src/emulation/sync.ts(831,13): error TS1360: Type '(path: string, options?: OpenDirOptions | undefined) => Dir' does not satisfy the expected type '(path: PathLike, options?: OpenDirOptions | undefined) => Dir'.
  Types of parameters 'path' and 'path' are incompatible.
    Type 'PathLike' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/emulation/sync.ts(885,8): error TS1360: Type '(source: string, destination: string, opts?: CopySyncOptions | undefined) => void' does not satisfy the expected type '(source: string | URL, destination: string | URL, opts?: CopySyncOptions | undefined) => void'.
  Types of parameters 'source' and 'source' are incompatible.
    Type 'string | URL' is not assignable to type 'string'.
      Type 'URL' is not assignable to type 'string'.
node_modules/@zenfs/core/src/file.ts(471,32): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/@zenfs/core/src/file.ts(544,42): error TS2532: Object is possibly 'undefined'.
node_modules/@zenfs/core/src/filesystem.ts(221,46): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(221,93): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(293,52): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(314,47): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(314,94): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(326,11): error TS7023: 'check' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
node_modules/@zenfs/core/src/filesystem.ts(443,10): error TS2488: Type 'AsyncOperation | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
node_modules/@zenfs/core/src/filesystem.ts(485,50): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/filesystem.ts(485,97): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/@zenfs/core/src/mutex.ts(11,5): error TS2532: Object is possibly 'undefined'.
node_modules/@zenfs/core/src/mutex.ts(23,16): error TS2532: Object is possibly 'undefined'.
node_modules/@zenfs/core/src/stats.ts(123,9): error TS2322: Type 'null' is not assignable to type 'Uint8Array | undefined'.
node_modules/@zenfs/core/src/stats.ts(189,27): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
  Type 'undefined' is not assignable to type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(190,27): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(191,27): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(192,31): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(193,23): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(194,23): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'number | bigint'.
node_modules/@zenfs/core/src/stats.ts(195,29): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'string | number | bigint | boolean'.
  Type 'undefined' is not assignable to type 'string | number | bigint | boolean'.
node_modules/@zenfs/core/src/stats.ts(196,28): error TS2345: Argument of type 'number | bigint | undefined' is not assignable to parameter of type 'string | number | bigint | boolean'.
node_modules/@zenfs/core/src/stats.ts(344,9): error TS2564: Property 'atimeNs' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(345,9): error TS2564: Property 'mtimeNs' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(346,9): error TS2564: Property 'ctimeNs' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(347,9): error TS2564: Property 'birthtimeNs' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(360,9): error TS2564: Property 'type' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(362,9): error TS2564: Property 'bsize' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(364,9): error TS2564: Property 'blocks' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(366,9): error TS2564: Property 'bfree' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(368,9): error TS2564: Property 'bavail' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(370,9): error TS2564: Property 'files' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(372,9): error TS2564: Property 'ffree' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(377,9): error TS2564: Property 'type' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(379,9): error TS2564: Property 'bsize' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(381,9): error TS2564: Property 'blocks' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(383,9): error TS2564: Property 'bfree' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(385,9): error TS2564: Property 'bavail' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(387,9): error TS2564: Property 'files' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/stats.ts(389,9): error TS2564: Property 'ffree' has no initializer and is not definitely assigned in the constructor.
node_modules/@zenfs/core/src/utils.ts(117,102): error TS7006: Parameter 'cb' implicitly has an 'any' type.
node_modules/@zenfs/core/src/utils.ts(269,4): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/core/src/utils.ts(276,3): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/@zenfs/dom/src/access.ts(3,41): error TS2307: Cannot find module '@zenfs/core/emulation/path.js' or its corresponding type declarations.
  There are types at '/Users/.../node_modules/@zenfs/core/dist/emulation/path.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
node_modules/@zenfs/dom/src/access.ts(99,35): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/@zenfs/dom/src/access.ts(174,4): error TS2322: Type 'FileSystemHandle | undefined' is not assignable to type 'FileSystemHandle'.
  Type 'undefined' is not assignable to type 'FileSystemHandle'.
node_modules/@zenfs/dom/src/access.ts(207,3): error TS2322: Type 'FileSystemHandle | undefined' is not assignable to type 'FileSystemHandle'.
  Type 'undefined' is not assignable to type 'FileSystemHandle'.
node_modules/@zenfs/dom/src/IndexedDB.ts(10,28): error TS2345: Argument of type 'DOMException | null' is not assignable to parameter of type 'ApiError | Error | DOMException'.
  Type 'null' is not assignable to type 'ApiError | Error | DOMException'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
james-pre commented 6 months ago

@RichDom2185,

I feel that using strict mode would actually benefit ZenFS... I'm working on making those changes and plan on releasing them soon. I've already found and corrected a number of bugs thanks to strict mode so it is definitely helping.

james-pre commented 6 months ago

@RichDom2185 Strict mode has been added in core v0.9.7 and DOM v0.2.6. Also, the tsconfig is also published along with the sources. You should have more success with that. Please let me know if you have any issues.