Skip to content

Commit 149e3b9

Browse files
authored
docs: publish api docs (libp2p#51)
Updates project config to publish api docs
1 parent 0a597f1 commit 149e3b9

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node_modules
2-
coverage
3-
.nyc_output
2+
dist
3+
.docs
4+
.coverage
5+
node_modules
46
package-lock.json
57
yarn.lock
6-
docs
7-
dist

README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# @libp2p/peer-store <!-- omit in toc -->
22

33
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4-
[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
54
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
65
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-peer-store.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-store)
7-
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-peer-store/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-peer-store/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
87

98
> Stores information about peers libp2p knows on the network
109
1110
## Table of contents <!-- omit in toc -->
1211

1312
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
1414
- [Description](#description)
1515
- [Submitting records to the PeerStore](#submitting-records-to-the-peerstore)
1616
- [Identify](#identify)
@@ -31,15 +31,24 @@
3131
- [Events](#events)
3232
- [Data Persistence](#data-persistence)
3333
- [Future Considerations](#future-considerations)
34+
- [API Docs](#api-docs)
3435
- [License](#license)
35-
- [Contribute](#contribute)
36+
- [Contribution](#contribution)
3637

3738
## Install
3839

3940
```console
4041
$ npm i @libp2p/peer-store
4142
```
4243

44+
### Browser `<script>` tag
45+
46+
Loading this module through a script tag will make it's exports available as `Libp2pPeerStore` in the global namespace.
47+
48+
```html
49+
<script src="https://unpkg.com/@libp2p/peer-store/dist/index.min.js"></script>
50+
```
51+
4352
## Description
4453

4554
Libp2p's PeerStore is responsible for keeping an updated register with the relevant information of the known peers. It should be the single source of truth for all peer data, where a subsystem can learn about peers' data and where someone can listen for updates. The PeerStore comprises four main components: `addressBook`, `keyBook`, `protocolBook` and `metadataBook`.
@@ -190,14 +199,18 @@ Metadata is stored under the following key pattern:
190199
- When improving libp2p configuration for specific runtimes, we should take into account the PeerStore recommended datastore.
191200
- When improving libp2p configuration, we should think about a possible way of allowing the configuration of Bootstrap to be influenced by the persisted peers, as a way to decrease the load on Bootstrap nodes.
192201

202+
## API Docs
203+
204+
- <https://libp2p.github.io/js-libp2p-peer-store>
205+
193206
## License
194207

195208
Licensed under either of
196209

197210
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
198211
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
199212

200-
## Contribute
213+
## Contribution
201214

202215
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
203216

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"types": "./dist/src/index.d.ts",
2323
"files": [
2424
"src",
25-
"dist/src",
25+
"dist",
2626
"!dist/test",
2727
"!**/*.tsbuildinfo"
2828
],
@@ -140,7 +140,8 @@
140140
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
141141
"test:node": "aegir test -t node --cov",
142142
"test:electron-main": "aegir test -t electron-main",
143-
"release": "aegir release"
143+
"release": "aegir release",
144+
"docs": "aegir docs"
144145
},
145146
"dependencies": {
146147
"@libp2p/interface-peer-id": "^1.0.4",
@@ -154,10 +155,10 @@
154155
"@multiformats/multiaddr": "^11.0.0",
155156
"err-code": "^3.0.1",
156157
"interface-datastore": "^7.0.0",
157-
"it-all": "^1.0.6",
158-
"it-filter": "^1.0.3",
159-
"it-foreach": "^0.1.1",
160-
"it-map": "^1.0.6",
158+
"it-all": "^2.0.0",
159+
"it-filter": "^2.0.0",
160+
"it-foreach": "^1.0.0",
161+
"it-map": "^2.0.0",
161162
"it-pipe": "^2.0.3",
162163
"mortice": "^3.0.0",
163164
"multiformats": "^10.0.0",
@@ -175,6 +176,6 @@
175176
"p-defer": "^4.0.0",
176177
"p-wait-for": "^5.0.0",
177178
"protons": "^6.0.0",
178-
"sinon": "^14.0.0"
179+
"sinon": "^15.0.1"
179180
}
180181
}

0 commit comments

Comments
 (0)