mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-28 17:52:13 +00:00
fix: new aegir
This commit is contained in:
parent
94e4ffe0a5
commit
30a1955929
21
.aegir.js
Normal file
21
.aegir.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
const path = require('path')
|
||||||
|
const esbuild = {
|
||||||
|
inject: [path.join(__dirname, 'test/fixtures/node-globals.js')]
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
tsRepo: true,
|
||||||
|
docs: {
|
||||||
|
entryPoint: "src/index.ts"
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
browser :{
|
||||||
|
config: {
|
||||||
|
buildConfig: esbuild
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
bundlesizeMax: '228KB',
|
||||||
|
config: esbuild
|
||||||
|
}
|
||||||
|
}
|
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
@ -30,11 +30,10 @@ jobs:
|
|||||||
- run: yarn --prefer-offline --frozen-lockfile
|
- run: yarn --prefer-offline --frozen-lockfile
|
||||||
- run: yarn run check
|
- run: yarn run check
|
||||||
- run: yarn run build
|
- run: yarn run build
|
||||||
# LArge bundle because of node-forge and bcrypto
|
- uses: ipfs/aegir/actions/bundle-size@master
|
||||||
# - uses: ipfs/aegir/actions/bundle-size@master
|
name: Check bundle size
|
||||||
# name: Check bundle size
|
with:
|
||||||
# with:
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
test-node:
|
test-node:
|
||||||
name: Test Nodejs
|
name: Test Nodejs
|
||||||
@ -60,7 +59,7 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
- run: yarn --prefer-offline --frozen-lockfile
|
- run: yarn --prefer-offline --frozen-lockfile
|
||||||
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
|
- run: aegir test -t node --bail --cov
|
||||||
- uses: codecov/codecov-action@v1
|
- uses: codecov/codecov-action@v1
|
||||||
|
|
||||||
test-chrome:
|
test-chrome:
|
||||||
@ -105,8 +104,30 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
- run: yarn --prefer-offline --frozen-lockfile
|
- run: yarn --prefer-offline --frozen-lockfile
|
||||||
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
|
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox
|
||||||
|
|
||||||
|
test-webkit:
|
||||||
|
name: Test Webkit
|
||||||
|
needs: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Get yarn cache directory path
|
||||||
|
id: yarn-cache-dir-path
|
||||||
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- run: yarn --prefer-offline --frozen-lockfile
|
||||||
|
- run: npx aegir test -t browser -t webworker --bail -- --browser webkit
|
||||||
|
|
||||||
test-electron-main:
|
test-electron-main:
|
||||||
name: Test Electron Main
|
name: Test Electron Main
|
||||||
needs: check
|
needs: check
|
||||||
|
21
package.json
21
package.json
@ -22,39 +22,32 @@
|
|||||||
"bench": "node benchmarks/benchmark.js",
|
"bench": "node benchmarks/benchmark.js",
|
||||||
"clean": "rm -rf dist",
|
"clean": "rm -rf dist",
|
||||||
"check": "aegir dep-check && aegir ts -p check",
|
"check": "aegir dep-check && aegir ts -p check",
|
||||||
"copy-dts": "copyup \"src/**/*.d.ts\" dist/src",
|
|
||||||
"build": "aegir build",
|
"build": "aegir build",
|
||||||
"postbuild": "yarn run copy-dts",
|
|
||||||
"lint": "aegir lint",
|
"lint": "aegir lint",
|
||||||
"lint:fix": "aegir lint --fix",
|
"lint:fix": "aegir lint --fix",
|
||||||
"pretest": "yarm run check",
|
"pretest": "yarn run check",
|
||||||
"test": "aegir test",
|
"test": "aegir test",
|
||||||
"test:node": "aegir test -t node",
|
"test:node": "aegir test -t node",
|
||||||
"test:browser": "aegir test -t browser",
|
"test:browser": "aegir test -t browser",
|
||||||
"docs": "aegir docs",
|
"docs": "aegir docs",
|
||||||
"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"
|
"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"
|
||||||
},
|
},
|
||||||
"aegir" :{
|
"browser": {
|
||||||
"node": true,
|
"util": false
|
||||||
"tsRepo": true,
|
|
||||||
"docs": {
|
|
||||||
"entryPoint": "src/index.ts"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bl": "^2.1.0",
|
"@types/bl": "^2.1.0",
|
||||||
"aegir": "ipfs/aegir#feat/ts-repo-support",
|
"aegir": "ipfs/aegir#feat/remove-webpack-karma",
|
||||||
"benchmark": "^2.1.4",
|
"benchmark": "^2.1.4",
|
||||||
|
"buffer": "^5.7.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"copyfiles": "^2.4.1",
|
"events": "^3.2.0",
|
||||||
"karma-mocha-webworker": "^1.3.0",
|
|
||||||
"microtime": "^3.0.0",
|
"microtime": "^3.0.0",
|
||||||
"mocha": "^8.2.1",
|
"mocha": "^8.2.1",
|
||||||
"sinon": "^9.2.4"
|
"sinon": "^9.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypto": "^5.3.0",
|
"bcrypto": "^5.4.0",
|
||||||
"buffer": "^5.4.3",
|
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"it-buffer": "^0.1.1",
|
"it-buffer": "^0.1.1",
|
||||||
"it-length-prefixed": "^3.0.0",
|
"it-length-prefixed": "^3.0.0",
|
||||||
|
2
test/fixtures/node-globals.js
vendored
Normal file
2
test/fixtures/node-globals.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
export const { Buffer } = require('buffer')
|
Loading…
x
Reference in New Issue
Block a user