Skip to content

Commit 30a1955

Browse files
committed
fix: new aegir
1 parent 94e4ffe commit 30a1955

File tree

5 files changed

+1177
-5279
lines changed

5 files changed

+1177
-5279
lines changed

.aegir.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require('path')
2+
const esbuild = {
3+
inject: [path.join(__dirname, 'test/fixtures/node-globals.js')]
4+
}
5+
module.exports = {
6+
tsRepo: true,
7+
docs: {
8+
entryPoint: "src/index.ts"
9+
},
10+
test: {
11+
browser :{
12+
config: {
13+
buildConfig: esbuild
14+
}
15+
}
16+
},
17+
build: {
18+
bundlesizeMax: '228KB',
19+
config: esbuild
20+
}
21+
}

.github/workflows/ci.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22

3-
on:
3+
on:
44
push:
55
branches:
66
- master
@@ -30,11 +30,10 @@ jobs:
3030
- run: yarn --prefer-offline --frozen-lockfile
3131
- run: yarn run check
3232
- run: yarn run build
33-
# LArge bundle because of node-forge and bcrypto
34-
# - uses: ipfs/aegir/actions/bundle-size@master
35-
# name: Check bundle size
36-
# with:
37-
# github_token: ${{ secrets.GITHUB_TOKEN }}
33+
- uses: ipfs/aegir/actions/bundle-size@master
34+
name: Check bundle size
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
3837

3938
test-node:
4039
name: Test Nodejs
@@ -60,7 +59,7 @@ jobs:
6059
restore-keys: |
6160
${{ runner.os }}-yarn-
6261
- run: yarn --prefer-offline --frozen-lockfile
63-
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
62+
- run: aegir test -t node --bail --cov
6463
- uses: codecov/codecov-action@v1
6564

6665
test-chrome:
@@ -105,8 +104,30 @@ jobs:
105104
restore-keys: |
106105
${{ runner.os }}-yarn-
107106
- run: yarn --prefer-offline --frozen-lockfile
108-
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
109-
107+
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox
108+
109+
test-webkit:
110+
name: Test Webkit
111+
needs: check
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/setup-node@v1
115+
with:
116+
node-version: ${{ matrix.node }}
117+
- uses: actions/checkout@v2
118+
- name: Get yarn cache directory path
119+
id: yarn-cache-dir-path
120+
run: echo "::set-output name=dir::$(yarn cache dir)"
121+
- uses: actions/cache@v2
122+
id: yarn-cache
123+
with:
124+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
125+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
126+
restore-keys: |
127+
${{ runner.os }}-yarn-
128+
- run: yarn --prefer-offline --frozen-lockfile
129+
- run: npx aegir test -t browser -t webworker --bail -- --browser webkit
130+
110131
test-electron-main:
111132
name: Test Electron Main
112133
needs: check

package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,32 @@
2222
"bench": "node benchmarks/benchmark.js",
2323
"clean": "rm -rf dist",
2424
"check": "aegir dep-check && aegir ts -p check",
25-
"copy-dts": "copyup \"src/**/*.d.ts\" dist/src",
2625
"build": "aegir build",
27-
"postbuild": "yarn run copy-dts",
2826
"lint": "aegir lint",
2927
"lint:fix": "aegir lint --fix",
30-
"pretest": "yarm run check",
28+
"pretest": "yarn run check",
3129
"test": "aegir test",
3230
"test:node": "aegir test -t node",
3331
"test:browser": "aegir test -t browser",
3432
"docs": "aegir docs",
3533
"proto:gen": "pbjs -t static-module -o ./src/proto/payload.js ./src/proto/payload.proto && pbts -o ./src/proto/payload.d.ts ./src/proto/payload.js && yarn run lint --fix"
3634
},
37-
"aegir" :{
38-
"node": true,
39-
"tsRepo": true,
40-
"docs": {
41-
"entryPoint": "src/index.ts"
42-
}
35+
"browser": {
36+
"util": false
4337
},
4438
"devDependencies": {
4539
"@types/bl": "^2.1.0",
46-
"aegir": "ipfs/aegir#feat/ts-repo-support",
40+
"aegir": "ipfs/aegir#feat/remove-webpack-karma",
4741
"benchmark": "^2.1.4",
42+
"buffer": "^5.7.1",
4843
"chai": "^4.2.0",
49-
"copyfiles": "^2.4.1",
50-
"karma-mocha-webworker": "^1.3.0",
44+
"events": "^3.2.0",
5145
"microtime": "^3.0.0",
5246
"mocha": "^8.2.1",
5347
"sinon": "^9.2.4"
5448
},
5549
"dependencies": {
56-
"bcrypto": "^5.3.0",
57-
"buffer": "^5.4.3",
50+
"bcrypto": "^5.4.0",
5851
"debug": "^4.3.1",
5952
"it-buffer": "^0.1.1",
6053
"it-length-prefixed": "^3.0.0",

test/fixtures/node-globals.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @ts-nocheck
2+
export const { Buffer } = require('buffer')

0 commit comments

Comments
 (0)