From b9ec6c71fab6301f128ba411495fa4a61ef77e5d Mon Sep 17 00:00:00 2001 From: achingbrain Date: Sun, 23 Feb 2025 22:31:51 +0000 Subject: [PATCH 1/2] docs: add spell checker to ci Adds cspell to CI to catch typos in code and docs. --- .cspell.json | 11 ++ .github/dictionary.txt | 0 .github/workflows/main.yml | 3 + README.md | 2 +- ROADMAP.md | 8 +- benchmarks/add-dir/README.md | 104 +++++++++--------- benchmarks/add-dir/package.json | 2 +- benchmarks/gc/package.json | 2 +- benchmarks/pinning/package.json | 2 +- benchmarks/transfer/package.json | 2 +- benchmarks/transports/README.md | 2 +- benchmarks/transports/package.json | 2 +- benchmarks/transports/src/tests.ts | 8 +- package.json | 3 +- packages/bitswap/package.json | 2 +- packages/bitswap/src/network.ts | 2 +- packages/bitswap/src/pb/message.proto | 4 +- packages/bitswap/src/pb/message.ts | 12 +- packages/bitswap/src/peer-want-lists/index.ts | 2 +- .../bitswap/src/peer-want-lists/ledger.ts | 12 +- packages/bitswap/src/utils/merge-messages.ts | 2 +- packages/bitswap/src/want-list.ts | 24 ++-- packages/bitswap/test/network.spec.ts | 12 +- packages/bitswap/test/peer-want-list.spec.ts | 8 +- packages/block-brokers/package.json | 2 +- .../test/trustless-gateway-utils.spec.ts | 26 ++--- packages/car/package.json | 2 +- packages/car/test/index.spec.ts | 20 ++-- packages/dag-cbor/package.json | 2 +- packages/dag-cbor/test/add.spec.ts | 2 + packages/dag-json/package.json | 2 +- packages/dag-json/test/add.spec.ts | 2 + packages/helia/package.json | 2 +- packages/helia/src/index.ts | 2 +- packages/http/package.json | 2 +- packages/interface/package.json | 2 +- packages/interop/package.json | 2 +- .../src/fixtures/create-helia.browser.ts | 2 +- packages/interop/src/fixtures/create-helia.ts | 2 +- packages/ipns/package.json | 2 +- packages/ipns/test/resolve-dnslink.spec.ts | 11 +- packages/json/package.json | 2 +- packages/json/test/add.spec.ts | 2 + packages/mfs/package.json | 2 +- packages/mfs/src/index.ts | 1 + packages/mfs/test/cp.spec.ts | 10 +- .../fixtures/create-subsharded-directory.ts | 16 +-- packages/mfs/test/rm.spec.ts | 14 +-- packages/routers/package.json | 2 +- packages/strings/package.json | 2 +- packages/strings/test/add.spec.ts | 3 + packages/unixfs/package.json | 2 +- .../unixfs/src/commands/utils/add-link.ts | 8 +- .../unixfs/src/commands/utils/dir-sharded.ts | 2 +- .../unixfs/src/commands/utils/remove-link.ts | 2 +- packages/unixfs/src/errors.ts | 2 +- packages/unixfs/src/index.ts | 2 +- packages/unixfs/test/add.spec.ts | 9 ++ packages/unixfs/test/cp.spec.ts | 6 +- .../fixtures/create-subsharded-directory.ts | 10 +- packages/unixfs/test/rm.spec.ts | 14 +-- packages/unixfs/test/stat.spec.ts | 2 +- packages/utils/package.json | 2 +- packages/utils/src/abstract-session.ts | 8 +- 64 files changed, 241 insertions(+), 198 deletions(-) create mode 100644 .cspell.json create mode 100644 .github/dictionary.txt diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000..ce02f35e1 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,11 @@ +{ + "import": [ + "./node_modules/aegir/cspell.json" + ], + "dictionaries": ["project"], + "dictionaryDefinitions": [{ + "name": "project", + "path": "./.github/dictionary.txt", + "addWords": true + }] +} diff --git a/.github/dictionary.txt b/.github/dictionary.txt new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9cc387f48..3f2b1c06d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,9 @@ jobs: - run: npm run --if-present lint - run: npm run --if-present dep-check - run: npm run --if-present doc-check + - uses: streetsidesoftware/cspell-action@ef95dc49d631fc2a9e9ea089ae2b2127b7c4588e # v6.10.0 + with: + use_cspell_files: true test-node: needs: build diff --git a/README.md b/README.md index 9dea2d6ce..b7faf7450 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ There are several other modules available outside this repo: - [`@helia/delegated-routing-v1-http-api`](https://github.com/ipfs/helia-delegated-routing-v1-http-api) An implementation of the [Delegated Routing v1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) including a server and a client - [Helia WNFS](https://github.com/shovelers/helia-wnfs) a [WNFS](https://guide.fission.codes/developers/webnative/file-system-wnfs) implementation built on top of Helia - [`@helia/remote-pinning`](https://github.com/ipfs/helia-remote-pinning) A Helia client for communicating with [IPFS Pinning Services](https://ipfs.github.io/pinning-services-api-spec/) -- [`@helia/http-gateway`](https://github.com/ipfs/helia-http-gateway) An implentation of the [IPFS HTTP Gateway API](https://docs.ipfs.tech/concepts/ipfs-gateway/#gateway-types) built with Helia +- [`@helia/http-gateway`](https://github.com/ipfs/helia-http-gateway) An implementation of the [IPFS HTTP Gateway API](https://docs.ipfs.tech/concepts/ipfs-gateway/#gateway-types) built with Helia # 📣 Project status diff --git a/ROADMAP.md b/ROADMAP.md index d942df93e..6d55df9f0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -19,7 +19,7 @@ https://github.com/ipfs/helia/issues/5 - [Q2](#q2) - [Drive Adoption](#drive-adoption) - [Q3](#q3) - - [Support Fully Speced Delegated Routing Protocols and Endpoints](#support-fully-speced-delegated-routing-protocols-and-endpoints) + - [Support Fully Specified Delegated Routing Protocols and Endpoints](#support-fully-specified-delegated-routing-protocols-and-endpoints) - [PL Delegate and Preload Nodes Will Be Shutting Down](#pl-delegate-and-preload-nodes-will-be-shutting-down) - [Past Milestones](#past-milestones) - [2022](#2022) @@ -44,7 +44,7 @@ Improve "hospitality" of the project: https://github.com/ipfs/helia/issues/35 After Helia is functional and users can adopt it, Protocol Labs EngRes ceases maintaining the legacy js-ipfs project. Issue for tracking js-ipfs deprecation with roadsigns to Helia: https://github.com/ipfs/js-ipfs/issues/4336 -Port over examples from js-ipfs-examples to helia-examples to help with onramping: https://github.com/ipfs/helia/issues/29 +Port over examples from js-ipfs-examples to helia-examples to help with on-ramping: https://github.com/ipfs/helia/issues/29 Demonstrate a practical example of Helia in a service worker as a fallback for HTTP gateways: https://github.com/ipfs/in-web-browsers/issues/207 @@ -52,9 +52,9 @@ Setup mechanism for measuring adoption: https://github.com/ipfs/helia/issues/41 ### Q3 -#### Support Fully Speced Delegated Routing Protocols and Endpoints +#### Support Fully Specified Delegated Routing Protocols and Endpoints -While it will be possible from a connectivity perspective to make DHT queries from a browser, we expect various applications will want to still delegate out routing. [HTTP Routing v1](https://github.com/ipfs/specs/blob/main/routing/ROUTING_V1_HTTP.md) is a protocol for delegated routing that other IPFS implementations like Kubo have implemented. While it currently uses HTTP as a transport, it is speced and not tied to the Kubo RPC API. +While it will be possible from a connectivity perspective to make DHT queries from a browser, we expect various applications will want to still delegate out routing. [HTTP Routing v1](https://github.com/ipfs/specs/blob/main/routing/ROUTING_V1_HTTP.md) is a protocol for delegated routing that other IPFS implementations like Kubo have implemented. While it currently uses HTTP as a transport, it is specified and not tied to the Kubo RPC API. #### PL Delegate and Preload Nodes Will Be Shutting Down diff --git a/benchmarks/add-dir/README.md b/benchmarks/add-dir/README.md index 91acbb95f..b87bf60a2 100644 --- a/benchmarks/add-dir/README.md +++ b/benchmarks/add-dir/README.md @@ -35,9 +35,9 @@ To run: [14:51:28] tsc [started] [14:51:33] tsc [completed] generating Ed25519 keypair... - ┌─────────┬─────────────────────┬─────────┬───────────┬──────┬───────────┬───────────────────────────────────────────────────────────────┐ - │ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ - ├─────────┼─────────────────────┼─────────┼───────────┼──────┼───────────┼───────────────────────────────────────────────────────────────┤ + ┌─────────┬─────────────────────┬─────────┬───────────┬──────┬───────────┬───────────┐ + │ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ + ├─────────┼─────────────────────┼─────────┼───────────┼──────┼───────────┼───────────┤ //... results here ``` @@ -73,25 +73,25 @@ generating Ed25519 keypair... (Use `node --trace-warnings ...` to show where the warning was created) generating Ed25519 keypair... generating Ed25519 keypair... -┌─────────┬───────────────────────────┬──────────┬──────────┬──────┬───────────┬───────────────────────────────────────────────────────────────┐ -│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ -├─────────┼───────────────────────────┼──────────┼──────────┼──────┼───────────┼───────────────────────────────────────────────────────────────┤ -│ 0 │ 'helia-fs - src' │ '438.44' │ '2.28' │ 439 │ '3.97' │ 'bafybeifaymukvfkyw6xgh4th7tsctiifr4ea2btoznf46y6b2fnvikdczi' │ -│ 1 │ 'helia-fs - dist' │ '81.62' │ '12.25' │ 82 │ '316.61' │ 'bafybeibm6mdqrw34ipb7r5pzam6jod5behsoxs73upv3zvucpq2zlv6x2i' │ -│ 2 │ 'helia-fs - ../gc/src' │ '475.87' │ '2.10' │ 476 │ '5.59' │ 'bafybeihhyvzl4zqbvvtafd6cnp37gwvrypn2cxpyr2yj5zppvgk3urxgpm' │ -│ 3 │ 'helia-mem - src' │ '924.29' │ '1.08' │ 925 │ '2.08' │ 'bafybeifaymukvfkyw6xgh4th7tsctiifr4ea2btoznf46y6b2fnvikdczi' │ -│ 4 │ 'helia-mem - dist' │ '242.95' │ '4.12' │ 243 │ '5.92' │ 'bafybeibm6mdqrw34ipb7r5pzam6jod5behsoxs73upv3zvucpq2zlv6x2i' │ -│ 5 │ 'helia-mem - ../gc/src' │ '901.17' │ '1.11' │ 902 │ '2.70' │ 'bafybeihhyvzl4zqbvvtafd6cnp37gwvrypn2cxpyr2yj5zppvgk3urxgpm' │ -│ 6 │ 'ipfs - src' │ '11.60' │ '86.22' │ 12 │ '103.93' │ 'bafybeihumrxwxpovdza7v7ukatwjye3ylpsrzx3sou2vw4s7zyjm55vdxy' │ -│ 7 │ 'ipfs - dist' │ '2.29' │ '436.19' │ 5 │ '456.56' │ 'bafybeiflrkun45ltbm5zg3uj2uw2nhtgj7rplcnshyo5domndyjbmp2xzy' │ -│ 8 │ 'ipfs - ../gc/src' │ '6.11' │ '163.68' │ 7 │ '181.44' │ 'bafybeibdpig6o56rjems2twzgvog7ssatt5szrpnjgvtnws4i4bm5csvoa' │ -│ 9 │ 'kubo - src' │ '13.78' │ '72.56' │ 14 │ '248.15' │ 'bafybeihumrxwxpovdza7v7ukatwjye3ylpsrzx3sou2vw4s7zyjm55vdxy' │ -│ 10 │ 'kubo - dist' │ '2.50' │ '400.71' │ 5 │ '1208.74' │ 'bafybeiflrkun45ltbm5zg3uj2uw2nhtgj7rplcnshyo5domndyjbmp2xzy' │ -│ 11 │ 'kubo - ../gc/src' │ '11.79' │ '84.79' │ 12 │ '433.94' │ 'bafybeifqlusi6zeboi7mxdbbjr5y5pdojrohhtelm4rbhb2vfkfa6f2kfu' │ -│ 12 │ 'kubo-direct - src' │ '14.68' │ '68.13' │ 15 │ '240.11' │ 'bafybeihumrxwxpovdza7v7ukatwjye3ylpsrzx3sou2vw4s7zyjm55vdxy' │ -│ 13 │ 'kubo-direct - dist' │ '2.48' │ '403.53' │ 5 │ '1232.42' │ 'bafybeiflrkun45ltbm5zg3uj2uw2nhtgj7rplcnshyo5domndyjbmp2xzy' │ -│ 14 │ 'kubo-direct - ../gc/src' │ '13.89' │ '71.99' │ 14 │ '329.82' │ 'bafybeifqlusi6zeboi7mxdbbjr5y5pdojrohhtelm4rbhb2vfkfa6f2kfu' │ -└─────────┴───────────────────────────┴──────────┴──────────┴──────┴───────────┴───────────────────────────────────────────────────────────────┘ +┌─────────┬───────────────────────────┬──────────┬──────────┬──────┬───────────┬───────────┐ +│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ +├─────────┼───────────────────────────┼──────────┼──────────┼──────┼───────────┼───────────┤ +│ 0 │ 'helia-fs - src' │ '438.44' │ '2.28' │ 439 │ '3.97' │ 'bafyfoo' │ +│ 1 │ 'helia-fs - dist' │ '81.62' │ '12.25' │ 82 │ '316.61' │ 'bafyfoo' │ +│ 2 │ 'helia-fs - ../gc/src' │ '475.87' │ '2.10' │ 476 │ '5.59' │ 'bafyfoo' │ +│ 3 │ 'helia-mem - src' │ '924.29' │ '1.08' │ 925 │ '2.08' │ 'bafyfoo' │ +│ 4 │ 'helia-mem - dist' │ '242.95' │ '4.12' │ 243 │ '5.92' │ 'bafyfoo' │ +│ 5 │ 'helia-mem - ../gc/src' │ '901.17' │ '1.11' │ 902 │ '2.70' │ 'bafyfoo' │ +│ 6 │ 'ipfs - src' │ '11.60' │ '86.22' │ 12 │ '103.93' │ 'bafyfoo' │ +│ 7 │ 'ipfs - dist' │ '2.29' │ '436.19' │ 5 │ '456.56' │ 'bafyfoo' │ +│ 8 │ 'ipfs - ../gc/src' │ '6.11' │ '163.68' │ 7 │ '181.44' │ 'bafyfoo' │ +│ 9 │ 'kubo - src' │ '13.78' │ '72.56' │ 14 │ '248.15' │ 'bafyfoo' │ +│ 10 │ 'kubo - dist' │ '2.50' │ '400.71' │ 5 │ '1208.74' │ 'bafyfoo' │ +│ 11 │ 'kubo - ../gc/src' │ '11.79' │ '84.79' │ 12 │ '433.94' │ 'bafyfoo' │ +│ 12 │ 'kubo-direct - src' │ '14.68' │ '68.13' │ 15 │ '240.11' │ 'bafyfoo' │ +│ 13 │ 'kubo-direct - dist' │ '2.48' │ '403.53' │ 5 │ '1232.42' │ 'bafyfoo' │ +│ 14 │ 'kubo-direct - ../gc/src' │ '13.89' │ '71.99' │ 14 │ '329.82' │ 'bafyfoo' │ +└─────────┴───────────────────────────┴──────────┴──────────┴──────┴───────────┴───────────┘ ``` ### MIN_TIME @@ -114,19 +114,19 @@ generating Ed25519 keypair... (Use `node --trace-warnings ...` to show where the warning was created) generating Ed25519 keypair... generating Ed25519 keypair... -┌─────────┬─────────────────────┬──────────┬──────────┬──────┬───────────┬───────────────────────────────────────────────────────────────┐ -│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ -├─────────┼─────────────────────┼──────────┼──────────┼──────┼───────────┼───────────────────────────────────────────────────────────────┤ -│ 0 │ 'helia - src' │ '516.16' │ '1.94' │ 517 │ '3.47' │ 'bafybeievc57xgecd6icfsrp2v4t2a5fepicezabwcvh7javhx7gr7zkbnu' │ -│ 1 │ 'helia - dist' │ '126.64' │ '7.90' │ 127 │ '13.49' │ 'bafybeiewlvh72zaaoxhxdajauozve5npi5kwryv4sj2ixayqhu4zgdd2nu' │ -│ 2 │ 'helia - ../gc/src' │ '502.72' │ '1.99' │ 503 │ '3.66' │ 'bafybeihhyvzl4zqbvvtafd6cnp37gwvrypn2cxpyr2yj5zppvgk3urxgpm' │ -│ 3 │ 'ipfs - src' │ '13.12' │ '76.22' │ 14 │ '99.63' │ 'bafybeic7zx457hr3s2z7n3rnl3nckwjo3nhlpex7kmzxw7tzv3y5fbyki4' │ -│ 4 │ 'ipfs - dist' │ '2.84' │ '352.04' │ 5 │ '418.21' │ 'bafybeiapdyhejcw6sd7f5bayzpp5in3rx44lu3rbpvl2opjgc2msevfsoe' │ -│ 5 │ 'ipfs - ../gc/src' │ '5.39' │ '185.56' │ 6 │ '217.48' │ 'bafybeibdpig6o56rjems2twzgvog7ssatt5szrpnjgvtnws4i4bm5csvoa' │ -│ 6 │ 'kubo - src' │ '17.47' │ '57.23' │ 18 │ '208.40' │ 'bafybeic7zx457hr3s2z7n3rnl3nckwjo3nhlpex7kmzxw7tzv3y5fbyki4' │ -│ 7 │ 'kubo - dist' │ '3.04' │ '328.87' │ 5 │ '1038.24' │ 'bafybeiapdyhejcw6sd7f5bayzpp5in3rx44lu3rbpvl2opjgc2msevfsoe' │ -│ 8 │ 'kubo - ../gc/src' │ '12.88' │ '77.65' │ 13 │ '328.25' │ 'bafybeifqlusi6zeboi7mxdbbjr5y5pdojrohhtelm4rbhb2vfkfa6f2kfu' │ -└─────────┴─────────────────────┴──────────┴──────────┴──────┴───────────┴───────────────────────────────────────────────────────────────┘ +┌─────────┬─────────────────────┬──────────┬──────────┬──────┬───────────┬───────────┐ +│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ +├─────────┼─────────────────────┼──────────┼──────────┼──────┼───────────┼───────────┤ +│ 0 │ 'helia - src' │ '516.16' │ '1.94' │ 517 │ '3.47' │ 'bafyfoo' │ +│ 1 │ 'helia - dist' │ '126.64' │ '7.90' │ 127 │ '13.49' │ 'bafyfoo' │ +│ 2 │ 'helia - ../gc/src' │ '502.72' │ '1.99' │ 503 │ '3.66' │ 'bafyfoo' │ +│ 3 │ 'ipfs - src' │ '13.12' │ '76.22' │ 14 │ '99.63' │ 'bafyfoo' │ +│ 4 │ 'ipfs - dist' │ '2.84' │ '352.04' │ 5 │ '418.21' │ 'bafyfoo' │ +│ 5 │ 'ipfs - ../gc/src' │ '5.39' │ '185.56' │ 6 │ '217.48' │ 'bafyfoo' │ +│ 6 │ 'kubo - src' │ '17.47' │ '57.23' │ 18 │ '208.40' │ 'bafyfoo' │ +│ 7 │ 'kubo - dist' │ '3.04' │ '328.87' │ 5 │ '1038.24' │ 'bafyfoo' │ +│ 8 │ 'kubo - ../gc/src' │ '12.88' │ '77.65' │ 13 │ '328.25' │ 'bafyfoo' │ +└─────────┴─────────────────────┴──────────┴──────────┴──────┴───────────┴───────────┘ ``` ### TEST_PATH @@ -147,15 +147,15 @@ TEST_PATH=../../node_modules/neo-async npm start generating Ed25519 keypair... (node:34722) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) -┌─────────┬──────────────────────────────────────────────┬─────────┬───────────┬──────┬───────────┬───────────────────────────────────────────────────────────────┐ -│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ -├─────────┼──────────────────────────────────────────────┼─────────┼───────────┼──────┼───────────┼───────────────────────────────────────────────────────────────┤ -│ 0 │ 'helia-fs - ../../node_modules/neo-async' │ '2.01' │ '498.48' │ 5 │ '2190.31' │ 'bafybeib5nofkubfon4upbeqvtn224uajsauqlkvlrik5p4xo53ws7e24sm' │ -│ 1 │ 'helia-mem - ../../node_modules/neo-async' │ '19.22' │ '52.04' │ 5 │ '85.31' │ 'bafybeib5nofkubfon4upbeqvtn224uajsauqlkvlrik5p4xo53ws7e24sm' │ -│ 2 │ 'ipfs - ../../node_modules/neo-async' │ '0.20' │ '4895.68' │ 5 │ '5209.99' │ 'bafybeigdyetiosfdnzg4cocoqneudndktcukaa3qdwj2ndeoxuqk6oxycm' │ -│ 3 │ 'kubo - ../../node_modules/neo-async' │ '0.38' │ '2641.59' │ 5 │ '7776.20' │ 'bafybeiey5wqhualgsssqo53dafzlp5fq2dzlv742raqvayougzsvbqvatm' │ -│ 4 │ 'kubo-direct - ../../node_modules/neo-async' │ '0.43' │ '2348.51' │ 5 │ '7149.77' │ 'bafybeiey5wqhualgsssqo53dafzlp5fq2dzlv742raqvayougzsvbqvatm' │ -└─────────┴──────────────────────────────────────────────┴─────────┴───────────┴──────┴───────────┴───────────────────────────────────────────────────────────────┘ +┌─────────┬──────────────────────────────────────────────┬─────────┬───────────┬──────┬───────────┬───────────┐ +│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ +├─────────┼──────────────────────────────────────────────┼─────────┼───────────┼──────┼───────────┼───────────┤ +│ 0 │ 'helia-fs - ../../node_modules/neo-async' │ '2.01' │ '498.48' │ 5 │ '2190.31' │ 'bafyfoo' │ +│ 1 │ 'helia-mem - ../../node_modules/neo-async' │ '19.22' │ '52.04' │ 5 │ '85.31' │ 'bafyfoo' │ +│ 2 │ 'ipfs - ../../node_modules/neo-async' │ '0.20' │ '4895.68' │ 5 │ '5209.99' │ 'bafyfoo' │ +│ 3 │ 'kubo - ../../node_modules/neo-async' │ '0.38' │ '2641.59' │ 5 │ '7776.20' │ 'bafyfoo' │ +│ 4 │ 'kubo-direct - ../../node_modules/neo-async' │ '0.43' │ '2348.51' │ 5 │ '7149.77' │ 'bafyfoo' │ +└─────────┴──────────────────────────────────────────────┴─────────┴───────────┴──────┴───────────┴───────────┘ ``` ```bash @@ -175,14 +175,14 @@ generating Ed25519 keypair... (Use `node --trace-warnings ...` to show where the warning was created) generating Ed25519 keypair... generating Ed25519 keypair... -┌─────────┬───────────────────────────────────────────────────────────┬────────┬─────────────┬──────┬─────────────┬───────────────────────────────────────────────────────────────┐ -│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ -├─────────┼───────────────────────────────────────────────────────────┼────────┼─────────────┼──────┼─────────────┼───────────────────────────────────────────────────────────────┤ -│ 0 │ 'helia - ../../node_modules/ipfs-core/node_modules' │ '0.15' │ '6708.96' │ 5 │ '29599.11' │ 'bafybeihjqqav7quarfmhnejijq7edikz7rvryhuocpug5l7ovhvhvxjtwi' │ -│ 1 │ 'ipfs - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '228866.62' │ 5 │ '237419.96' │ 'bafybeicwkwides7xtqvxtc56vbmolrfli2ds2i3dmevghlibhmxmebir7u' │ -│ 2 │ 'kubo - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '230310.82' │ 5 │ '234432.20' │ 'bafybeicwkwides7xtqvxtc56vbmolrfli2ds2i3dmevghlibhmxmebir7u' │ -│ 3 │ 'kubo-direct - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '205561.86' │ 5 │ '219400.15' │ 'bafybeicwkwides7xtqvxtc56vbmolrfli2ds2i3dmevghlibhmxmebir7u' │ -└─────────┴───────────────────────────────────────────────────────────┴────────┴─────────────┴──────┴─────────────┴───────────────────────────────────────────────────────────────┘ +┌─────────┬───────────────────────────────────────────────────────────┬────────┬─────────────┬──────┬─────────────┬───────────┐ +│ (index) │ Implementation │ ops/s │ ms/op │ runs │ p99 │ CID │ +├─────────┼───────────────────────────────────────────────────────────┼────────┼─────────────┼──────┼─────────────┼───────────┤ +│ 0 │ 'helia - ../../node_modules/ipfs-core/node_modules' │ '0.15' │ '6708.96' │ 5 │ '29599.11' │ 'bafyfoo' │ +│ 1 │ 'ipfs - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '228866.62' │ 5 │ '237419.96' │ 'bafyfoo' │ +│ 2 │ 'kubo - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '230310.82' │ 5 │ '234432.20' │ 'bafyfoo' │ +│ 3 │ 'kubo-direct - ../../node_modules/ipfs-core/node_modules' │ '0.00' │ '205561.86' │ 5 │ '219400.15' │ 'bafyfoo' │ +└─────────┴───────────────────────────────────────────────────────────┴────────┴─────────────┴──────┴─────────────┴───────────┘ ``` ## Troubleshooting diff --git a/benchmarks/add-dir/package.json b/benchmarks/add-dir/package.json index 8ff0a05f0..1b205924e 100644 --- a/benchmarks/add-dir/package.json +++ b/benchmarks/add-dir/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@helia/unixfs": "^4.0.1", - "aegir": "^45.0.1", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2", "blockstore-fs": "^2.0.1", "datastore-core": "^10.0.2", diff --git a/benchmarks/gc/package.json b/benchmarks/gc/package.json index c7bd90277..7eadde344 100644 --- a/benchmarks/gc/package.json +++ b/benchmarks/gc/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@ipld/dag-pb": "^4.0.6", - "aegir": "^45.0.1", + "aegir": "^45.1.1", "blockstore-fs": "^2.0.1", "datastore-level": "^11.0.1", "execa": "^8.0.1", diff --git a/benchmarks/pinning/package.json b/benchmarks/pinning/package.json index 13f8e148e..dd26879cd 100644 --- a/benchmarks/pinning/package.json +++ b/benchmarks/pinning/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@ipld/dag-pb": "^4.0.6", - "aegir": "^45.0.1", + "aegir": "^45.1.1", "blockstore-fs": "^2.0.1", "datastore-level": "^11.0.1", "execa": "^8.0.1", diff --git a/benchmarks/transfer/package.json b/benchmarks/transfer/package.json index 90f6ae6c5..23161664d 100644 --- a/benchmarks/transfer/package.json +++ b/benchmarks/transfer/package.json @@ -20,7 +20,7 @@ "@ipld/dag-pb": "^4.0.2", "@libp2p/tcp": "^10.0.1", "@multiformats/multiaddr": "^12.3.1", - "aegir": "^45.0.1", + "aegir": "^45.1.1", "blockstore-fs": "^2.0.1", "datastore-level": "^11.0.1", "helia": "^5.1.1", diff --git a/benchmarks/transports/README.md b/benchmarks/transports/README.md index 0baf08178..60c38afe4 100644 --- a/benchmarks/transports/README.md +++ b/benchmarks/transports/README.md @@ -28,7 +28,7 @@ To run: WebSockets (node.js -> node.js) filecoin defaults, 1068, 1642, 2092, 2812, 4117, 4423, 6117, 7820, 7182, 7816 //... results here ``` -3. Graph the CSV data with your favourite graphing tool +3. Graph the CSV data with your favorite graphing tool ## Debugging diff --git a/benchmarks/transports/package.json b/benchmarks/transports/package.json index 9ce055ce6..4c6f7b105 100644 --- a/benchmarks/transports/package.json +++ b/benchmarks/transports/package.json @@ -27,7 +27,7 @@ "@libp2p/websockets": "^9.0.0", "@libp2p/webtransport": "^5.0.0", "@multiformats/multiaddr": "^12.2.1", - "aegir": "^45.0.1", + "aegir": "^45.1.1", "blockstore-fs": "^2.0.1", "blockstore-idb": "^2.0.1", "datastore-idb": "^3.0.0", diff --git a/benchmarks/transports/src/tests.ts b/benchmarks/transports/src/tests.ts index 81c31b322..a626317d4 100644 --- a/benchmarks/transports/src/tests.ts +++ b/benchmarks/transports/src/tests.ts @@ -22,7 +22,7 @@ interface Impl { listen?(relay: Multiaddr): string } -const webRTCimpls: Record = { +const webRTCImpls: Record = { chromium: { type: 'helia', exec: PLAYWRIGHT, @@ -46,7 +46,7 @@ const webRTCimpls: Record = { } } -const webSocketimpls: Record = { +const webSocketImpls: Record = { 'node.js': { type: 'helia', listen: () => '/ip4/127.0.0.1/tcp/0/ws' @@ -119,9 +119,9 @@ function addTests (name: string, impls: Record, tests: Test[], rel export function createTests (relay: Multiaddr): Test[] { const output: Test[] = [] - addTests('WebRTC', webRTCimpls, output, relay) + addTests('WebRTC', webRTCImpls, output, relay) addTests('WebTransport', webTransportImpls, output, relay) - addTests('WebSockets', webSocketimpls, output, relay) + addTests('WebSockets', webSocketImpls, output, relay) addTests('TCP', tcpImpls, output, relay) return output diff --git a/package.json b/package.json index 428f55449..197cccccd 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "lint": "aegir run lint", "dep-check": "aegir run dep-check", "doc-check": "aegir run doc-check", + "spell-check": "aegir spell-check", "release": "run-s build docs:no-publish npm:release docs", "npm:release": "aegir exec --bail false npm -- publish", "release:rc": "aegir release-rc", @@ -38,7 +39,7 @@ "docs:no-publish": "aegir docs --publish false" }, "devDependencies": { - "aegir": "^45.0.1", + "aegir": "^45.1.1", "npm-run-all": "^4.1.5" }, "type": "module", diff --git a/packages/bitswap/package.json b/packages/bitswap/package.json index 58f5ba73b..c97fc0a2f 100644 --- a/packages/bitswap/package.json +++ b/packages/bitswap/package.json @@ -92,7 +92,7 @@ "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/peer-id": "^5.0.8", "@types/sinon": "^17.0.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2", "delay": "^6.0.0", "it-all": "^3.0.6", diff --git a/packages/bitswap/src/network.ts b/packages/bitswap/src/network.ts index 6e82a5aa7..157f89340 100644 --- a/packages/bitswap/src/network.ts +++ b/packages/bitswap/src/network.ts @@ -344,7 +344,7 @@ export class Network extends TypedEventEmitter { // dial and wait for identify - this is to avoid opening a protocol stream // that we are not going to use but depends on the remote node running the - // identitfy protocol + // identify protocol const [ connection ] = await Promise.all([ diff --git a/packages/bitswap/src/pb/message.proto b/packages/bitswap/src/pb/message.proto index bed8d177e..6fc71ed31 100644 --- a/packages/bitswap/src/pb/message.proto +++ b/packages/bitswap/src/pb/message.proto @@ -11,7 +11,7 @@ message WantlistEntry { int32 priority = 2; // the priority (normalized). default to 1 optional bool cancel = 3; // whether this revokes an entry optional WantType wantType = 4; // Note: defaults to enum 0, ie Block - optional bool sendDontHave = 5; // Note: defaults to false + optional bool sendDoNotHave = 5; // Note: defaults to false } message Wantlist { @@ -26,7 +26,7 @@ message Block { enum BlockPresenceType { HaveBlock = 0; - DontHaveBlock = 1; + DoNotHaveBlock = 1; } message BlockPresence { diff --git a/packages/bitswap/src/pb/message.ts b/packages/bitswap/src/pb/message.ts index 7023fa267..c6a445820 100644 --- a/packages/bitswap/src/pb/message.ts +++ b/packages/bitswap/src/pb/message.ts @@ -28,7 +28,7 @@ export interface WantlistEntry { priority: number cancel?: boolean wantType?: WantType - sendDontHave?: boolean + sendDoNotHave?: boolean } export namespace WantlistEntry { @@ -61,9 +61,9 @@ export namespace WantlistEntry { WantType.codec().encode(obj.wantType, w) } - if (obj.sendDontHave != null) { + if (obj.sendDoNotHave != null) { w.uint32(40) - w.bool(obj.sendDontHave) + w.bool(obj.sendDoNotHave) } if (opts.lengthDelimited !== false) { @@ -98,7 +98,7 @@ export namespace WantlistEntry { break } case 5: { - obj.sendDontHave = reader.bool() + obj.sendDoNotHave = reader.bool() break } default: { @@ -275,12 +275,12 @@ export namespace Block { export enum BlockPresenceType { HaveBlock = 'HaveBlock', - DontHaveBlock = 'DontHaveBlock' + DoNotHaveBlock = 'DoNotHaveBlock' } enum __BlockPresenceTypeValues { HaveBlock = 0, - DontHaveBlock = 1 + DoNotHaveBlock = 1 } export namespace BlockPresenceType { diff --git a/packages/bitswap/src/peer-want-lists/index.ts b/packages/bitswap/src/peer-want-lists/index.ts index 661fe5ae8..d8d4a9345 100644 --- a/packages/bitswap/src/peer-want-lists/index.ts +++ b/packages/bitswap/src/peer-want-lists/index.ts @@ -139,7 +139,7 @@ export class PeerWantLists { cid, priority: entry.priority, wantType: entry.wantType ?? WantType.WantBlock, - sendDontHave: entry.sendDontHave ?? false + sendDoNotHave: entry.sendDoNotHave ?? false }) } } diff --git a/packages/bitswap/src/peer-want-lists/ledger.ts b/packages/bitswap/src/peer-want-lists/ledger.ts index 4242cf1f6..5cdfc56bb 100644 --- a/packages/bitswap/src/peer-want-lists/ledger.ts +++ b/packages/bitswap/src/peer-want-lists/ledger.ts @@ -40,12 +40,12 @@ export interface PeerWantListEntry { /** * Whether the remote should tell us if they have the block or not */ - sendDontHave: boolean + sendDoNotHave: boolean /** * If we don't have the block and we've told them we don't have the block */ - sentDontHave?: boolean + sentDoNotHave?: boolean } export class Ledger { @@ -133,19 +133,19 @@ export class Ledger { // we don't have the requested block and the remote is not interested // in us telling them that - if (!entry.sendDontHave) { + if (!entry.sendDoNotHave) { continue } // we have already told them we don't have the block - if (entry.sentDontHave === true) { + if (entry.sentDoNotHave === true) { continue } - entry.sentDontHave = true + entry.sentDoNotHave = true message.addBlockPresence(entry.cid, { cid: entry.cid.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }) } } diff --git a/packages/bitswap/src/utils/merge-messages.ts b/packages/bitswap/src/utils/merge-messages.ts index b8a9eca8d..751693fe0 100644 --- a/packages/bitswap/src/utils/merge-messages.ts +++ b/packages/bitswap/src/utils/merge-messages.ts @@ -13,7 +13,7 @@ export function mergeMessages (existingMessage: QueuedBitswapMessage, newMessage // take later values if passed, otherwise use earlier ones entry.cancel = entry.cancel ?? existingEntry.cancel entry.wantType = entry.wantType ?? existingEntry.wantType - entry.sendDontHave = entry.sendDontHave ?? existingEntry.sendDontHave + entry.sendDoNotHave = entry.sendDoNotHave ?? existingEntry.sendDoNotHave } existingMessage.wantlist.set(key, entry) diff --git a/packages/bitswap/src/want-list.ts b/packages/bitswap/src/want-list.ts index 7cf66dc05..368edd2be 100644 --- a/packages/bitswap/src/want-list.ts +++ b/packages/bitswap/src/want-list.ts @@ -57,12 +57,12 @@ export interface WantListEntry { /** * Whether the remote should tell us if they have the block or not */ - sendDontHave: boolean + sendDoNotHave: boolean } export interface WantOptions extends AbortOptions, ProgressOptions { /** - * Allow prioritising blocks + * Allow prioritizing blocks */ priority?: number } @@ -73,7 +73,7 @@ export interface WantBlockResult { block: Uint8Array } -export interface WantDontHaveResult { +export interface WantDoNotHaveResult { sender: PeerId cid: CID has: false @@ -86,7 +86,7 @@ export interface WantHaveResult { block?: Uint8Array } -export type WantPresenceResult = WantDontHaveResult | WantHaveResult +export type WantPresenceResult = WantDoNotHaveResult | WantHaveResult export interface WantListEvents { block: CustomEvent @@ -152,7 +152,7 @@ export class WantList extends TypedEventEmitter implements Start priority: options.priority ?? 1, wantType: options.wantType ?? WantType.WantBlock, cancel: false, - sendDontHave: true + sendDoNotHave: true } this.wants.set(cidStr, entry) @@ -234,7 +234,7 @@ export class WantList extends TypedEventEmitter implements Start priority: entry.priority, wantType: entry.wantType, cancel: entry.cancel, - sendDontHave: entry.sendDontHave + sendDoNotHave: entry.sendDoNotHave }) } @@ -285,7 +285,7 @@ export class WantList extends TypedEventEmitter implements Start const message = new QueuedBitswapMessage() message.addWantlistEntry(cid, { cid: cid.bytes, - sendDontHave: true, + sendDoNotHave: true, wantType: WantType.WantHave, priority: 1 }) @@ -294,7 +294,7 @@ export class WantList extends TypedEventEmitter implements Start await this.network.sendMessage(peerId, message) // wait for peer response - const event = await raceEvent>(this, 'presence', options.signal, { + const event = await raceEvent>(this, 'presence', options.signal, { filter: (event) => { return peerId.equals(event.detail.sender) && uint8ArrayEquals(cid.multihash.digest, event.detail.cid.multihash.digest) } @@ -320,7 +320,7 @@ export class WantList extends TypedEventEmitter implements Start const message = new QueuedBitswapMessage() message.addWantlistEntry(cid, { cid: cid.bytes, - sendDontHave: true, + sendDoNotHave: true, wantType: WantType.WantBlock, priority: 1 }) @@ -399,7 +399,7 @@ export class WantList extends TypedEventEmitter implements Start } }) - this.safeDispatchEvent('presence', { + this.safeDispatchEvent('presence', { detail: { sender, cid, @@ -428,7 +428,7 @@ export class WantList extends TypedEventEmitter implements Start this.log('received %s from %p for %c', type, sender, cid) - this.safeDispatchEvent('presence', { + this.safeDispatchEvent('presence', { detail: { sender, cid, @@ -462,7 +462,7 @@ export class WantList extends TypedEventEmitter implements Start priority: 1, wantType: WantType.WantBlock, cancel: false, - sendDontHave: false + sendDoNotHave: false }) } diff --git a/packages/bitswap/test/network.spec.ts b/packages/bitswap/test/network.spec.ts index d88a8df3a..d0aaf796f 100644 --- a/packages/bitswap/test/network.spec.ts +++ b/packages/bitswap/test/network.spec.ts @@ -136,7 +136,7 @@ describe('network', () => { const lpstr = lpStream(localDuplex) - // garbage data, cannot be unmarshalled as protobuf + // garbage data, cannot be unmarshaled as protobuf await lpstr.write(Uint8Array.from([0, 1, 2, 3])) await pRetry(() => { @@ -401,11 +401,11 @@ describe('network', () => { }) messageA.addBlockPresence(cid3, { cid: cid3.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }) messageA.addBlockPresence(cid5, { cid: cid5.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }) messageA.addWantlistEntry(cid5, { cid: cid5.bytes, @@ -424,7 +424,7 @@ describe('network', () => { }) messageB.addBlockPresence(cid4, { cid: cid4.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }) messageB.addBlockPresence(cid5, { cid: cid5.bytes, @@ -478,13 +478,13 @@ describe('network', () => { }]) expect(message).to.have.deep.property('blockPresences', [{ cid: cid3.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }, { cid: cid5.bytes, type: BlockPresenceType.HaveBlock }, { cid: cid4.bytes, - type: BlockPresenceType.DontHaveBlock + type: BlockPresenceType.DoNotHaveBlock }]) expect(message).to.have.deep.property('wantlist', { full: true, diff --git a/packages/bitswap/test/peer-want-list.spec.ts b/packages/bitswap/test/peer-want-list.spec.ts index f5990602d..1285483b7 100644 --- a/packages/bitswap/test/peer-want-list.spec.ts +++ b/packages/bitswap/test/peer-want-list.spec.ts @@ -328,7 +328,7 @@ describe('peer-want-lists', () => { cid: cid.bytes, priority: 1, wantType: WantType.WantBlock, - sendDontHave: true + sendDoNotHave: true }] } } @@ -347,7 +347,7 @@ describe('peer-want-lists', () => { expect(message.blocks).to.be.empty('should not have sent blocks') expect(message.blockPresences).to.have.lengthOf(1) expect([...message.blockPresences.values()][0].cid).to.equalBytes(cid.bytes) - expect([...message.blockPresences.values()][0].type).to.equal(BlockPresenceType.DontHaveBlock, 'should have sent DontHaveBlock presence') + expect([...message.blockPresences.values()][0].type).to.equal(BlockPresenceType.DoNotHaveBlock, 'should have sent DoNotHaveBlock presence') }) it('should send requested blocks to peer when presence was requested but block size is less than maxSizeReplaceHasWithBlock', async () => { @@ -418,7 +418,7 @@ describe('peer-want-lists', () => { cid: cid.bytes, priority: 1, wantType: WantType.WantHave, - sendDontHave: true + sendDoNotHave: true }] } } @@ -437,7 +437,7 @@ describe('peer-want-lists', () => { expect(message.blocks).to.be.empty('should not have sent blocks') expect(message.blockPresences).to.have.lengthOf(1) expect([...message.blockPresences.values()][0].cid).to.equalBytes(cid.bytes) - expect([...message.blockPresences.values()][0].type).to.equal(BlockPresenceType.DontHaveBlock, 'should have sent DontHaveBlock presence') + expect([...message.blockPresences.values()][0].type).to.equal(BlockPresenceType.DoNotHaveBlock, 'should have sent DoNotHaveBlock presence') }) it('should remove wants when peer cancels', async () => { diff --git a/packages/block-brokers/package.json b/packages/block-brokers/package.json index bdc2fa482..a912be63a 100644 --- a/packages/block-brokers/package.json +++ b/packages/block-brokers/package.json @@ -74,7 +74,7 @@ "@multiformats/uri-to-multiaddr": "^8.0.0", "@types/polka": "^0.5.7", "@types/sinon": "^17.0.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "cors": "^2.8.5", "polka": "^0.5.2", "sinon": "^19.0.2", diff --git a/packages/block-brokers/test/trustless-gateway-utils.spec.ts b/packages/block-brokers/test/trustless-gateway-utils.spec.ts index 1aca9b3ba..5ae88319b 100644 --- a/packages/block-brokers/test/trustless-gateway-utils.spec.ts +++ b/packages/block-brokers/test/trustless-gateway-utils.spec.ts @@ -4,50 +4,50 @@ import { filterNonHTTPMultiaddrs } from '../src/trustless-gateway/utils.js' describe('trustless-gateway-block-broker-utils', () => { it('filterNonHTTPMultiaddrs respects allowInsecure multiaddrs correctly', async function () { - const nonSecureMaddr = uriToMultiaddr('http://mygw.com') - const secureMaddr = uriToMultiaddr('https://mygw.com') + const nonSecureAddr = uriToMultiaddr('http://mygw.com') + const secureAddr = uriToMultiaddr('https://mygw.com') - const filtered = filterNonHTTPMultiaddrs([nonSecureMaddr, secureMaddr], true, true) + const filtered = filterNonHTTPMultiaddrs([nonSecureAddr, secureAddr], true, true) expect(filtered.length).to.deep.equal(2) }) it('filterNonHTTPMultiaddrs filters local multiaddrs correctly', async function () { - const localMaddr = uriToMultiaddr('http://localhost') + const localAddr = uriToMultiaddr('http://localhost') - const filtered = filterNonHTTPMultiaddrs([localMaddr], true, true) + const filtered = filterNonHTTPMultiaddrs([localAddr], true, true) expect(filtered.length).to.deep.equal(1) }) it('filterNonHTTPMultiaddrs filters multiaddrs correctly', async function () { - const localMaddr = uriToMultiaddr('http://localhost') + const localAddr = uriToMultiaddr('http://localhost') - const filtered = filterNonHTTPMultiaddrs([localMaddr], false, false) + const filtered = filterNonHTTPMultiaddrs([localAddr], false, false) expect(filtered.length).to.deep.equal(0) }) it('filterNonHTTPMultiaddrs allows 127.0.0.1 when allowInsecure=false', async function () { - const localMaddr = uriToMultiaddr('http://127.0.0.1') + const localAddr = uriToMultiaddr('http://127.0.0.1') - const filtered = filterNonHTTPMultiaddrs([localMaddr], false, true) + const filtered = filterNonHTTPMultiaddrs([localAddr], false, true) expect(filtered.length).to.deep.equal(1) }) it('filterNonHTTPMultiaddrs allows localhost when allowInsecure=false', async function () { - const localMaddr = uriToMultiaddr('http://localhost') + const localAddr = uriToMultiaddr('http://localhost') - const filtered = filterNonHTTPMultiaddrs([localMaddr], false, true) + const filtered = filterNonHTTPMultiaddrs([localAddr], false, true) expect(filtered.length).to.deep.equal(1) }) it('filterNonHTTPMultiaddrs allows *.localhost when allowInsecure=false', async function () { - const localMaddr = uriToMultiaddr('http://example.localhost') + const localAddr = uriToMultiaddr('http://example.localhost') - const filtered = filterNonHTTPMultiaddrs([localMaddr], false, true) + const filtered = filterNonHTTPMultiaddrs([localAddr], false, true) expect(filtered.length).to.deep.equal(1) }) diff --git a/packages/car/package.json b/packages/car/package.json index 8f8de66ec..43121c371 100644 --- a/packages/car/package.json +++ b/packages/car/package.json @@ -70,7 +70,7 @@ "@helia/mfs": "^4.0.2", "@helia/unixfs": "^4.0.2", "@ipld/dag-pb": "^4.1.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2", "datastore-core": "^10.0.2", "ipfs-unixfs-importer": "^15.3.1", diff --git a/packages/car/test/index.spec.ts b/packages/car/test/index.spec.ts index 4b7ad4209..5174cb9ab 100644 --- a/packages/car/test/index.spec.ts +++ b/packages/car/test/index.spec.ts @@ -126,14 +126,14 @@ describe('import/export car file', () => { const otherMFS = mfs({ blockstore: otherBlockstore, datastore: otherDatastore }) const otherCar = car({ blockstore: otherBlockstore, getCodec }) - await otherMFS.mkdir('/testDups') - await otherMFS.mkdir('/testDups/sub') + await otherMFS.mkdir('/testDuplicates') + await otherMFS.mkdir('/testDuplicates/sub') const sourceCid = await otherUnixFS.addBytes(smallFile) - await otherMFS.cp(sourceCid, '/testDups/a.smallfile') - await otherMFS.cp(sourceCid, '/testDups/sub/b.smallfile') + await otherMFS.cp(sourceCid, '/testDuplicates/a.small-file') + await otherMFS.cp(sourceCid, '/testDuplicates/sub/b.small-file') - const rootObject = await otherMFS.stat('/testDups/') + const rootObject = await otherMFS.stat('/testDuplicates/') const rootCid = rootObject.cid const writer = memoryCarWriter(rootCid) @@ -153,14 +153,14 @@ describe('import/export car file', () => { const otherMFS = mfs({ blockstore: otherBlockstore, datastore: otherDatastore }) const otherCar = car({ blockstore: otherBlockstore, getCodec }) - await otherMFS.mkdir('/testDups') - await otherMFS.mkdir('/testDups/sub') + await otherMFS.mkdir('/testDuplicates') + await otherMFS.mkdir('/testDuplicates/sub') const sourceCid = await otherUnixFS.addBytes(smallFile) - await otherMFS.cp(sourceCid, '/testDups/a.smallfile') - await otherMFS.cp(sourceCid, '/testDups/sub/b.smallfile') + await otherMFS.cp(sourceCid, '/testDuplicates/a.small-file') + await otherMFS.cp(sourceCid, '/testDuplicates/sub/b.small-file') - const rootObject = await otherMFS.stat('/testDups/') + const rootObject = await otherMFS.stat('/testDuplicates/') const rootCid = rootObject.cid const writer = memoryCarWriter(rootCid) diff --git a/packages/dag-cbor/package.json b/packages/dag-cbor/package.json index c2b9f74b3..cc398f286 100644 --- a/packages/dag-cbor/package.json +++ b/packages/dag-cbor/package.json @@ -63,7 +63,7 @@ "progress-events": "^1.0.1" }, "devDependencies": { - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2" }, "sideEffects": false diff --git a/packages/dag-cbor/test/add.spec.ts b/packages/dag-cbor/test/add.spec.ts index eb1e52c74..0b5314511 100644 --- a/packages/dag-cbor/test/add.spec.ts +++ b/packages/dag-cbor/test/add.spec.ts @@ -21,6 +21,7 @@ describe('put', () => { hello: 'world' }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bafyreidykglsfhoixmivffc5uwhcgshx4j465xwqntbmu43nb2dzqwfvae') }) @@ -31,6 +32,7 @@ describe('put', () => { hasher: identity }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bafyqadnbmvugk3dmn5sxo33snrsa') }) }) diff --git a/packages/dag-json/package.json b/packages/dag-json/package.json index 44c159b27..3d729eab1 100644 --- a/packages/dag-json/package.json +++ b/packages/dag-json/package.json @@ -62,7 +62,7 @@ "progress-events": "^1.0.1" }, "devDependencies": { - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2" }, "sideEffects": false diff --git a/packages/dag-json/test/add.spec.ts b/packages/dag-json/test/add.spec.ts index 7a146b9e3..753095892 100644 --- a/packages/dag-json/test/add.spec.ts +++ b/packages/dag-json/test/add.spec.ts @@ -21,6 +21,7 @@ describe('put', () => { hello: 'world' }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('baguqeerasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') }) @@ -31,6 +32,7 @@ describe('put', () => { hasher: identity }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('baguqeaarpmrgqzlmnrxseorco5xxe3deej6q') }) }) diff --git a/packages/helia/package.json b/packages/helia/package.json index 7cd32b2d4..57eaf3e5d 100644 --- a/packages/helia/package.json +++ b/packages/helia/package.json @@ -92,7 +92,7 @@ "devDependencies": { "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.3.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "it-all": "^3.0.6", "it-drain": "^3.0.7" }, diff --git a/packages/helia/src/index.ts b/packages/helia/src/index.ts index bb9200422..f35ced8eb 100644 --- a/packages/helia/src/index.ts +++ b/packages/helia/src/index.ts @@ -56,7 +56,7 @@ export interface DAGWalker { export interface HeliaInit extends HeliaClassInit { /** * A libp2p node is required to perform network operations. Either a - * preconfigured node or options to configure a node can be passed + * pre-configured node or options to configure a node can be passed * here. * * If node options are passed, they will be merged with the default diff --git a/packages/http/package.json b/packages/http/package.json index c2c7e543d..cc7c3dc52 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -63,7 +63,7 @@ }, "devDependencies": { "@libp2p/interface": "^2.2.1", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "interface-datastore": "^8.3.1", "multiformats": "^13.3.1", "sinon": "^19.0.2", diff --git a/packages/interface/package.json b/packages/interface/package.json index fc1296739..f23e4ca9b 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -80,7 +80,7 @@ "progress-events": "^1.0.1" }, "devDependencies": { - "aegir": "^45.0.6" + "aegir": "^45.1.1" }, "sideEffects": false } diff --git a/packages/interop/package.json b/packages/interop/package.json index 334820e9b..b9c0d96be 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -80,7 +80,7 @@ "@libp2p/peer-id": "^5.0.8", "@libp2p/websockets": "^9.0.13", "@multiformats/sha3": "^3.0.2", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "helia": "^5.2.1", "ipfs-unixfs-importer": "^15.3.1", "ipfsd-ctl": "^15.0.2", diff --git a/packages/interop/src/fixtures/create-helia.browser.ts b/packages/interop/src/fixtures/create-helia.browser.ts index 921e73b80..04e02ad26 100644 --- a/packages/interop/src/fixtures/create-helia.browser.ts +++ b/packages/interop/src/fixtures/create-helia.browser.ts @@ -48,7 +48,7 @@ export async function createHeliaNode (libp2pOptions?: Libp2pOptions): Promise { name: 'foobar.baz.', TTL: 60, type: RecordType.TXT, + // spellchecker:disable-next-line data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe/' }])) const result = await name.resolveDNSLink('foobar.baz', { nocache: true }) + // spellchecker:disable-next-line expect(result.cid.toString()).to.equal('bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe', 'doesn\'t support trailing slashes') }) @@ -142,10 +144,12 @@ describe('resolveDNSLink', () => { name: 'foobar.baz.', TTL: 60, type: RecordType.TXT, + // spellchecker:disable-next-line data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe/foobar/path/123' }])) const result = await name.resolveDNSLink('foobar.baz', { nocache: true }) + // spellchecker:disable-next-line expect(result.cid.toString()).to.equal('bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe', 'doesn\'t support trailing slashes') expect(result.path).to.equal('foobar/path/123') }) @@ -210,6 +214,7 @@ describe('resolveDNSLink', () => { name: '_dnslink.delegated.foobar.baz.', TTL: 60, type: RecordType.TXT, + // spellchecker:disable-next-line data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe' }])) @@ -237,6 +242,7 @@ describe('resolveDNSLink', () => { name: '_dnslink.delegated.foobar.baz.', TTL: 60, type: RecordType.TXT, + // spellchecker:disable-next-line data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe' }])) @@ -258,6 +264,7 @@ describe('resolveDNSLink', () => { name: '_dnslink.foobar.baz.', TTL: 60, type: RecordType.TXT, + // spellchecker:disable-next-line data: 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe' } dns.query.withArgs('_dnslink.foobar.baz').resolves(dnsResponse([answer])) diff --git a/packages/json/package.json b/packages/json/package.json index f583638a5..6d8dfd216 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -61,7 +61,7 @@ "progress-events": "^1.0.1" }, "devDependencies": { - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2" }, "sideEffects": false diff --git a/packages/json/test/add.spec.ts b/packages/json/test/add.spec.ts index 871acb9e0..3e195d287 100644 --- a/packages/json/test/add.spec.ts +++ b/packages/json/test/add.spec.ts @@ -21,6 +21,7 @@ describe('put', () => { hello: 'world' }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') }) @@ -31,6 +32,7 @@ describe('put', () => { hasher: identity }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bagaaiaarpmrgqzlmnrxseorco5xxe3deej6q') }) }) diff --git a/packages/mfs/package.json b/packages/mfs/package.json index 303ddef1a..1cb623640 100644 --- a/packages/mfs/package.json +++ b/packages/mfs/package.json @@ -66,7 +66,7 @@ }, "devDependencies": { "@ipld/dag-pb": "^4.1.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2", "datastore-core": "^10.0.2", "delay": "^6.0.0", diff --git a/packages/mfs/src/index.ts b/packages/mfs/src/index.ts index 7613df73f..32a1d69d3 100644 --- a/packages/mfs/src/index.ts +++ b/packages/mfs/src/index.ts @@ -254,6 +254,7 @@ class DefaultMFS implements MFS { constructor (components: MFSComponents, init: MFSInit = {}) { this.components = components + // spellchecker:disable-next-line this.key = new Key(init.key ?? '/locals/filesroot') this.unixfs = unixfs(components) } diff --git a/packages/mfs/test/cp.spec.ts b/packages/mfs/test/cp.spec.ts index c8e946196..7bf481856 100644 --- a/packages/mfs/test/cp.spec.ts +++ b/packages/mfs/test/cp.spec.ts @@ -10,7 +10,7 @@ import { identity } from 'multiformats/hashes/identity' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { type MFS, mfs } from '../src/index.js' import { createShardedDirectory } from './fixtures/create-sharded-directory.js' -import { createSubshardedDirectory } from './fixtures/create-subsharded-directory.js' +import { createSubShardedDirectory } from './fixtures/create-subsharded-directory.js' import type { Blockstore } from 'interface-blockstore' import type { Datastore } from 'interface-datastore' @@ -54,7 +54,7 @@ describe('cp', () => { .with.property('name', 'NotUnixFSError') }) - it('refuses to copy a non-existant file', async () => { + it('refuses to copy a non-existent file', async () => { await expect(fs.cp('/foo.txt', '/bar.txt')).to.eventually.be.rejected .with.property('name', 'DoesNotExistError') }) @@ -125,6 +125,7 @@ describe('cp', () => { const subDirStats = await fs.stat(normalSubDirPath) expect(subDirStats).to.have.nested.property('unixfs.type', 'directory') + // spellchecker:disable-next-line expect(subDirStats.cid.toString()).to.equal('bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354') }) @@ -146,6 +147,7 @@ describe('cp', () => { const fileInDirStats = await fs.stat(fileInDirectoryPath) expect(fileInDirStats).to.have.nested.property('unixfs.type', 'file') + // spellchecker:disable-next-line expect(fileInDirStats.cid.toString()).to.equal('bafybeibyuhrlz5wvmzhn5twibjtpofeek4v6afw3uvk6jkewrdkgivvcea') }) @@ -168,12 +170,12 @@ describe('cp', () => { })).to.eventually.be.undefined() }) - it('copies a file to a sharded directory that creates a subshard', async () => { + it('copies a file to a sharded directory that creates a sub-shard', async () => { const { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore) + } = await createSubShardedDirectory(blockstore) const shardedDirPath = '/sharded-dir' await fs.cp(importerCid, shardedDirPath) diff --git a/packages/mfs/test/fixtures/create-subsharded-directory.ts b/packages/mfs/test/fixtures/create-subsharded-directory.ts index 119f8ac9f..9aafa914a 100644 --- a/packages/mfs/test/fixtures/create-subsharded-directory.ts +++ b/packages/mfs/test/fixtures/create-subsharded-directory.ts @@ -5,7 +5,7 @@ import last from 'it-last' import type { Blockstore } from 'interface-blockstore' import type { CID } from 'multiformats/cid' -export async function createSubshardedDirectory (blockstore: Blockstore, depth: number = 1, files: number = 5000): Promise<{ +export async function createSubShardedDirectory (blockstore: Blockstore, depth: number = 1, files: number = 5000): Promise<{ importerCid: CID containingDirCid: CID fileName: string @@ -23,7 +23,7 @@ export async function createSubshardedDirectory (blockstore: Blockstore, depth: shardSplitThresholdBytes: 1 }) - if (await searchCIDForSubshards(containingDirCid, blockstore, depth)) { + if (await searchCIDForSubShards(containingDirCid, blockstore, depth)) { count = i break @@ -31,7 +31,7 @@ export async function createSubshardedDirectory (blockstore: Blockstore, depth: } if (fileName == null) { - throw new Error('could not find file that would create a subshard') + throw new Error('could not find file that would create a sub-shard') } // create a shard with the importer that is the same as the directory after we delete the file that causes a sub-shard to be created @@ -59,11 +59,11 @@ export async function createSubshardedDirectory (blockstore: Blockstore, depth: } } -async function searchCIDForSubshards (cid: CID, blockstore: Blockstore, depth: number = 1): Promise { +async function searchCIDForSubShards (cid: CID, blockstore: Blockstore, depth: number = 1): Promise { const block = await blockstore.get(cid) const node = dagPb.decode(block) - // search links for subshard + // search links for sub-shard for (const link of node.Links) { if (link.Name?.length === 2) { const block = await blockstore.get(link.Hash) @@ -71,18 +71,18 @@ async function searchCIDForSubshards (cid: CID, blockstore: Blockstore, depth: n const firstLink = node.Links[1] if (firstLink == null) { - throw new Error('Subshard had no child links') + throw new Error('Sub-shard had no child links') } if (firstLink.Name == null) { - throw new Error('Subshard child had no name') + throw new Error('Sub-shard child had no name') } if (depth === 1) { return true } - if (await searchCIDForSubshards(link.Hash, blockstore, depth - 1)) { + if (await searchCIDForSubShards(link.Hash, blockstore, depth - 1)) { return true } } diff --git a/packages/mfs/test/rm.spec.ts b/packages/mfs/test/rm.spec.ts index ee1ea8727..2690777d6 100644 --- a/packages/mfs/test/rm.spec.ts +++ b/packages/mfs/test/rm.spec.ts @@ -7,7 +7,7 @@ import { importer } from 'ipfs-unixfs-importer' import last from 'it-last' import { type MFS, mfs } from '../src/index.js' import { createShardedDirectory } from './fixtures/create-sharded-directory.js' -import { createSubshardedDirectory } from './fixtures/create-subsharded-directory.js' +import { createSubShardedDirectory } from './fixtures/create-subsharded-directory.js' import { smallFile } from './fixtures/files.js' import type { Blockstore } from 'interface-blockstore' import type { Datastore } from 'interface-datastore' @@ -187,12 +187,12 @@ describe('rm', () => { expect(dirStats.cid.toString()).to.equal(importerCid.toString()) }) - it('results in the same hash as a sharded directory created by the importer when removing a subshard', async function () { + it('results in the same hash as a sharded directory created by the importer when removing a sub-shard', async function () { const { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore) + } = await createSubShardedDirectory(blockstore) await fs.cp(importerCid, '/importer-dir') await expect(fs.stat('/importer-dir')).to.eventually.have.nested.property('unixfs.type', 'hamt-sharded-directory') @@ -201,7 +201,7 @@ describe('rm', () => { const dirPath = `/${dirName}` await fs.cp(containingDirCid, dirPath) - // remove the file that caused the subshard to be created and the CID should be the same as the importer + // remove the file that caused the sub-shard to be created and the CID should be the same as the importer await fs.rm(`${dirPath}/${fileName}`, { shardSplitThresholdBytes: 1 }) @@ -214,12 +214,12 @@ describe('rm', () => { expect(dirStats.cid.toString()).to.equal(importerCid.toString(), 'removing a file from the imported dir did not result in the same CID') }) - it('results in the same hash as a sharded directory created by the importer when removing a subshard of a subshard', async function () { + it('results in the same hash as a sharded directory created by the importer when removing a sub-shard of a sub-shard', async function () { const { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore, 2) + } = await createSubShardedDirectory(blockstore, 2) await fs.cp(importerCid, '/importer-dir') await expect(fs.stat('/importer-dir')).to.eventually.have.nested.property('unixfs.type', 'hamt-sharded-directory') @@ -228,7 +228,7 @@ describe('rm', () => { const dirPath = `/${dirName}` await fs.cp(containingDirCid, dirPath) - // remove the file that caused the subshard to be created and the CID should be the same as the importer + // remove the file that caused the sub-shard to be created and the CID should be the same as the importer await fs.rm(`${dirPath}/${fileName}`, { shardSplitThresholdBytes: 1 }) diff --git a/packages/routers/package.json b/packages/routers/package.json index adda42212..3415b8ddd 100644 --- a/packages/routers/package.json +++ b/packages/routers/package.json @@ -67,7 +67,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.7", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "it-all": "^3.0.6", "it-drain": "^3.0.7", "sinon-ts": "^2.0.0" diff --git a/packages/strings/package.json b/packages/strings/package.json index a7b585f8c..a52b5bf2b 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -64,7 +64,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2" }, "sideEffects": false diff --git a/packages/strings/test/add.spec.ts b/packages/strings/test/add.spec.ts index 47a414bd9..41c6ada23 100644 --- a/packages/strings/test/add.spec.ts +++ b/packages/strings/test/add.spec.ts @@ -20,6 +20,7 @@ describe('put', () => { it('adds a string', async () => { const cid = await str.add('hello world') + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bafkreifzjut3te2nhyekklss27nh3k72ysco7y32koao5eei66wof36n5e') }) @@ -28,6 +29,7 @@ describe('put', () => { hasher: identity }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bafkqac3imvwgy3zao5xxe3de') }) @@ -36,6 +38,7 @@ describe('put', () => { codec: json }) + // spellchecker:disable-next-line expect(`${cid}`).to.equal('bagaaieraxfgspomtju7arjjokll5u7nl7lcij37dpjjyb3uqrd32zyxpzxuq') }) }) diff --git a/packages/unixfs/package.json b/packages/unixfs/package.json index 7308eea56..4d0ff1249 100644 --- a/packages/unixfs/package.json +++ b/packages/unixfs/package.json @@ -95,7 +95,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "aegir": "^45.0.6", + "aegir": "^45.1.1", "blockstore-core": "^5.0.2", "delay": "^6.0.0", "iso-url": "^1.2.1", diff --git a/packages/unixfs/src/commands/utils/add-link.ts b/packages/unixfs/src/commands/utils/add-link.ts index 30e9c69e1..da9c60c81 100644 --- a/packages/unixfs/src/commands/utils/add-link.ts +++ b/packages/unixfs/src/commands/utils/add-link.ts @@ -165,7 +165,7 @@ const addToShardedDirectory = async (parent: Directory, child: Required, throw new AlreadyExistsError() } - log('overwriting %s in subshard', child.Name) + log('overwriting %s in sub-shard', child.Name) finalSegment.node.Links = finalSegment.node.Links.filter(l => l.Name !== linkName) finalSegment.node.Links.push({ Name: linkName, @@ -173,10 +173,10 @@ const addToShardedDirectory = async (parent: Directory, child: Required, Tsize: child.Tsize }) } else if (existingLink.Name?.length === 2) { - throw new Error('Existing link was subshard?!') + throw new Error('Existing link was sub-shard?!') } else { // conflict, add a new HAMT segment - log('prefix %s already exists, creating new subshard', prefix) + log('prefix %s already exists, creating new sub-shard', prefix) // find the sibling we are going to replace const index = finalSegment.node.Links.findIndex(l => l.Name?.startsWith(prefix)) const sibling = finalSegment.node.Links.splice(index, 1)[0] @@ -186,7 +186,7 @@ const addToShardedDirectory = async (parent: Directory, child: Required, const wrapped = wrapHash(hamtHashFn) const siblingHash = wrapped(uint8ArrayFromString(siblingName)) - // discard hash bits until we reach the subshard depth + // discard hash bits until we reach the sub-shard depth for (let i = 0; i < path.length; i++) { await siblingHash.take(hamtBucketBits) } diff --git a/packages/unixfs/src/commands/utils/dir-sharded.ts b/packages/unixfs/src/commands/utils/dir-sharded.ts index a8107914b..33562b9b7 100644 --- a/packages/unixfs/src/commands/utils/dir-sharded.ts +++ b/packages/unixfs/src/commands/utils/dir-sharded.ts @@ -161,7 +161,7 @@ async function * flush (bucket: Bucket, blockstore } if (shard == null) { - throw new Error('Could not flush sharded directory, no subshard found') + throw new Error('Could not flush sharded directory, no sub-shard found') } links.push({ diff --git a/packages/unixfs/src/commands/utils/remove-link.ts b/packages/unixfs/src/commands/utils/remove-link.ts index 61128a8ee..8f1097605 100644 --- a/packages/unixfs/src/commands/utils/remove-link.ts +++ b/packages/unixfs/src/commands/utils/remove-link.ts @@ -96,7 +96,7 @@ const removeFromShardedDirectory = async (parent: Directory, name: string, block finalSegment.children.unset(index) if (finalSegment.node.Links.length === 1) { - // replace the subshard with the last remaining file in the parent + // replace the sub-shard with the last remaining file in the parent while (true) { if (path.length === 1) { break diff --git a/packages/unixfs/src/errors.ts b/packages/unixfs/src/errors.ts index 22614c6bb..2ff6f82de 100644 --- a/packages/unixfs/src/errors.ts +++ b/packages/unixfs/src/errors.ts @@ -18,7 +18,7 @@ export class NotUnixFSError extends UnixFSError { export class InvalidPBNodeError extends UnixFSError { constructor (message = 'invalid PBNode') { - super(message, 'InvalidPBNodeError', 'ERR_INVALID_PBNODE') + super(message, 'InvalidPBNodeError', 'ERR_INVALID_PB_NODE') } } diff --git a/packages/unixfs/src/index.ts b/packages/unixfs/src/index.ts index b1596b8cd..6956d1a0b 100644 --- a/packages/unixfs/src/index.ts +++ b/packages/unixfs/src/index.ts @@ -233,7 +233,7 @@ export interface RmOptions extends AbortOptions, ProgressOptions { /** - * An optional path to allow statting paths inside directories + * An optional path to allow getting stats of paths inside directories */ path?: string diff --git a/packages/unixfs/test/add.spec.ts b/packages/unixfs/test/add.spec.ts index dbc9e9be9..13fd1d819 100644 --- a/packages/unixfs/test/add.spec.ts +++ b/packages/unixfs/test/add.spec.ts @@ -28,7 +28,9 @@ describe('addAll', () => { }])) expect(output).to.have.lengthOf(2) + // spellchecker:disable-next-line expect(output[0].cid.toString()).to.equal('bafkreiaixnpf23vkyecj5xqispjq5ubcwgsntnnurw2bjby7khe4wnjihu') + // spellchecker:disable-next-line expect(output[1].cid.toString()).to.equal('bafkreidmuy2n45xj3cdknzprtzo2uvgm3hak6mzy5sllxty457agsftd34') }) @@ -39,6 +41,7 @@ describe('addAll', () => { const res = await last(fs.addAll(globSource('./test/fixtures', 'files/**/*'))) + // spellchecker:disable-next-line expect(res?.cid.toString()).to.equal('bafybeievhllpjjjbyg53g74wcl5hckdccjjj7zgtexqcacjegoduegnkyu') }) }) @@ -56,6 +59,7 @@ describe('addBytes', () => { it('adds bytes', async () => { const cid = await fs.addBytes(Uint8Array.from([0, 1, 2, 3, 4])) + // spellchecker:disable-next-line expect(cid.toString()).to.equal('bafkreiaixnpf23vkyecj5xqispjq5ubcwgsntnnurw2bjby7khe4wnjihu') }) }) @@ -73,6 +77,7 @@ describe('addByteStream', () => { it('adds bytes', async () => { const cid = await fs.addByteStream([Uint8Array.from([0, 1, 2, 3, 4])]) + // spellchecker:disable-next-line expect(cid.toString()).to.equal('bafkreiaixnpf23vkyecj5xqispjq5ubcwgsntnnurw2bjby7khe4wnjihu') }) }) @@ -92,12 +97,14 @@ describe('addFile', () => { content: Uint8Array.from([0, 1, 2, 3, 4]) }) + // spellchecker:disable-next-line expect(cid.toString()).to.equal('bafkreiaixnpf23vkyecj5xqispjq5ubcwgsntnnurw2bjby7khe4wnjihu') }) it('adds a file from a URL', async () => { const cid = await fs.addFile(urlSource(new URL(`${process.env.ECHO_SERVER}/download?data=hello-world`))) + // spellchecker:disable-next-line expect(cid.toString()).to.equal('bafkreifpuj5ujvb3aku75ja5cphnylsac3h47b6f3p4zbzmtm2nkrtrinu') }) }) @@ -117,12 +124,14 @@ describe('addDirectory', () => { cidVersion: 0 }) + // spellchecker:disable-next-line expect(cid.toString()).to.equal('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn') }) it('adds an empty directory with no args', async () => { const cid = await fs.addDirectory() + // spellchecker:disable-next-line expect(cid.toString()).to.equal('bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354') }) }) diff --git a/packages/unixfs/test/cp.spec.ts b/packages/unixfs/test/cp.spec.ts index b932133cc..a24bed246 100644 --- a/packages/unixfs/test/cp.spec.ts +++ b/packages/unixfs/test/cp.spec.ts @@ -9,7 +9,7 @@ import { identity } from 'multiformats/hashes/identity' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { unixfs, type UnixFS } from '../src/index.js' import { createShardedDirectory } from './fixtures/create-sharded-directory.js' -import { createSubshardedDirectory } from './fixtures/create-subsharded-directory.js' +import { createSubShardedDirectory } from './fixtures/create-subsharded-directory.js' import { smallFile } from './fixtures/files.js' import type { Blockstore } from 'interface-blockstore' @@ -167,12 +167,12 @@ describe('cp', () => { })).to.eventually.be.ok() }) - it('copies a file to a sharded directory that creates a subshard', async () => { + it('copies a file to a sharded directory that creates a sub-shard', async () => { const { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore) + } = await createSubShardedDirectory(blockstore) // adding a file to the importer CID should result in the shard with a subshard const fileCid = CID.parse('bafkreiaixnpf23vkyecj5xqispjq5ubcwgsntnnurw2bjby7khe4wnjihu') diff --git a/packages/unixfs/test/fixtures/create-subsharded-directory.ts b/packages/unixfs/test/fixtures/create-subsharded-directory.ts index 697623a04..ae044a5c5 100644 --- a/packages/unixfs/test/fixtures/create-subsharded-directory.ts +++ b/packages/unixfs/test/fixtures/create-subsharded-directory.ts @@ -5,7 +5,7 @@ import { unixfs } from '../../src/index.js' import type { Blockstore } from 'interface-blockstore' import type { CID } from 'multiformats/cid' -export async function createSubshardedDirectory (blockstore: Blockstore, depth: number = 1, files: number = 5000): Promise<{ +export async function createSubShardedDirectory (blockstore: Blockstore, depth: number = 1, files: number = 5000): Promise<{ importerCid: CID containingDirCid: CID fileName: string @@ -31,7 +31,7 @@ export async function createSubshardedDirectory (blockstore: Blockstore, depth: } if (fileName == null) { - throw new Error('could not find file that would create a subshard') + throw new Error('could not find file that would create a sub-shard') } // create a shard with the importer that is the same as the directory after we delete the file that causes a sub-shard to be created @@ -63,7 +63,7 @@ async function searchCIDForSubshards (cid: CID, blockstore: Blockstore, depth: n const block = await blockstore.get(cid) const node = dagPb.decode(block) - // search links for subshard + // search links for sub-shard for (const link of node.Links) { if (link.Name?.length === 2) { const block = await blockstore.get(link.Hash) @@ -71,11 +71,11 @@ async function searchCIDForSubshards (cid: CID, blockstore: Blockstore, depth: n const firstLink = node.Links[1] if (firstLink == null) { - throw new Error('Subshard had no child links') + throw new Error('Sub-shard had no child links') } if (firstLink.Name == null) { - throw new Error('Subshard child had no name') + throw new Error('Sub-shard child had no name') } if (depth === 1) { diff --git a/packages/unixfs/test/rm.spec.ts b/packages/unixfs/test/rm.spec.ts index fad81c62d..13a1026b8 100644 --- a/packages/unixfs/test/rm.spec.ts +++ b/packages/unixfs/test/rm.spec.ts @@ -6,7 +6,7 @@ import { importer } from 'ipfs-unixfs-importer' import last from 'it-last' import { unixfs, type UnixFS } from '../src/index.js' import { createShardedDirectory } from './fixtures/create-sharded-directory.js' -import { createSubshardedDirectory } from './fixtures/create-subsharded-directory.js' +import { createSubShardedDirectory } from './fixtures/create-subsharded-directory.js' import { smallFile } from './fixtures/files.js' import type { Blockstore } from 'interface-blockstore' import type { CID } from 'multiformats/cid' @@ -175,17 +175,17 @@ describe('rm', () => { expect(containingDirCid).to.eql(importerCid) }) - it('results in the same hash as a sharded directory created by the importer when removing a subshard', async function () { + it('results in the same hash as a sharded directory created by the importer when removing a sub-shard', async function () { const { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore) + } = await createSubShardedDirectory(blockstore) await expect(fs.stat(importerCid)) .to.eventually.have.nested.property('unixfs.type', 'hamt-sharded-directory') - // remove the file that caused the subshard to be created and the CID should be the same as the importer + // remove the file that caused the sub-shard to be created and the CID should be the same as the importer const finalDirCid = await fs.rm(containingDirCid, fileName, { shardSplitThresholdBytes: 1 }) @@ -197,17 +197,17 @@ describe('rm', () => { expect(finalDirCid).to.eql(importerCid, 'removing a file from the imported dir not result in the same CID') }) - it('results in the same hash as a sharded directory created by the importer when removing a subshard of a subshard', async function () { + it('results in the same hash as a sharded directory created by the importer when removing a sub-shard of a sub-shard', async function () { let { containingDirCid, fileName, importerCid - } = await createSubshardedDirectory(blockstore, 2) + } = await createSubShardedDirectory(blockstore, 2) await expect(fs.stat(importerCid)) .to.eventually.have.nested.property('unixfs.type', 'hamt-sharded-directory') - // remove the file that caused the subshard to be created and the CID should be the same as the importer + // remove the file that caused the sub-shard to be created and the CID should be the same as the importer containingDirCid = await fs.rm(containingDirCid, fileName, { shardSplitThresholdBytes: 1 }) diff --git a/packages/unixfs/test/stat.spec.ts b/packages/unixfs/test/stat.spec.ts index 7f1202597..14f78ceba 100644 --- a/packages/unixfs/test/stat.spec.ts +++ b/packages/unixfs/test/stat.spec.ts @@ -161,7 +161,7 @@ describe('stat', function () { }) }) - it('sstats a sharded directory', async function () { + it('stats a sharded directory', async function () { const mtime = { secs: 5n, nsecs: 0 diff --git a/packages/utils/package.json b/packages/utils/package.json index 354351e85..69575d2b6 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -82,7 +82,7 @@ "@libp2p/crypto": "^5.0.7", "@libp2p/peer-id": "^5.0.8", "@types/sinon": "^17.0.3", - "aegir": "^45.0.6", + "aegir": "^45.1.1", "datastore-core": "^10.0.2", "delay": "^6.0.0", "it-all": "^3.0.6", diff --git a/packages/utils/src/abstract-session.ts b/packages/utils/src/abstract-session.ts index c20334456..d889166bc 100644 --- a/packages/utils/src/abstract-session.ts +++ b/packages/utils/src/abstract-session.ts @@ -24,7 +24,7 @@ export interface BlockstoreSessionEvents { } export abstract class AbstractSession extends TypedEventEmitter> implements BlockBroker { - private intialPeerSearchComplete?: Promise + private initialPeerSearchComplete?: Promise private readonly requests: Map> private readonly name: string protected log: Logger @@ -64,13 +64,13 @@ export abstract class AbstractSession Date: Mon, 24 Feb 2025 10:25:31 +0000 Subject: [PATCH 2/2] chore: update expected length --- .github/workflows/main.yml | 4 +--- packages/car/test/index.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f2b1c06d..0da5dea6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,9 +30,7 @@ jobs: - run: npm run --if-present lint - run: npm run --if-present dep-check - run: npm run --if-present doc-check - - uses: streetsidesoftware/cspell-action@ef95dc49d631fc2a9e9ea089ae2b2127b7c4588e # v6.10.0 - with: - use_cspell_files: true + - run: npm run --if-present spell-check test-node: needs: build diff --git a/packages/car/test/index.spec.ts b/packages/car/test/index.spec.ts index 5174cb9ab..e8303c9a3 100644 --- a/packages/car/test/index.spec.ts +++ b/packages/car/test/index.spec.ts @@ -143,7 +143,7 @@ describe('import/export car file', () => { }) const carBytes = await writer.bytes() - expect(carBytes.length).to.equal(349) + expect(carBytes.length).to.equal(351) }) it('exports a car file with duplicates', async () => { @@ -167,6 +167,6 @@ describe('import/export car file', () => { await otherCar.export(rootCid, writer) const carBytes = await writer.bytes() - expect(carBytes.length).to.equal(399) + expect(carBytes.length).to.equal(401) }) })