ergo
ergo copied to clipboard
feat(*): Add Typescript type definitions
Signed-off-by: Giacomo Minighin [email protected]
Issue #785
Added typescript definitions for ergo-compiler ergo-engine
Changes
- added packages/ergo-compiler/types/index.d.ts
- added packages/ergo-compiler/types/tsconfig.json
- added typescript @types/node in ergo-compiler dev dependencies
- added script types:check in ergo-compiler
- added packages/ergo-engine/types/index.d.ts
- added packages/ergo-engine/types/tsconfig.json
- added typescript in ergo-engine dev dependencies
- added script types:check in ergo-engine
@j4m3sb0mb My apologies that it has taken us so long to get to this. Thank you for your contribution.
I would love to get this merged, can you please remove the ^
symbols from the changed package.json
files. In this repository we require that all dependencies use explicit versions.
You can check that the test passes locally by running npm run depcheck
from the root folder.
Coverage remained the same at 95.376% when pulling a6b5229c6e887111c33896719b9297ccb767bdf9 on j4m3sb0mb:master into 653df8dba652899d3f5322229070e7cdf5d603b6 on accordproject:master.
@jeromesimeon @radhikakotangoor I'm happy with this, do either of you have input on the type definitions?
I left some any
type that should be changed with the proper type but I wasn't sure wich was.
Ok @jeromesimeon where should i put the "helloworld.ts"?
Ok @jeromesimeon where should i put the "helloworld.ts"?
That's a really good question. I would put it in e.g., ./tests/typescript
for now. We can see later if we find a better place.
I'm writing a little example with some functions but I think that for a real test should be used this package: https://github.com/SamVerschueren/tsd
I'm writing a little example with some functions but I think that for a real test should be used this package: https://github.com/SamVerschueren/tsd
Hi @j4m3sb0mb it's been a while since I've looked at TypeScript, but what you are suggesting sounds good (we will have to maintain this over time). I think the PR is valuable as is though I think I would be happy with either:
- add a small example to explain how to use the code with TypeScript and merge this, then do a later separate PR with a testing package along the lines of the one you suggest
- keep this PR open and wait for testing
I think it's a bit up to you which of those sound better.
Thanks!