Skip to content

Commit

Permalink
chore: convert to monorepo
Browse files Browse the repository at this point in the history
Converts this repository to a monorepo - in the initial pass the only
monorepo package is libp2p itself.
  • Loading branch information
achingbrain committed Jun 7, 2023
1 parent 14aa40f commit 2a82858
Show file tree
Hide file tree
Showing 153 changed files with 525 additions and 348 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,34 @@ jobs:

release:
runs-on: ubuntu-latest
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer, test-interop]
needs: [
test-node,
test-chrome,
test-chrome-webworker,
test-firefox,
test-firefox-webworker,
test-electron-main,
test-electron-renderer,
test-interop
]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: manifest
release-type: node
# breaking changes should rev the minor (remove after v1)
bump-minor-pre-major: true
# features should rev the patch (remove after v1)
bump-patch-for-minor-pre-major: true
manifest-file: .release-please-manifest.json
config-file: .release-please.json
changelog-types: |
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "chore", "section": "Trivial Changes", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "deps", "section": "Dependencies", "hidden": false }
]
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand All @@ -179,23 +195,21 @@ jobs:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- uses: ipfs/aegir/actions/cache-node-modules@master
- if: ${{ steps.release.outputs.release_created }}
name: Generate typedoc URLs
run: npm --if-present run docs -- --publish false
- if: ${{ steps.release.outputs.release_created }}
- uses: ipfs/aegir/actions/docker-login@master
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
- if: ${{ steps.release.outputs.releases_created }}
name: Run release version
run: npm publish
run: |
git update-index --assume-unchanged packages/libp2p/src/version.ts
npm run --if-present release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: ${{ steps.release.outputs.release_created }}
name: Publish docs
run: npm run --if-present docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ !steps.release.outputs.release_created }}
- if: ${{ !steps.release.outputs.releases_created }}
name: Run release rc
run: |
npm version `node -p -e "require('./package.json').version"`-`git rev-parse --short HEAD` --no-git-tag-version
npm publish --tag next
git update-index --assume-unchanged packages/libp2p/src/version.ts
npm run --if-present release:rc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"packages/libp2p":"0.45.5"
}
9 changes: 9 additions & 0 deletions .release-please.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": ["node-workspace"],
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"group-pull-request-title-pattern": "chore: release ${component}",
"packages": {
"packages/libp2p": {}
}
}
43 changes: 0 additions & 43 deletions ISSUE_TEMPLATE.md

This file was deleted.

45 changes: 0 additions & 45 deletions MIGRATION_TEMPLATE.md

This file was deleted.

19 changes: 0 additions & 19 deletions OKR.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/auto-relay/dialer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { webSockets } from '@libp2p/websockets'
import { noise } from '@chainsafe/libp2p-noise'
import { mplex } from '@libp2p/mplex'
import { multiaddr } from '@multiformats/multiaddr'
import { yamux } from '@chainsafe/libp2p-yamux/dist/src'
import { yamux } from '@chainsafe/libp2p-yamux'
import { circuitRelayTransport } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'

Expand Down
2 changes: 1 addition & 1 deletion examples/auto-relay/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { webSockets } from '@libp2p/websockets'
import { noise } from '@chainsafe/libp2p-noise'
import { mplex } from '@libp2p/mplex'
import { multiaddr } from '@multiformats/multiaddr'
import { yamux } from '@chainsafe/libp2p-yamux/dist/src'
import { yamux } from '@chainsafe/libp2p-yamux'
import { circuitRelayTransport } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'

Expand Down
2 changes: 1 addition & 1 deletion examples/connection-encryption/1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createLibp2p } from '../../dist/src/index.js'
import { createLibp2p } from '../../packages/libp2p/dist/src/index.js'
import { tcp } from '@libp2p/tcp'
import { mplex } from '@libp2p/mplex'
import { yamux } from '@chainsafe/libp2p-yamux'
Expand Down
2 changes: 1 addition & 1 deletion examples/delegated-routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@chainsafe/libp2p-noise": "^12.0.0",
"ipfs-core": "^0.15.4",
"ipfs-http-client": "^58.0.1",
"libp2p": "file:../../",
"libp2p": "file:../../packages/libp2p",
"@libp2p/delegated-content-routing": "^4.0.0",
"@libp2p/delegated-peer-routing": "^4.0.0",
"@libp2p/kad-dht": "^9.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/libp2p-in-the-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@libp2p/webrtc": "^1.2.0",
"@libp2p/websockets": "^6.0.1",
"@libp2p/webtransport": "^2.0.1",
"libp2p": "file:../../"
"libp2p": "file:../../packages/libp2p"
},
"devDependencies": {
"vite": "^2.8.6"
Expand Down
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"execa": "^6.1.0",
"fs-extra": "^10.1.0",
"it-to-buffer": "^3.0.1",
"libp2p": "file:../",
"libp2p": "file:../packages/libp2p",
"p-defer": "^4.0.0",
"uint8arrays": "^4.0.0",
"which": "^2.0.1"
Expand Down
8 changes: 2 additions & 6 deletions interop/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
FROM node:18

WORKDIR /app
COPY package.json .
COPY ./node_modules ./node_modules
COPY ./packages/libp2p ./packages/libp2p

WORKDIR /app/interop
COPY ./interop/node_modules ./node_modules

WORKDIR /app
COPY ./dist ./dist

WORKDIR /app/interop
COPY ./interop/dist ./dist

COPY ./interop/package.json .
COPY ./interop/.aegir.js .

Expand Down
2 changes: 1 addition & 1 deletion interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@libp2p/webtransport": "^2.0.1",
"@multiformats/mafmt": "^12.1.2",
"@multiformats/multiaddr": "^12.1.3",
"libp2p": "../",
"libp2p": "../packages/libp2p",
"redis": "4.5.1"
},
"browser": {
Expand Down
Loading

0 comments on commit 2a82858

Please sign in to comment.