From 1a68aefed1790c770616dab1f1265d0ea930de78 Mon Sep 17 00:00:00 2001 From: arc-alex Date: Mon, 27 Jan 2025 11:25:39 +0100 Subject: [PATCH 1/3] update types/node remove unused package --- apps/server/package.json | 1 - .../src/utils/__tests__/oscArgParser.test.ts | 80 ------- apps/server/src/utils/oscArgParser.ts | 41 ---- pnpm-lock.yaml | 197 +++++++++++++----- pnpm-workspace.yaml | 2 +- 5 files changed, 144 insertions(+), 177 deletions(-) delete mode 100644 apps/server/src/utils/__tests__/oscArgParser.test.ts delete mode 100644 apps/server/src/utils/oscArgParser.ts diff --git a/apps/server/package.json b/apps/server/package.json index 929a9ee93f..a7595feca5 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -30,7 +30,6 @@ "@types/express": "^4.17.17", "@types/multer": "^1.4.11", "@types/node": "catalog:", - "@types/node-osc": "^6.0.3", "@types/websocket": "^1.0.5", "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "catalog:", diff --git a/apps/server/src/utils/__tests__/oscArgParser.test.ts b/apps/server/src/utils/__tests__/oscArgParser.test.ts deleted file mode 100644 index 2293579d5c..0000000000 --- a/apps/server/src/utils/__tests__/oscArgParser.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { stringToOSCArgs } from '../oscArgParser.js'; - -describe('test stringToOSCArgs()', () => { - it('all types', () => { - const test = 'test 1111 0.1111 TRUE FALSE'; - const expected = [ - { type: 'string', value: 'test' }, - { type: 'integer', value: 1111 }, - { type: 'float', value: 0.1111 }, - { type: 'T', value: true }, - { type: 'F', value: false }, - ]; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('empty is nothing', () => { - const test = undefined; - const expected: any[] = []; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('empty is nothing', () => { - const test = ''; - const expected: any[] = []; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('1 space is nothing', () => { - const test = ' '; - const expected: any[] = []; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('keep other types in strings', () => { - const test = 'test "1111" "0.1111" "TRUE" "FALSE"'; - const expected = [ - { type: 'string', value: 'test' }, - { type: 'string', value: '1111' }, - { type: 'string', value: '0.1111' }, - { type: 'string', value: 'TRUE' }, - { type: 'string', value: 'FALSE' }, - ]; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('keep spaces in quoted strings', () => { - const test = '"test space" 1111 0.1111 TRUE FALSE'; - const expected = [ - { type: 'string', value: 'test space' }, - { type: 'integer', value: 1111 }, - { type: 'float', value: 0.1111 }, - { type: 'T', value: true }, - { type: 'F', value: false }, - ]; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('keep spaces escaped quotes', () => { - const test = '"test \\" space" 1111 0.1111 TRUE FALSE'; - const expected = [ - { type: 'string', value: 'test " space' }, - { type: 'integer', value: 1111 }, - { type: 'float', value: 0.1111 }, - { type: 'T', value: true }, - { type: 'F', value: false }, - ]; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); - - it('2 spaces', () => { - const test = '1111 0.1111 TRUE FALSE'; - const expected = [ - { type: 'integer', value: 1111 }, - { type: 'float', value: 0.1111 }, - { type: 'T', value: true }, - { type: 'F', value: false }, - ]; - expect(stringToOSCArgs(test)).toStrictEqual(expected); - }); -}); diff --git a/apps/server/src/utils/oscArgParser.ts b/apps/server/src/utils/oscArgParser.ts deleted file mode 100644 index 2bc6f65d4c..0000000000 --- a/apps/server/src/utils/oscArgParser.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { Argument } from 'node-osc'; -import { splitWhitespace } from 'ontime-utils'; - -export function stringToOSCArgs(argsString: string | undefined): Argument[] { - if (typeof argsString === 'undefined' || argsString === '') { - return new Array(); - } - const matches = splitWhitespace(argsString); - - if (!matches) { - return new Array(); - } - - const parsedArguments: Argument[] = matches.map((argString: string) => { - const argAsNum = Number(argString); - // NOTE: number like: 1 2.0 33333 - if (!Number.isNaN(argAsNum)) { - return { type: argString.includes('.') ? 'float' : 'integer', value: argAsNum }; - } - - if (argString.startsWith('"') && argString.endsWith('"')) { - // NOTE: "quoted string" - return { type: 'string', value: argString.substring(1, argString.length - 1) }; - } - - if (argString === 'TRUE') { - // NOTE: Boolean true - return { type: 'T', value: true }; - } - - if (argString === 'FALSE') { - // NOTE: Boolean false - return { type: 'F', value: false }; - } - - // NOTE: string - return { type: 'string', value: argString }; - }); - - return parsedArguments; -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d0cac5923..0b52691ecc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,9 @@ settings: catalogs: default: + '@types/node': + specifier: 20.17.16 + version: 20.17.16 '@typescript-eslint/eslint-plugin': specifier: 7.16.1 version: 7.16.1 @@ -15,6 +18,9 @@ catalogs: eslint: specifier: 8.56.0 version: 8.56.0 + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0 eslint-plugin-prettier: specifier: 5.1.3 version: 5.1.3 @@ -37,7 +43,7 @@ importers: version: 1.49.1 '@types/node': specifier: 'catalog:' - version: 20.14.10 + version: 20.17.16 '@typescript-eslint/eslint-plugin': specifier: 'catalog:' version: 7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.56.0)(typescript@5.5.3))(eslint@8.56.0)(typescript@5.5.3) @@ -188,7 +194,7 @@ importers: version: 7.16.1(eslint@8.56.0)(typescript@5.5.3) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)) + version: 4.2.1(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)) eslint: specifier: 'catalog:' version: 8.56.0 @@ -230,19 +236,19 @@ importers: version: 5.5.3 vite: specifier: ^5.2.11 - version: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + version: 5.2.11(@types/node@22.10.10)(sass@1.57.1) vite-plugin-compression2: specifier: ^1.3.3 - version: 1.3.3(rollup@4.17.2)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)) + version: 1.3.3(rollup@4.17.2)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)) vite-plugin-svgr: specifier: ^4.2.0 - version: 4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)) + version: 4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)) vite-tsconfig-paths: specifier: ^4.3.1 - version: 4.3.1(typescript@5.5.3)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)) + version: 4.3.1(typescript@5.5.3)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)) vitest: specifier: 'catalog:' - version: 2.1.6(@types/node@20.14.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) + version: 2.1.6(@types/node@22.10.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) apps/electron: devDependencies: @@ -336,10 +342,7 @@ importers: version: 1.4.11 '@types/node': specifier: 'catalog:' - version: 20.14.10 - '@types/node-osc': - specifier: ^6.0.3 - version: 6.0.3 + version: 20.17.16 '@types/websocket': specifier: ^1.0.5 version: 1.0.5 @@ -384,7 +387,7 @@ importers: version: 5.5.3 vitest: specifier: 'catalog:' - version: 2.1.6(@types/node@20.14.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) + version: 2.1.6(@types/node@20.17.16)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) packages/types: devDependencies: @@ -439,7 +442,7 @@ importers: version: 5.5.3 vitest: specifier: 'catalog:' - version: 2.1.6(@types/node@20.14.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) + version: 2.1.6(@types/node@22.10.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1) packages: @@ -2055,12 +2058,15 @@ packages: '@types/multer@1.4.11': resolution: {integrity: sha512-svK240gr6LVWvv3YGyhLlA+6LRRWA4mnGIU7RcNmgjBYFl6665wcXrRfxGp5tEPVHUNm5FMcmq7too9bxCwX/w==} - '@types/node-osc@6.0.3': - resolution: {integrity: sha512-f0JUTDVAlk/mV9RH6jE6g/8Y7l+Mvi3f1x7xv0RG3VI1PktaXEd60mR+4plpMS9VbRovFoPsS7qaaIDhFXdaEw==} - '@types/node@20.14.10': resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} + '@types/node@20.17.16': + resolution: {integrity: sha512-vOTpLduLkZXePLxHiHsBLp98mHGnl8RptV4YAO3HfKO5UHjDvySGbxKtpYfy8Sx5+WKcgc45qNreJJRVM3L6mw==} + + '@types/node@22.10.10': + resolution: {integrity: sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==} + '@types/parse-json@4.0.0': resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} @@ -4756,6 +4762,12 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + + undici-types@6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -6717,13 +6729,13 @@ snapshots: '@types/body-parser@1.19.2': dependencies: '@types/connect': 3.4.35 - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/cacheable-request@6.0.3': dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.14.10 + '@types/node': 22.10.10 '@types/responselike': 1.0.3 '@types/color-convert@2.0.0': @@ -6738,11 +6750,11 @@ snapshots: '@types/connect@3.4.35': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/cors@2.8.17': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/debug@4.1.12': dependencies: @@ -6752,7 +6764,7 @@ snapshots: '@types/express-serve-static-core@4.17.33': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 @@ -6765,7 +6777,7 @@ snapshots: '@types/fs-extra@9.0.13': dependencies: - '@types/node': 20.14.10 + '@types/node': 22.10.10 '@types/http-cache-semantics@4.0.4': {} @@ -6773,7 +6785,7 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 20.14.10 + '@types/node': 22.10.10 '@types/lodash.mergewith@4.6.7': dependencies: @@ -6789,19 +6801,23 @@ snapshots: dependencies: '@types/express': 4.17.17 - '@types/node-osc@6.0.3': - dependencies: - '@types/node': 20.14.10 - '@types/node@20.14.10': dependencies: undici-types: 5.26.5 + '@types/node@20.17.16': + dependencies: + undici-types: 6.19.8 + + '@types/node@22.10.10': + dependencies: + undici-types: 6.20.0 + '@types/parse-json@4.0.0': {} '@types/plist@3.0.5': dependencies: - '@types/node': 20.14.10 + '@types/node': 22.10.10 xmlbuilder: 15.1.1 optional: true @@ -6823,7 +6839,7 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 20.14.10 + '@types/node': 22.10.10 '@types/scheduler@0.16.2': {} @@ -6832,22 +6848,22 @@ snapshots: '@types/serve-static@1.15.0': dependencies: '@types/mime': 3.0.1 - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/verror@1.10.9': optional: true '@types/websocket@1.0.5': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/ws@8.5.10': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.10 + '@types/node': 22.10.10 optional: true '@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.56.0)(typescript@5.5.3))(eslint@8.56.0)(typescript@5.5.3)': @@ -6974,14 +6990,14 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-react@4.2.1(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1))': + '@vitejs/plugin-react@4.2.1(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1))': dependencies: '@babel/core': 7.23.6 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.6) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.6) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) transitivePeerDependencies: - supports-color @@ -6992,13 +7008,21 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.6(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1))': + '@vitest/mocker@2.1.6(vite@5.2.11(@types/node@20.17.16)(sass@1.57.1))': dependencies: '@vitest/spy': 2.1.6 estree-walker: 3.0.3 magic-string: 0.30.14 optionalDependencies: - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@20.17.16)(sass@1.57.1) + + '@vitest/mocker@2.1.6(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1))': + dependencies: + '@vitest/spy': 2.1.6 + estree-walker: 3.0.3 + magic-string: 0.30.14 + optionalDependencies: + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) '@vitest/pretty-format@2.1.6': dependencies: @@ -9896,6 +9920,10 @@ snapshots: undici-types@5.26.5: {} + undici-types@6.19.8: {} + + undici-types@6.20.0: {} + universalify@0.1.2: {} universalify@0.2.0: @@ -9968,13 +9996,30 @@ snapshots: extsprintf: 1.4.1 optional: true - vite-node@2.1.6(@types/node@20.14.10)(sass@1.57.1): + vite-node@2.1.6(@types/node@20.17.16)(sass@1.57.1): + dependencies: + cac: 6.7.14 + debug: 4.3.7 + es-module-lexer: 1.5.4 + pathe: 1.1.2 + vite: 5.2.11(@types/node@20.17.16)(sass@1.57.1) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + + vite-node@2.1.6(@types/node@22.10.10)(sass@1.57.1): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) transitivePeerDependencies: - '@types/node' - less @@ -9985,50 +10030,60 @@ snapshots: - supports-color - terser - vite-plugin-compression2@1.3.3(rollup@4.17.2)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)): + vite-plugin-compression2@1.3.3(rollup@4.17.2)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.17.2) tar-mini: 0.2.0 - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) transitivePeerDependencies: - rollup - vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)): + vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.17.2) '@svgr/core': 8.1.0(typescript@5.5.3) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.5.3)) - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) transitivePeerDependencies: - rollup - supports-color - typescript - vite-tsconfig-paths@4.3.1(typescript@5.5.3)(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)): + vite-tsconfig-paths@4.3.1(typescript@5.5.3)(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.0.2(typescript@5.5.3) optionalDependencies: - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) transitivePeerDependencies: - supports-color - typescript - vite@5.2.11(@types/node@20.14.10)(sass@1.57.1): + vite@5.2.11(@types/node@20.17.16)(sass@1.57.1): dependencies: esbuild: 0.20.2 postcss: 8.4.38 rollup: 4.17.2 optionalDependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 + fsevents: 2.3.3 + sass: 1.57.1 + + vite@5.2.11(@types/node@22.10.10)(sass@1.57.1): + dependencies: + esbuild: 0.20.2 + postcss: 8.4.38 + rollup: 4.17.2 + optionalDependencies: + '@types/node': 22.10.10 fsevents: 2.3.3 sass: 1.57.1 - vitest@2.1.6(@types/node@20.14.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1): + vitest@2.1.6(@types/node@20.17.16)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1): dependencies: '@vitest/expect': 2.1.6 - '@vitest/mocker': 2.1.6(vite@5.2.11(@types/node@20.14.10)(sass@1.57.1)) + '@vitest/mocker': 2.1.6(vite@5.2.11(@types/node@20.17.16)(sass@1.57.1)) '@vitest/pretty-format': 2.1.6 '@vitest/runner': 2.1.6 '@vitest/snapshot': 2.1.6 @@ -10044,11 +10099,47 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.2.11(@types/node@20.14.10)(sass@1.57.1) - vite-node: 2.1.6(@types/node@20.14.10)(sass@1.57.1) + vite: 5.2.11(@types/node@20.17.16)(sass@1.57.1) + vite-node: 2.1.6(@types/node@20.17.16)(sass@1.57.1) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.10 + '@types/node': 20.17.16 + happy-dom: 16.7.2 + jsdom: 21.1.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - stylus + - sugarss + - supports-color + - terser + + vitest@2.1.6(@types/node@22.10.10)(happy-dom@16.7.2)(jsdom@21.1.0)(sass@1.57.1): + dependencies: + '@vitest/expect': 2.1.6 + '@vitest/mocker': 2.1.6(vite@5.2.11(@types/node@22.10.10)(sass@1.57.1)) + '@vitest/pretty-format': 2.1.6 + '@vitest/runner': 2.1.6 + '@vitest/snapshot': 2.1.6 + '@vitest/spy': 2.1.6 + '@vitest/utils': 2.1.6 + chai: 5.1.2 + debug: 4.3.7 + expect-type: 1.1.0 + magic-string: 0.30.14 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.1 + tinypool: 1.0.2 + tinyrainbow: 1.2.0 + vite: 5.2.11(@types/node@22.10.10)(sass@1.57.1) + vite-node: 2.1.6(@types/node@22.10.10)(sass@1.57.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.10.10 happy-dom: 16.7.2 jsdom: 21.1.0 transitivePeerDependencies: @@ -10145,8 +10236,6 @@ snapshots: wrappy@1.0.2: {} - ws@8.13.0: {} - ws@8.18.0: {} xlsx@0.18.5: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0f0f01831a..90d8e22012 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,7 +6,7 @@ catalog: typescript: 5.5.3 "@typescript-eslint/eslint-plugin": 7.16.1 "@typescript-eslint/parser": 7.16.1 - "@types/node": 20.14.10 + "@types/node": 20.17.16 prettier: 3.3.1 eslint: 8.56.0 eslint-config-prettier: 9.1.0 From e6ba880f531315a6e75dfc15157165a4a92c245c Mon Sep 17 00:00:00 2001 From: arc-alex Date: Mon, 27 Jan 2025 12:13:02 +0100 Subject: [PATCH 2/3] update todos --- apps/server/src/adapters/OscAdapter.ts | 3 +-- apps/server/src/api-data/automation/clients/osc.client.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/server/src/adapters/OscAdapter.ts b/apps/server/src/adapters/OscAdapter.ts index 044a586e43..dfd6c1d72d 100644 --- a/apps/server/src/adapters/OscAdapter.ts +++ b/apps/server/src/adapters/OscAdapter.ts @@ -28,8 +28,7 @@ class OscServer implements IAdapter { // args: extra data, only used on some API entries /** - * TODO: remove this type casting when mergend in deleration file - * https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71659 + * TODO: fix ArrayBuffer casting */ const msg = fromBuffer(buf); if (msg.oscType === 'bundle') { diff --git a/apps/server/src/api-data/automation/clients/osc.client.ts b/apps/server/src/api-data/automation/clients/osc.client.ts index f0c5b62053..61e32ea0a1 100644 --- a/apps/server/src/api-data/automation/clients/osc.client.ts +++ b/apps/server/src/api-data/automation/clients/osc.client.ts @@ -33,11 +33,7 @@ function preparePayload(output: OSCOutput, state: RuntimeState): OscPacketInput function emit(targetIP: string, targetPort: number, packet: OscPacketInput) { logger.info(LogOrigin.Tx, `Sending OSC: ${targetIP}:${targetPort}`); - /** - * TODO: remove this type casting when change is merged - * https://github.com/DefinitelyTyped/DefinitelyTyped/pull/71659 - */ - const buffer = oscPacketToBuffer(packet) as unknown as Uint8Array; + const buffer = oscPacketToBuffer(packet); udpClient.send(buffer, 0, buffer.byteLength, targetPort, targetIP, (error) => { if (error) { logger.warning(LogOrigin.Tx, `Failed sending OSC: ${error}`); From 8267b000d7f9dca64ee32e7e476c9eb999568abb Mon Sep 17 00:00:00 2001 From: arc-alex Date: Wed, 29 Jan 2025 23:26:50 +0100 Subject: [PATCH 3/3] update osc-min --- apps/server/package.json | 2 +- apps/server/src/adapters/OscAdapter.ts | 5 +---- pnpm-lock.yaml | 10 +++++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/server/package.json b/apps/server/package.json index a7595feca5..7be49920f5 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -19,7 +19,7 @@ "lowdb": "^7.0.1", "multer": "^1.4.5-lts.1", "ontime-utils": "workspace:*", - "osc-min": "^2.1.1", + "osc-min": "2.1.2", "sanitize-filename": "^1.6.3", "steno": "^4.0.2", "ws": "^8.18.0", diff --git a/apps/server/src/adapters/OscAdapter.ts b/apps/server/src/adapters/OscAdapter.ts index dfd6c1d72d..2abdd538c0 100644 --- a/apps/server/src/adapters/OscAdapter.ts +++ b/apps/server/src/adapters/OscAdapter.ts @@ -20,16 +20,13 @@ class OscServer implements IAdapter { logger.info(LogOrigin.Rx, `OSC: Starting server on port ${port}`); this.udpSocket = dgram.createSocket('udp4'); this.udpSocket.on('error', (error) => logger.error(LogOrigin.Rx, `OSC IN: ${error}`)); - this.udpSocket.on('message', (buf: ArrayBuffer) => { + this.udpSocket.on('message', (buf) => { // message should look like /ontime/{command}/{params?} {args} where // ontime: fixed message for app // command: command to be called // params: used to create a nested object to patch with // args: extra data, only used on some API entries - /** - * TODO: fix ArrayBuffer casting - */ const msg = fromBuffer(buf); if (msg.oscType === 'bundle') { //TODO: manage bundles diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b52691ecc..30f4213798 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -316,8 +316,8 @@ importers: specifier: workspace:* version: link:../../packages/utils osc-min: - specifier: ^2.1.1 - version: 2.1.1 + specifier: 2.1.2 + version: 2.1.2 sanitize-filename: specifier: ^1.6.3 version: 1.6.3 @@ -3983,8 +3983,8 @@ packages: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} - osc-min@2.1.1: - resolution: {integrity: sha512-3Ai9vP8AAh1sCh5Zm8BUybfulv5OvqpTVa2BcUoTrLeD1Ss3cohIQpF1f18gx0CTbi9Dv4SvtdMb7y4g++7lYA==} + osc-min@2.1.2: + resolution: {integrity: sha512-dEhg7wBJ+QTHqY4iwnctkaFWzXLq+yHA2olxYfnxBw1fMy/iWJ/b7ovfXfwc/yxLXGiUHQhTxlQSHzL8ueHz6Q==} engines: {node: '>=0.10.0'} p-cancelable@2.1.1: @@ -9130,7 +9130,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - osc-min@2.1.1: {} + osc-min@2.1.2: {} p-cancelable@2.1.1: {}