Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feat/support-dns-over-https
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Nov 2, 2023
2 parents 0d9c747 + d954e0a commit 14ac953
Show file tree
Hide file tree
Showing 25 changed files with 191 additions and 326 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/automerge.yml

This file was deleted.

191 changes: 16 additions & 175 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,184 +1,25 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: test & maybe release

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check

test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:node
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: node

test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: chrome

test-chrome-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: chrome-webworker
permissions:
contents: write
packages: write

test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: firefox
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

test-firefox-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: firefox-webworker

test-webkit:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:webkit
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: webkit

test-webkit-webworker:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:webkit-webworker
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: webkit-webworker

test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-main
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: electron-main

test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
with:
flags: electron-renderer

release:
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: ipfs/aegir/actions/docker-login@master
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
- run: npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
js-test-and-release:
uses: pl-strflt/uci/.github/workflows/js-test-and-release.yml@v0.0
secrets:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
"keywords": [
"ipfs"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"private": true,
"scripts": {
"reset": "aegir run clean && aegir clean **/node_modules **/package-lock.json",
Expand All @@ -33,13 +29,15 @@
"generate": "aegir run generate",
"build": "aegir run build",
"lint": "aegir run lint",
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs",
"docs:no-publish": "npm run docs -- --publish false",
"dep-check": "aegir run dep-check",
"release": "npm run docs:no-publish && aegir run release && npm run docs"
"release": "run-s build docs:no-publish npm:release docs",
"npm:release": "aegir run release",
"docs": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs -- --exclude packages/interop --excludeExternals",
"docs:no-publish": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude packages/interop"
},
"devDependencies": {
"aegir": "^39.0.8"
"aegir": "^41.0.0",
"npm-run-all": "^4.1.5"
},
"type": "module",
"workspaces": [
Expand Down
46 changes: 19 additions & 27 deletions packages/interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
"keywords": [
"IPFS"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
Expand All @@ -35,6 +31,7 @@
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true,
"sourceType": "module"
}
},
Expand All @@ -52,42 +49,37 @@
"test:electron-main": "aegir test -t electron-main"
},
"devDependencies": {
"@chainsafe/libp2p-gossipsub": "^8.0.0",
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@helia/interface": "^1.0.0",
"@helia/ipns": "^1.0.0",
"@libp2p/interface-libp2p": "^3.2.0",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-pubsub": "^4.0.1",
"@libp2p/kad-dht": "^9.3.4",
"@libp2p/peer-id": "^2.0.1",
"@libp2p/peer-id-factory": "^2.0.1",
"@libp2p/tcp": "^7.0.1",
"@libp2p/websockets": "^6.0.1",
"aegir": "^39.0.8",
"@chainsafe/libp2p-gossipsub": "^10.1.0",
"@chainsafe/libp2p-noise": "^13.0.0",
"@chainsafe/libp2p-yamux": "^5.0.0",
"@helia/interface": "^2.0.0",
"@helia/ipns": "^2.0.0",
"@libp2p/interface": "^0.1.2",
"@libp2p/kad-dht": "^10.0.4",
"@libp2p/peer-id": "^3.0.2",
"@libp2p/peer-id-factory": "^3.0.3",
"@libp2p/tcp": "^8.0.4",
"@libp2p/websockets": "^7.0.4",
"aegir": "^41.0.0",
"blockstore-core": "^4.0.1",
"datastore-core": "^9.0.3",
"go-ipfs": "^0.20.0",
"helia": "^1.0.0",
"go-ipfs": "^0.22.0",
"helia": "^2.0.1",
"ipfsd-ctl": "^13.0.0",
"ipns": "^6.0.0",
"ipns": "^7.0.1",
"it-all": "^3.0.2",
"it-last": "^3.0.1",
"it-map": "^3.0.3",
"kubo-rpc-client": "^3.0.0",
"libp2p": "^0.45.3",
"libp2p": "^0.46.6",
"merge-options": "^3.0.4",
"multiformats": "^11.0.1",
"multiformats": "^12.0.1",
"uint8arrays": "^4.0.3",
"wherearewe": "^2.0.1"
},
"browser": {
"./dist/test/fixtures/create-helia.js": "./dist/test/fixtures/create-helia.browser.js",
"go-ipfs": false
},
"private": true,
"typedoc": {
"entryPoint": "./src/index.ts"
}
"private": true
}
6 changes: 3 additions & 3 deletions packages/interop/test/dht.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ipns } from '@helia/ipns'
import { dht } from '@helia/ipns/routing'
import { type KadDHT, kadDHT } from '@libp2p/kad-dht'
import { kadDHT, type DualKadDHT } from '@libp2p/kad-dht'
import { createEd25519PeerId, createRSAPeerId, createSecp256k1PeerId } from '@libp2p/peer-id-factory'
import { expect } from 'aegir/chai'
import { ipnsSelector } from 'ipns/selector'
Expand All @@ -23,13 +23,13 @@ import { keyTypes } from './fixtures/key-types.js'
import { waitFor } from './fixtures/wait-for.js'
import type { Helia } from '@helia/interface'
import type { IPNS } from '@helia/ipns'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { Libp2p } from '@libp2p/interface'
import type { Controller } from 'ipfsd-ctl'
import type { PeerId } from 'kubo-rpc-client/dist/src/types.js'

keyTypes.forEach(type => {
describe(`dht routing with ${type} keys`, () => {
let helia: Helia<Libp2p<{ dht: KadDHT }>>
let helia: Helia<Libp2p<{ dht: DualKadDHT }>>
let kubo: Controller
let name: IPNS

Expand Down
2 changes: 1 addition & 1 deletion packages/interop/test/fixtures/create-helia.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MemoryDatastore } from 'datastore-core'
import { createHelia } from 'helia'
import { createLibp2p, type Libp2pOptions } from 'libp2p'
import type { Helia } from '@helia/interface'
import type { Libp2p } from '@libp2p/interface-libp2p'
import type { Libp2p } from '@libp2p/interface'

export async function createHeliaNode <T extends { identify: any }> (config: Libp2pOptions<T> = {}): Promise<Helia<Libp2p<T>>> {
const blockstore = new MemoryBlockstore()
Expand Down
6 changes: 4 additions & 2 deletions packages/interop/test/fixtures/create-helia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { tcp } from '@libp2p/tcp'
import { MemoryBlockstore } from 'blockstore-core'
import { MemoryDatastore } from 'datastore-core'
import { createHelia } from 'helia'
import { createLibp2p, type Libp2p, type Libp2pOptions } from 'libp2p'
import { createLibp2p, type Libp2pOptions } from 'libp2p'
import type { Helia } from '@helia/interface'
import type { Libp2p } from '@libp2p/interface'
import type { IdentifyService } from 'libp2p/identify'

export async function createHeliaNode <T extends { identify: any }> (config: Libp2pOptions<T> = {}): Promise<Helia<Libp2p<T>>> {
export async function createHeliaNode <T extends { identify: IdentifyService }> (config: Libp2pOptions<T> = {}): Promise<Helia<Libp2p<T>>> {
const blockstore = new MemoryBlockstore()
const datastore = new MemoryDatastore()

Expand Down
4 changes: 2 additions & 2 deletions packages/interop/test/fixtures/create-kubo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// @ts-expect-error no types
/* eslint-disable @typescript-eslint/ban-ts-comment,@typescript-eslint/prefer-ts-expect-error */
// @ts-ignore no types - TODO: remove me once the next version of npm-go-ipfs has shipped
import * as goIpfs from 'go-ipfs'
import { type Controller, type ControllerOptions, createController } from 'ipfsd-ctl'
import * as kuboRpcClient from 'kubo-rpc-client'
Expand Down
2 changes: 1 addition & 1 deletion packages/interop/test/fixtures/create-peer-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import map from 'it-map'
import { sha256 } from 'multiformats/hashes/sha2'
import { compare as uint8ArrayCompare } from 'uint8arrays/compare'
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerId } from '@libp2p/interface/peer-id'

/**
* Sort peers by distance to the KadID of the passed buffer
Expand Down
2 changes: 1 addition & 1 deletion packages/interop/test/fixtures/key-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PeerIdType } from '@libp2p/interface-peer-id'
import type { PeerIdType } from '@libp2p/interface/peer-id'

export const keyTypes: PeerIdType[] = [
'Ed25519',
Expand Down
Loading

0 comments on commit 14ac953

Please sign in to comment.