Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 3544df7

Browse files
authored
feat!: convert to typescript (#53)
- Converts this module to typescript - Publishes as ESM only - Removes cms operations to remove node-forge from the dependencies - if you need this, see [@libp2p/cms](https://www.npmjs.com/@libp2p/cms) BREAKING CHANGE: this module is now typescript and does not store the self key on startup. cms operations have also been moved to [@libp2p/cms](https://www.npmjs.com/@libp2p/cms)
1 parent 2a9b99c commit 3544df7

26 files changed

+1623
-1452
lines changed

.gitattributes

-2
This file was deleted.

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "10:00"
8+
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'
+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: test & maybe release
2+
on:
3+
push:
4+
branches:
5+
- master # with #262 - ${{{ github.default_branch }}}
6+
pull_request:
7+
8+
jobs:
9+
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: lts/*
17+
- uses: ipfs/aegir/actions/cache-node-modules@master
18+
- run: npm run --if-present lint
19+
- run: npm run --if-present dep-check
20+
21+
test-node:
22+
needs: check
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: [windows-latest, ubuntu-latest, macos-latest]
27+
node: [lts/*]
28+
fail-fast: true
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.node }}
34+
- uses: ipfs/aegir/actions/cache-node-modules@master
35+
- run: npm run --if-present test:node
36+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
37+
with:
38+
flags: node
39+
40+
test-chrome:
41+
needs: check
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: actions/setup-node@v3
46+
with:
47+
node-version: lts/*
48+
- uses: ipfs/aegir/actions/cache-node-modules@master
49+
- run: npm run --if-present test:chrome
50+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
51+
with:
52+
flags: chrome
53+
54+
test-chrome-webworker:
55+
needs: check
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: actions/setup-node@v3
60+
with:
61+
node-version: lts/*
62+
- uses: ipfs/aegir/actions/cache-node-modules@master
63+
- run: npm run --if-present test:chrome-webworker
64+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
65+
with:
66+
flags: chrome-webworker
67+
68+
test-firefox:
69+
needs: check
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v3
73+
- uses: actions/setup-node@v3
74+
with:
75+
node-version: lts/*
76+
- uses: ipfs/aegir/actions/cache-node-modules@master
77+
- run: npm run --if-present test:firefox
78+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
79+
with:
80+
flags: firefox
81+
82+
test-firefox-webworker:
83+
needs: check
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v3
87+
- uses: actions/setup-node@v3
88+
with:
89+
node-version: lts/*
90+
- uses: ipfs/aegir/actions/cache-node-modules@master
91+
- run: npm run --if-present test:firefox-webworker
92+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
93+
with:
94+
flags: firefox-webworker
95+
96+
test-electron-main:
97+
needs: check
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v3
101+
- uses: actions/setup-node@v3
102+
with:
103+
node-version: lts/*
104+
- uses: ipfs/aegir/actions/cache-node-modules@master
105+
- run: npx xvfb-maybe npm run --if-present test:electron-main
106+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
107+
with:
108+
flags: electron-main
109+
110+
test-electron-renderer:
111+
needs: check
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/checkout@v3
115+
- uses: actions/setup-node@v3
116+
with:
117+
node-version: lts/*
118+
- uses: ipfs/aegir/actions/cache-node-modules@master
119+
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
120+
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
121+
with:
122+
flags: electron-renderer
123+
124+
release:
125+
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
126+
runs-on: ubuntu-latest
127+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
128+
steps:
129+
- uses: actions/checkout@v3
130+
with:
131+
fetch-depth: 0
132+
- uses: actions/setup-node@v3
133+
with:
134+
node-version: lts/*
135+
- uses: ipfs/aegir/actions/cache-node-modules@master
136+
- uses: ipfs/aegir/actions/docker-login@master
137+
with:
138+
docker-token: ${{ secrets.DOCKER_TOKEN }}
139+
docker-username: ${{ secrets.DOCKER_USERNAME }}
140+
- run: npm run --if-present release
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/stale.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Close and mark stale issue
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
stale:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/stale@v3
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
20+
close-issue-message: 'This issue was closed because it is missing author input.'
21+
stale-issue-label: 'kind/stale'
22+
any-of-labels: 'need/author-input'
23+
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
24+
days-before-issue-stale: 6
25+
days-before-issue-close: 7
26+
enable-statistics: true

.gitignore

+5-42
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,8 @@
1-
docs
2-
**/node_modules/
3-
**/*.log
4-
test/repo-tests*
5-
**/bundle.js
6-
7-
# Logs
8-
logs
9-
*.log
10-
11-
coverage
12-
.nyc_output
13-
14-
# Runtime data
15-
pids
16-
*.pid
17-
*.seed
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
25-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26-
.grunt
27-
28-
# node-waf configuration
29-
.lock-wscript
30-
31-
build
32-
33-
# Dependency directory
34-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
351
node_modules
36-
37-
lib
2+
build
383
dist
39-
test/test-data/go-ipfs-repo/LOCK
40-
test/test-data/go-ipfs-repo/LOG
41-
test/test-data/go-ipfs-repo/LOG.old
42-
43-
# while testing npm5
4+
.docs
5+
.coverage
6+
node_modules
447
package-lock.json
45-
yarn.lock
8+
yarn.lock

.travis.yml

-42
This file was deleted.

LICENSE

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
MIT License
1+
This project is dual licensed under MIT and Apache-2.0.
22

3-
Copyright (c) 2017 libp2p
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
3+
MIT: https://www.opensource.org/licenses/mit
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-APACHE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

LICENSE-MIT

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
 (0)