-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: convert all source files to ESM * build: upgrade deps to latest; migrate to newer eslint flat config; lint src * test: migrate tests to ESM * ci: migrate to new action versions; add node 21 to test matrix * build(examples/web): upgrade deps to latest; migrate to newer eslint flat config * build: use browser-compatible implementation of EventEmitter * build(examples/web): do not import serial/ws connections for browser builds * test: reinstate test for optional dependency `canvas`
- Loading branch information
Showing
30 changed files
with
1,751 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
const ALL_DEVICES = require('./device') | ||
import * as ALL_DEVICES from './device.js' | ||
|
||
async function discover() { | ||
export async function discover(args) { | ||
const devices = await ALL_DEVICES.LoupedeckDevice.list() | ||
if (devices.length === 0) throw new Error('No devices found') | ||
const { productId, ...args } = devices[0] | ||
const { productId, ...connectArgs } = devices[0] | ||
const deviceType = Object.values(ALL_DEVICES).find(dev => dev.productId === productId) | ||
if (!deviceType) throw new Error(`Device with product ID ${productId} not yet supported! Please file an issue at https://github.com/foxxyz/loupedeck/issues`) | ||
const device = new deviceType(args) | ||
const device = new deviceType({ ...args, ...connectArgs }) | ||
return device | ||
} | ||
|
||
module.exports = { | ||
discover | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import jsConfig from '@appliedminds/eslint-config' | ||
import jest from 'eslint-plugin-jest' | ||
import globals from 'globals' | ||
|
||
export default [ | ||
...jsConfig, | ||
jest.configs['flat/recommended'], | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import amJs from '@appliedminds/eslint-config' | ||
import amVue from '@appliedminds/eslint-config/vue.js' | ||
|
||
export default [ | ||
...amJs, | ||
...amVue, | ||
] |
Oops, something went wrong.