This allows for catching TypeErrors when open gets called
- Change MockBinding to properly throw and return errors on open
- Enforce bindings throwing on empty string paths
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object.
- Move all bindings into platform specific modules DarwinBinding LinuxBinding, and WindowsBinding
- Separate out the bindings from the SerialPort class so it can be required by itself.
- Provide mock bindings as a tested first class bindings layer
- Mixin stream methods with `pushBindingWrap`, inspired from fs.readStream
- All integration tests now require an Arduino
- Ditch sandboxed modules as we don't need to be that heavy handed to test anymore
TODO
- windows binding
- performance test
- memory leak test
- 🎉
`this.buffer` is never initialized so if we close the port while reading we'll get an error. This has no tests but doesn't fail any of our current tests. With the streams rewrite this is no longer an issue and instead of testing it fully here I'd rather concentrate on a new implementation of it.
Parsers are now transform streams! I'm not 100% convinced this is easier to use but it is more clear about the mechanics. I think that might make it worthwhile. It also opens up a clear example to how to make your own parser.
This moves a lot of docs into JSDOC and provides a doc build system including throwing a CI error if the docs are out of date or if the wrong file was edited. Docs are put into the README for now but html docs are possible. Updated contributors guide to explain how to update the docs.
Todo:
- transition static methods and parsers into jsdoc
- options objects and callbacks show as instance methods
- npm test now runs everything but stress tests
- TEST_PORT is optional but now requires an arduino, the travis provided OS X serial port wasn't worth it
- do some improvements to coverage
- Drop grunt for file size and complexity
- Eslint has dropped 0.10
I don't think Istanbul can detect coverage on sandboxed modules like our mocked bindings. Moving to an isolated binding will improve this situation.
I also don't think coveralls is working on travis
- Constructor now throws errors when given invalid options
- The Constructor’s callback is given to `.open()` if `openImmediately` is set
- Depreciation warning when using the old style SerialPort.SerialPort
- Fix bug where write callback was being called multiple times when write operations blocked
- [windows] refactored write code to be less complex
- [unix] refactored write code to be less complex
- added arduino required integration tests
- Errors should always be an error or null
- bindings.close doesn't throw with proper args so why are we catching?
- throw on update if given bad options
- support and test updating and opening with custom baud rates
- Drop `bluebird` 168kb for `es6-promise` 37.1kb (vs 18.1kb library code) bundled sizes
- Move `node-pre-gyp-github` to dev deps so it's not always installed (5.8MB package size)
- Stop bundling `node-pre-gyp-github` as it's only needed during publishing
- Test requiring the library as part of the build processes on all platforms
- move all js code into ./lib
- move all the easy stuff into ./lib/bindings the rest will bring breaking changes probably
- Refactor to fix bugs
- Remove the path behind `udevadm` as it’s not always in the same place but it’s so far it is always in the path
- Tests listUnix, (`pnpId` assumes a lot about `udevadm` =( )
- Adds `ttyMDF` to the list of serial ports for “High Speed UART device of Intel Medfield platform”
- turn down the verboseness on appveyor nam installs
- upgrade sandboxed-module for windows support
Fixes#650, #651, #634, #697 and #621