Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit 0e11f03

Browse files
hugomrdiasvmx
authored andcommitted
feat: add ts types with aegir
this is a best effort approach since multiformats/multiformats will probably superseed this repo soon.
1 parent c9afd37 commit 0e11f03

File tree

12 files changed

+159
-248
lines changed

12 files changed

+159
-248
lines changed

.github/workflows/main.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: yarn
16+
- run: yarn lint
17+
- run: yarn build
18+
- uses: gozala/[email protected]
19+
- run: yarn aegir dep-check -- -i aegir
20+
- uses: ipfs/aegir/actions/bundle-size@master
21+
name: size
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
test-node:
25+
needs: check
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
matrix:
29+
os: [windows-latest, ubuntu-latest, macos-latest]
30+
node: [12, 14]
31+
fail-fast: true
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v1
35+
with:
36+
node-version: ${{ matrix.node }}
37+
- run: yarn
38+
- run: npx nyc --reporter=lcov npm run test:node -- --bail
39+
- uses: codecov/codecov-action@v1
40+
test-chrome:
41+
needs: check
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
- run: yarn
46+
- run: yarn aegir test -t browser -t webworker
47+
test-firefox:
48+
needs: check
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- run: yarn
53+
- run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless
54+
test-electron-main:
55+
needs: check
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v2
59+
- run: yarn
60+
- run: npx xvfb-maybe yarn aegir test -t electron-main --bail
61+
test-electron-renderer:
62+
needs: check
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v2
66+
- run: yarn
67+
- run: npx xvfb-maybe yarn aegir test -t electron-renderer --bail

.npmignore

-35
This file was deleted.

.travis.yml

-40
This file was deleted.

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"coverage": "aegir coverage",
1818
"docs": "aegir docs"
1919
},
20+
"files": [
21+
"src",
22+
"dist"
23+
],
2024
"pre-push": [
2125
"lint",
2226
"test"
@@ -35,20 +39,22 @@
3539
"url": "https://github.com/multiformats/js-cid/issues"
3640
},
3741
"dependencies": {
38-
"class-is": "^1.1.0",
3942
"multibase": "^3.0.1",
4043
"multicodec": "^2.0.1",
4144
"multihashes": "^3.0.1",
4245
"uint8arrays": "^1.1.0"
4346
},
4447
"devDependencies": {
45-
"aegir": "^26.0.0",
48+
"aegir": "^29.0.1",
4649
"multihashing-async": "^2.0.1"
4750
},
4851
"engines": {
4952
"node": ">=4.0.0",
5053
"npm": ">=3.0.0"
5154
},
55+
"eslintConfig": {
56+
"extends": "ipfs"
57+
},
5258
"contributors": [
5359
"David Dias <[email protected]>",
5460
"Volker Mische <[email protected]>",

src/cid-util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const CIDUtil = {
99
* Returns undefined if it is a valid CID.
1010
*
1111
* @param {any} other
12-
* @returns {string}
12+
* @returns {string|undefined}
1313
*/
1414
checkCIDComponents: function (other) {
1515
if (other == null) {

src/index.d.ts

-126
This file was deleted.

0 commit comments

Comments
 (0)