@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.
- package/dist/backends/backend.d.ts +1 -1
- package/dist/backends/memory.d.ts +0 -1
- package/dist/backends/memory.js +0 -3
- package/dist/backends/overlay.d.ts +0 -1
- package/dist/backends/overlay.js +0 -3
- package/dist/backends/port/fs.d.ts +0 -1
- package/dist/backends/port/fs.js +0 -3
- package/dist/backends/store/fs.d.ts +1 -1
- package/dist/backends/store/fs.js +1 -1
- package/dist/{inode.d.ts → backends/store/inode.d.ts} +2 -2
- package/dist/{inode.js → backends/store/inode.js} +4 -4
- package/dist/config.js +1 -1
- package/dist/devices.d.ts +1 -1
- package/dist/emulation/promises.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +3 -3
- package/dist/lib.d.ts +0 -1
- package/dist/lib.js +0 -2
|
@@ -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
|
package/dist/backends/memory.js
CHANGED
package/dist/backends/overlay.js
CHANGED
package/dist/backends/port/fs.js
CHANGED
|
@@ -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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
41
|
-
import { randomBigInt } from '
|
|
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 -
|
|
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
|
|
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
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