Skip to content

Commit

Permalink
fix: broken package.json commands, broken named imports due to node -…
Browse files Browse the repository at this point in the history
…-experimental-modules (#153)

* fix(rpc): use export * instead of named import + export because of node --experimental-modules bug

* fix: broken package.json commands
  • Loading branch information
varunsrin committed Oct 10, 2022
1 parent a7c7041 commit d73534f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
},
"type": "module",
"scripts": {
"bench": "tsx src/bench.ts",
"bench": "tsx src/test/perf/bench.ts",
"build": "yarn clean && tsc --project ./tsconfig.json",
"clean": "rm -rf ./build",
"check:types": "tsc --noEmit",
"dev": "tsx watch src/server.ts",
"dev": "tsx watch src/cli.ts",
"prepare": "husky install",
"lint": "eslint src/ --color --ext .ts",
"lint:fix": "yarn run lint -- --fix",
Expand Down
8 changes: 6 additions & 2 deletions src/network/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import { RPCClient } from './client';
import { RPCServer } from './server';
import { RPCHandler } from './interfaces';

export { RPCClient, RPCServer, RPCHandler };
// node --experimental-modules does not play nicely with exports and refuses to import a default interface even when
// implementing the fix described here: https://github.com/ardatan/graphql-tools/issues/913
// Requires further investigating, but export * seems like a decent workaround for now
export * from './interfaces';

export { RPCClient, RPCServer };

0 comments on commit d73534f

Please sign in to comment.