Skip to content

Commit

Permalink
fileserver: upgrade to @zenfs/core 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Oct 7, 2024
1 parent ffa57d0 commit 5b5fa50
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions integ/browser-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"devDependencies": {
"@nodelib/fs.walk": "^2.0.0",
"@types/webpack": "^5.28.5",
"@zenfs/core": "0.16.3",
"@zenfs/dom": "0.2.14",
"@zenfs/core": "1.0.2",
"@zenfs/dom": "0.2.16",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.0",
"puppeteer": "^23.4.0",
"puppeteer": "^23.5.0",
"ts-loader": "^9.5.1",
"tslib": "^2.7.0",
"type-fest": "^4.26.1",
"webpack": "^5.94.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion integ/browser-tests/tests/segmented-object/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ window.testZenFS = async (payloadHex): Promise<FetchedInfo> => {
await zenfsConfigure({
mounts: {
"/W": {
backend: WebAccess,
backend: WebAccess as any, // https://github.com/zen-fs/dom/issues/18
handle: root,
},
},
Expand Down
2 changes: 1 addition & 1 deletion mk/tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": ["DOM", "ES2023", "ESNext.Promise"],
"lib": ["DOM", "ES2023", "ESNext.Decorators", "ESNext.Promise"],
"module": "ES2022",
"moduleResolution": "Node",
"noEmitOnError": true,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
"test": "vitest",
"typedoc": "bash mk/typedoc.sh"
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
"packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca",
"devDependencies": {
"@types/node": "^20.16.5",
"@types/node": "^20.16.10",
"@types/wtfnode": "^0.7.3",
"@typescript/lib-dom": "npm:@types/[email protected].163",
"@vitest/coverage-v8": "^2.1.1",
"@typescript/lib-dom": "npm:@types/[email protected].169",
"@vitest/coverage-v8": "^2.1.2",
"@yoursunny/xo-config": "0.58.0",
"codedown": "^3.2.0",
"tslib": "^2.7.0",
"typedoc": "^0.26.7",
"typedoc": "^0.26.8",
"typescript": "~5.5.4",
"vitest": "^2.1.1"
"vitest": "^2.1.2"
},
"engines": {
"node": "^20.12.0 || ^22.0.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@ndn/segmented-object": "workspace:*",
"@ndn/tlv": "workspace:*",
"@ndn/util": "workspace:*",
"@zenfs/core": "0.16.3",
"@zenfs/core": "1.0.2",
"mnemonist": "^0.39.8",
"obliterator": "^2.0.4",
"streaming-iterables": "^8.0.1",
Expand Down
7 changes: 4 additions & 3 deletions pkg/fileserver/src/zenfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class NDNFileSystem extends Async(Readonly(FileSystem)) {
throw new ErrnoError(Errno.EPERM, path);
}
const m = await this.getFileMetadata(path);
return new NDNFile(path, this.client, m);
return new NDNFile(this, path, this.client, m);
}
}
export namespace NDNFileSystem {
Expand All @@ -85,11 +85,12 @@ export namespace NDNFileSystem {

class NDNFile extends File {
constructor(
public override readonly path: string,
fs: NDNFileSystem,
path: string,
private readonly client: Client,
private readonly m: FileMetadata,
) {
super();
super(fs, path);
}

public override position = 0;
Expand Down
2 changes: 1 addition & 1 deletion pkg/segmented-object/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ndn/naming-convention2": "workspace:*",
"@ndn/packet": "workspace:*",
"@ndn/util": "workspace:*",
"@zenfs/core": "0.16.3",
"@zenfs/core": "1.0.2",
"it-keepalive": "^1.2.0",
"mnemonist": "^0.39.8",
"obliterator": "^2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion pkg/segmented-object/src/serve/chunk-source/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export namespace FileChunkSource {
*
* @remarks
* - Set `true` to use ZenFS, which is a cross-platform virtual filesystem independent from
* the underlying operating system. This is the default in browser environment.
* the underlying operating system. This is the only choice in browser environment.
* - Set `false` to use Node.js native filesystem. This is the default in Node.js.
*/
zenfs?: boolean;
Expand Down

0 comments on commit 5b5fa50

Please sign in to comment.