Skip to content

Commit 861957a

Browse files
authored
docs: publish api docs for all modules (libp2p#39)
Updates project config and publishes tsdocs for all child projects of this repo
1 parent 900b96b commit 861957a

File tree

9 files changed

+62
-21
lines changed

9 files changed

+62
-21
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
build
88
dist
9-
docs
9+
.docs
1010

1111
# Dependency directory
1212
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
1313
node_modules
1414
# Lock files
1515
package-lock.json
16-
yarn.lock
16+
yarn.lock

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
; package-lock with tarball deps breaks lerna/nx - remove when https://github.com/semantic-release/github/pull/487 is merged
2+
package-lock=false

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
# js-libp2p-peer-id <!-- 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-id.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-id)
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-id/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-peer-id/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-peer-id/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
87

98
> PeerId implementation and factory in JavaScript
109
1110
## Table of contents <!-- omit in toc -->
1211

1312
- [Structure](#structure)
13+
- [API Docs](#api-docs)
1414
- [License](#license)
15-
- [Contribution](#contribution)
15+
- [Contribute](#contribute)
1616

1717
## Structure
1818

1919
- [`/packages/libp2p-peer-id`](./packages/libp2p-peer-id) Implementation of @libp2p/interface-peer-id
2020
- [`/packages/libp2p-peer-id-factory`](./packages/libp2p-peer-id-factory) Create PeerId instances
2121

22+
## API Docs
23+
24+
- <https://libp2p.github.io/js-libp2p-peer-id>
25+
2226
## License
2327

2428
Licensed under either of
2529

2630
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
2731
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
2832

29-
## Contribution
33+
## Contribute
3034

3135
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.

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lerna": "4.0.0",
2+
"lerna": "5.0.0",
33
"useWorkspaces": true,
44
"version": "independent",
55
"command": {

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@
3434
"generate": "lerna run generate",
3535
"build": "lerna run build",
3636
"lint": "lerna run lint",
37+
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs",
38+
"docs:no-publish": "npm run docs -- --publish false",
3739
"dep-check": "lerna run dep-check",
38-
"release": "lerna run --concurrency 1 release -- --"
40+
"release": "npm run docs:no-publish && lerna run --concurrency 1 release && npm run docs"
3941
},
4042
"dependencies": {
43+
"aegir": "^37.7.5",
4144
"lerna": "^5.0.0",
4245
"rimraf": "^3.0.2"
4346
},

packages/libp2p-peer-id-factory/README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
# @libp2p/peer-id-factory <!-- 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-id.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-id)
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-id/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-peer-id/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-peer-id/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
87

98
> Create PeerId instances
109
1110
## Table of contents <!-- omit in toc -->
1211

1312
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
1414
- [Description](#description)
1515
- [Example](#example)
16+
- [API Docs](#api-docs)
1617
- [License](#license)
17-
- [Contribution](#contribution)
18+
- [Contribute](#contribute)
1819

1920
## Install
2021

2122
```console
2223
$ npm i @libp2p/peer-id-factory
2324
```
2425

26+
### Browser `<script>` tag
27+
28+
Loading this module through a script tag will make it's exports available as `Libp2pPeerIdFactory` in the global namespace.
29+
30+
```html
31+
<script src="https://unpkg.com/@libp2p/peer-id-factory/dist/index.min.js"></script>
32+
```
33+
2534
## Description
2635

2736
Generate, import, and export PeerIDs, for use with [IPFS](https://github.com/ipfs/ipfs).
@@ -43,13 +52,17 @@ console.log(id.toString())
4352
12D3KooWRm8J3iL796zPFi2EtGGtUJn58AG67gcqzMFHZnnsTzqD
4453
```
4554

55+
## API Docs
56+
57+
- <https://libp2p.github.io/js-libp2p-peer-id/modules/_libp2p_peer_id_factory.html>
58+
4659
## License
4760

4861
Licensed under either of
4962

5063
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
5164
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
5265

53-
## Contribution
66+
## Contribute
5467

5568
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.

packages/libp2p-peer-id-factory/package.json

+5-2
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
],
@@ -152,8 +152,11 @@
152152
"uint8arrays": "^4.0.2"
153153
},
154154
"devDependencies": {
155-
"aegir": "^37.0.7",
155+
"aegir": "^37.7.5",
156156
"protons": "^6.0.0",
157157
"util": "^0.12.4"
158+
},
159+
"typedoc": {
160+
"entryPoint": "./src/index.ts"
158161
}
159162
}

packages/libp2p-peer-id/README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
# @libp2p/peer-id <!-- 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-id.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-id)
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-id/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-peer-id/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-peer-id/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
87

98
> Implementation of @libp2p/interface-peer-id
109
1110
## Table of contents <!-- omit in toc -->
1211

1312
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
1414
- [Description](#description)
1515
- [Example](#example)
16+
- [API Docs](#api-docs)
1617
- [License](#license)
17-
- [Contribution](#contribution)
18+
- [Contribute](#contribute)
1819

1920
## Install
2021

2122
```console
2223
$ npm i @libp2p/peer-id
2324
```
2425

26+
### Browser `<script>` tag
27+
28+
Loading this module through a script tag will make it's exports available as `Libp2pPeerId` in the global namespace.
29+
30+
```html
31+
<script src="https://unpkg.com/@libp2p/peer-id/dist/index.min.js"></script>
32+
```
33+
2534
## Description
2635

2736
A basic implementation of a peer id
@@ -36,13 +45,17 @@ const id = new PeerId(...)
3645
console.log(id.toCid())
3746
```
3847

48+
## API Docs
49+
50+
- <https://libp2p.github.io/js-libp2p-peer-id/modules/_libp2p_peer_id.html>
51+
3952
## License
4053

4154
Licensed under either of
4255

4356
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
4457
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
4558

46-
## Contribution
59+
## Contribute
4760

4861
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.

packages/libp2p-peer-id/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@libp2p/peer-id",
33
"version": "1.1.17",
4-
"description": "Implementation of @libp2p/interface-peer-d",
4+
"description": "Implementation of @libp2p/interface-peer-id",
55
"license": "Apache-2.0 OR MIT",
66
"homepage": "https://github.com/libp2p/js-libp2p-peer-id/tree/master/packages/libp2p-peer-id#readme",
77
"repository": {
@@ -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
],
@@ -144,6 +144,9 @@
144144
"uint8arrays": "^4.0.2"
145145
},
146146
"devDependencies": {
147-
"aegir": "^37.0.7"
147+
"aegir": "^37.7.5"
148+
},
149+
"typedoc": {
150+
"entryPoint": "./src/index.ts"
148151
}
149152
}

0 commit comments

Comments
 (0)