-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: typescript everything #2406
Conversation
This is the first commit with composit projects and project references
- Typscript types are now available for all packages - Serialport no longer supports Node 10 - `baudRate` on `serialport` and `@serialport/stream` packages is no longer defaulted to 9600 - All parser packages now have named exports - Bindings have moved from `@serialport/bindings` to `@serialport/bindings-cpp` they are shipped with `prebuildify` and no longer require a download. - `@serialport/bindings-cpp` now leverages N-API and shouldn't need to be upgraded for every node release. - baudRate is now required - bindings and mock bindings now have a new interface with bindings-cpp - stream no longer has a list method - serialport package no longer has a static bindings property TODO - stop bits are incorrect from a bindings level to the port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is still in draft. Just a quick look. Overall changes don't look too bad, mostly annoying in the tests to assert the runtime checks 😄
stuck on the 2k write test on an arduino - it seems to crash the poor thing, the mock bindings deal just fine. I'm going to copy the test into the bindings cpp repo becasue it's eiother an issue ther or with my hardware. mock binding now can give smaller read responses even if there is available data (much like a real port) find find-arduino too
composit packages only exist for builds not for general development
"test:watch": "mocha -w", | ||
"test": "nyc --reporter=html --reporter=text --reporter lcovonly mocha", | ||
"typecheck": "tsc" | ||
"typecheck": "lerna exec tsc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is better not sure -it's fast so nbd either way
@@ -47,7 +58,7 @@ class SlipDecoder extends Transform { | |||
} | |||
|
|||
if (this.escape) { | |||
if (byte === this.opts.ESC_START) { | |||
if (byte === this.opts.ESC_START && this.opts.START) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really the only functional change in parsers - it doesn't break tests and the code doesn't make sense or typecheck without it
e98b0c7
to
00a4537
Compare
This is a huge pr, trying to get anything to convert to typescript piecemeal was very very frustrating and most of the conversions are straight copies.
However
@serialport/stream
serialport
Full change log
bindings-abstract
is nowbindings-interface
and it's in it's own repo (bindings-cpp
relies on it and having a cyclic dependency on the monorepo was hard)baudRate
onserialport
and@serialport/stream
packages is no longer defaulted to 9600@serialport/bindings
to@serialport/bindings-cpp
they are shipped with -prebuildify
and no longer require a download.@serialport/bindings-cpp
now leverages N-API and shouldn't need to be upgraded for every node release.