Skip to content

Commit 163d463

Browse files
RangerMauvervagg
authored andcommitted
feat!: use aegir for ESM-only build/testing/release
BREAKING CHANGE ESM-only publish
1 parent 88e29ea commit 163d463

19 files changed

+398
-269
lines changed

.eslintrc

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"extends": [
3-
"standard",
4-
"plugin:@typescript-eslint/recommended"
5-
],
6-
"plugins": [
7-
"@typescript-eslint"
8-
],
9-
"rules": {
10-
"@typescript-eslint/explicit-module-boundary-types": "off",
11-
"@typescript-eslint/ban-ts-comment": "off"
2+
"extends": "ipfs",
3+
"env": {
4+
"browser": true,
5+
"node": true,
6+
"es2020": true
127
}
138
}

.github/dependabot.yml

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

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

-61
This file was deleted.

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
.nyc_output
2-
build
3-
dist
4-
coverage
1+
.coverage
52
package-lock.json
63
node_modules
74
.DS_Store
85
yarn.lock
96
types
107
test/ts-use/tsconfig.tsbuildinfo
118
test/tsconfig.tsbuildinfo
9+
*.log

LICENSE

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

LICENSE-APACHE

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
Copyright 2020 Protocol Labs
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
22

3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
5-
You may obtain a copy of the License at
3+
http://www.apache.org/licenses/LICENSE-2.0
64

7-
http://www.apache.org/licenses/LICENSE-2.0
8-
9-
Unless required by applicable law or agreed to in writing, software
10-
distributed under the License is distributed on an "AS IS" BASIS,
11-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
See the License for the specific language governing permissions and
13-
limitations under the License.
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

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
Copyright 2020 Protocol Labs
1+
The MIT License (MIT)
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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:
49

5-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
612

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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)