Skip to content

Commit 31eb6f7

Browse files
authored
docs: update project config and readmes (#47)
Updates config to build all docs and simplify readmes.
1 parent b130c17 commit 31eb6f7

File tree

13 files changed

+135
-71
lines changed

13 files changed

+135
-71
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Semantic PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
uses: pl-strflt/.github/.github/workflows/[email protected]

.github/workflows/stale.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,12 @@ name: Close and mark stale issue
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: '0 0 * * *'
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
610

711
jobs:
812
stale:
9-
10-
runs-on: ubuntu-latest
11-
permissions:
12-
issues: write
13-
pull-requests: write
14-
15-
steps:
16-
- uses: actions/stale@v3
17-
with:
18-
repo-token: ${{ secrets.GITHUB_TOKEN }}
19-
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
20-
close-issue-message: 'This issue was closed because it is missing author input.'
21-
stale-issue-label: 'kind/stale'
22-
any-of-labels: 'need/author-input'
23-
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
24-
days-before-issue-stale: 6
25-
days-before-issue-close: 7
26-
enable-statistics: true
13+
uses: pl-strflt/.github/.github/workflows/[email protected]

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,18 @@
44
</a>
55
</p>
66

7-
# helia-delegated-routing-v1-http-api <!-- omit in toc -->
8-
97
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
108
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
119
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
1210
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
1311

1412
> The Delegated Routing V1 HTTP API powered by Helia
1513
16-
This repo contains a server implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) along with a client that can be used to interact with any compliant server implementation.
17-
18-
## Table of contents <!-- omit in toc -->
14+
## About
1915

20-
- [Structure](#structure)
21-
- [API Docs](#api-docs)
22-
- [License](#license)
23-
- [Contribute](#contribute)
16+
This repo contains a server implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) along with a client that can be used to interact with any compliant server implementation.
2417

25-
## Structure
18+
## Packages
2619

2720
- [`/packages/client`](./packages/client) A Delegated Routing V1 HTTP API client
2821
- [`/packages/interop`](./packages/interop) Interop tests for the Delegated Routing V1 HTTP API server powered by Helia

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"dep-check": "aegir run dep-check",
3333
"release": "run-s build docs:no-publish npm:release docs",
3434
"npm:release": "aegir run release",
35-
"docs": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs -- --exclude packages/interop --excludeExternals",
36-
"docs:no-publish": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude packages/interop"
35+
"docs": "aegir docs",
36+
"docs:no-publish": "aegir docs --publish false"
3737
},
3838
"devDependencies": {
3939
"aegir": "^41.0.0",

packages/client/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,30 @@
44
</a>
55
</p>
66

7-
# @helia/delegated-routing-v1-http-api-client <!-- omit in toc -->
8-
97
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
108
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
119
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
1210
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
1311

1412
> A Delegated Routing V1 HTTP API client
1513
16-
A client implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) that can be used to interact with any compliant server implementation.
14+
## About
15+
16+
A client implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/)
17+
that can be used to interact with any compliant server implementation.
18+
19+
### Example
1720

18-
## Table of contents <!-- omit in toc -->
21+
```typescript
22+
import { createRoutingV1HttpApiClient } from '@helia/routing-v1-http-api-client'
23+
import { CID } from 'multiformats/cid'
1924

20-
- [Install](#install)
21-
- [API Docs](#api-docs)
22-
- [License](#license)
23-
- [Contribute](#contribute)
25+
const client = createRoutingV1HttpApiClient(new URL('https://example.org'))
26+
27+
for await (const prov of getProviders(CID.parse('QmFoo'))) {
28+
// ...
29+
}
30+
```
2431

2532
## Install
2633

packages/client/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* @packageDocumentation
33
*
4-
* Create a client to use with a Routing V1 HTTP API server.
4+
* A client implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/)
5+
* that can be used to interact with any compliant server implementation.
56
*
67
* @example
78
*

packages/client/typedoc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"entryPoints": [
33
"./src/index.ts"
4-
]
4+
],
5+
"readme": "none",
6+
"includeVersion": true
57
}

packages/interop/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,13 @@
44
</a>
55
</p>
66

7-
# @helia/delegated-routing-v1-http-api-interop <!-- omit in toc -->
8-
97
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
108
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
119
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
1210
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
1311

1412
> Interop tests for the Delegated Routing V1 HTTP API server powered by Helia
1513
16-
## Table of contents <!-- omit in toc -->
17-
18-
- [Install](#install)
19-
- [License](#license)
20-
- [Contribute](#contribute)
21-
22-
## Install
23-
24-
```console
25-
$ npm i @helia/delegated-routing-v1-http-api-interop
26-
```
27-
2814
## License
2915

3016
Licensed under either of

packages/interop/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
"!dist/test",
2323
"!**/*.tsbuildinfo"
2424
],
25-
"exports": {
26-
".": {
27-
"types": "./dist/src/index.d.ts",
28-
"import": "./dist/src/index.js"
29-
}
30-
},
3125
"eslintConfig": {
3226
"extends": "ipfs",
3327
"parserOptions": {

packages/server/README.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,64 @@
44
</a>
55
</p>
66

7-
# @helia/delegated-routing-v1-http-api-server <!-- omit in toc -->
8-
97
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
108
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
119
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
1210
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
1311

1412
> A Delegated Routing V1 HTTP API server powered by Helia
1513
16-
A server implementation of the IPFS [Delegated Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/).
14+
## About
15+
16+
Implements HTTP routes for a Fastify server that conform to the [Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/).
17+
18+
### Example
19+
20+
```typescript
21+
import { createHelia } from 'helia'
22+
import { createRoutingV1HttpApiServer } from '@helia/routing-v1-http-api-server'
23+
24+
const helia = await createHelia()
25+
const server = await createRoutingV1HttpApiServer(helia, {
26+
listen: {
27+
// fastify listen options
28+
}
29+
})
30+
31+
// now make http requests
32+
```
33+
34+
Alternatively if you have a Fastify instance already you can add routes to it.
35+
,
36+
37+
### Example
38+
39+
```typescript
40+
import fastify from 'fastify'
41+
import cors from '@fastify/cors'
42+
import { createHelia } from 'helia'
43+
import routes from '@helia/routing-v1-http-api-server/routes'
44+
45+
const server = fastify({
46+
// fastify options
47+
})
48+
await server.register(cors, {
49+
origin: '*',
50+
methods: ['GET', 'OPTIONS'],
51+
strictPreflight: false
52+
})
1753

18-
## Table of contents <!-- omit in toc -->
54+
const helia = await createHelia()
1955

20-
- [Install](#install)
21-
- [API Docs](#api-docs)
22-
- [License](#license)
23-
- [Contribute](#contribute)
56+
// configure Routing V1 HTTP API routes
57+
routes(server, helia)
58+
59+
await server.listen({
60+
// fastify listen options
61+
})
62+
63+
// now make http requests
64+
```
2465

2566
## Install
2667

0 commit comments

Comments
 (0)