ergo icon indicating copy to clipboard operation
ergo copied to clipboard

feat(*): Add Typescript type definitions

Open j4m3sb0mb opened this issue 3 years ago • 8 comments

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 avatar Nov 03 '20 15:11 j4m3sb0mb

@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.

mttrbrts avatar Mar 02 '21 09:03 mttrbrts

Coverage Status

Coverage remained the same at 95.376% when pulling a6b5229c6e887111c33896719b9297ccb767bdf9 on j4m3sb0mb:master into 653df8dba652899d3f5322229070e7cdf5d603b6 on accordproject:master.

coveralls avatar Mar 02 '21 15:03 coveralls

@jeromesimeon @radhikakotangoor I'm happy with this, do either of you have input on the type definitions?

mttrbrts avatar Mar 05 '21 12:03 mttrbrts

I left some any type that should be changed with the proper type but I wasn't sure wich was.

j4m3sb0mb avatar Mar 08 '21 09:03 j4m3sb0mb

Ok @jeromesimeon where should i put the "helloworld.ts"?

j4m3sb0mb avatar Mar 15 '21 10:03 j4m3sb0mb

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.

jeromesimeon avatar Mar 15 '21 12:03 jeromesimeon

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

j4m3sb0mb avatar Mar 16 '21 12:03 j4m3sb0mb

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:

  1. 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
  2. keep this PR open and wait for testing

I think it's a bit up to you which of those sound better.

Thanks!

jeromesimeon avatar Mar 27 '21 15:03 jeromesimeon