This is a VS Code Marketplace Extension that allows us to connect Hardware Interface Devices (HIDs) to our computers and trigger VSCode commands. π
-
Make sure your HID hardware device is connected to your computer.
-
Open the command palette:
a. MAC: (Command + Shift + P)
b. Windows: (Control + Shift + P)
-
Type
vsconnect
.a. Select the
VSConnect
option. -
Press the key on the HID device you want to use to trigger a VSCode command 10 times (explanation for selecting 10 times here).
-
Filter for the command you want to trigger with your hardware device.
a. In the GIF example above, we are triggering the VSCode
Create New File
command. -
You should see a notification in the bottom right screen that reads
[VSCode Command] is now connected!
. -
Press the key HID trigger and watch the VSCode command work!
This project has only been tested on the Ubuntu (Linux) operating system. If you happen to make this function properly on other operating systems, it'd be great if you could let me know in a GitHub Issue and outline the steps you took to make it work so I can list it as functional. π
-
If you are using a Linux operating system, you will need to configure a udev rules configuration file to allow your operating sytem permission to connect the HID hardware devices. a. Create a file
/etc/udev/rules.d/100-vsconnect.rules
b. Add these contents to that file:SUBSYSTEM=="usb", ATTRS{idVendor}=="VID", ATTRS{idProduct}=="PID", MODE="0666"
c. Then load the rules by entering:
sudo service udev restart
β οΈ This project is in alpha, so this step will need to be automated and configured more securely. -
Install dependencies: a. This project requires actually having the VSCode IDE installed to test it since it is a VSCode extension.
b. Install
npm
on your computer. I suggest using the Node Version Manager for ease of switching versions on your computer. -
Then type
nvm use
in the root of the project.a. This utilizes the
.nvmrc
file which selects the latest version of Node to run. -
Then type
npm i
in the root of the project.a. This installs the dependencies, including the VSCode extension and electron dependencies, specified in the package.json file to be able to run the project.
-
Then use the
./vscode/launch.json
file to launch the debugger:a. Go to the
Run and Debug
tab. b. SelectRun Extension
in the dropdown . c. Click the green play button to run the project. -
Run the project locally the same way you see how the GIF illustrates it working above!
-
Install dependencies:
Install
npm
on your computer. I suggest using the Node Version Manager for ease of switching versions on your computer. -
Then type
nvm use
in the root of the project.This utilizes the
.nvmrc
file which selects the latest version of Node to run. -
Type
npm run test
to run the Jest unit test suite.
This application is managed and run by the Electron framework. So the design is setup within 2 main parts in order to maintain code that is:
β easy to read
β easy to write
β easy to test
-
"Frontend"
-
"Backend"
-
-
Core
-
Infrastructure
-
-
Generally, we'll always take an external input and do something- and then repeat this pattern over and over and over.
Use cases are routines that utilize the layers round trip. A use case starts from an invokation from an external entity like a user (or another system in the future).
Use Case Sequence Diagram
Every use case has been broken down into layers. This makes it much easier to:
β write unit tests by mocking the decoupled dependencies.
β modify existing use cases without messing everything else up.
β create new use cases by copying/pasting previous ones.
Repositories, external APIs, Event listeners, and all other code that deal with IO in some way should be implemented in this layer.
Users
The layer the user iteracts with. 2 responsibilities:
- capture user input and update the presenter layer for coordination
- invoked by the presenter to display updates to the user
The layer that orchestrates the interaction between the model (core) and view layers. 2 responsibilities:
- pass user input to the core
- create the view model for the view to receive and display to the user
2 responsibilities:
- aggregate the data the domain service and domain model need to work with
- orchestrate non-functional side effects that the system needs to run
2 responsibilities:
- first, validate the data provided by the application service by passing it to the domain model
- second, perform business logic with the provided data
1 responsibility:
- validate the data for the domain service (if needed)
Will explain when I find the time outside of work.
Will explain when I find the time outside of work.
Will explain when I find the time outside of work.