Skip to content

Commit 719925a

Browse files
authored
feat!: update deps (#163)
BREAKING CHANGE: update to new libp2p interface versions
1 parent 0cbce13 commit 719925a

File tree

10 files changed

+59
-49
lines changed

10 files changed

+59
-49
lines changed

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
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@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
38+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
3939
with:
40-
directory: ./.nyc_output
4140
flags: node
4241

4342
test-chrome:
@@ -50,9 +49,8 @@ jobs:
5049
node-version: lts/*
5150
- uses: ipfs/aegir/actions/cache-node-modules@master
5251
- run: npm run --if-present test:chrome
53-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
52+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
5453
with:
55-
directory: ./.nyc_output
5654
flags: chrome
5755

5856
test-chrome-webworker:
@@ -65,9 +63,8 @@ jobs:
6563
node-version: lts/*
6664
- uses: ipfs/aegir/actions/cache-node-modules@master
6765
- run: npm run --if-present test:chrome-webworker
68-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
66+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
6967
with:
70-
directory: ./.nyc_output
7168
flags: chrome-webworker
7269

7370
test-firefox:
@@ -80,9 +77,8 @@ jobs:
8077
node-version: lts/*
8178
- uses: ipfs/aegir/actions/cache-node-modules@master
8279
- run: npm run --if-present test:firefox
83-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
80+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
8481
with:
85-
directory: ./.nyc_output
8682
flags: firefox
8783

8884
test-firefox-webworker:
@@ -95,9 +91,8 @@ jobs:
9591
node-version: lts/*
9692
- uses: ipfs/aegir/actions/cache-node-modules@master
9793
- run: npm run --if-present test:firefox-webworker
98-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
94+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
9995
with:
100-
directory: ./.nyc_output
10196
flags: firefox-webworker
10297

10398
test-electron-main:
@@ -110,9 +105,8 @@ jobs:
110105
node-version: lts/*
111106
- uses: ipfs/aegir/actions/cache-node-modules@master
112107
- run: npx xvfb-maybe npm run --if-present test:electron-main
113-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
108+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
114109
with:
115-
directory: ./.nyc_output
116110
flags: electron-main
117111

118112
test-electron-renderer:
@@ -125,9 +119,8 @@ jobs:
125119
node-version: lts/*
126120
- uses: ipfs/aegir/actions/cache-node-modules@master
127121
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
128-
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
122+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
129123
with:
130-
directory: ./.nyc_output
131124
flags: electron-renderer
132125

133126
release:

README.md

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
# IPNS <!-- omit in toc -->
1+
# ipns <!-- 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-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
5-
[![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/#ipfs:matrix.org)
3+
[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io)
64
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
7-
[![Discord](https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord&style=flat-square)](https://discord.gg/24fmuwR)
8-
[![standard-readme](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
9-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
5+
[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs)
6+
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipns.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipns)
7+
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipns/actions/workflows/js-test-and-release.yml)
108

119
> ipns record definitions
1210
13-
This module contains all the necessary code for creating, understanding and validating IPNS records.
14-
15-
## Lead Maintainer <!-- omit in toc -->
16-
17-
[Vasco Santos](https://github.com/vasco-santos).
18-
19-
## Table of Contents <!-- omit in toc -->
11+
## Table of contents <!-- omit in toc -->
2012

13+
- [Install](#install)
14+
- [Lead Maintainer <!-- omit in toc -->](#lead-maintainer----omit-in-toc---)
2115
- [Usage](#usage)
22-
- [Create record](#create-record)
16+
- - [Create record](#create-record)
2317
- [Validate record](#validate-record)
2418
- [Embed public key to record](#embed-public-key-to-record)
2519
- [Extract public key from record](#extract-public-key-from-record)
@@ -28,7 +22,7 @@ This module contains all the necessary code for creating, understanding and vali
2822
- [Unmarshal data from proto buffer](#unmarshal-data-from-proto-buffer)
2923
- [Validator](#validator)
3024
- [API](#api)
31-
- [Create record](#create-record-1)
25+
- - [Create record](#create-record-1)
3226
- [Validate record](#validate-record-1)
3327
- [Datastore key](#datastore-key-1)
3428
- [Marshal data with proto buffer](#marshal-data-with-proto-buffer-1)
@@ -38,10 +32,19 @@ This module contains all the necessary code for creating, understanding and vali
3832
- [Namespace](#namespace)
3933
- [Contribute](#contribute)
4034
- [License](#license)
35+
- [Contribute](#contribute-1)
4136

42-
### Install
37+
## Install
4338

44-
> npm install ipns
39+
```console
40+
$ npm i ipns
41+
```
42+
43+
This module contains all the necessary code for creating, understanding and validating IPNS records.
44+
45+
## Lead Maintainer <!-- omit in toc -->
46+
47+
[Vasco Santos](https://github.com/vasco-santos).
4548

4649
## Usage
4750

@@ -88,9 +91,7 @@ ipns.getLocalKey(peerId)
8891

8992
Returns a key to be used for storing the ipns entry locally, that is:
9093

91-
```
92-
/ipns/${base32(<HASH>)}
93-
```
94+
/ipns/${base32(<HASH>)}
9495

9596
#### Marshal data with proto buffer
9697

@@ -211,7 +212,7 @@ Embed a public key in an IPNS entry. If it is possible to extract the public key
211212
- `publicKey` (`PubKey` [RSA Instance](https://github.com/libp2p/js-libp2p-crypto/blob/master/src/keys/rsa-class.js)): key to be used for cryptographic operations.
212213
- `ipnsEntry` (Object): ipns entry record (obtained using the create function).
213214

214-
Returns a `Promise`. If the promise resolves to null it means the public key can be extracted directly from the `peer-id`.
215+
Returns a `Promise`. If the promise resolves to null it means the public key can be extracted directly from the `peer-id`.
215216

216217
#### Extract public key from record
217218

@@ -252,4 +253,15 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
252253

253254
## License
254255

255-
Copyright (c) Protocol Labs, Inc. under the **MIT License**. See [LICENSE file](./LICENSE) for details.
256+
Licensed under either of
257+
258+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
259+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
260+
261+
## Contribute
262+
263+
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
264+
265+
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
266+
267+
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@
4646
],
4747
"exports": {
4848
".": {
49+
"types": "./dist/src/index.d.ts",
4950
"import": "./dist/src/index.js"
5051
},
5152
"./selector": {
53+
"types": "./dist/src/selector.d.ts",
5254
"import": "./dist/src/selector.js"
5355
},
5456
"./validator": {
57+
"types": "./dist/src/validator.d.ts",
5558
"import": "./dist/src/validator.js"
5659
}
5760
},
@@ -161,9 +164,11 @@
161164
"generate": "protons src/pb/ipns.proto"
162165
},
163166
"dependencies": {
164-
"@libp2p/crypto": "^0.22.12",
165-
"@libp2p/interfaces": "^2.0.2",
166-
"@libp2p/logger": "^1.1.3",
167+
"@libp2p/crypto": "^1.0.0",
168+
"@libp2p/interface-dht": "^1.0.1",
169+
"@libp2p/interface-keys": "^1.0.3",
170+
"@libp2p/interface-peer-id": "^1.0.4",
171+
"@libp2p/logger": "^2.0.0",
167172
"@libp2p/peer-id": "^1.1.9",
168173
"cborg": "^1.3.3",
169174
"debug": "^4.2.0",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
1111
import * as Digest from 'multiformats/hashes/digest'
1212
import { identity } from 'multiformats/hashes/identity'
1313
import { IpnsEntry } from './pb/ipns.js'
14-
import type { PrivateKey } from '@libp2p/interfaces/keys'
15-
import type { PeerId } from '@libp2p/interfaces/peer-id'
14+
import type { PrivateKey } from '@libp2p/interface-keys'
15+
import type { PeerId } from '@libp2p/interface-peer-id'
1616

1717
const log = logger('ipns')
1818
const ID_MULTIHASH_CODE = identity.code

src/selector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
22
import { IpnsEntry } from './pb/ipns.js'
33
import { parseRFC3339 } from './utils.js'
4-
import type { SelectFn } from '@libp2p/interfaces/dht'
4+
import type { SelectFn } from '@libp2p/interface-dht'
55

66
export const ipnsSelector: SelectFn = (key, data) => {
77
const entries = data.map((buf, index) => ({

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import errCode from 'err-code'
2-
import type { PeerId } from '@libp2p/interfaces/peer-id'
2+
import type { PeerId } from '@libp2p/interface-peer-id'
33
import type { IPNSEntry, IPNSEntryData } from './index.js'
44
import * as ERRORS from './errors.js'
55
import { unmarshalPublicKey } from '@libp2p/crypto/keys'

src/validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { IpnsEntry } from './pb/ipns.js'
55
import { parseRFC3339, extractPublicKey, ipnsEntryDataForV1Sig, ipnsEntryDataForV2Sig, unmarshal, peerIdFromRoutingKey, parseCborData } from './utils.js'
66
import * as ERRORS from './errors.js'
77
import type { IPNSEntry } from './index.js'
8-
import type { PublicKey } from '@libp2p/interfaces/keys'
9-
import type { ValidateFn } from '@libp2p/interfaces/dht'
8+
import type { PublicKey } from '@libp2p/interface-keys'
9+
import type { ValidateFn } from '@libp2p/interface-dht'
1010
import { logger } from '@libp2p/logger'
1111

1212
const log = logger('ipns:validator')

test/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { generateKeyPair } from '@libp2p/crypto/keys'
88
import { randomBytes } from '@libp2p/crypto'
99
import * as ipns from '../src/index.js'
1010
import * as ERRORS from '../src/errors.js'
11-
import type { PeerId } from '@libp2p/interfaces/peer-id'
11+
import type { PeerId } from '@libp2p/interface-peer-id'
1212
import { unmarshal, marshal, extractPublicKey, peerIdToRoutingKey } from '../src/utils.js'
1313
import { ipnsValidator } from '../src/validator.js'
1414
import { createEd25519PeerId } from '@libp2p/peer-id-factory'

test/selector.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { generateKeyPair } from '@libp2p/crypto/keys'
77
import * as ipns from '../src/index.js'
88
import { marshal, peerIdToRoutingKey } from '../src/utils.js'
99
import { ipnsSelector } from '../src/selector.js'
10-
import type { PeerId } from '@libp2p/interfaces/peer-id'
10+
import type { PeerId } from '@libp2p/interface-peer-id'
1111

1212
describe('selector', function () {
1313
this.timeout(20 * 1000)

test/validator.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { generateKeyPair } from '@libp2p/crypto/keys'
99
import { randomBytes } from '@libp2p/crypto'
1010
import * as ipns from '../src/index.js'
1111
import * as ERRORS from '../src/errors.js'
12-
import type { PeerId } from '@libp2p/interfaces/peer-id'
12+
import type { PeerId } from '@libp2p/interface-peer-id'
1313
import { marshal, peerIdToRoutingKey } from '../src/utils.js'
1414
import { ipnsValidator } from '../src/validator.js'
1515

0 commit comments

Comments
 (0)