From d875165f69a9360fb16ba15a34bda638f2fc7706 Mon Sep 17 00:00:00 2001 From: Elder Ryan Date: Sat, 27 Apr 2024 20:28:38 +0800 Subject: [PATCH] Revert "chore: fix tsconfig and pbjs issue (#574)" This reverts commit ab744218db89f35a264eb5ff05fcb86972d909a5. --- index.ts | 8 +++----- package.json | 8 +++----- tsconfig.json | 8 ++++++++ 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 tsconfig.json diff --git a/index.ts b/index.ts index aa266f1e0..b39df40ae 100644 --- a/index.ts +++ b/index.ts @@ -1,8 +1,6 @@ -import init from "./rings_node.js"; +import init from "./rings_node"; export default init; -export * from "./rings_node.js"; -import Long from "long"; - -export * from "./rings_node_proto.js"; +export * from "./rings_node"; +export * from "./rings_node_proto"; diff --git a/package.json b/package.json index 6d555f0bf..c8596d092 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "description": "Rings is a structured peer-to-peer network implementation using WebRTC, Chord algorithm, and full WebAssembly (WASM) support.\n", "version": "0.6.1", "license": "GPL-3.0", - "type": "module", "repository": { "type": "git", "url": "https://github.com/RingsNetwork/rings-node" @@ -14,16 +13,15 @@ "scripts": { "wasm_pack": "wasm-pack build crates/node --release --scope ringsnetwork -t web --no-default-features --features browser_default --features console_error_panic_hook", "proto_generate": "mkdir -p dist && pbjs -t static-module --keep-case -o dist/rings_node_proto.js crates/rpc/src/protos/rings_node.proto && pbts -o dist/rings_node_proto.d.ts dist/rings_node_proto.js", - "prepare": "npm run wasm_pack && npm run proto_generate && cp crates/node/pkg/rings_node* ./dist && cp index.ts ./dist && tsc --target es6 --moduleResolution nodenext --module nodenext ./dist/index.ts" + "prepare": "npm run wasm_pack && npm run proto_generate && cp crates/node/pkg/rings_node* ./dist && cp index.ts ./dist && tsc ./dist/index.ts" }, "dependencies": { "circomlib": "^2.0.5", - "protobufjs": "https://github.com/RingsNetwork/protobuf.js#83686a0", - "long": "^3.2.0" + "protobufjs": "https://github.com/RingsNetwork/protobuf.js#83686a0" }, "devDependencies": { "protobufjs-cli": "^1.1.2", - "typescript": "^5" + "typescript": "^4.9.5" }, "files": [ "dist/" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..731231610 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "target": "es6", + "declaration": true, + "esModuleInterop": true + } +}