Skip to content

Commit

Permalink
docs: add spell checker to ci
Browse files Browse the repository at this point in the history
Adds cspell to CI to catch typos in code and docs.
  • Loading branch information
achingbrain committed Feb 24, 2025
1 parent 2c7185c commit b9ec6c7
Show file tree
Hide file tree
Showing 64 changed files with 241 additions and 198 deletions.
11 changes: 11 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"import": [
"./node_modules/aegir/cspell.json"
],
"dictionaries": ["project"],
"dictionaryDefinitions": [{
"name": "project",
"path": "./.github/dictionary.txt",
"addWords": true
}]
}
Empty file added .github/dictionary.txt
Empty file.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -44,17 +44,17 @@ 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

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

Expand Down
104 changes: 52 additions & 52 deletions benchmarks/add-dir/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion benchmarks/add-dir/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/gc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pinning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/transports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/transports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/transports/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Impl {
listen?(relay: Multiaddr): string
}

const webRTCimpls: Record<string, Impl> = {
const webRTCImpls: Record<string, Impl> = {
chromium: {
type: 'helia',
exec: PLAYWRIGHT,
Expand All @@ -46,7 +46,7 @@ const webRTCimpls: Record<string, Impl> = {
}
}

const webSocketimpls: Record<string, Impl> = {
const webSocketImpls: Record<string, Impl> = {
'node.js': {
type: 'helia',
listen: () => '/ip4/127.0.0.1/tcp/0/ws'
Expand Down Expand Up @@ -119,9 +119,9 @@ function addTests (name: string, impls: Record<string, Impl>, 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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
"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",
"docs": "aegir docs",
"docs:no-publish": "aegir docs --publish false"
},
"devDependencies": {
"aegir": "^45.0.1",
"aegir": "^45.1.1",
"npm-run-all": "^4.1.5"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/bitswap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/bitswap/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export class Network extends TypedEventEmitter<NetworkEvents> {

// 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([
Expand Down
4 changes: 2 additions & 2 deletions packages/bitswap/src/pb/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -26,7 +26,7 @@ message Block {

enum BlockPresenceType {
HaveBlock = 0;
DontHaveBlock = 1;
DoNotHaveBlock = 1;
}

message BlockPresence {
Expand Down
12 changes: 6 additions & 6 deletions packages/bitswap/src/pb/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface WantlistEntry {
priority: number
cancel?: boolean
wantType?: WantType
sendDontHave?: boolean
sendDoNotHave?: boolean
}

export namespace WantlistEntry {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -98,7 +98,7 @@ export namespace WantlistEntry {
break
}
case 5: {
obj.sendDontHave = reader.bool()
obj.sendDoNotHave = reader.bool()
break
}
default: {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/bitswap/src/peer-want-lists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class PeerWantLists {
cid,
priority: entry.priority,
wantType: entry.wantType ?? WantType.WantBlock,
sendDontHave: entry.sendDontHave ?? false
sendDoNotHave: entry.sendDoNotHave ?? false
})
}
}
Expand Down
12 changes: 6 additions & 6 deletions packages/bitswap/src/peer-want-lists/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bitswap/src/utils/merge-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit b9ec6c7

Please sign in to comment.