Skip to content

Commit 962ada1

Browse files
authored
refactor!: migrate to ESM, Replace Jest with native test runner (#39)
* refactor: convert all source files to ESM pt 1 * build: upgrade deps to latest; migrate to newer eslint flat config; lint src * test: migrate tests to ESM * build: use browser-compatible implementation of EventEmitter; examples working * test: reinstate test for optional dependency `canvas` * refactor!: de-jestify part 1 * test!: dejestify, part 2/2 * ci: remove node 18 support * ci: run apt update to prevent 404 errors * build(examples/web): upgrade deps to latest
1 parent e593ea7 commit 962ada1

21 files changed

+2979
-6011
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [18.x, 20.x, 22.x, 23.x, latest]
14+
node-version: [20.x, 22.x, 23.x, latest]
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Use Node.js ${{ matrix.node-version }}
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: ${{ matrix.node-version }}
21+
- name: Update repositories
22+
run: sudo apt-get update
2123
- name: Install system dependencies
2224
run: sudo apt-get install libcairo2-dev libpango1.0-dev libgif-dev
2325
- run: npm ci

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Supports:
2424
Requirements
2525
------------
2626

27-
* Node 18+
28-
* Supported Device
27+
* Node 20+
28+
* Supported Devices:
2929
* Loupedeck Live
3030
* Loupedeck Live S
3131
* Loupedeck CT

__mocks__/serialport.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Sec-WebSocket-Accept: PLOTDYCXHOTMeouth==
1515
`
1616

1717
// Stand-in for a Loupedeck serial device
18-
export class SerialPort extends EventEmitter {
18+
export class MockSerialPort extends EventEmitter {
1919
static list() {
2020
return [
2121
{

__mocks__/ws.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import EventEmitter from 'node:events'
22

33
// Stand-in for a real WebSocket
4-
export default class MockSocket extends EventEmitter {
4+
export class MockSocket extends EventEmitter {
55
constructor(url) {
66
super()
77
this.url = url

eslint.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import jsConfig from '@appliedminds/eslint-config'
2-
import jest from 'eslint-plugin-jest'
32
import globals from 'globals'
43

54
export default [
65
...jsConfig,
7-
jest.configs['flat/recommended'],
86
{
97
languageOptions: {
108
globals: {

examples/web/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ It uses [Vite](https://github.com/vitejs/vite) & [Vue 3](https://github.com/vuej
88
Requirements
99
------------
1010

11-
* Node 16+
12-
* Supported Browser
11+
* Node 20+
12+
* Supported Browsers
1313
* Google Chrome 89+
1414
* Microsoft Edge 89+
1515
* Opera 67+

0 commit comments

Comments
 (0)