CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

Refactor/add typescript #88

Closed james-hummingbot closed 3 years ago

james-hummingbot commented 3 years ago

@evseevnn Can you take a look at this? I must be doing something wrong because I see the following when I do yarn start.

22:05:50 0|ts-node  | TypeError: dist/index.js: Emit skipped
22:05:50 0|ts-node  |     at getOutput (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/index.ts:924:17)
22:05:50 0|ts-node  |     at Object.compile (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/index.ts:1189:32)
22:05:50 0|ts-node  |     at Module.m._compile (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/index.ts:1295:42)
22:05:50 0|ts-node  |     at Module._extensions..js (internal/modules/cjs/loader.js:973:10)
22:05:50 0|ts-node  |     at Object.require.extensions.<computed> [as .js] (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/index.ts:1298:12)
22:05:50 0|ts-node  |     at Module.load (internal/modules/cjs/loader.js:812:32)
22:05:50 0|ts-node  |     at Function.Module._load (internal/modules/cjs/loader.js:724:14)
22:05:50 0|ts-node  |     at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
22:05:50 0|ts-node  |     at main (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/bin.ts:246:14)
22:05:50 0|ts-node  |     at Object.<anonymous> (/home/james/work/hummingbot/gateway-api/node_modules/ts-node/src/bin.ts:382:3)
james-hummingbot commented 3 years ago

I see the problem, I was using ts-node, works if I switch to babel-node. Any suggestions to changes to package.json would be nice.

evseevnn commented 3 years ago

I see the problem, I was using ts-node, works if I switch to babel-node. Any suggestions to changes to package.json would be nice.

Actually for me all works fine with regular node.

If you still need help ask me directly.

RC-13 commented 3 years ago

@james-hummingbot I'm currently getting an error when running the yarn run start command, no issue when starting in debug mode (yarn run debug). Cross-checked the development branch and confirm that it only happens in this branch. yarn start error

james-hummingbot commented 3 years ago

@evseevnn I have addressed all the issues you mentioned.

james-hummingbot commented 3 years ago

@RC-13 There is now a build/compile phase before you can run the production version because we are using TypeScript (debug is for local development and not as efficient as the production version). I just update the README to clarify this. Let me know if there is any internal documentation that we need to update as well. Also notice there is a small change in DOCKERFILE as well for the build phase.

yarn 
yarn run build
yarn run start