Compare commits
10 Commits
b135f62c18
...
23326938c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23326938c9 | ||
|
|
31e061a852 | ||
|
|
252fe1bcda | ||
|
|
f1b4d43380 | ||
|
|
04bc46b37e | ||
|
|
58320efbb3 | ||
|
|
8fee963c77 | ||
|
|
afc2eec6c1 | ||
|
|
51141b3f05 | ||
|
|
fbf76ea6fa |
54
.github/workflows/build.yml
vendored
Normal file
54
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: 🐧 Linux
|
||||||
|
os: ubuntu-latest
|
||||||
|
pnpm_command: 'build:linux'
|
||||||
|
binary_path: dist/*.AppImage
|
||||||
|
asset_name: zeroone.AppImage
|
||||||
|
- name: 🪟 Windows
|
||||||
|
os: windows-latest
|
||||||
|
pnpm_command: 'build:win'
|
||||||
|
binary_path: dist/*.exe
|
||||||
|
asset_name: zeroone.exe
|
||||||
|
- name: 🍏 Mac
|
||||||
|
os: macos-latest
|
||||||
|
pnpm_command: 'build:mac'
|
||||||
|
binary_path: dist/*.dmg
|
||||||
|
asset_name: zeroone.dmg
|
||||||
|
name: ${{ matrix.name }} Build
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: 🚚 Checkout latest code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 🟩 Use Node.js 20.x
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20.x'
|
||||||
|
|
||||||
|
- name: ⚡ Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4.0.0
|
||||||
|
|
||||||
|
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
|
||||||
|
- name: 💡 Tweak pnpm.cjs
|
||||||
|
if: ${{ contains(matrix.os, 'windows') }}
|
||||||
|
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: 🔨 Build Project
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
pnpm i
|
||||||
|
pnpm ${{ matrix.pnpm_command }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -13,10 +13,10 @@ jobs:
|
|||||||
- name: 🐧 Linux
|
- name: 🐧 Linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
pnpm_command: 'build:linux'
|
pnpm_command: 'build:linux'
|
||||||
binary_path: dist/*.deb
|
binary_path: dist/*.AppImage
|
||||||
asset_name: zeroone.deb
|
asset_name: zeroone.AppImage
|
||||||
- name: 🪟 Windows
|
- name: 🪟 Windows
|
||||||
os: macos-latest
|
os: windows-latest
|
||||||
pnpm_command: 'build:win'
|
pnpm_command: 'build:win'
|
||||||
binary_path: dist/*.exe
|
binary_path: dist/*.exe
|
||||||
asset_name: zeroone.exe
|
asset_name: zeroone.exe
|
||||||
@@ -44,7 +44,13 @@ jobs:
|
|||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
|
|
||||||
- name: ⚡ Setup pnpm
|
- name: ⚡ Setup pnpm
|
||||||
uses: pnpm/action-setup@v3.0.0
|
uses: pnpm/action-setup@v4.0.0
|
||||||
|
|
||||||
|
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
|
||||||
|
- name: Tweak pnpm.cjs
|
||||||
|
if: ${{ contains(matrix.os, 'windows') }}
|
||||||
|
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: 🔨 Build Project
|
- name: 🔨 Build Project
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"description": "Configuration Suite for Binaris Devices",
|
"description": "Configuration Suite for Binaris Devices",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "katbinaris",
|
"author": "katbinaris",
|
||||||
"packageManager": "pnpm@8.14.1",
|
"packageManager": "pnpm@9.3.0",
|
||||||
"homepage": "https://github.com/katbinaris/zeroone",
|
"homepage": "https://github.com/katbinaris/zeroone",
|
||||||
"build": {
|
"build": {
|
||||||
"productName": "ZERO_ONE"
|
"productName": "ZERO_ONE"
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import { PortInfo } from '@serialport/bindings-interface'
|
|||||||
import { EventEmitter } from 'events'
|
import { EventEmitter } from 'events'
|
||||||
|
|
||||||
// JTAG interface, TODO: change me!
|
// JTAG interface, TODO: change me!
|
||||||
const NANO_PRODUCT_ID = '8010'
|
const NANO_VID_PID_PAIRS = [
|
||||||
const NANO_VENDOR_ID = '239A'
|
{ vid: '239A', pid: '8010' },
|
||||||
|
{ vid: '303A', pid: '1001' }
|
||||||
|
]
|
||||||
const NANO_BAUD_RATE = 115200
|
const NANO_BAUD_RATE = 115200
|
||||||
|
|
||||||
class NanoSerialApi extends EventEmitter {
|
class NanoSerialApi extends EventEmitter {
|
||||||
@@ -18,9 +20,12 @@ class NanoSerialApi extends EventEmitter {
|
|||||||
const found_nano_devices: string[] = []
|
const found_nano_devices: string[] = []
|
||||||
for (const port of ports) {
|
for (const port of ports) {
|
||||||
if (
|
if (
|
||||||
port.productId?.toUpperCase() === NANO_PRODUCT_ID &&
|
port.serialNumber &&
|
||||||
port.vendorId?.toUpperCase() === NANO_VENDOR_ID &&
|
NANO_VID_PID_PAIRS.some(
|
||||||
port.serialNumber
|
(pair) =>
|
||||||
|
pair.vid === port.vendorId?.toUpperCase() &&
|
||||||
|
pair.pid === port.productId?.toUpperCase()
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
found_nano_devices.push(port.serialNumber)
|
found_nano_devices.push(port.serialNumber)
|
||||||
if (this.all_nano_devices[port.serialNumber] === undefined) {
|
if (this.all_nano_devices[port.serialNumber] === undefined) {
|
||||||
@@ -30,14 +35,6 @@ class NanoSerialApi extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve(found_nano_devices)
|
|
||||||
for (const serialNumber in this.all_nano_devices) {
|
|
||||||
if (found_nano_devices.indexOf(serialNumber) === -1) {
|
|
||||||
delete this.all_nano_devices[serialNumber]
|
|
||||||
this.emit('nanoSerialApi:device-detached', serialNumber)
|
|
||||||
console.log('detached', serialNumber)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error)
|
reject(error)
|
||||||
@@ -120,6 +117,7 @@ class NanoSerialApi extends EventEmitter {
|
|||||||
})
|
})
|
||||||
port.open((err) => {
|
port.open((err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
console.log('Error opening port: ', err)
|
||||||
reject(err)
|
reject(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<p>Idle Timeout: </p>
|
<p>Idle Timeout: </p>
|
||||||
<p>
|
<p>
|
||||||
{{
|
{{
|
||||||
deviceStore.settings?.idleTimeout
|
deviceStore.settings?.idleTimeout !== 999999999
|
||||||
? `${Math.round(deviceStore.settings.idleTimeout / 1000)}s`
|
? `${Math.round(deviceStore.settings.idleTimeout / 1000)}s`
|
||||||
: 'Off'
|
: 'Off'
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -401,14 +401,14 @@ export const useDeviceStore = defineStore('device', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cycleIdleTimeout() {
|
cycleIdleTimeout() {
|
||||||
if (this.settings!.idleTimeout === 0) {
|
if (this.settings!.idleTimeout === 999999999) {
|
||||||
this.setIdleTimeout(10000)
|
this.setIdleTimeout(10000)
|
||||||
} else if (this.settings!.idleTimeout === 10000) {
|
} else if (this.settings!.idleTimeout === 10000) {
|
||||||
this.setIdleTimeout(30000)
|
this.setIdleTimeout(30000)
|
||||||
} else if (this.settings!.idleTimeout === 30000) {
|
} else if (this.settings!.idleTimeout === 30000) {
|
||||||
this.setIdleTimeout(60000)
|
this.setIdleTimeout(60000)
|
||||||
} else {
|
} else {
|
||||||
this.setIdleTimeout(0)
|
this.setIdleTimeout(999999999)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setPosition(position: number) {
|
setPosition(position: number) {
|
||||||
@@ -649,7 +649,10 @@ export const useDeviceStore = defineStore('device', {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
profile: this.currentProfileName,
|
profile: this.currentProfileName,
|
||||||
updates: {
|
updates: {
|
||||||
knob: this.currentProfile!.knob
|
knob: this.currentProfile!.knob.map((v) => ({
|
||||||
|
haptic: { outputRamp: v.haptic.outputRamp },
|
||||||
|
type: v.type
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -666,7 +669,10 @@ export const useDeviceStore = defineStore('device', {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
profile: this.currentProfileName,
|
profile: this.currentProfileName,
|
||||||
updates: {
|
updates: {
|
||||||
knob: this.currentProfile!.knob
|
knob: this.currentProfile!.knob.map((v) => ({
|
||||||
|
haptic: { detentStrength: v.haptic.detentStrength },
|
||||||
|
type: v.type
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -749,7 +755,7 @@ export const initializeDevices = () => {
|
|||||||
setTimeout(function timer() {
|
setTimeout(function timer() {
|
||||||
console.log('Requesting profile', profileName)
|
console.log('Requesting profile', profileName)
|
||||||
nanoIpc.send(deviceid, JSON.stringify({ profile: profileName }))
|
nanoIpc.send(deviceid, JSON.stringify({ profile: profileName }))
|
||||||
}, i * 15)
|
}, i * 30)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (update.current !== undefined) {
|
if (update.current !== undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user