Skip to content

Commit bc20def

Browse files
authored
docs: publish api docs (#113)
Update project config to publish api docs
1 parent e4d74cf commit bc20def

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.gitignore

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

README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,33 @@
33
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
44
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
55
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-pubsub.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-pubsub)
6-
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-pubsub/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-pubsub/actions/workflows/js-test-and-release.yml)
6+
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-pubsub/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-pubsub/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
77

88
> libp2p pubsub base class
99
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13+
- [Browser `<script>` tag](#browser-script-tag)
1314
- [Usage](#usage)
15+
- [API Docs](#api-docs)
1416
- [License](#license)
15-
- [Contribute](#contribute)
17+
- [Contribution](#contribution)
1618

1719
## Install
1820

1921
```console
2022
$ npm i @libp2p/pubsub
2123
```
2224

25+
### Browser `<script>` tag
26+
27+
Loading this module through a script tag will make it's exports available as `Libp2pPubsub` in the global namespace.
28+
29+
```html
30+
<script src="https://unpkg.com/@libp2p/pubsub/dist/index.min.js"></script>
31+
```
32+
2333
## Usage
2434

2535
```console
@@ -34,13 +44,17 @@ class MyPubsubImplementation extends PubSubBaseProtocol {
3444
}
3545
```
3646

47+
## API Docs
48+
49+
- <https://libp2p.github.io/js-libp2p-pubsub>
50+
3751
## License
3852

3953
Licensed under either of
4054

4155
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
4256
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
4357

44-
## Contribute
58+
## Contribution
4559

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

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"files": [
4141
"src",
42-
"dist/src",
42+
"dist",
4343
"!dist/test",
4444
"!**/*.tsbuildinfo"
4545
],
@@ -173,7 +173,8 @@
173173
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
174174
"test:node": "aegir test -t node --cov",
175175
"test:electron-main": "aegir test -t electron-main",
176-
"release": "aegir release"
176+
"release": "aegir release",
177+
"docs": "aegir docs"
177178
},
178179
"dependencies": {
179180
"@libp2p/crypto": "^1.0.0",
@@ -206,7 +207,7 @@
206207
"p-wait-for": "^5.0.0",
207208
"protons": "^6.0.0",
208209
"protons-runtime": "^4.0.1",
209-
"sinon": "^14.0.0",
210+
"sinon": "^15.0.1",
210211
"util": "^0.12.4"
211212
}
212213
}

0 commit comments

Comments
 (0)