Skip to content

Commit

Permalink
chore: upgrade to node22
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-seifert authored Dec 27, 2024
1 parent 46c590c commit 370a65f
Show file tree
Hide file tree
Showing 8 changed files with 2,648 additions and 1,477 deletions.
1 change: 0 additions & 1 deletion .github/workflows/companion-module-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
uses: bitfocus/actions/.github/workflows/module-checks.yaml@main
# with:
# upload-artifact: true # uncomment this to upload the built package as an artifact to this workflow that you can download and share with others

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
.DS_Store
/pkg
/pkg.tgz
/pkg.tgz
/.yarn
14 changes: 7 additions & 7 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export function getActions() {
duration = await this.parseVariablesInString(action.options.variableValue)
duration = parseInt(duration)
if (duration >= 50 && duration <= 20000) {
duration = duration
//Pass duration as is
} else {
this.log('warn', 'Transition duration must be between 50 and 20000ms')
return
Expand Down Expand Up @@ -426,7 +426,7 @@ export function getActions() {
let duration = null
duration = this.states.transitionDuration + action.options.duration
if (duration >= 50 && duration <= 20000) {
duration = duration
//Pass duration as is
} else if (duration < 50) {
duration = 50
} else if (duration > 20000) {
Expand Down Expand Up @@ -657,7 +657,7 @@ export function getActions() {
let LOG_RANGE_DB = 96.0
let LOG_OFFSET_DB = 6.0
let LOG_OFFSET_VAL = -0.77815125038364363
let LOG_RANGE_VAL = -2.00860017176191756
let LOG_RANGE_VAL = Number('-2.00860017176191756')

//Calculate current "percent" of volume slider in OBS
let dB = this.sources[action.options.source].inputVolume
Expand Down Expand Up @@ -1686,7 +1686,7 @@ export function getActions() {
try {
command.replace(/ /g, '')
} catch (e) {
this.log('warn', 'Unknown command format')
this.log('warn', `Unknown command format: ${e.message}`)
return
}

Expand All @@ -1695,7 +1695,7 @@ export function getActions() {
try {
arg = JSON.parse(arg)
} catch (e) {
this.log('warn', 'Request data must be formatted as valid JSON.')
this.log('warn', `Request data must be formatted as valid JSON. ${e.message}`)
return
}
}
Expand Down Expand Up @@ -1735,7 +1735,7 @@ export function getActions() {
vendorName.replace(/ /g, '')
requestType.replace(/ /g, '')
} catch (e) {
this.log('warn', 'Unknown vendor or request format')
this.log('warn', `Unknown vendor or request format ${e.message}`)
return
}

Expand All @@ -1744,7 +1744,7 @@ export function getActions() {
try {
requestData = JSON.parse(requestData)
} catch (e) {
this.log('warn', 'Request data must be formatted as valid JSON.')
this.log('warn', `Request data must be formatted as valid JSON. ${e.message}`)
return
}
}
Expand Down
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { generateEslintConfig } from '@companion-module/tools/eslint/config.mjs'

const baseConfig = await generateEslintConfig({})

const customConfig = [
...baseConfig,
{
languageOptions: {
sourceType: 'module',
},
},
]

export default customConfig
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ class OBSInstance extends InstanceBase {
try {
let formattedTime = new Date(data).toISOString().slice(11, 19)
return formattedTime
} catch (error) {}
} catch (error) {
this.log('debug', `Error formatting timecode: ${error}`)
}
}

roundNumber(number, decimalPlaces) {
Expand Down
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@
"main": "index.js",
"type": "module",
"scripts": {
"format": "prettier -w ."
"format": "prettier -w .",
"package": "companion-module-build",
"lint:raw": "eslint",
"lint": "yarn lint:raw ."
},
"license": "MIT",
"dependencies": {
"@companion-module/base": "~1.11.1",
"@companion-module/base": "~1.11.3",
"obs-websocket-js": "5.0.6"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bitfocus/companion-module-obs-studio.git"
},
"devDependencies": {
"@companion-module/tools": "^2.1.0",
"prettier": "^3.3.3"
"@companion-module/tools": "^2.1.1",
"eslint": "^9.17.0",
"prettier": "^3.4.2"
},
"prettier": "@companion-module/tools/.prettierrc.json"
"engines": {
"node": "^22.12"
},
"prettier": "@companion-module/tools/.prettierrc.json",
"packageManager": "[email protected]"
}
Loading

0 comments on commit 370a65f

Please sign in to comment.