Skip to content

Commit 807fdd4

Browse files
achingbrainrvagg
andauthored
feat!: publish as esm-only (#71)
Following on from the conversation in ipld/ipld#224 this converts this repo to use the latest aegir with Unified CI. 1. Remove all build related dev deps apart from `aegir` 1. Run the `npx aegir check-project` command to update project config 1. Remove non-Unified-CI github actions 1. Update imports to import from `src/index.js` instead of `@ipld/dag-pb` 1. Rename `test/*.js` to `test/*.spec.js` so aegir can find them 1. Update `tsconfig.json` to extend config from `aegir` 1. Remove `"main"` and other unused fields from `package.json` 1. Use `chai` from `aegir` pre-configured with plugins we use 1. Fixes everything the linter complains about 1. Updates `multiformats` to 10.x.x Co-authored-by: Rod Vagg <rod@vagg.org>
1 parent 14f9cdc commit 807fdd4

21 files changed

+321
-223
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 14 deletions
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

Lines changed: 8 additions & 0 deletions
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'
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: test & maybe release
2+
on:
3+
push:
4+
branches:
5+
- master # with #262 - ${{{ github.default_branch }}}
6+
pull_request:
7+
branches:
8+
- master # 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@v3
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@v3
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@v3
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@v3
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@v3
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@v3
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@v3
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@v3
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/master' # 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@v3
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

Lines changed: 0 additions & 63 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ lib-cov
1616

1717
# Coverage directory used by tools like istanbul
1818
coverage
19+
.coverage
1920

2021
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
2122
.grunt

.npmignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

LICENSE

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
The MIT License (MIT)
2-
3-
Copyright (c) 2015 David Dias
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.
1+
This project is dual licensed under MIT and Apache-2.0.
222

3+
MIT: https://www.opensource.org/licenses/mit
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-APACHE

Lines changed: 5 additions & 0 deletions
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

Lines changed: 19 additions & 0 deletions
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.

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
# @ipld/dag-cbor
1+
# @ipld/dag-cbor <!-- omit in toc -->
22

3-
JS implementation of `dag-cbor`.
3+
[![codecov](https://img.shields.io/codecov/c/github/ipld/js-dag-cbor.svg?style=flat-square)](https://codecov.io/gh/ipld/js-dag-cbor)
4+
[![CI](https://img.shields.io/github/workflow/status/ipld/js-dag-cbor/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipld/js-dag-cbor/actions/workflows/js-test-and-release.yml)
5+
6+
> JS implementation of DAG-CBOR
7+
8+
## Table of contents <!-- omit in toc -->
9+
10+
- [Install](#install)
11+
- [Spec](#spec)
12+
- [License](#license)
13+
- [Contribute](#contribute)
14+
15+
## Install
16+
17+
```console
18+
$ npm i @ipld/dag-cbor
19+
```
420

521
This is the *new* interface meant for use by itself or with `multiformats` and
622
`@ipld/block`. It is not used by `js-ipld-format` which is currently
@@ -29,6 +45,17 @@ decoded.y[0] // 2
2945
CID.asCID(decoded.z.a) // cid instance
3046
```
3147

32-
# Spec
48+
## Spec
3349

3450
The [`dag-cbor` specification is in the IPLD specs repo](https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-cbor.md).
51+
52+
## License
53+
54+
Licensed under either of
55+
56+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
57+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
58+
59+
## Contribute
60+
61+
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)