Skip to content

Commit c0dfd63

Browse files
committed
feat: esm
1 parent 1210d86 commit c0dfd63

48 files changed

Lines changed: 1308 additions & 1681 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { generateEslintConfig } from '@sofie-automation/code-standard-preset/eslint/main.mjs'
2+
3+
export default await generateEslintConfig({
4+
testRunner: 'vitest',
5+
})

package.json

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
22
"name": "hyperdeck-connection",
3-
"version": "2.0.1",
3+
"version": "3.0.0-0",
44
"description": "Typescript Node.js library for connecting with a BlackmagicDesign's HyperDeck devices.",
5-
"main": "dist/index.js",
6-
"typings": "dist/index.d.ts",
7-
"module": "dist/module/index.js",
8-
"browser": "dist/browser/index.js",
5+
"type": "module",
6+
"exports": {
7+
".": {
8+
"import": "./dist/index.js",
9+
"require": "./dist/index.js",
10+
"types": "./dist/index.d.ts"
11+
},
12+
"./package.json": "./package.json"
13+
},
914
"license": "MIT",
1015
"repository": {
1116
"type": "git",
@@ -29,27 +34,25 @@
2934
],
3035
"scripts": {
3136
"prepare": "husky",
32-
"build": "rimraf dist && yarn build:main",
37+
"build": "rimraf dist && run build:main",
3338
"build:main": "tsc -p tsconfig.build.json",
34-
"lint:raw": "eslint --ext .ts --ext .js --ext .tsx --ext .jsx --ignore-pattern dist",
35-
"lint": "yarn lint:raw .",
36-
"lint-fix": "yarn lint --fix",
39+
"lint:raw": "eslint",
40+
"lint": "run lint:raw .",
41+
"lint-fix": "run lint --fix",
3742
"unit": "jest",
38-
"test": "yarn lint && yarn unit",
39-
"test:integration": "yarn lint && jest --config=jest-integration.config.js",
43+
"test": "run lint && run unit",
44+
"test:integration": "run lint && jest --config=jest-integration.config.js",
4045
"watch": "jest --watch",
4146
"cov": "jest --coverage && open-cli coverage/lcov-report/index.html",
4247
"cov-open": "open-cli coverage/lcov-report/index.html",
43-
"docs": "yarn docs:html && open-cli docs/index.html",
44-
"docs:test": "yarn docs:html",
48+
"docs": "run docs:html && open-cli docs/index.html",
49+
"docs:test": "run docs:html",
4550
"docs:html": "typedoc --entryPoints src/index.ts --excludePrivate --theme default --out docs",
4651
"docs:json": "typedoc --json docs/typedoc.json --entryPoints src/index.ts",
4752
"changelog": "sofie-version",
48-
"release": "yarn reset && yarn test && yarn changelog",
49-
"reset": "git clean -dfx && git reset --hard && yarn",
50-
"validate:dependencies": "yarn audit --groups dependencies && yarn license-validate",
51-
"validate:dev-dependencies": "yarn audit --groups devDependencies",
52-
"license-validate": "yarn sofie-licensecheck --allowPackages caniuse-lite@1.0.30001312"
53+
"validate:dependencies": "yarn npm audit --environment production && run license-validate",
54+
"validate:dev-dependencies": "yarn npm audit",
55+
"license-validate": "sofie-licensecheck --allowPackages caniuse-lite@1.0.30001312"
5356
},
5457
"engines": {
5558
"node": ">=22.22"
@@ -61,17 +64,20 @@
6164
"/LICENSE"
6265
],
6366
"devDependencies": {
64-
"@sofie-automation/code-standard-preset": "~2.5.1",
65-
"@types/jest": "^29.5.5",
67+
"@eslint/js": "^10.0.1",
68+
"@sofie-automation/code-standard-preset": "~3.2.2",
69+
"@types/jest": "^29.5.14",
6670
"@types/node": "^22.19.21",
71+
"eslint": "^10.5.0",
6772
"husky": "^9.1.7",
6873
"jest": "^29.7.0",
6974
"lint-staged": "^17.0.7",
70-
"open-cli": "^7.2.0",
75+
"open-cli": "^9.0.0",
76+
"prettier": "^3.8.4",
7177
"rimraf": "^6.1.3",
72-
"ts-jest": "^29.1.1",
73-
"typedoc": "^0.23.28",
74-
"typescript": "~4.9.5"
78+
"ts-jest": "^29.4.11",
79+
"typedoc": "^0.28.19",
80+
"typescript": "~6.0.3"
7581
},
7682
"keywords": [
7783
"blackmagic",
@@ -83,10 +89,6 @@
8389
"open",
8490
"source"
8591
],
86-
"dependencies": {
87-
"eventemitter3": "^4.0.7",
88-
"tslib": "^2.8.1"
89-
},
9092
"prettier": "@sofie-automation/code-standard-preset/.prettierrc.json",
9193
"lint-staged": {
9294
"*.{css,json,md,scss}": [
@@ -96,8 +98,5 @@
9698
"yarn lint:raw --fix"
9799
]
98100
},
99-
"resolutions": {
100-
"lint-staged": "13.2.3"
101-
},
102101
"packageManager": "yarn@4.17.0"
103102
}

src/asyncHandlers/configuration.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ResponseMessage } from '../message'
2-
import { IHandler } from './iHandler'
3-
import { AsynchronousCode } from '../codes'
4-
import { ConfigurationChangeResponse } from '../events'
1+
import { ResponseMessage } from '../message.js'
2+
import { IHandler } from './iHandler.js'
3+
import { AsynchronousCode } from '../codes.js'
4+
import { ConfigurationChangeResponse } from '../events.js'
55

66
export class ConfigurationChange implements IHandler<'notify.configuration'> {
77
responseCode = AsynchronousCode.Configuration

src/asyncHandlers/displayTimecode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ResponseMessage } from '../message'
2-
import { IHandler } from './iHandler'
3-
import { AsynchronousCode } from '../codes'
4-
import { DisplayTimecodeChangeResponse } from '../events'
1+
import { ResponseMessage } from '../message.js'
2+
import { IHandler } from './iHandler.js'
3+
import { AsynchronousCode } from '../codes.js'
4+
import { DisplayTimecodeChangeResponse } from '../events.js'
55

66
export class DisplayTimecodeChange implements IHandler<'notify.displayTimecode'> {
77
responseCode = AsynchronousCode.DisplayTimecode

src/asyncHandlers/iHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { HyperdeckAsyncEvents } from '../events'
2-
import { AsynchronousCode } from '../codes'
3-
import { ResponseMessage } from '../message'
1+
import { HyperdeckAsyncEvents } from '../events.js'
2+
import { AsynchronousCode } from '../codes.js'
3+
import { ResponseMessage } from '../message.js'
44

55
export interface IHandler<TEvent extends keyof HyperdeckAsyncEvents> {
66
responseCode: AsynchronousCode

src/asyncHandlers/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export * from './configuration'
2-
export * from './displayTimecode'
3-
export * from './iHandler'
4-
export * from './remoteInfo'
5-
export * from './slotInfo'
6-
export * from './timelinePosition'
7-
export * from './transportInfo'
1+
export * from './configuration.js'
2+
export * from './displayTimecode.js'
3+
export * from './iHandler.js'
4+
export * from './remoteInfo.js'
5+
export * from './slotInfo.js'
6+
export * from './timelinePosition.js'
7+
export * from './transportInfo.js'

src/asyncHandlers/remoteInfo.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ResponseMessage } from '../message'
2-
import { parseBool } from '../util'
3-
import { IHandler } from './iHandler'
4-
import { AsynchronousCode } from '../codes'
5-
import { RemoteInfoChangeResponse } from '../events'
1+
import { ResponseMessage } from '../message.js'
2+
import { parseBool } from '../util.js'
3+
import { IHandler } from './iHandler.js'
4+
import { AsynchronousCode } from '../codes.js'
5+
import { RemoteInfoChangeResponse } from '../events.js'
66

77
export class RemoteInfoChange implements IHandler<'notify.remote'> {
88
responseCode = AsynchronousCode.RemoteInfo

src/asyncHandlers/slotInfo.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { VideoFormat, SlotStatus } from '../enums'
2-
import { ResponseMessage } from '../message'
3-
import { parseIntIfDefined } from '../util'
4-
import { IHandler } from './iHandler'
5-
import { AsynchronousCode } from '../codes'
6-
import { SlotInfoChangeResponse } from '../events'
1+
import { VideoFormat, SlotStatus } from '../enums.js'
2+
import { ResponseMessage } from '../message.js'
3+
import { parseIntIfDefined } from '../util.js'
4+
import { IHandler } from './iHandler.js'
5+
import { AsynchronousCode } from '../codes.js'
6+
import { SlotInfoChangeResponse } from '../events.js'
77

88
export class SlotInfoChange implements IHandler<'notify.slot'> {
99
responseCode = AsynchronousCode.SlotInfo

0 commit comments

Comments
 (0)