update deps to current state of module template; update runtime to node22
This commit is contained in:
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@@ -0,0 +1 @@
|
||||
lint-staged
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"legacyIds": [],
|
||||
"runtime": {
|
||||
"type": "node18",
|
||||
"type": "node22",
|
||||
"api": "nodejs-ipc",
|
||||
"apiVersion": "0.0.0",
|
||||
"entrypoint": "../dist/main.js"
|
||||
|
||||
27
package.json
27
package.json
@@ -4,6 +4,7 @@
|
||||
"main": "dist/main.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"postinstall": "husky",
|
||||
"format": "prettier -w .",
|
||||
"package": "yarn run build && companion-module-build",
|
||||
"build": "rimraf dist && yarn run build:main",
|
||||
@@ -17,19 +18,26 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bitfocus/companion-module-toggl-track.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^22.14",
|
||||
"yarn": "^4"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@companion-module/base": "~1.11",
|
||||
"@companion-module/base": "~1.11.3",
|
||||
"toggl-track": "^0.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@companion-module/tools": "~2.1.1",
|
||||
"@types/node": "^22.10.2",
|
||||
"eslint": "^9.17.0",
|
||||
"prettier": "^3.4.2",
|
||||
"rimraf": "^5.0.10",
|
||||
"typescript": "~5.5.4",
|
||||
"typescript-eslint": "^8.18.1"
|
||||
"@companion-module/tools": "~2.3.0",
|
||||
"@types/node": "^22.14.1",
|
||||
"@types/ws": "^8",
|
||||
"eslint": "^9.24.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.5.1",
|
||||
"prettier": "^3.5.3",
|
||||
"rimraf": "^6.0.1",
|
||||
"typescript": "~5.8.3",
|
||||
"typescript-eslint": "^8.30.1"
|
||||
},
|
||||
"prettier": "@companion-module/tools/.prettierrc.json",
|
||||
"lint-staged": {
|
||||
@@ -39,5 +47,6 @@
|
||||
"*.{ts,tsx,js,jsx}": [
|
||||
"yarn lint:raw --fix"
|
||||
]
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.9.1"
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface ModuleConfig {
|
||||
workspaceName: string
|
||||
alwaysStart: boolean
|
||||
startTimerPoller: boolean
|
||||
timerPollerInterval: number
|
||||
}
|
||||
|
||||
export function GetConfigFields(): SomeCompanionConfigField[] {
|
||||
@@ -36,9 +37,18 @@ export function GetConfigFields(): SomeCompanionConfigField[] {
|
||||
{
|
||||
type: 'checkbox',
|
||||
id: 'startTimerPoller',
|
||||
label: 'Poll for current time entry every 30 seconds',
|
||||
label: 'Poll for current time entry every n seconds',
|
||||
width: 12,
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
id: 'timerPollerInterval',
|
||||
label: 'Poll interval in seconds',
|
||||
width: 12,
|
||||
default: 60,
|
||||
min: 30,
|
||||
max: 3600,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export class TogglTrack extends InstanceBase<ModuleConfig> {
|
||||
void (async () => {
|
||||
await this.getCurrentTimer()
|
||||
})()
|
||||
}, 30 * 1000)
|
||||
}, this.config.timerPollerInterval * 1000)
|
||||
}
|
||||
private stopTimeEntryPoller(): void {
|
||||
this.log('info', 'Stopping TimeEntry-Poller')
|
||||
|
||||
Reference in New Issue
Block a user