Skip to content

Commit ceef343

Browse files
authored
chore: update project config (#121)
Update to latest version of project config.
1 parent aa874ab commit ceef343

8 files changed

+162
-98
lines changed

.github/dependabot.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ updates:
44
directory: "/"
55
schedule:
66
interval: daily
7-
time: "11:00"
7+
time: "10:00"
88
open-pull-requests-limit: 10
9+
commit-message:
10+
prefix: "deps"
11+
prefix-development: "deps(dev)"

.github/workflows/automerge.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Automerge
2+
on: [ pull_request ]
3+
4+
jobs:
5+
automerge:
6+
uses: protocol/.github/.github/workflows/automerge.yml@master
7+
with:
8+
job: 'automerge'

.github/workflows/main.yml .github/workflows/js-test-and-release.yml

+43-23
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ name: test & maybe release
22
on:
33
push:
44
branches:
5-
- master
5+
- master # with #262 - ${{{ github.default_branch }}}
66
pull_request:
77
branches:
8-
- master
8+
- master # with #262 - ${{{ github.default_branch }}}
99

1010
jobs:
1111

1212
check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
1717
with:
1818
node-version: lts/*
1919
- uses: ipfs/aegir/actions/cache-node-modules@master
@@ -29,95 +29,115 @@ jobs:
2929
node: [16]
3030
fail-fast: true
3131
steps:
32-
- uses: actions/checkout@v2
33-
- uses: actions/setup-node@v2
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
3434
with:
3535
node-version: ${{ matrix.node }}
3636
- uses: ipfs/aegir/actions/cache-node-modules@master
3737
- run: npm run --if-present test:node
38-
- uses: codecov/codecov-action@v1
38+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
39+
with:
40+
flags: node
3941

4042
test-chrome:
4143
needs: check
4244
runs-on: ubuntu-latest
4345
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-node@v2
46+
- uses: actions/checkout@v3
47+
- uses: actions/setup-node@v3
4648
with:
4749
node-version: lts/*
4850
- uses: ipfs/aegir/actions/cache-node-modules@master
4951
- run: npm run --if-present test:chrome
52+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
53+
with:
54+
flags: chrome
5055

5156
test-chrome-webworker:
5257
needs: check
5358
runs-on: ubuntu-latest
5459
steps:
55-
- uses: actions/checkout@v2
56-
- uses: actions/setup-node@v2
60+
- uses: actions/checkout@v3
61+
- uses: actions/setup-node@v3
5762
with:
5863
node-version: lts/*
5964
- uses: ipfs/aegir/actions/cache-node-modules@master
6065
- run: npm run --if-present test:chrome-webworker
66+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
67+
with:
68+
flags: chrome-webworker
6169

6270
test-firefox:
6371
needs: check
6472
runs-on: ubuntu-latest
6573
steps:
66-
- uses: actions/checkout@v2
67-
- uses: actions/setup-node@v2
74+
- uses: actions/checkout@v3
75+
- uses: actions/setup-node@v3
6876
with:
6977
node-version: lts/*
7078
- uses: ipfs/aegir/actions/cache-node-modules@master
7179
- run: npm run --if-present test:firefox
80+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
81+
with:
82+
flags: firefox
7283

7384
test-firefox-webworker:
7485
needs: check
7586
runs-on: ubuntu-latest
7687
steps:
77-
- uses: actions/checkout@v2
78-
- uses: actions/setup-node@v2
88+
- uses: actions/checkout@v3
89+
- uses: actions/setup-node@v3
7990
with:
8091
node-version: lts/*
8192
- uses: ipfs/aegir/actions/cache-node-modules@master
8293
- run: npm run --if-present test:firefox-webworker
94+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
95+
with:
96+
flags: firefox-webworker
8397

8498
test-electron-main:
8599
needs: check
86100
runs-on: ubuntu-latest
87101
steps:
88-
- uses: actions/checkout@v2
89-
- uses: actions/setup-node@v2
102+
- uses: actions/checkout@v3
103+
- uses: actions/setup-node@v3
90104
with:
91105
node-version: lts/*
92106
- uses: ipfs/aegir/actions/cache-node-modules@master
93107
- run: npx xvfb-maybe npm run --if-present test:electron-main
108+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
109+
with:
110+
flags: electron-main
94111

95112
test-electron-renderer:
96113
needs: check
97114
runs-on: ubuntu-latest
98115
steps:
99-
- uses: actions/checkout@v2
100-
- uses: actions/setup-node@v2
116+
- uses: actions/checkout@v3
117+
- uses: actions/setup-node@v3
101118
with:
102119
node-version: lts/*
103120
- uses: ipfs/aegir/actions/cache-node-modules@master
104121
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
122+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
123+
with:
124+
flags: electron-renderer
105125

106126
release:
107127
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
108128
runs-on: ubuntu-latest
109-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
129+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
110130
steps:
111-
- uses: actions/checkout@v2.4.0
131+
- uses: actions/checkout@v3
112132
with:
113133
fetch-depth: 0
114-
- uses: actions/setup-node@v2
134+
- uses: actions/setup-node@v3
115135
with:
116136
node-version: lts/*
117137
- uses: ipfs/aegir/actions/cache-node-modules@master
118138
- uses: ipfs/aegir/actions/docker-login@master
119139
with:
120-
docker-token: ${{ secrets.DOCKER_USERNAME }}
140+
docker-token: ${{ secrets.DOCKER_TOKEN }}
121141
docker-username: ${{ secrets.DOCKER_USERNAME }}
122142
- run: npm run --if-present release
123143
env:

LICENSE

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
This project is dual licensed under MIT and Apache-2.0.
2+
13
MIT: https://www.opensource.org/licenses/mit
2-
Apache-2.0: https://www.apache.org/licenses/license-2.0
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-MIT

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
19+
THE SOFTWARE.

README.md

+50-33
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# js-mafmt
1+
# @multiformats/mafmt <!-- omit in toc -->
22

3-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
4-
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)
5-
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)
6-
[![Dependency Status](https://david-dm.org/multiformats/js-mafmt.svg?style=flat-square)](https://david-dm.org/multiformats/js-mafmt)
7-
[![](https://img.shields.io/travis/multiformats/js-mafmt.svg?style=flat-square)](https://travis-ci.com/multiformats/js-mafmt)
3+
[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)
84
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-mafmt.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-mafmt)
5+
[![CI](https://img.shields.io/github/workflow/status/multiformats/js-mafmt/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/multiformats/js-mafmt/actions/workflows/js-test-and-release.yml)
96

10-
> Javascript implementation of multiaddr validation
7+
> A multiaddr validator
8+
9+
## Table of contents <!-- omit in toc -->
10+
11+
- [Install](#install)
12+
- [Usage](#usage)
13+
- [API](#api)
14+
- [`mafmt.<FORMAT>.matches(multiaddr)`](#mafmtformatmatchesmultiaddr)
15+
- [License](#license)
16+
- [Contribute](#contribute)
1117

1218
## Install
1319

14-
```sh
15-
npm install @multiformats/mafmt
20+
```console
21+
$ npm i @multiformats/mafmt
1622
```
1723

1824
## Usage
1925

2026
```js
21-
import * as mafmt from 'multiformats/mafmt'
27+
import * as mafmt from '@multiformats/mafmt'
2228

2329
mafmt.DNS.matches('/dns4/ipfs.io') // true
2430
```
@@ -29,31 +35,42 @@ mafmt.DNS.matches('/dns4/ipfs.io') // true
2935

3036
Where `<FORMAT>` may be:
3137

32-
| `<FORMAT>` | Description | Example(s) |
33-
| --- | --- | --- |
34-
| `DNS` | a "dns4" or "dns6" format multiaddr | `/dnsaddr/ipfs.io`
35-
| `DNS4` | a "dns4" format multiaddr | `/dns4/ipfs.io` |
36-
| `DNS6` | a "dns6" format multiaddr | `/dns6/protocol.ai/tcp/80` |
37-
| `IP` | an "ip4" or "ip6" format multiaddr | `/ip4/127.0.0.1` <br> `/ip6/fc00::` |
38-
| `TCP` | a "tcp" over `IP` format multiaddr | `/ip4/0.0.7.6/tcp/1234` |
39-
| `UDP` | a "udp" over `IP` format multiaddr | `/ip4/0.0.7.6/udp/1234` |
40-
| `QUIC` | a "quic" over `UDP` format multiaddr | `/ip4/1.2.3.4/udp/1234/quic` |
41-
| `UTP` | a "utp" over `UDP` format multiaddr | `/ip4/1.2.3.4/udp/3456/utp` |
42-
| `Websockets` | a "ws" over `TCP` or "ws" over `DNS` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws` <br> `/dnsaddr/ipfs.io/ws` |
43-
| `WebSocketsSecure` | a "wss" over `TCP` or "wss" over `DNS` format multiaddr | `/ip6/::/tcp/0/wss` <br> `/dnsaddr/ipfs.io/wss` |
44-
| `HTTP` | a "http" over `TCP` or `DNS` or "http" over `DNS` format multiaddr | `/ip4/127.0.0.1/tcp/90/http` <br> `/dnsaddr/ipfs.io/http` |
45-
| `HTTPS` | a "https" over `TCP` or `DNS` or "https" over `DNS` format multiaddr | `/ip4/127.0.0.1/tcp/90/https` <br> `/dnsaddr/ipfs.io/https` |
46-
| `WebRTCStar` | a "p2p" over "p2p-webrtc-star" over `Websockets` or "p2p" over "p2p-webrtc-star" over `WebSocketsSecure` format multiaddr | `/dnsaddr/ipfs.io/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` |
47-
| `WebSocketStar` | a "p2p" over "p2p-websocket-star" over `Websockets` or "p2p" over "p2p-websocket-star" over `WebSocketsSecure` or "p2p-websocket-star" over `Websockets` or "p2p-websocket-star" over `WebSocketsSecure` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws/p2p-websocket-star` <br> `/dnsaddr/localhost/ws/p2p-websocket-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` |
48-
| `WebRTCDirect` | a "p2p-webrtc-direct" over `HTTP` or "p2p-webrtc-direct" over `HTTPS` format multiaddr | `/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct` |
49-
| `Reliable` | a `WebSockets` or `WebSocketsSecure` or `HTTP` or `HTTPS` or `WebRTCStar` or `WebRTCDirect` or `TCP` or `UTP` or `QUIC` format multiaddr | `/dnsaddr/ipfs.io/wss` |
50-
| `Circuit` | | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4/p2p-circuit/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj` |
51-
| `P2P` | "p2p", aka "ipfs", over `Reliable` or `WebRTCStar` or "p2p" format multiaddr | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` <br> `/ip4/127.0.0.1/tcp/20008/ws/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj` |
38+
| `<FORMAT>` | Description | Example(s) |
39+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
40+
| `DNS` | a "dns4" or "dns6" format multiaddr | `/dnsaddr/ipfs.io` |
41+
| `DNS4` | a "dns4" format multiaddr | `/dns4/ipfs.io` |
42+
| `DNS6` | a "dns6" format multiaddr | `/dns6/protocol.ai/tcp/80` |
43+
| `IP` | an "ip4" or "ip6" format multiaddr | `/ip4/127.0.0.1` <br> `/ip6/fc00::` |
44+
| `TCP` | a "tcp" over `IP` format multiaddr | `/ip4/0.0.7.6/tcp/1234` |
45+
| `UDP` | a "udp" over `IP` format multiaddr | `/ip4/0.0.7.6/udp/1234` |
46+
| `QUIC` | a "quic" over `UDP` format multiaddr | `/ip4/1.2.3.4/udp/1234/quic` |
47+
| `UTP` | a "utp" over `UDP` format multiaddr | `/ip4/1.2.3.4/udp/3456/utp` |
48+
| `Websockets` | a "ws" over `TCP` or "ws" over `DNS` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws` <br> `/dnsaddr/ipfs.io/ws` |
49+
| `WebSocketsSecure` | a "wss" over `TCP` or "wss" over `DNS` format multiaddr | `/ip6/::/tcp/0/wss` <br> `/dnsaddr/ipfs.io/wss` |
50+
| `HTTP` | a "http" over `TCP` or `DNS` or "http" over `DNS` format multiaddr | `/ip4/127.0.0.1/tcp/90/http` <br> `/dnsaddr/ipfs.io/http` |
51+
| `HTTPS` | a "https" over `TCP` or `DNS` or "https" over `DNS` format multiaddr | `/ip4/127.0.0.1/tcp/90/https` <br> `/dnsaddr/ipfs.io/https` |
52+
| `WebRTCStar` | a "p2p" over "p2p-webrtc-star" over `Websockets` or "p2p" over "p2p-webrtc-star" over `WebSocketsSecure` format multiaddr | `/dnsaddr/ipfs.io/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` |
53+
| `WebSocketStar` | a "p2p" over "p2p-websocket-star" over `Websockets` or "p2p" over "p2p-websocket-star" over `WebSocketsSecure` or "p2p-websocket-star" over `Websockets` or "p2p-websocket-star" over `WebSocketsSecure` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws/p2p-websocket-star` <br> `/dnsaddr/localhost/ws/p2p-websocket-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` |
54+
| `WebRTCDirect` | a "p2p-webrtc-direct" over `HTTP` or "p2p-webrtc-direct" over `HTTPS` format multiaddr | `/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct` |
55+
| `Reliable` | a `WebSockets` or `WebSocketsSecure` or `HTTP` or `HTTPS` or `WebRTCStar` or `WebRTCDirect` or `TCP` or `UTP` or `QUIC` format multiaddr | `/dnsaddr/ipfs.io/wss` |
56+
| `Circuit` | | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4/p2p-circuit/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj` |
57+
| `P2P` | "p2p", aka "ipfs", over `Reliable` or `WebRTCStar` or "p2p" format multiaddr | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` <br> `/ip4/127.0.0.1/tcp/20008/ws/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj` |
5258

5359
Where `multiaddr` may be:
5460

55-
* a [Multiaddr](https://www.npmjs.com/package/multiaddr)
56-
* a String
57-
* a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
61+
- a [Multiaddr](https://www.npmjs.com/package/@multiformats/multiaddr)
62+
- a String
63+
- a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
5864

5965
Returns `true`/`false`
66+
67+
## License
68+
69+
Licensed under either of
70+
71+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
72+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
73+
74+
## Contribute
75+
76+
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.

0 commit comments

Comments
 (0)