This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Converts to typescript - Only named exports - No more CJS, only ESM - Runs tests on all supported environments - Adds auto-publish - Adds dependabot BREAKING CHANGE: switch to named exports, ESM only
- Loading branch information
1 parent
2acf9a6
commit 296791e
Showing
28 changed files
with
1,412 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ updates: | |
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "11:00" | ||
time: "10:00" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Automatically merge pull requests opened by web3-bot, as soon as (and only if) all tests pass. | ||
# This reduces the friction associated with updating with our workflows. | ||
|
||
on: [ pull_request ] | ||
name: Automerge | ||
|
||
jobs: | ||
automerge-check: | ||
if: github.event.pull_request.user.login == 'web3-bot' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
status: ${{ steps.should-automerge.outputs.status }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check if we should automerge | ||
id: should-automerge | ||
run: | | ||
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do | ||
committer=$(git show --format=$'%ce' -s $commit) | ||
echo "Committer: $committer" | ||
if [[ "$committer" != "web3-bot@users.noreply.github.com" ]]; then | ||
echo "Commit $commit wasn't committed by web3-bot, but by $committer." | ||
echo "::set-output name=status::false" | ||
exit | ||
fi | ||
done | ||
echo "::set-output name=status::true" | ||
automerge: | ||
needs: automerge-check | ||
runs-on: ubuntu-latest | ||
# The check for the user is redundant here, as this job depends on the automerge-check job, | ||
# but it prevents this job from spinning up, just to be skipped shortly after. | ||
if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true' | ||
steps: | ||
- name: Wait on tests | ||
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 | ||
running-workflow-name: 'automerge' # the name of this job | ||
- name: Merge PR | ||
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1 | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
MERGE_LABELS: "" | ||
MERGE_METHOD: "squash" | ||
MERGE_DELETE_BRANCH: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: test & maybe release | ||
on: | ||
push: | ||
branches: | ||
- master # with #262 - ${{{ github.default_branch }}} | ||
pull_request: | ||
branches: | ||
- master # with #262 - ${{{ github.default_branch }}} | ||
|
||
jobs: | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present lint | ||
- run: npm run --if-present dep-check | ||
|
||
test-node: | ||
needs: check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
node: [16] | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:node | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: node | ||
|
||
test-chrome: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:chrome | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: chrome | ||
|
||
test-chrome-webworker: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:chrome-webworker | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: chrome-webworker | ||
|
||
test-firefox: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:firefox | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: firefox | ||
|
||
test-firefox-webworker: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:firefox-webworker | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: firefox-webworker | ||
|
||
test-electron-main: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npx xvfb-maybe npm run --if-present test:electron-main | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: electron-main | ||
|
||
test-electron-renderer: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npx xvfb-maybe npm run --if-present test:electron-renderer | ||
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 | ||
with: | ||
directory: ./.nyc_output | ||
flags: electron-renderer | ||
|
||
release: | ||
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- uses: ipfs/aegir/actions/docker-login@master | ||
with: | ||
docker-token: ${{ secrets.DOCKER_TOKEN }} | ||
docker-username: ${{ secrets.DOCKER_USERNAME }} | ||
- run: npm run --if-present release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,4 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 David Dias | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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. | ||
This project is dual licensed under MIT and Apache-2.0. | ||
|
||
MIT: https://www.opensource.org/licenses/mit | ||
Apache-2.0: https://www.apache.org/licenses/license-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
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 | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.