diff --git a/package-lock.json b/package-lock.json index 2b4c529..14f1bae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,10 +7,9 @@ "": { "name": "@zenfs/emscripten", "version": "0.0.2", - "hasInstallScript": true, "license": "MIT", "dependencies": { - "utilium": "^0.3.4" + "utilium": ">=0.4.0" }, "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", @@ -27,7 +26,7 @@ "node": ">= 18" }, "peerDependencies": { - "@zenfs/core": "~0.11.2" + "@zenfs/core": ">=0.18.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -227,12 +226,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "20.16.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", + "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", + "license": "MIT", "peer": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/readable-stream": { @@ -446,32 +446,28 @@ "license": "ISC" }, "node_modules/@zenfs/core": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/@zenfs/core/-/core-0.11.2.tgz", - "integrity": "sha512-ctN7GtUdQqNfW7yF5eD7dpzaooE3AmwCYY0kiH6VGyQufhaIIycniADCBGIVvvT2xJY3lBQdbxNgf7Z7ySwOQA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@zenfs/core/-/core-0.18.0.tgz", + "integrity": "sha512-ZcKBTbytztoMNq+GywBpN/TGUjQ5WpmQx7VBT48smSVezzzsOCgNlqps+Gp8hdRwytPbPMwV2hinKmewvvcUQA==", + "license": "MIT", "peer": true, "dependencies": { - "@types/node": "^20.12.5", + "@types/node": "^20.12.12", "@types/readable-stream": "^4.0.10", "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", "minimatch": "^9.0.3", "readable-stream": "^4.5.2", - "utilium": "^0.2.1" + "utilium": ">=0.4.0" }, "bin": { "build": "scripts/build.js", "make-index": "scripts/make-index.js" }, "engines": { - "node": ">= 18" + "node": ">= 16" } }, - "node_modules/@zenfs/core/node_modules/utilium": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/utilium/-/utilium-0.2.1.tgz", - "integrity": "sha512-uLn55gYhtxFcS2X6rgvd3+aIEx5xVA3GBQgBkyJRdKAHxXXYiyB5P6ZmL/94HIWvgZaVs8xnNRCiiiRUBqyUIA==", - "peer": true - }, "node_modules/abort-controller": { "version": "3.0.0", "license": "MIT", @@ -950,6 +946,12 @@ "node": ">=6" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, "node_modules/events": { "version": "3.3.0", "license": "MIT", @@ -1855,9 +1857,10 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT", "peer": true }, "node_modules/uri-js": { @@ -1869,9 +1872,13 @@ } }, "node_modules/utilium": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/utilium/-/utilium-0.3.4.tgz", - "integrity": "sha512-qk6wXThaKkeigQchXWEmTw388ZPvKHwYzpkcII/azXuE8OgQypOKH1j+fA6M88ucpqEdHqldXjNKzHya2S9lHA==" + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/utilium/-/utilium-0.6.2.tgz", + "integrity": "sha512-0SKmuJ001j6EvZQ9oa47MFRQ01ArBor79jXoij/I2jY7E5HoN+CvrYuQaX7730ya0W6uQ2MwwGWIzhAD+YqhXQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1" + } }, "node_modules/vscode-oniguruma": { "version": "1.7.0", diff --git a/package.json b/package.json index 0146b51..02e260f 100644 --- a/package.json +++ b/package.json @@ -54,9 +54,9 @@ "typescript": "5.2.2" }, "peerDependencies": { - "@zenfs/core": "~0.11.2" + "@zenfs/core": ">=0.18.0" }, "dependencies": { - "utilium": "^0.3.4" + "utilium": ">=0.4.0" } } diff --git a/src/backend.ts b/src/backend.ts index 2668f38..51c5051 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -1,9 +1,8 @@ -import type { Backend } from '@zenfs/core'; -import { Cred } from '@zenfs/core/cred.js'; +import { Sync, type Backend } from '@zenfs/core'; import { basename, dirname } from '@zenfs/core/emulation/path.js'; import { Errno, ErrnoError, errorMessages } from '@zenfs/core/error.js'; import { File } from '@zenfs/core/file.js'; -import { FileSystem, FileSystemMetadata, Sync } from '@zenfs/core/filesystem.js'; +import { FileSystem, FileSystemMetadata } from '@zenfs/core/filesystem.js'; import { FileType, Stats } from '@zenfs/core/stats.js'; import { Buffer } from 'buffer'; @@ -158,11 +157,11 @@ export class EmscriptenFS extends Sync(FileSystem) { } } - public renameSync(oldPath: string, newPath: string, cred: Cred): void { + public renameSync(oldPath: string, newPath: string): void { try { this.em.rename(oldPath, newPath); } catch (e) { - throw convertError(e, e.errno != Errno.ENOENT ? '' : this.existsSync(oldPath, cred) ? newPath : oldPath); + throw convertError(e, e.errno != Errno.ENOENT ? '' : this.existsSync(oldPath) ? newPath : oldPath); } }