Skip to content

Commit

Permalink
chore: update aegir to latest version (#80)
Browse files Browse the repository at this point in the history
Removes boilerplate config that is no longer required.
  • Loading branch information
achingbrain authored Apr 7, 2022
1 parent 52438f1 commit 3a98959
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 132 deletions.
50 changes: 4 additions & 46 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,8 @@
# 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
on: [ pull_request ]

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" != "[email protected]" ]]; 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
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
"build": "lerna run build",
"lint": "lerna run lint",
"clean": "lerna run clean",
"dep-check": "lerna run dep-check",
"release": "lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo"
"release": "lerna run --concurrency 1 release -- --"
},
"dependencies": {
"lerna": "^4.0.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/libp2p-daemon-client/.aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

export default {
build: {
config: {
platform: 'node'
}
}
}
19 changes: 10 additions & 9 deletions packages/libp2p-daemon-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,30 +119,31 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"dep-check": "aegir dep-check",
"build": "aegir build",
"pretest": "npm run build",
"test": "aegir test -t node -f ./dist/test/*.js",
"test:node": "aegir test -t node -f ./dist/test/*.js",
"release": "semantic-release"
"test": "aegir test -t node",
"test:node": "aegir test -t node",
"release": "aegir release"
},
"dependencies": {
"@libp2p/daemon-protocol": "^0.0.1",
"@libp2p/daemon-protocol": "^1.0.0",
"@libp2p/interfaces": "^1.3.17",
"@libp2p/logger": "^1.1.2",
"@libp2p/peer-id": "^1.1.8",
"@libp2p/tcp": "^1.0.6",
"@multiformats/multiaddr": "^10.1.8",
"err-code": "^3.0.1",
"it-stream-types": "^1.0.4",
"multiformats": "^9.4.2"
"multiformats": "^9.6.4"
},
"devDependencies": {
"@libp2p/daemon-server": "^1.0.0",
"@libp2p/interface-compliance-tests": "^1.1.20",
"@libp2p/daemon-server": "^0.0.2",
"@libp2p/peer-id-factory": "^1.0.8",
"aegir": "^36.0.0",
"aegir": "^37.0.5",
"it-all": "^1.0.6",
"it-pipe": "^2.0.3",
"sinon": "^13.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Client implements DaemonClient {
}

/**
* @typedef {Object} IdentifyResponse
* @typedef {object} IdentifyResponse
* @property {PeerId} peerId
* @property {Array.<multiaddr>} addrs
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/test/dht.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server'
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server'
import { createClient, DaemonClient } from '../src/index.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/test/pubsub.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server'
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-client/test/stream.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server'
import { createClient, DaemonClient } from '../src/index.js'
Expand Down
12 changes: 1 addition & 11 deletions packages/libp2p-daemon-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020",
"lib": [
"ES2021",
"ES2021.Promise",
"ES2021.String",
"ES2020.BigInt",
"DOM",
"DOM.Iterable"
]
"outDir": "dist"
},
"include": [
"src",
Expand Down
10 changes: 6 additions & 4 deletions packages/libp2p-daemon-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -143,17 +143,19 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"build": "tsc && cp src/*.js src/*.d.ts dist/src",
"build": "aegir build",
"postbuild": "cp src/*.js src/*.d.ts dist/src",
"generate": "npm run generate:proto && npm run generate:proto-types",
"generate:proto": "pbjs -t static-module -w es6 -r libp2p-daemon --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/protocol/index.js ./src/protocol/index.proto",
"generate:proto-types": "pbts -o src/protocol/index.d.ts src/protocol/index.js",
"release": "semantic-release"
"release": "aegir release"
},
"dependencies": {
"protobufjs": "^6.10.2"
},
"devDependencies": {
"aegir": "^36.0.0"
"aegir": "^37.0.5"
}
}
12 changes: 1 addition & 11 deletions packages/libp2p-daemon-protocol/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020",
"lib": [
"ES2021",
"ES2021.Promise",
"ES2021.String",
"ES2020.BigInt",
"DOM",
"DOM.Iterable"
]
"outDir": "dist"
},
"include": [
"src"
Expand Down
8 changes: 8 additions & 0 deletions packages/libp2p-daemon-server/.aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

export default {
build: {
config: {
platform: 'node'
}
}
}
17 changes: 9 additions & 8 deletions packages/libp2p-daemon-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,21 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"dep-check": "aegir dep-check",
"build": "aegir build",
"pretest": "npm run build",
"test": "aegir test -t node -f dist/test/*.js dist/test/**/*.js",
"test:node": "aegir test -t node -f dist/test/*.js dist/test/**/*.js",
"release": "semantic-release"
"test": "aegir test -t node",
"test:node": "aegir test -t node",
"release": "aegir release"
},
"dependencies": {
"@libp2p/daemon-protocol": "^0.0.1",
"@libp2p/daemon-protocol": "^1.0.0",
"@libp2p/interfaces": "^1.3.17",
"@libp2p/logger": "^1.1.2",
"@libp2p/tcp": "^1.0.6",
"@libp2p/peer-id": "^1.1.8",
"@libp2p/tcp": "^1.0.6",
"@multiformats/multiaddr": "^10.1.8",
"it-drain": "^1.0.5",
"it-length-prefixed": "^7.0.1",
Expand All @@ -146,7 +147,7 @@
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"aegir": "^36.0.0",
"aegir": "^37.0.5",
"sinon": "^13.0.1",
"ts-sinon": "^2.0.2"
}
Expand Down
8 changes: 5 additions & 3 deletions packages/libp2p-daemon-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ export class Server implements Libp2pServer {
/**
* Handles requests for the given connection
*/
async handleConnection (connection: Connection) {
handleConnection (connection: Connection) {
const daemon = this // eslint-disable-line @typescript-eslint/no-this-alias
// @ts-expect-error connection may actually be a maconn?
const streamHandler = new StreamHandler({ stream: connection, maxLength: LIMIT })

await pipe(
void pipe(
streamHandler.decoder,
source => (async function * () {
let request: Request
Expand Down Expand Up @@ -507,7 +507,9 @@ export class Server implements Libp2pServer {
streamHandler.write(result)
}
}
)
).catch(err => {
log(err)
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-server/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint max-nested-callbacks: ["error", 5] */

import { Multiaddr } from '@multiformats/multiaddr'
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { createServer, Libp2p } from '../src/index.js'
import { stubInterface } from 'ts-sinon'

Expand Down
12 changes: 1 addition & 11 deletions packages/libp2p-daemon-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist",
"emitDeclarationOnly": false,
"module": "ES2020",
"lib": [
"ES2021",
"ES2021.Promise",
"ES2021.String",
"ES2020.BigInt",
"DOM",
"DOM.Iterable"
]
"outDir": "dist"
},
"include": [
"src",
Expand Down
8 changes: 8 additions & 0 deletions packages/libp2p-daemon/.aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

export default {
build: {
config: {
platform: 'node'
}
}
}
18 changes: 9 additions & 9 deletions packages/libp2p-daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"npm": ">=7.0.0"
},
"bin": {
"jsp2pd": "src/cli/bin.js"
"jsp2pd": "dist/src/index.js"
},
"type": "module",
"types": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -122,24 +122,24 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -t node -f dist/test/*.js dist/test/**/*.js",
"test:node": "aegir test -t node -f dist/test/*.js dist/test/**/*.js",
"release": "semantic-release"
"dep-check": "aegir dep-check",
"build": "aegir build",
"test": "aegir test -t node",
"test:node": "aegir test -t node",
"release": "aegir release"
},
"dependencies": {
"@libp2p/daemon-server": "^0.0.2",
"@libp2p/daemon-server": "^1.0.0",
"@libp2p/interfaces": "^1.3.17",
"@multiformats/multiaddr": "^10.1.8",
"es-main": "^1.0.2",
"yargs": "^17.3.1",
"yargs-promise": "^1.1.0"
},
"devDependencies": {
"aegir": "^36.0.0",
"aegir": "^37.0.5",
"sinon": "^13.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/libp2p-daemon/test/cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env mocha */

import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import sinon from 'sinon'
import cli from '../src/index.js'

Expand Down
Loading

0 comments on commit 3a98959

Please sign in to comment.