Skip to content

Commit

Permalink
Merge branch 'main' into feature/dotenv-config
Browse files Browse the repository at this point in the history
  • Loading branch information
trungnotchung authored Oct 29, 2024
2 parents b29c265 + 12d8c31 commit 5b087ea
Show file tree
Hide file tree
Showing 28 changed files with 712 additions and 407 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/buf-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish buf files
on:
workflow_call:
permissions:
contents: read
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v1
with:
token: ${{ secrets.BUF_TOKEN }}
tpr_comment: false
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ jobs:
packages: write
uses: ./.github/workflows/npm-publish.yml

publish_buf_registry:
name: Publish buf files
permissions:
contents: read
needs:
- npm_publish
uses: ./.github/workflows/buf-registry.yml

build_docker_images:
name: Build Docker Images
permissions:
Expand Down
6 changes: 3 additions & 3 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ managed:
enabled: true
plugins:
- local: ./node_modules/ts-proto/protoc-gen-ts_proto
out: ./packages
out: .
opt:
- esModuleInterop=true
- fileSuffix=_pb
- ts_proto_opt=outputServices=grpc-js
- remote: buf.build/grpc/node
out: ./packages
out: .
opt:
- ts_proto_opt=esModuleInterop=true
inputs:
- directory: ./packages
exclude_paths:
- packages/node/node_modules
- packages/node
- packages/network/node_modules
- packages/object/node_modules
14 changes: 5 additions & 9 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
version: v2
modules:
# - path: packages/node
# excludes:
# - packages/node/node_modules
- path: packages/network
excludes:
- packages/network/node_modules
- path: packages/object
excludes:
- packages/object/node_modules
- path: packages/object/src/proto
name: buf.build/topology/object

- path: packages/network/src/proto
name: buf.build/topology/network
10 changes: 5 additions & 5 deletions examples/canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-topology-examples-canvas",
"version": "0.2.0",
"version": "0.2.1-0",
"license": "MIT",
"scripts": {
"build": "vite build",
Expand All @@ -9,10 +9,10 @@
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.2.0",
"@topology-foundation/network": "0.2.0",
"@topology-foundation/node": "0.2.0",
"@topology-foundation/object": "0.2.0",
"@topology-foundation/blueprints": "0.2.1-0",
"@topology-foundation/network": "0.2.1-0",
"@topology-foundation/node": "0.2.1-0",
"@topology-foundation/object": "0.2.1-0",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/chat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "topology-example-chat",
"version": "0.2.0",
"version": "0.2.1-0",
"description": "Topology Protocol Chat Example",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
Expand All @@ -13,10 +13,10 @@
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.2.0",
"@topology-foundation/network": "0.2.0",
"@topology-foundation/node": "0.2.0",
"@topology-foundation/object": "0.2.0",
"@topology-foundation/blueprints": "0.2.1-0",
"@topology-foundation/network": "0.2.1-0",
"@topology-foundation/node": "0.2.1-0",
"@topology-foundation/object": "0.2.1-0",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
Expand Down
8 changes: 4 additions & 4 deletions examples/grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "topology-example-grid",
"version": "0.2.0",
"version": "0.2.1-0",
"description": "Topology Protocol Grid Exmaple",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
Expand All @@ -13,9 +13,9 @@
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/network": "0.2.0",
"@topology-foundation/node": "0.2.0",
"@topology-foundation/object": "0.2.0",
"@topology-foundation/network": "0.2.1-0",
"@topology-foundation/node": "0.2.1-0",
"@topology-foundation/object": "0.2.1-0",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"memfs": "^4.11.1",
Expand Down
10 changes: 5 additions & 5 deletions examples/local-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "topology-example-localdev",
"version": "0.2.0",
"version": "0.2.1-0",
"description": "Topology Protocol Local Dev Example",
"main": "src/index.ts",
"repository": "https://github.com/topology-foundation/ts-topology.git",
Expand All @@ -13,10 +13,10 @@
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@topology-foundation/blueprints": "0.2.0",
"@topology-foundation/network": "0.2.0",
"@topology-foundation/node": "0.2.0",
"@topology-foundation/object": "0.2.0",
"@topology-foundation/blueprints": "0.2.1-0",
"@topology-foundation/network": "0.2.1-0",
"@topology-foundation/node": "0.2.1-0",
"@topology-foundation/object": "0.2.1-0",
"assemblyscript": "^0.27.29",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
Expand Down
112 changes: 57 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
{
"name": "ts-topology",
"description": "The official TypeScript implementation of Topology Protocol",
"version": "0.2.0",
"license": "MIT",
"homepage": "https://topology.gg/",
"repository": {
"type": "git",
"url": "git+https://github.com/topology-foundation/ts-topology.git"
},
"bugs": {
"url": "https://github.com/topology-foundation/ts-topology/issues"
},
"workspaces": [
"packages/*",
"examples/*"
],
"scripts": {
"bench": "vitest bench",
"biome-check": "biome check",
"clean": "pnpm --filter '@topology-foundation/*' clean",
"docs": "typedoc",
"postinstall": "pnpm --filter '@topology-foundation/*' build",
"proto-gen": "buf generate",
"release": "release-it",
"test": "vitest"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@release-it-plugins/workspaces": "^4.2.0",
"@types/node": "^22.5.4",
"assemblyscript": "^0.27.29",
"dotenv": "^16.4.5",
"release-it": "^17.6.0",
"ts-proto": "^2.2.4",
"typedoc": "^0.26.6",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.1.1"
},
"private": true,
"release-it": {
"plugins": {
"@release-it-plugins/workspaces": {
"publish": false
}
},
"npm": false,
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
}
}
"name": "ts-topology",
"description": "The official TypeScript implementation of Topology Protocol",
"version": "0.2.1-0",
"license": "MIT",
"homepage": "https://topology.gg/",
"repository": {
"type": "git",
"url": "git+https://github.com/topology-foundation/ts-topology.git"
},
"bugs": {
"url": "https://github.com/topology-foundation/ts-topology/issues"
},
"workspaces": [
"packages/*",
"examples/*"
],
"scripts": {
"bench": "vitest bench",
"biome-check": "biome check",
"clean": "pnpm --filter '@topology-foundation/*' clean",
"docs": "typedoc",
"postinstall": "pnpm --filter '@topology-foundation/*' build",
"proto-gen": "pnpm proto-gen:object && pnpm proto-gen:network",
"proto-gen:object": "buf generate packages/object/src/proto -o packages/object/src/proto",
"proto-gen:network": "buf generate packages/network/src/proto -o packages/network/src/proto",
"release": "release-it",
"test": "vitest"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@release-it-plugins/workspaces": "^4.2.0",
"@types/node": "^22.5.4",
"assemblyscript": "^0.27.29",
"dotenv": "^16.4.5",
"release-it": "^17.6.0",
"ts-proto": "^2.2.4",
"typedoc": "^0.26.6",
"typescript": "^5.5.4",
"vite": "^5.4.9",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.1.1"
},
"private": true,
"release-it": {
"plugins": {
"@release-it-plugins/workspaces": {
"publish": false
}
},
"npm": false,
"git": {
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true
}
}
}
4 changes: 2 additions & 2 deletions packages/blueprints/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@topology-foundation/blueprints",
"version": "0.2.0",
"version": "0.2.1-0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,7 +34,7 @@
"test": "vitest"
},
"devDependencies": {
"@topology-foundation/object": "0.2.0",
"@topology-foundation/object": "0.2.1-0",
"assemblyscript": "^0.27.29"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/network/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@topology-foundation/network",
"version": "0.2.0",
"version": "0.2.1-0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/network/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./node.js";
export * as NetworkPb from "./proto/messages_pb.js";
export * as NetworkPb from "./proto/topology/network/messages_pb.js";
2 changes: 1 addition & 1 deletion packages/network/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { webTransport } from "@libp2p/webtransport";
import { multiaddr } from "@multiformats/multiaddr";
import { type Libp2p, createLibp2p } from "libp2p";
import { fromString as uint8ArrayFromString } from "uint8arrays/from-string";
import { Message } from "./proto/messages_pb.js";
import { Message } from "./proto/topology/network/messages_pb.js";
import { uint8ArrayToStream } from "./stream.js";

export * from "./stream.js";
Expand Down
Loading

0 comments on commit 5b087ea

Please sign in to comment.