Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: manzt/zarrita.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 396fce52bd258fe6d60d3ef3bd9a3d6476086473
Choose a base ref
..
head repository: manzt/zarrita.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f4c7b8f93e29c34947ed36fe4a8bd0dac6a50353
Choose a head ref
Showing with 1,165 additions and 666 deletions.
  1. +2 −2 README.md
  2. 0 index.html → demo.html
  3. +2 −3 package.json
  4. +1 −1 packages/core/__tests__/consolidated.test.ts
  5. +2 −2 packages/core/__tests__/open.test.ts
  6. +3 −3 packages/storage/__tests__/fetch.test.ts
  7. +1,155 −655 pnpm-lock.yaml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ browser, run `pnpm build` and start a web-server in the root of the repository:

```sh
python3 -m http.server .
# navigate to localhost:8000
# navigate to localhost:8000/demo.html
```

You can edit the contents of `index.html` and refresh the page.
You can edit the contents of `demo.html` and refresh the page.
File renamed without changes.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@
"test": "vitest --api",
"fmt": "dprint fmt",
"lint": "dprint check",
"publint": "pnpm --recursive --filter=\"./packages/**\" exec publint",
"errors": "vim -c \"copen\" -c \"cexpr system('npx build')\" -c \"wincmd p\""
"publint": "pnpm --recursive --filter=\"./packages/**\" exec publint"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
@@ -16,6 +15,6 @@
"dprint": "^0.45.0",
"publint": "^0.2.2",
"typescript": "^5.3.3",
"vitest": "^0.33.0"
"vitest": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/core/__tests__/consolidated.test.ts
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ describe("withConsolidated", () => {
let try_open = () => withConsolidated(new FileSystemStore(root));
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v2 consolidated metadata"',
`[NodeNotFoundError: Node not found: v2 consolidated metadata]`,
);
});
});
4 changes: 2 additions & 2 deletions packages/core/__tests__/open.test.ts
Original file line number Diff line number Diff line change
@@ -467,7 +467,7 @@ describe("v2", () => {
open.v2(store.resolve("/not/a/group"), { kind: "group" });
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v2 group"',
`[NodeNotFoundError: Node not found: v2 group]`,
);
});

@@ -724,7 +724,7 @@ describe("v3", () => {
open.v3(store.resolve("/not/a/group"), { kind: "group" });
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v3 array or group"',
`[NodeNotFoundError: Node not found: v3 array or group]`,
);
});

6 changes: 3 additions & 3 deletions packages/storage/__tests__/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ describe("FetchStore", () => {

it("returns undefined for missing file", async () => {
let store = new FetchStore(href);
expect(await store.get("/missing.json")).toBeUndefined();
expect(await store.get("/some/random/file/missing.duh")).toBeUndefined();
});

it("forwards request options to fetch", async () => {
@@ -127,15 +127,15 @@ describe("FetchStore", () => {
let store = new FetchStore(href);
let bytes = await store.getRange("/zarr.json", { suffixLength: 50 });
expect(new TextDecoder().decode(bytes)).toMatchInlineSnapshot(
'"utes\\": {}, \\"zarr_format\\": 3, \\"node_type\\": \\"group\\"}"',
`"utes": {}, "zarr_format": 3, "node_type": "group"}"`,
);
});

it("reads partial - offset, length", async () => {
let store = new FetchStore(href);
let bytes = await store.getRange("/zarr.json", { offset: 4, length: 50 });
expect(new TextDecoder().decode(bytes)).toMatchInlineSnapshot(
'"tributes\\": {}, \\"zarr_format\\": 3, \\"node_type\\": \\"gro"',
`"tributes": {}, "zarr_format": 3, "node_type": "gro"`,
);
});
});
Loading