Skip to content

Commit

Permalink
refactor!: migrate to ESM, Replace Jest with native test runner (#39)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
foxxyz authored Feb 2, 2025
1 parent e593ea7 commit 962ada1
Show file tree
Hide file tree
Showing 21 changed files with 2,979 additions and 6,011 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x, 23.x, latest]
node-version: [20.x, 22.x, 23.x, latest]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Update repositories
run: sudo apt-get update
- name: Install system dependencies
run: sudo apt-get install libcairo2-dev libpango1.0-dev libgif-dev
- run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Supports:
Requirements
------------

* Node 18+
* Supported Device
* Node 20+
* Supported Devices:
* Loupedeck Live
* Loupedeck Live S
* Loupedeck CT
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Sec-WebSocket-Accept: PLOTDYCXHOTMeouth==
`

// Stand-in for a Loupedeck serial device
export class SerialPort extends EventEmitter {
export class MockSerialPort extends EventEmitter {
static list() {
return [
{
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/ws.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EventEmitter from 'node:events'

// Stand-in for a real WebSocket
export default class MockSocket extends EventEmitter {
export class MockSocket extends EventEmitter {
constructor(url) {
super()
this.url = url
Expand Down
2 changes: 0 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
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: {
Expand Down
4 changes: 2 additions & 2 deletions examples/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ It uses [Vite](https://github.com/vitejs/vite) & [Vue 3](https://github.com/vuej
Requirements
------------

* Node 16+
* Supported Browser
* Node 20+
* Supported Browsers
* Google Chrome 89+
* Microsoft Edge 89+
* Opera 67+
Expand Down
Loading

0 comments on commit 962ada1

Please sign in to comment.