@zenfs/core 1.6.5 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,7 @@ export interface Backend<FS extends FileSystem = FileSystem, TOptions extends ob
61
61
  * 'false' if the API is unavailable
62
62
  *
63
63
  */
64
- isAvailable(): boolean | Promise<boolean>;
64
+ isAvailable?(): boolean | Promise<boolean>;
65
65
  }
66
66
  /**
67
67
  * Gets the options type of a backend
@@ -12,7 +12,6 @@ export declare class InMemoryStore extends Map<bigint, Uint8Array> implements Si
12
12
  }
13
13
  declare const _InMemory: {
14
14
  readonly name: "InMemory";
15
- readonly isAvailable: () => boolean;
16
15
  readonly options: {
17
16
  readonly name: {
18
17
  readonly type: "string";
@@ -18,9 +18,6 @@ export class InMemoryStore extends Map {
18
18
  }
19
19
  const _InMemory = {
20
20
  name: 'InMemory',
21
- isAvailable() {
22
- return true;
23
- },
24
21
  options: {
25
22
  name: { type: 'string', required: false },
26
23
  },
@@ -115,7 +115,6 @@ declare const _Overlay: {
115
115
  readonly required: true;
116
116
  };
117
117
  };
118
- readonly isAvailable: () => boolean;
119
118
  readonly create: (options: OverlayOptions) => OverlayFS;
120
119
  };
121
120
  type _Overlay = typeof _Overlay;
@@ -537,9 +537,6 @@ const _Overlay = {
537
537
  writable: { type: 'object', required: true },
538
538
  readable: { type: 'object', required: true },
539
539
  },
540
- isAvailable() {
541
- return true;
542
- },
543
540
  create(options) {
544
541
  return new OverlayFS(options);
545
542
  },
@@ -102,7 +102,6 @@ declare const _Port: {
102
102
  required: false;
103
103
  };
104
104
  };
105
- isAvailable(): boolean;
106
105
  create(options: RPC.Options): PortFS;
107
106
  };
108
107
  type _Port = typeof _Port;
@@ -220,9 +220,6 @@ const _Port = {
220
220
  },
221
221
  timeout: { type: 'number', required: false },
222
222
  },
223
- isAvailable() {
224
- return true;
225
- },
226
223
  create(options) {
227
224
  return new PortFS(options);
228
225
  },
@@ -1,6 +1,6 @@
1
1
  import type { File } from '../../file.js';
2
2
  import { FileSystem, type FileSystemMetadata } from '../../filesystem.js';
3
- import { Inode } from '../../inode.js';
3
+ import { Inode } from './inode.js';
4
4
  import type { Stats } from '../../stats.js';
5
5
  import type { Store, Transaction } from './store.js';
6
6
  /**
@@ -56,7 +56,7 @@ import { basename, dirname, parse, resolve } from '../../emulation/path.js';
56
56
  import { Errno, ErrnoError } from '../../error.js';
57
57
  import { PreloadFile } from '../../file.js';
58
58
  import { FileSystem } from '../../filesystem.js';
59
- import { Inode, rootIno } from '../../inode.js';
59
+ import { Inode, rootIno } from './inode.js';
60
60
  import { decodeDirListing, encodeDirListing, encodeUTF8, randomBigInt } from '../../utils.js';
61
61
  import { serialize } from 'utilium';
62
62
  const maxInodeAllocTries = 5;
@@ -1,4 +1,4 @@
1
- import { Stats, type StatsLike } from './stats.js';
1
+ import { Stats, type StatsLike } from '../../stats.js';
2
2
  /**
3
3
  * Room inode
4
4
  * @hidden
@@ -7,7 +7,7 @@ export declare const rootIno = 0n;
7
7
  /**
8
8
  * Generic inode definition that can easily be serialized.
9
9
  * @internal
10
- * @todo [BREAKING]
10
+ * @todo [BREAKING] Remove 58 byte Inode upgrade path
11
11
  */
12
12
  export declare class Inode implements StatsLike {
13
13
  constructor(buffer?: ArrayBufferLike | ArrayBufferView);
@@ -37,8 +37,8 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
37
37
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
38
38
  };
39
39
  import { deserialize, sizeof, struct, types as t } from 'utilium';
40
- import { Stats } from './stats.js';
41
- import { randomBigInt } from './utils.js';
40
+ import { Stats } from '../../stats.js';
41
+ import { randomBigInt } from '../../utils.js';
42
42
  /**
43
43
  * Room inode
44
44
  * @hidden
@@ -47,7 +47,7 @@ export const rootIno = 0n;
47
47
  /**
48
48
  * Generic inode definition that can easily be serialized.
49
49
  * @internal
50
- * @todo [BREAKING]
50
+ * @todo [BREAKING] Remove 58 byte Inode upgrade path
51
51
  */
52
52
  let Inode = (() => {
53
53
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -118,7 +118,7 @@ let Inode = (() => {
118
118
  This will be different from the actual one,
119
119
  but `ino` isn't used anywhere so it should be fine.
120
120
  */
121
- new DataView(newBuffer.buffer).setBigUint64(sz_inode - 2, randomBigInt());
121
+ new DataView(newBuffer.buffer).setBigUint64(sz_inode - 1, randomBigInt());
122
122
  buffer = newBuffer;
123
123
  }
124
124
  deserialize(this, buffer);
package/dist/config.js CHANGED
@@ -41,7 +41,7 @@ export async function resolveMountConfig(configuration, _depth = 0) {
41
41
  configuration[key] = await resolveMountConfig(value, ++_depth);
42
42
  }
43
43
  const { backend } = configuration;
44
- if (!(await backend.isAvailable())) {
44
+ if (typeof backend.isAvailable == 'function' && !(await backend.isAvailable())) {
45
45
  throw new ErrnoError(Errno.EPERM, 'Backend not available: ' + backend.name);
46
46
  }
47
47
  await checkOptions(backend, configuration);
package/dist/devices.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { StatsLike } from './stats.js';
6
6
  import { Stats } from './stats.js';
7
7
  /**
8
8
  * A device
9
- * @todo Maybe add major/minor number or some other device information, like a UUID?
9
+ * @todo Maybe add some other device information, like a UUID?
10
10
  * @privateRemarks
11
11
  * UUIDs were considered, however they don't make sense without an easy mechanism for persistence
12
12
  */
@@ -354,7 +354,6 @@ export declare function statfs(this: V_Context, path: fs.PathLike, opts: fs.Stat
354
354
  export declare function statfs(this: V_Context, path: fs.PathLike, opts?: fs.StatFsOptions): Promise<fs.StatsFs | fs.BigIntStatsFs>;
355
355
  /**
356
356
  * Retrieves the files matching the specified pattern.
357
- * @todo Implement
358
357
  */
359
358
  export declare function glob(this: V_Context, pattern: string | string[]): NodeJS.AsyncIterator<string>;
360
359
  export declare function glob(this: V_Context, pattern: string | string[], opt: fs.GlobOptionsWithFileTypes): NodeJS.AsyncIterator<Dirent>;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export * from './credentials.js';
14
14
  export * from './devices.js';
15
15
  export * from './file.js';
16
16
  export * from './filesystem.js';
17
- export * from './inode.js';
17
+ export * from './backends/store/inode.js';
18
18
  export * from './mixins/index.js';
19
19
  export * from './stats.js';
20
20
  export * from './utils.js';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export * from './credentials.js';
14
14
  export * from './devices.js';
15
15
  export * from './file.js';
16
16
  export * from './filesystem.js';
17
- export * from './inode.js';
17
+ export * from './backends/store/inode.js';
18
18
  export * from './mixins/index.js';
19
19
  export * from './stats.js';
20
20
  export * from './utils.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "A filesystem, anywhere",
5
5
  "funding": {
6
6
  "type": "individual",
package/readme.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # ZenFS
2
2
 
3
- ZenFS is a file system that emulates the [NodeJS filesystem API](http://nodejs.org/api/fs.html).
4
-
5
- It works using a system of backends, which are used by ZenFS to store and retrieve data. ZenFS can also integrate with other tools.
3
+ ZenFS is a file system that emulates the [NodeJS filesystem API](http://nodejs.org/api/fs.html). It works using a system of backends, which are used by ZenFS to store and retrieve data. ZenFS can also integrate with other tools.
6
4
 
7
5
  ## Backends
8
6
 
@@ -27,6 +25,8 @@ For more information, see the [docs](https://zenfs.dev/core).
27
25
  npm install @zenfs/core
28
26
  ```
29
27
 
28
+ If you're using ZenFS, especially for big projects, please consider supporting the project. Thousands of hours have been dedicated to its development, and your acknowledgment or financial support would go a long way toward improving ZenFS and its community.
29
+
30
30
  ## Usage
31
31
 
32
32
  ```js
package/dist/lib.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/lib.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- /* eslint-disable @typescript-eslint/no-empty-object-type */