This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is sort of two changes, hopefully that's okay.
The first change, an actual bugfix:
Fix the command that gets run when running
Arduino CLI: Upload
.There was an error that would appear:
Previously, the command used the pure "upload" command from arduino-cli, which meant it wasn't compiling then uploading, just uploading.
This didn't match the
Arduino: Upload
command, which does compile, and separately, it seems it was intended to do the upload command because there was a--build-path
flag being passed, which is for thecompile
command.I changed the code so that instead of an
arduino-cli upload
command, it now does anarduino-cli compile --upload
command, which does two things:Arduino: Upload
command, and makes it so that it works with the flags that are passed in (those two facts make me relatively confident that was the intended purpose of this command in the first place)arduino-cli compile
command.The second change was to make the development experience better:
There seemed to be a few parts of the codebase where there was some assumptions made about the developer's environment. For example, the correct version of node and npm, a specific version of python installed, g++, etc. Trying to build the project on an M1 Macbook was very challenging, I spent a couple hours trying to get it all working properly.
In the end, I had to update a number of dependencies (the old ones were deprecated anyways and everything seems to work properly still) as well.
To tie it all together, I wrote a Dockerfile which sets up the development environment properly and builds the project.
Finally, I added two commands to the package.json "scripts" section:
package
which runsnode ./build/package.js
. This is just for convenience/discoverability since it took me a while to figure out how to even build the project.dockerbuild
, which builds the docker file and then runs the package script, and outputs the resulting .vsix files in the./out
directory.I also updated the README as appropriate.
Fixes:
#1686
#1646
#1319