@zenfs/core
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -46,3 +46,2 @@ import type { Ino } from '../../inode.js'; | ||
protected store: SimpleSyncStore; | ||
constructor(store: SimpleSyncStore); | ||
getSync(ino: Ino): Uint8Array; | ||
@@ -49,0 +48,0 @@ setSync(ino: Ino, data: Uint8Array): void; |
@@ -46,4 +46,4 @@ import { SyncTransaction } from './store.js'; | ||
export class SimpleTransaction extends SyncTransaction { | ||
constructor(store) { | ||
super(store); | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
@@ -50,0 +50,0 @@ * Stores data in the keys we modify prior to modifying them. |
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { Buffer } from 'buffer'; | ||
@@ -5,0 +7,0 @@ import type * as fs from 'node:fs'; |
@@ -8,2 +8,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { Buffer } from 'buffer'; | ||
@@ -10,0 +11,0 @@ import type * as fs from 'node:fs'; |
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import type * as Node from 'fs'; | ||
@@ -4,0 +5,0 @@ import { Readable, Writable } from 'readable-stream'; |
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { Buffer } from 'buffer'; | ||
@@ -5,0 +6,0 @@ import type * as fs from 'node:fs'; |
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { EventEmitter } from 'eventemitter3'; | ||
@@ -5,0 +6,0 @@ import type { EventEmitter as NodeEventEmitter } from 'node:events'; |
{ | ||
"name": "@zenfs/core", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A filesystem, anywhere", | ||
@@ -50,3 +50,3 @@ "main": "dist/index.js", | ||
"lint": "tsc -p tsconfig.json --noEmit && eslint src tests", | ||
"test": "tsc -p tests/tsconfig.json && cross-env NODE_OPTIONS=--experimental-vm-modules npx jest", | ||
"test": "tsx --test --experimental-test-coverage", | ||
"build": "node scripts/build.js --globalName=ZenFS --entry src/index.ts", | ||
@@ -63,3 +63,3 @@ "build:docs": "typedoc", | ||
"dependencies": { | ||
"@types/node": "^20.12.12", | ||
"@types/node": "^20.16.10", | ||
"@types/readable-stream": "^4.0.10", | ||
@@ -70,3 +70,3 @@ "buffer": "^6.0.3", | ||
"readable-stream": "^4.5.2", | ||
"utilium": ">=0.4.0" | ||
"utilium": "^0.7.0" | ||
}, | ||
@@ -76,14 +76,10 @@ "devDependencies": { | ||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2", | ||
"@jest/globals": "^29.5.0", | ||
"@stylistic/eslint-plugin": "^2.6.1", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/jest": "^29.5.1", | ||
"cross-env": "^7.0.3", | ||
"esbuild": "^0.21.0", | ||
"eslint": "^9.8.0", | ||
"globals": "^15.9.0", | ||
"jest": "^29.7.0", | ||
"lint-staged": "^15.2.7", | ||
"prettier": "^3.2.5", | ||
"ts-jest": "^29.1.5", | ||
"tsx": "^4.19.1", | ||
"typedoc": "^0.25.13", | ||
@@ -90,0 +86,0 @@ "typedoc-plugin-remove-references": "^0.0.6", |
@@ -97,3 +97,3 @@ import { Errno, ErrnoError } from '../error.js'; | ||
constructor({ index = 'index.json', baseUrl = '' }: FetchOptions) { | ||
public constructor({ index = 'index.json', baseUrl = '' }: FetchOptions) { | ||
super(typeof index != 'string' ? index : fetchFile<IndexData>(index, 'json')); | ||
@@ -100,0 +100,0 @@ |
@@ -121,3 +121,3 @@ /* Note: this file is named file_index.ts because Typescript has special behavior regarding index.ts which can't be disabled. */ | ||
constructor(private indexData: IndexData | Promise<IndexData>) { | ||
public constructor(private indexData: IndexData | Promise<IndexData>) { | ||
super(); | ||
@@ -124,0 +124,0 @@ } |
@@ -60,3 +60,3 @@ import { dirname } from '../emulation/path.js'; | ||
constructor({ writable, readable }: OverlayOptions) { | ||
public constructor({ writable, readable }: OverlayOptions) { | ||
super(); | ||
@@ -63,0 +63,0 @@ this.writable = writable; |
@@ -24,3 +24,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export class PortFile extends File { | ||
constructor( | ||
public constructor( | ||
public fs: PortFS, | ||
@@ -198,23 +198,31 @@ public readonly fd: number, | ||
} | ||
public openFile(path: string, flag: string): Promise<File> { | ||
return this.rpc('openFile', path, flag); | ||
} | ||
public createFile(path: string, flag: string, mode: number): Promise<File> { | ||
return this.rpc('createFile', path, flag, mode); | ||
} | ||
public unlink(path: string): Promise<void> { | ||
return this.rpc('unlink', path); | ||
} | ||
public rmdir(path: string): Promise<void> { | ||
return this.rpc('rmdir', path); | ||
} | ||
public mkdir(path: string, mode: number): Promise<void> { | ||
return this.rpc('mkdir', path, mode); | ||
} | ||
public readdir(path: string): Promise<string[]> { | ||
return this.rpc('readdir', path); | ||
} | ||
public exists(path: string): Promise<boolean> { | ||
return this.rpc('exists', path); | ||
} | ||
public link(srcpath: string, dstpath: string): Promise<void> { | ||
@@ -221,0 +229,0 @@ return this.rpc('link', srcpath, dstpath); |
@@ -33,3 +33,3 @@ import { credentials } from '../../credentials.js'; | ||
constructor(protected store: T) { | ||
public constructor(protected store: T) { | ||
super(); | ||
@@ -36,0 +36,0 @@ } |
@@ -85,6 +85,2 @@ import type { Ino } from '../../inode.js'; | ||
constructor(store: SimpleSyncStore) { | ||
super(store); | ||
} | ||
public getSync(ino: Ino): Uint8Array { | ||
@@ -91,0 +87,0 @@ const val = this.store.get(ino); |
@@ -39,3 +39,3 @@ import { ErrnoError } from '../../error.js'; | ||
export abstract class Transaction<T extends Store = Store> { | ||
constructor(protected store: T) {} | ||
public constructor(protected store: T) {} | ||
@@ -138,11 +138,15 @@ /** | ||
} | ||
public async set(ino: bigint, data: Uint8Array): Promise<void> { | ||
return this.setSync(ino, data); | ||
} | ||
public async remove(ino: Ino): Promise<void> { | ||
return this.removeSync(ino); | ||
} | ||
public async commit(): Promise<void> { | ||
return this.commitSync(); | ||
} | ||
public async abort(): Promise<void> { | ||
@@ -149,0 +153,0 @@ return this.abortSync(); |
@@ -14,3 +14,3 @@ import type { Dir as _Dir, Dirent as _Dirent } from 'fs'; | ||
constructor( | ||
public constructor( | ||
public path: string, | ||
@@ -17,0 +17,0 @@ protected stats: Stats |
@@ -275,3 +275,3 @@ /** | ||
*/ | ||
constructor( | ||
public constructor( | ||
public errno: Errno, | ||
@@ -278,0 +278,0 @@ message: string = errorMessages[errno], |
@@ -149,3 +149,3 @@ import type { FileReadResult } from 'node:fs/promises'; | ||
export abstract class File { | ||
constructor( | ||
public constructor( | ||
/** | ||
@@ -363,3 +363,3 @@ * @internal | ||
*/ | ||
constructor( | ||
public constructor( | ||
/** | ||
@@ -770,3 +770,3 @@ * The file system that created the file. | ||
export class NoSyncFile<T extends FileSystem> extends PreloadFile<T> { | ||
constructor(fs: T, path: string, flag: string, stats: Stats, contents?: Uint8Array) { | ||
public constructor(fs: T, path: string, flag: string, stats: Stats, contents?: Uint8Array) { | ||
super(fs, path, flag, stats, contents); | ||
@@ -773,0 +773,0 @@ } |
@@ -84,3 +84,3 @@ import { Stats, type StatsLike } from './stats.js'; | ||
constructor(buffer?: ArrayBufferLike) { | ||
public constructor(buffer?: ArrayBufferLike) { | ||
const setDefaults = !buffer; | ||
@@ -87,0 +87,0 @@ buffer ??= new ArrayBuffer(offsets.end); |
@@ -177,3 +177,3 @@ import type * as Node from 'fs'; | ||
*/ | ||
constructor({ atimeMs, mtimeMs, ctimeMs, birthtimeMs, uid, gid, size, mode, ino }: Partial<StatsLike> = {}) { | ||
public constructor({ atimeMs, mtimeMs, ctimeMs, birthtimeMs, uid, gid, size, mode, ino }: Partial<StatsLike> = {}) { | ||
const now = Date.now(); | ||
@@ -294,8 +294,11 @@ this.atimeMs = this._convert(atimeMs ?? now); | ||
} | ||
public get mtimeNs(): bigint { | ||
return BigInt(this.mtimeMs) * 1000n; | ||
} | ||
public get ctimeNs(): bigint { | ||
return BigInt(this.ctimeMs) * 1000n; | ||
} | ||
public get birthtimeNs(): bigint { | ||
@@ -302,0 +305,0 @@ return BigInt(this.birthtimeMs) * 1000n; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
14
22181
1961601
+ Addedutilium@0.7.10(transitive)
- Removed@xterm/xterm@5.5.0(transitive)
- Removedutilium@1.2.0(transitive)
Updated@types/node@^20.16.10
Updatedutilium@^0.7.0