Closed JordiChauzi closed 4 years ago
hey @JordiChauzi this new feature is awesome and I love the code and error messages!
I think you were right to point out the issue of the board spec technically being invalid JSON. What I'm going to propose is to switch to a .js file instead, and document (in the README) the general idea of how to create this file. We can point the user to the custom board section of the README rather than reinvent the wheel so they can learn how to do this. What do you think?
hey @JordiChauzi this new feature is awesome and I love the code and error messages!
I think you were right to point out the issue of the board spec technically being invalid JSON. What I'm going to propose is to switch to a .js file instead, and document (in the README) the general idea of how to create this file. We can point the user to the custom board section of the README rather than reinvent the wheel so they can learn how to do this. What do you think?
Yep, this seems logical.
I have changed the custom file to a JavaScript file. I have implemented a simple solution to export the board (ie. module.exports = board;
). Tell me if you want something different!
thanks for making these changes! I'm ready to merge and release these changes if you're comfortable with that!
All is good on my side!
whoops! Sorry for dropping the ball on this! Merging and releasing in a new version now 👀 Thanks again for adding this much needed feature 😄 🎉
Fixes #97
This PR allows to provide a custom board specification in the CLI, eg:
This change being in the CLI part, I am not sure what is the appropriate way to test it.
There is currently not a lot of documentation for custom boards (looking at you #151), so I did not add documentation on the expected JSON format. The only tricky part, I think, is the
signature
field where we create theBuffer
from the input JSON array. Maybe adding a CLI option to display the JSON specification for a supported board may help ?Maybe we want to the feature to the library part? It may make sense to handle the
Buffer
creation for the user.I tried to provide an accurate error message, but using the same argument, it is kind of hard to discriminate between a board name and a JSON file.