TypeScript inside the package #3
Conversation
|
@ithinuel could you please take a look? |
ithinuel
left a comment
There was a problem hiding this comment.
Thanks for your contribution, I'm glad it can help you !
I don't know much about typescript so I have some questions:
- Is there a way to test the validity of those new files ?
eg, checking the APIs actually match and are not broken by futures changes ? - Can those test be tested in CI ?
Speeking of CI, I noticed that the nodejs versions in .travis.yml where long outdated. So I prepared #4 to bump them to latest version and latest LTS.
|
@ithinuel thank you for pointing out the question regarding type validation, I've taken some time to verify what's possible and found out it can be partially done using: This led to few issues being fixed 🙇 Unfortunately, that's only a semantics and for sure it can let some logical errors pass. The only way I can know is to rewrite tests to TypeScript, to let compiler jump in when it detects any difference in types when API methods are used in test scenarios. |
|
Thanks for looking into this. Do you think it'd be reasonable to add a little .ts example to demo this lib using typescript ? I could then use that as a reference if/when I find time to learn typescript 😄 |
I've done a TS mapping to be able to use the mqttsn-packet in my project and I'd like to share the results with you.