Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
cache: npm

- name: Install dependencies
run: npm install
run: npm run install

- name: Run Build
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: npm

- name: Install dependencies
run: npm install
run: npm run install

- name: Run Build
run: npm run build
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,33 @@ Please do not build Agent from source unless you want to develop it. Using an ex

### Step 1: Build Dependencies

You'll need Node.js 20.x. Use your OS package manager to install it. [Check the NodeJS site for more info.](https://nodejs.org/en/download/package-manager/ "Installing Node.js via package manager") Mac OS users can simply `brew install node` to get both. Should you need multiple Node.js versions on the same computer, use Node Version Manager for [Mac/Linux](https://github.com/creationix/nvm) or for [Windows](https://github.com/coreybutler/nvm-windows)
You'll need Node.js 20.x. Use your OS package manager to install it. [Check the Node.js site for more info.](https://nodejs.org/en/download/package-manager/ "Installing Node.js via package manager") Mac OS users can simply `brew install node` to get both. Should you need multiple Node.js versions on the same computer, use Node Version Manager for [Mac/Linux](https://github.com/creationix/nvm) or for [Windows](https://github.com/coreybutler/nvm-windows)

You'll also need `libusb`.
On debian-based linux distros, `apt-get install libusb-dev libudev-dev g++` is sufficient.
On Mac OS, use `brew install libusb libusb-compat`.
On macOS, use `brew install libusb libusb-compat`.
For everyone else, use the appropriate package manager for your OS.

### Step 2: Build Environment

```
git clone git@github.com:UltimateHackingKeyboard/agent.git
cd agent
npm ci
npm run install
npm run build
npm run electron
```

The `npm run install` script wraps `npm ci --ignore-scripts && npm run postinstall`,
allowing us to skip dependency install scripts. Agent currently has no dependencies
that require post-install steps, so this serves as a workaround until npm 12 ships with Node.js.

At this point, Agent should be running on your machine.

## Install dependencies

npm workspace installs dependencies in hoisted mode, it is not really suitable for us.
If you add or update a dependency of a package then navigate to the directory edit the package.json and run `npm install`
If you add or update a dependency of a package then navigate to the directory edit the package.json and run `npm install --ignore-scripts`

## Developing the web application

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"webpack-cli": "7.2.1"
},
"scripts": {
"postinstall": "lerna exec npm ci",
"install": "npm ci --ignore-scripts && npm run postinstall",
"postinstall": "lerna exec npm ci -- --ignore-scripts",
"test": "lerna run test",
"lint": "lerna run lint",
"e2e": "lerna run e2e --scope uhk-web",
Expand Down
2 changes: 1 addition & 1 deletion packages/uhk-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"build": "webpack && npm run install:build-deps && npm run download-firmware && npm run copy-to-tmp-folder",
"clean": "rimraf ./node_modules ./dist",
"lint": "eslint",
"install:build-deps": "cd ./dist && npm i",
"install:build-deps": "cd ./dist && npm i --ignore-scripts",
"download-firmware": "node ../../scripts/download-firmware.js",
"copy-to-tmp-folder": "node ../../scripts/copy-to-tmp-folder.js",
"webpack": "webpack"
Expand Down
2 changes: 1 addition & 1 deletion packages/usb/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Usage

1. Install node.js and npm
2. Run `npm ci` in the root directory of the git repository
2. Run `npm run install` in the root directory of the git repository
3. Run `npm build`
4. Switch to usb directory `cd packages/usb`
4. Run script eg. `./blink-led-pwm-brightness.ts`
Expand Down