From 0f7f8b41aeacb174122a4fd2b883b44b7a011001 Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 21:48:59 +0900 Subject: [PATCH 1/7] change imports --- packages/network/src/index.ts | 6 +++--- packages/network/src/node.ts | 2 +- packages/network/src/relay.ts | 2 +- packages/node/package.json | 1 + packages/node/src/index.ts | 2 +- tsconfig.json | 1 + yarn.lock | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/network/src/index.ts b/packages/network/src/index.ts index 22951e73..ab51100c 100644 --- a/packages/network/src/index.ts +++ b/packages/network/src/index.ts @@ -1,3 +1,3 @@ -export { TopologyNetworkNodeConfig, TopologyNetworkNode } from "./node"; -export { stringToStream, streamToString } from "./stream"; -export { createRelayNode } from "./relay"; +export { TopologyNetworkNodeConfig, TopologyNetworkNode } from "./node.ts"; +export { stringToStream, streamToString } from "./stream.ts"; +export { createRelayNode } from "./relay.ts"; diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index ab1d8c31..e9fd65fe 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -13,7 +13,7 @@ import { webRTC, webRTCDirect } from "@libp2p/webrtc"; import { webSockets } from "@libp2p/websockets"; import { multiaddr } from "@multiformats/multiaddr"; import { Libp2p, createLibp2p } from "libp2p"; -import { stringToStream } from "./stream"; +import { stringToStream } from "./stream.ts"; import { webTransport } from "@libp2p/webtransport"; import { bootstrap } from "@libp2p/bootstrap"; diff --git a/packages/network/src/relay.ts b/packages/network/src/relay.ts index ff927e12..45cbef29 100644 --- a/packages/network/src/relay.ts +++ b/packages/network/src/relay.ts @@ -8,7 +8,7 @@ import { pubsubPeerDiscovery } from "@libp2p/pubsub-peer-discovery"; import { webSockets } from "@libp2p/websockets"; import { createLibp2p } from "libp2p"; -import relayerJson from "./peer-id-relayer"; +import relayerJson from "./peer-id-relayer.ts"; import { autoNAT } from "@libp2p/autonat"; // TODO: diff --git a/packages/node/package.json b/packages/node/package.json index ffe120c0..88b68ff6 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@types/node": "^20.14.2", + "node-datachannel": "^0.9.2", "tsx": "^4.15.6", "typescript": "^5.4.5", "vitest": "^1.6.0" diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 28c3ee36..4482807b 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -6,7 +6,7 @@ import { streamToString, } from "@topology-foundation/network"; import { TopologyObject } from "@topology-foundation/object"; -import { TopologyObjectStore } from "./store"; +import { TopologyObjectStore } from "./store.ts"; import { fromString as uint8ArrayFromString } from "uint8arrays/from-string"; import { toString as uint8ArrayToString } from "uint8arrays/to-string"; diff --git a/tsconfig.json b/tsconfig.json index 0d668bc6..10cf9f77 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "esModuleInterop": true, "moduleResolution": "node", + "allowImportingTsExtensions": true, "declaration": true, "declarationMap": true, diff --git a/yarn.lock b/yarn.lock index eec11d86..76513e05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3245,7 +3245,7 @@ node-abi@^3.3.0: dependencies: semver "^7.3.5" -node-datachannel@^0.9.0: +node-datachannel@^0.9.0, node-datachannel@^0.9.2: version "0.9.2" resolved "https://registry.yarnpkg.com/node-datachannel/-/node-datachannel-0.9.2.tgz#0cfccb9d95afff3a6ff01f0e75e99d9d6764d109" integrity sha512-sknq4EAJcSNHUMiK6Gru3vtwo8QICiFs5xJyaitJy/ZLSUbikaGrDORpIpdGp8++4AYQOYC5vr9VyA6i01KeJQ== From 041b56113c9d15a09b3d5bc25abbda5a5b1b209b Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 21:50:07 +0900 Subject: [PATCH 2/7] add emitdeclarationonly --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 10cf9f77..41df8af7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "esModuleInterop": true, "moduleResolution": "node", "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, "declaration": true, "declarationMap": true, From b3881a9c14a7730e74c9dc11a8dfa069162c3e94 Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 21:50:58 +0900 Subject: [PATCH 3/7] chore: release v0.0.8 --- package.json | 2 +- packages/crdt/package.json | 2 +- packages/network/package.json | 2 +- packages/node/package.json | 8 ++++---- packages/object/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 884b6fdd..32fb6d0c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ts-topology", "description": "The official TypeScript implementation of Topology Protocol", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "homepage": "https://topology.gg/", "repository": { diff --git a/packages/crdt/package.json b/packages/crdt/package.json index a2f9902d..ea38d9be 100644 --- a/packages/crdt/package.json +++ b/packages/crdt/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/crdt", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "repository": { "type": "git", diff --git a/packages/network/package.json b/packages/network/package.json index 31048b22..c67cef30 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/network", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "repository": { "type": "git", diff --git a/packages/node/package.json b/packages/node/package.json index 88b68ff6..f66d262b 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/node", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "repository": { "type": "git", @@ -37,8 +37,8 @@ "vitest": "^1.6.0" }, "dependencies": { - "@topology-foundation/crdt": "0.0.7", - "@topology-foundation/network": "0.0.7", - "@topology-foundation/object": "0.0.7" + "@topology-foundation/crdt": "0.0.8", + "@topology-foundation/network": "0.0.8", + "@topology-foundation/object": "0.0.8" } } diff --git a/packages/object/package.json b/packages/object/package.json index f802c0be..d637b3af 100644 --- a/packages/object/package.json +++ b/packages/object/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/object", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "repository": { "type": "git", From df565a4743432a6bad673498ee944bf1973f2b3b Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 22:09:08 +0900 Subject: [PATCH 4/7] change imports from ts to js --- examples/canvas/yarn.lock | 26 +++++++++++++------------- packages/network/src/index.ts | 6 +++--- packages/network/src/node.ts | 2 +- packages/network/src/relay.ts | 2 +- packages/node/src/index.ts | 2 +- tsconfig.json | 2 -- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/examples/canvas/yarn.lock b/examples/canvas/yarn.lock index a6a7679d..11351060 100644 --- a/examples/canvas/yarn.lock +++ b/examples/canvas/yarn.lock @@ -714,11 +714,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/fnv1a/-/fnv1a-3.1.0.tgz#f8e46597298f6fd4c12dc901cdd4e73beb4d24fa" integrity sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w== -"@topology-foundation/crdt@0.0.7", "@topology-foundation/crdt@file:../../packages/crdt": - version "0.0.7" +"@topology-foundation/crdt@0.0.8", "@topology-foundation/crdt@file:../../packages/crdt": + version "0.0.8" -"@topology-foundation/network@0.0.7", "@topology-foundation/network@file:../../packages/network": - version "0.0.7" +"@topology-foundation/network@0.0.8", "@topology-foundation/network@file:../../packages/network": + version "0.0.8" dependencies: "@chainsafe/libp2p-gossipsub" "^13.0.0" "@chainsafe/libp2p-noise" "^15.0.0" @@ -737,19 +737,19 @@ libp2p "^1.6.0" "@topology-foundation/node@file:../../packages/node": - version "0.0.7" + version "0.0.8" dependencies: - "@topology-foundation/crdt" "0.0.7" - "@topology-foundation/network" "0.0.7" - "@topology-foundation/object" "0.0.7" + "@topology-foundation/crdt" "0.0.8" + "@topology-foundation/network" "0.0.8" + "@topology-foundation/object" "0.0.8" -"@topology-foundation/object@0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@topology-foundation/object/-/object-0.0.7.tgz#227cae7fb47caeef812f7ab15ac70d778405fa89" - integrity sha512-kasUqQaBeNGCCnojWVFNxnR1izG1kU2mIRGKMZbODRnYkgMd9mTc08AHLflA2qAs0Vkci9LxRyMNWtzugJZEZQ== +"@topology-foundation/object@0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@topology-foundation/object/-/object-0.0.8.tgz#39e57a7cee3c210b94c9a048da5befb0e6695e71" + integrity sha512-hlwqX2/IWuFVk29ssGUT/ZT6sED0r0At13TH3GnUGewijhnn0ZKriQEXr01BQurvm5pOXIJ8php1Jtafzg4RFA== "@topology-foundation/object@file:../../packages/object": - version "0.0.7" + version "0.0.8" "@tsconfig/node10@^1.0.7": version "1.0.11" diff --git a/packages/network/src/index.ts b/packages/network/src/index.ts index ab51100c..69243949 100644 --- a/packages/network/src/index.ts +++ b/packages/network/src/index.ts @@ -1,3 +1,3 @@ -export { TopologyNetworkNodeConfig, TopologyNetworkNode } from "./node.ts"; -export { stringToStream, streamToString } from "./stream.ts"; -export { createRelayNode } from "./relay.ts"; +export { TopologyNetworkNodeConfig, TopologyNetworkNode } from "./node.js"; +export { stringToStream, streamToString } from "./stream.js"; +export { createRelayNode } from "./relay.js"; diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index e9fd65fe..a60ff2e8 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -13,7 +13,7 @@ import { webRTC, webRTCDirect } from "@libp2p/webrtc"; import { webSockets } from "@libp2p/websockets"; import { multiaddr } from "@multiformats/multiaddr"; import { Libp2p, createLibp2p } from "libp2p"; -import { stringToStream } from "./stream.ts"; +import { stringToStream } from "./stream.js"; import { webTransport } from "@libp2p/webtransport"; import { bootstrap } from "@libp2p/bootstrap"; diff --git a/packages/network/src/relay.ts b/packages/network/src/relay.ts index 45cbef29..5c2dd188 100644 --- a/packages/network/src/relay.ts +++ b/packages/network/src/relay.ts @@ -8,7 +8,7 @@ import { pubsubPeerDiscovery } from "@libp2p/pubsub-peer-discovery"; import { webSockets } from "@libp2p/websockets"; import { createLibp2p } from "libp2p"; -import relayerJson from "./peer-id-relayer.ts"; +import relayerJson from "./peer-id-relayer.js"; import { autoNAT } from "@libp2p/autonat"; // TODO: diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 4482807b..640fc27a 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -6,7 +6,7 @@ import { streamToString, } from "@topology-foundation/network"; import { TopologyObject } from "@topology-foundation/object"; -import { TopologyObjectStore } from "./store.ts"; +import { TopologyObjectStore } from "./store.js"; import { fromString as uint8ArrayFromString } from "uint8arrays/from-string"; import { toString as uint8ArrayToString } from "uint8arrays/to-string"; diff --git a/tsconfig.json b/tsconfig.json index 41df8af7..0d668bc6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,6 @@ "esModuleInterop": true, "moduleResolution": "node", - "allowImportingTsExtensions": true, - "emitDeclarationOnly": true, "declaration": true, "declarationMap": true, From 73d70b99d024aa6f1833c80ca7f54aa022886aee Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 22:09:26 +0900 Subject: [PATCH 5/7] chore: release v0.0.9 --- package.json | 2 +- packages/crdt/package.json | 2 +- packages/network/package.json | 2 +- packages/node/package.json | 8 ++++---- packages/object/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 32fb6d0c..4b6b4a00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ts-topology", "description": "The official TypeScript implementation of Topology Protocol", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "homepage": "https://topology.gg/", "repository": { diff --git a/packages/crdt/package.json b/packages/crdt/package.json index ea38d9be..bec508ec 100644 --- a/packages/crdt/package.json +++ b/packages/crdt/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/crdt", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "repository": { "type": "git", diff --git a/packages/network/package.json b/packages/network/package.json index c67cef30..58c92a82 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/network", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "repository": { "type": "git", diff --git a/packages/node/package.json b/packages/node/package.json index f66d262b..887e0271 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/node", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "repository": { "type": "git", @@ -37,8 +37,8 @@ "vitest": "^1.6.0" }, "dependencies": { - "@topology-foundation/crdt": "0.0.8", - "@topology-foundation/network": "0.0.8", - "@topology-foundation/object": "0.0.8" + "@topology-foundation/crdt": "0.0.9", + "@topology-foundation/network": "0.0.9", + "@topology-foundation/object": "0.0.9" } } diff --git a/packages/object/package.json b/packages/object/package.json index d637b3af..2183966f 100644 --- a/packages/object/package.json +++ b/packages/object/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/object", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "repository": { "type": "git", From 4a4af47b397eba39463c5e5fe0b8c5a5da4aa26b Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 22:16:03 +0900 Subject: [PATCH 6/7] add directory imports --- packages/crdt/src/builtins/2PSet/index.ts | 2 +- packages/crdt/src/builtins/PNCounter/index.ts | 2 +- packages/crdt/src/index.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/crdt/src/builtins/2PSet/index.ts b/packages/crdt/src/builtins/2PSet/index.ts index e3ced04d..ca566195 100644 --- a/packages/crdt/src/builtins/2PSet/index.ts +++ b/packages/crdt/src/builtins/2PSet/index.ts @@ -1,4 +1,4 @@ -import { GSet } from "../GSet"; +import { GSet } from "../GSet/index.js"; /// 2PSet with support for state and op changes export class TwoPSet { diff --git a/packages/crdt/src/builtins/PNCounter/index.ts b/packages/crdt/src/builtins/PNCounter/index.ts index 36b1a7ee..7ad3a0d7 100644 --- a/packages/crdt/src/builtins/PNCounter/index.ts +++ b/packages/crdt/src/builtins/PNCounter/index.ts @@ -1,4 +1,4 @@ -import { GCounter } from "../GCounter"; +import { GCounter } from "../GCounter/index.js"; /// State-based PNCounter export class PNCounter { diff --git a/packages/crdt/src/index.ts b/packages/crdt/src/index.ts index af091e56..1badb84a 100644 --- a/packages/crdt/src/index.ts +++ b/packages/crdt/src/index.ts @@ -1,5 +1,5 @@ // TODO dumb export logic, fix this -export { IGCounter, GCounter } from "./builtins/GCounter"; -export { PNCounter } from "./builtins/PNCounter"; -export { GSet } from "./builtins/GSet"; -export { TwoPSet } from "./builtins/2PSet"; +export { IGCounter, GCounter } from "./builtins/GCounter/index.js"; +export { PNCounter } from "./builtins/PNCounter/index.js"; +export { GSet } from "./builtins/GSet/index.js"; +export { TwoPSet } from "./builtins/2PSet/index.js"; From e636c3eb077889c173c988c9a1d5a1a82c034ae5 Mon Sep 17 00:00:00 2001 From: droak Date: Fri, 28 Jun 2024 22:16:22 +0900 Subject: [PATCH 7/7] chore: release v0.0.10 --- package.json | 2 +- packages/crdt/package.json | 2 +- packages/network/package.json | 2 +- packages/node/package.json | 8 ++++---- packages/object/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 4b6b4a00..a2ef6dc9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ts-topology", "description": "The official TypeScript implementation of Topology Protocol", - "version": "0.0.9", + "version": "0.0.10", "license": "MIT", "homepage": "https://topology.gg/", "repository": { diff --git a/packages/crdt/package.json b/packages/crdt/package.json index bec508ec..9f354525 100644 --- a/packages/crdt/package.json +++ b/packages/crdt/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/crdt", - "version": "0.0.9", + "version": "0.0.10", "license": "MIT", "repository": { "type": "git", diff --git a/packages/network/package.json b/packages/network/package.json index 58c92a82..d7e66825 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/network", - "version": "0.0.9", + "version": "0.0.10", "license": "MIT", "repository": { "type": "git", diff --git a/packages/node/package.json b/packages/node/package.json index 887e0271..07b881fe 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/node", - "version": "0.0.9", + "version": "0.0.10", "license": "MIT", "repository": { "type": "git", @@ -37,8 +37,8 @@ "vitest": "^1.6.0" }, "dependencies": { - "@topology-foundation/crdt": "0.0.9", - "@topology-foundation/network": "0.0.9", - "@topology-foundation/object": "0.0.9" + "@topology-foundation/crdt": "0.0.10", + "@topology-foundation/network": "0.0.10", + "@topology-foundation/object": "0.0.10" } } diff --git a/packages/object/package.json b/packages/object/package.json index 2183966f..b1902810 100644 --- a/packages/object/package.json +++ b/packages/object/package.json @@ -1,6 +1,6 @@ { "name": "@topology-foundation/object", - "version": "0.0.9", + "version": "0.0.10", "license": "MIT", "repository": { "type": "git",