From 179d7b8b9333b0a2e07f4535b62caba32721e81f Mon Sep 17 00:00:00 2001 From: Danya H Date: Tue, 28 Jan 2025 22:44:54 +0000 Subject: [PATCH] upd (fw): - eslint config - correct tsconfigs --- .eslintrc.yaml | 31 -- .../21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db | Bin 4096 -> 40960 bytes ...1ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-shm | Bin 32768 -> 0 bytes ...1ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-wal | Bin 144232 -> 0 bytes .nx/workspace-data/d/daemon.log | 46 +++ .nx/workspace-data/d/server-process.json | 3 - .nx/workspace-data/file-map.json | 126 ++++---- browser/src/core/browser.ts | 5 - cli/tsconfig.json | 4 +- eslint.config.ts | 57 ++++ package.json | 12 +- pnpm-lock.yaml | 275 +++++++++--------- rpc/src/index.ts | 86 +++--- rpc/tsconfig.json | 5 +- tsconfig.json | 2 +- 15 files changed, 365 insertions(+), 287 deletions(-) delete mode 100644 .eslintrc.yaml delete mode 100644 .nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-shm delete mode 100644 .nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-wal delete mode 100644 .nx/workspace-data/d/server-process.json create mode 100644 eslint.config.ts diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index aaa528c..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,31 +0,0 @@ -env: - node: true - es6: true - es2019: true -extends: - - 'eslint:recommended' - - 'plugin:@typescript-eslint/recommended' -# - 'prettier' -parser: '@typescript-eslint/parser' -parserOptions: - ecmaVersion: '2019' - sourceType: 'script' -plugins: - - '@typescript-eslint' -ignorePatterns: - - 'node_modules' -rules: { - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-unused-vars': [ - 'warn', - { - "argsIgnorePattern": '^_', - "varsIgnorePattern": '^_', - "caughtErrorsIgnorePattern": '^_' - } - ], - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-types': 'off', - 'consistent-return': 'warn', - 'no-empty': 'off', -} diff --git a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db b/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db index 7ee7c113a09428e4daafacb6e70a35d18573e608..7dc907c5d903ed31415af8b39278c8744d4537b0 100644 GIT binary patch literal 40960 zcmeI*&2QUe90zbaFHYL6eI^h~5vt@Js;%0R#?GrJO-t8#Q?xei(iE+y$V;BKUelzD zoxMpQP1_EfxNw~W7Y-b_!3hZtNJtzQ{{@qfcHn?GAmFhRcS-%26-`XgeXXYT%k%vF zJRkp()_y#1_3EN&Q+cD)-7#!ABODV#A)zG8f*^$0Yn;8jDavLd-U9n64$TM6hJ@6; z-3juWFg7j;WR83{@#o~PM{gXRI`aLvbmYUJYFG~e2tWV=5P$##An@-BJdonC#L1K5 zqbs&?y+s>FV~f^1J$tujTO$i&3srr-rpvYY3yZouvPnKQE_0?W!`gCI*Ys;Od8Jxj zny;?QSM+tcvRsoZYm19#xYZh+CS|qCm70E8ufC{oml`&0*4baMwepg_TAN>5kuU0( z=GPW$^1@oRs#j|Dy)FD58jS|Etd|UOX}PMGFIU|DopO3UD_8YPI@|w(zAD>>wOwyg z+b~;}+~2&f@3Y#Nlvp|`3TC@W?^rim>~HhB(X%`5a(%?Ru8b^>FUF+A^o&T|qRzhS zX7i4_%PrHgJKekS!Lch>F6!50uY|l@={IapYS6G1NlKhPEv~!yFldNHZ}w=LG4LAC$d3-j~9%n_2(x9lzV{+@KA6@F@}8TgJCZUtFxwX>XXDy{=)K zopwLyNGoRx5h-zHCg^Q8-1E9JycE6vmKaM+PmA~8bG>%ho4IM&EXDgjLnBV!T2A6_ z)4QW7HT==&|A4w>w0d;3!f1!)LQ-O3I;cZlL+Xk*7iPat;?D1s3HB1n&jS0x1OW&@ z00Izz00bZa0SG_<0uX?}|6kxuF?{0f%C-8tdUdtDTv5}hY%1*x@QdUZfqh|u00bZa z0SG_<0uX=z1Rwwb2teS_2uy@ej6J^!;EexA$Z>&uOFkf1*$gHKKmY;|fB*y_009U< z00Izzz-uF*#iO}}grKC0N=7N5r2BZv({CjA`*tbjMc|BEA0&cVlDr6M z|C#MUB5anTUIflb^FbnPq#`WBJFbJj4OY*6sHoH5Vxv7bBZFR50WXlpAh20bU>ZLFeESBV diff --git a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-shm b/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-shm deleted file mode 100644 index bd854bc8452d82f7f3029232db5c4b1914c30d41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)xlKbs5C-5eV1o_jKFob(NCf0mKoJx}0nh~!AthLd7F+-kq6Q?GMSxz0NG!yD zBmG+Y9lLM70%q`Z8l@I9tz3?C?PZRyhNDsc;_Uo-c=Gc4{CIkId((TkydV7X`P}NG z%D!)n`n>$TNinaq^mQ<-*SE!R4k>C8-~{O@MUxBj#?-}~CPywgncnY^V45FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjZZBGAe?6W!>K*@tMIYVxzdIbP=3iM(Shjq5D>*@t&V>6DbR{&6_z+7xanZ>IJ)F&{XbFPLbu`wE_#V6f3b78`TPEoB#m=1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 L2oNCf{{-Fv-y19N diff --git a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-wal b/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-wal deleted file mode 100644 index 51c08a8cdf62e0857727de4358ebff3b8c92bd93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 144232 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 NX runtime error err=cannot send event from fs watcher: sending into a closed channel + + +> NX runtime error err=cannot send event from fs watcher: sending into a closed channel + +[NX Daemon Server] - 2025-01-28T21:09:41.108Z - Server stopped because: "LOCK_FILES_CHANGED" diff --git a/.nx/workspace-data/d/server-process.json b/.nx/workspace-data/d/server-process.json deleted file mode 100644 index a36a18a..0000000 --- a/.nx/workspace-data/d/server-process.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "processId": 1932 -} diff --git a/.nx/workspace-data/file-map.json b/.nx/workspace-data/file-map.json index a47f934..e999083 100644 --- a/.nx/workspace-data/file-map.json +++ b/.nx/workspace-data/file-map.json @@ -5,57 +5,17 @@ "nxJsonPlugins": [], "fileMap": { "nonProjectFiles": [ - { - "file": ".syncpackrc", - "hash": "13719523772355468859" - }, - { - "file": "nx.json", - "hash": "9446346482472849254" - }, - { - "file": "cli/pnpm-lock.yaml", - "hash": "17187343980520924484" - }, - { - "file": ".prettierrc.yaml", - "hash": "17309111231433830353" - }, - { - "file": ".gitignore", - "hash": "466019069558237198" - }, - { - "file": "cli/src/utils/cloner.ts", - "hash": "1132274951157266930" - }, - { - "file": "cli/package.json", - "hash": "3111660507833056649" - }, - { - "file": "readme.md", - "hash": "1902671373761520170" - }, - { - "file": "cli/LICENSE", - "hash": "1507993085755105257" - }, - { - "file": "cli/tsup.config.ts", - "hash": "13827088844122432138" - }, { "file": "LICENSE", "hash": "3851877826332079922" }, { - "file": "cli/src/commands/download-updater.ts", - "hash": "11440367832134551579" + "file": "cli/readme.md", + "hash": "16218391603489013576" }, { - "file": "cli/src/commands/create.ts", - "hash": "2930999059286089181" + "file": "pnpm-workspace.yaml", + "hash": "7023137976272453398" }, { "file": "cli/src/index.ts", @@ -66,15 +26,27 @@ "hash": "449396566283249838" }, { - "file": "cli/src/utils/update.ts", - "hash": "17254076707872483328" + "file": "cli/tsconfig.json", + "hash": "12144877836401991171" }, { - "file": "lerna.json", - "hash": "9008042841666655823" + "file": "nx.json", + "hash": "9446346482472849254" }, { - "file": ".eslintrc.yaml", + "file": "cli/package.json", + "hash": "3111660507833056649" + }, + { + "file": "tsconfig.json", + "hash": "13322631129280839479" + }, + { + "file": ".gitea/ISSUE_TEMPLATE.yaml", + "hash": "6189181406018576855" + }, + { + "file": ".oldeslintrc.yaml", "hash": "10112531714126869677" }, { @@ -82,32 +54,64 @@ "hash": "14631295638127641855" }, { - "file": ".gitea/ISSUE_TEMPLATE.yaml", - "hash": "6189181406018576855" + "file": "eslint.config.js", + "hash": "6623060945532673300" + }, + { + "file": "cli/src/utils/cloner.ts", + "hash": "1132274951157266930" + }, + { + "file": "cli/pnpm-lock.yaml", + "hash": "17187343980520924484" + }, + { + "file": "cli/src/commands/download-updater.ts", + "hash": "11440367832134551579" + }, + { + "file": "cli/src/utils/update.ts", + "hash": "17254076707872483328" + }, + { + "file": "cli/tsup.config.ts", + "hash": "13827088844122432138" + }, + { + "file": "cli/src/commands/create.ts", + "hash": "2930999059286089181" + }, + { + "file": "readme.md", + "hash": "1902671373761520170" }, { "file": "cli/src/commands/test-rpc.ts", "hash": "14383022690595309411" }, { - "file": "cli/tsconfig.json", - "hash": "12144877836401991171" + "file": ".syncpackrc", + "hash": "13719523772355468859" }, { - "file": "tsconfig.json", - "hash": "13322631129280839479" - }, - { - "file": "pnpm-workspace.yaml", - "hash": "7023137976272453398" + "file": "cli/LICENSE", + "hash": "1507993085755105257" }, { "file": "cli/.prettierrc.yaml", "hash": "14222459966692279673" }, { - "file": "cli/readme.md", - "hash": "16218391603489013576" + "file": ".gitignore", + "hash": "466019069558237198" + }, + { + "file": "lerna.json", + "hash": "9008042841666655823" + }, + { + "file": ".prettierrc.yaml", + "hash": "17309111231433830353" } ], "projectFileMap": { diff --git a/browser/src/core/browser.ts b/browser/src/core/browser.ts index 765baa0..3a4ee07 100644 --- a/browser/src/core/browser.ts +++ b/browser/src/core/browser.ts @@ -1,11 +1,6 @@ import { Helper } from './helper' import { rpc } from './rpc' import type * as T from '../types' -import { - RageFW_BrowserEvent, - RageFW_ClientEvent, - RageFW_ServerEvent, -} from '../types' /** Browser-side interactions */ export class Browser extends Helper { diff --git a/cli/tsconfig.json b/cli/tsconfig.json index 9543d5d..4889b88 100644 --- a/cli/tsconfig.json +++ b/cli/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { - "target": "es6", + "target": "esnext", "module": "commonjs", "moduleResolution": "node", - "lib": ["DOM", "ES6"], + "lib": ["DOM", "esnext"], "declaration": true, "declarationMap": true, "sourceMap": true, diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..0d086bc --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,57 @@ +import globals from 'globals' +import pluginJs from '@eslint/js' +import tseslint from 'typescript-eslint' + +import type { Linter } from 'eslint' + +export default [ + { + ignores: ['**/.*/*', '**/dist/*', '**/node_modules/*', '*.config.*'], + }, + pluginJs.configs.recommended, + ...(tseslint.configs.recommended as Linter.Config[]), + { + name: 'global', + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + 'consistent-return': 'off', + 'no-empty': 'off', + }, + }, + { + name: 'browser/rpc', + files: ['browser/src/*.{ts,js}', 'rpc/src/*.{ts,js}'], + languageOptions: { + globals: { ...globals.browser, ...globals.node, ...globals.es2022 }, + }, + }, + { + name: 'cli', + files: ['cli/src/*.{ts,js}'], + languageOptions: { + globals: { ...globals.node, ...globals.es2024 }, + ecmaVersion: 2024, + }, + }, + { + name: 'client/server/shared', + files: [ + 'client/**/*.{ts,js}', + 'server/**/*.{ts,js}', + 'shared/**/*.{ts,js}', + ], + languageOptions: { + globals: { ...globals.node, ...globals.es2022 }, + }, + }, +] satisfies Linter.Config[] diff --git a/package.json b/package.json index b94d7cc..4a75dea 100644 --- a/package.json +++ b/package.json @@ -4,37 +4,37 @@ "!cli" ], "scripts": { - "lint": "eslint --c .eslintrc.yaml --ext .ts browser/ client/ server/ shared-types/", - + "lint": "eslint . --config eslint.config.ts", "_____build": "echo build", "build:browser": "cd browser && pnpm build", "build:client": "cd client && pnpm build", "build:server": "cd server && pnpm build", "build:rpc": "cd rpc pnpm build", "build": "pnpm rebuild:browser && pnpm rebuild:client && pnpm rebuild:server", - "_____deps": "echo must be ran before lerna commands", "deps:check": "syncpack list-mismatches", "deps:fix": "syncpack fix-mismatches", - "_____lerna": "echo publish", "lerna:system": "lerna info && lerna list", "lerna:version": "lerna version --no-private", + "lerna:pre": "pnpm run lint && pnpm run deps:check", "lerna:build": "lerna run build" }, "dependencies": { + "@eslint/js": "^9.19.0", "@microsoft/api-extractor": "^7.49.1", "@ragempcommunity/types-cef": "^2.1.8", "@ragempcommunity/types-client": "^2.1.8", "@ragempcommunity/types-server": "^2.1.8", - "@typescript-eslint/eslint-plugin": "^7.13.0", - "@typescript-eslint/parser": "^7.13.0", "cli": "^1.0.1", "eslint": "^9.19.0", + "globals": "^15.14.0", + "jiti": "^2.4.2", "lerna": "^8.1.9", "prettier": "^3.4.2", "tsup": "^8.3.6", "typescript": "^5.7.3", + "typescript-eslint": "^8.22.0", "winston": "^3.17.0" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2dfc14c..001bbde 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@eslint/js': + specifier: ^9.19.0 + version: 9.19.0 '@microsoft/api-extractor': specifier: ^7.49.1 version: 7.49.1(@types/node@22.12.0) @@ -20,18 +23,18 @@ importers: '@ragempcommunity/types-server': specifier: ^2.1.8 version: 2.1.8 - '@typescript-eslint/eslint-plugin': - specifier: ^7.13.0 - version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.19.0)(typescript@5.7.3))(eslint@9.19.0)(typescript@5.7.3) - '@typescript-eslint/parser': - specifier: ^7.13.0 - version: 7.18.0(eslint@9.19.0)(typescript@5.7.3) cli: specifier: ^1.0.1 version: 1.0.1 eslint: specifier: ^9.19.0 - version: 9.19.0 + version: 9.19.0(jiti@2.4.2) + globals: + specifier: ^15.14.0 + version: 15.14.0 + jiti: + specifier: ^2.4.2 + version: 2.4.2 lerna: specifier: ^8.1.9 version: 8.1.9(encoding@0.1.13) @@ -40,10 +43,13 @@ importers: version: 3.4.2 tsup: specifier: ^8.3.6 - version: 8.3.6(@microsoft/api-extractor@7.49.1(@types/node@22.12.0))(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.6(@microsoft/api-extractor@7.49.1(@types/node@22.12.0))(jiti@2.4.2)(typescript@5.7.3)(yaml@2.7.0) typescript: specifier: ^5.7.3 version: 5.7.3 + typescript-eslint: + specifier: ^8.22.0 + version: 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) winston: specifier: ^3.17.0 version: 3.17.0 @@ -55,11 +61,11 @@ importers: browser: dependencies: '@entityseven/rage-fw-rpc': - specifier: 0.2.5 - version: 0.2.5(typescript@5.7.3) + specifier: workspace:* + version: link:../rpc '@entityseven/rage-fw-shared-types': - specifier: 0.2.0 - version: 0.2.0 + specifier: workspace:* + version: link:../shared-types '@ragempcommunity/types-cef': specifier: ^2.1.8 version: 2.1.8 @@ -74,11 +80,11 @@ importers: client: dependencies: '@entityseven/rage-fw-rpc': - specifier: 0.2.5 - version: 0.2.5(typescript@5.7.3) + specifier: workspace:* + version: link:../rpc '@entityseven/rage-fw-shared-types': - specifier: 0.2.0 - version: 0.2.0 + specifier: workspace:* + version: link:../shared-types '@ragempcommunity/types-client': specifier: ^2.1.8 version: 2.1.8 @@ -106,11 +112,11 @@ importers: server: dependencies: '@entityseven/rage-fw-rpc': - specifier: 0.2.5 - version: 0.2.5(typescript@5.7.3) + specifier: workspace:* + version: link:../rpc '@entityseven/rage-fw-shared-types': - specifier: 0.2.0 - version: 0.2.0 + specifier: workspace:* + version: link:../shared-types '@ragempcommunity/types-server': specifier: ^2.1.8 version: 2.1.8 @@ -158,14 +164,6 @@ packages: '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - '@entityseven/rage-fw-rpc@0.2.5': - resolution: {integrity: sha512-U9V+eZTQbkL+JZEU3TS+fCroPyvSvBXICLikcC/h9gCNHhFiS6vm+W+92LqGzBi3K+aZEnsx57hAhhObB03g0w==} - peerDependencies: - typescript: ^5 - - '@entityseven/rage-fw-shared-types@0.2.0': - resolution: {integrity: sha512-boHXIvNXFvUqpc5gcgJIgDTu5rl3alquNmMMVRekm5w0H5giiKtiEN2krY9opAYgOLHIrEEqLwY5T1/NwYcRVw==} - '@esbuild/aix-ppc64@0.24.2': resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} engines: {node: '>=18'} @@ -814,63 +812,52 @@ packages: '@types/triple-beam@1.3.5': resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} - '@typescript-eslint/eslint-plugin@7.18.0': - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/eslint-plugin@8.22.0': + resolution: {integrity: sha512-4Uta6REnz/xEJMvwf72wdUnC3rr4jAQf5jnTkeRQ9b6soxLxhDEbS/pfMPoJLDfFPNVRdryqWUIV/2GZzDJFZw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/parser@7.18.0': - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/parser@8.22.0': + resolution: {integrity: sha512-MqtmbdNEdoNxTPzpWiWnqNac54h8JDAmkWtJExBVVnSrSmi9z+sZUt0LfKqk9rjqmKOIeRhO4fHHJ1nQIjduIQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.22.0': + resolution: {integrity: sha512-/lwVV0UYgkj7wPSw0o8URy6YI64QmcOdwHuGuxWIYznO6d45ER0wXUbksr9pYdViAofpUCNJx/tAzNukgvaaiQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@7.18.0': - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/type-utils@8.22.0': + resolution: {integrity: sha512-NzE3aB62fDEaGjaAYZE4LH7I1MUwHooQ98Byq0G0y3kkibPJQIXVUspzlFOmOfHhiDLwKzMlWxaNv+/qcZurJA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.22.0': + resolution: {integrity: sha512-0S4M4baNzp612zwpD4YOieP3VowOARgK2EkN/GBn95hpyF8E2fbMT55sRHWBq+Huaqk3b3XK+rxxlM8sPgGM6A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@8.22.0': + resolution: {integrity: sha512-SJX99NAS2ugGOzpyhMza/tX+zDwjvwAtQFLsBo3GQxiGcvaKlqGBkmZ+Y1IdiSi9h4Q0Lr5ey+Cp9CGWNY/F/w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/utils@8.22.0': + resolution: {integrity: sha512-T8oc1MbF8L+Bk2msAvCUzjxVB2Z2f+vXYfcucE2wOmYs7ZUwco5Ep0fYZw8quNwOiw9K8GYVL+Kgc2pETNTLOg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@8.22.0': + resolution: {integrity: sha512-AWpYAXnUgvLNabGTy3uBylkgZoosva/miNd1I8Bz3SjotmQPbVqhO4Cczo8AsZ44XVErEBPr/CRSgaj8sG7g0w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@yarnpkg/lockfile@1.1.0': resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} @@ -1663,6 +1650,10 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + globals@15.14.0: + resolution: {integrity: sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==} + engines: {node: '>=18'} + globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -1912,6 +1903,10 @@ packages: resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jiti@2.4.2: + resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} + hasBin: true + jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} @@ -3014,11 +3009,11 @@ packages: resolution: {integrity: sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==} engines: {node: '>= 14.0.0'} - ts-api-utils@1.4.3: - resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} - engines: {node: '>=16'} + ts-api-utils@2.0.0: + resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==} + engines: {node: '>=18.12'} peerDependencies: - typescript: '>=4.2.0' + typescript: '>=4.8.4' ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -3083,6 +3078,13 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript-eslint@8.22.0: + resolution: {integrity: sha512-Y2rj210FW1Wb6TWXzQc5+P+EWI9/zdS57hLEc0gnyuvdzWo8+Y8brKlbj0muejonhMI/xAZCnZZwjbIfv1CkOw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + typescript@5.7.2: resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} @@ -3296,12 +3298,6 @@ snapshots: dependencies: tslib: 2.8.1 - '@entityseven/rage-fw-rpc@0.2.5(typescript@5.7.3)': - dependencies: - typescript: 5.7.3 - - '@entityseven/rage-fw-shared-types@0.2.0': {} - '@esbuild/aix-ppc64@0.24.2': optional: true @@ -3377,9 +3373,9 @@ snapshots: '@esbuild/win32-x64@0.24.2': optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@9.19.0)': + '@eslint-community/eslint-utils@4.4.1(eslint@9.19.0(jiti@2.4.2))': dependencies: - eslint: 9.19.0 + eslint: 9.19.0(jiti@2.4.2) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -4022,86 +4018,82 @@ snapshots: '@types/triple-beam@1.3.5': {} - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.19.0)(typescript@5.7.3))(eslint@9.19.0)(typescript@5.7.3)': + '@typescript-eslint/eslint-plugin@8.22.0(@typescript-eslint/parser@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 7.18.0(eslint@9.19.0)(typescript@5.7.3) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.19.0)(typescript@5.7.3) - '@typescript-eslint/utils': 7.18.0(eslint@9.19.0)(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 7.18.0 - eslint: 9.19.0 + '@typescript-eslint/parser': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.22.0 + '@typescript-eslint/type-utils': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.22.0 + eslint: 9.19.0(jiti@2.4.2) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.4.3(typescript@5.7.3) - optionalDependencies: + ts-api-utils: 2.0.0(typescript@5.7.3) typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.19.0)(typescript@5.7.3)': + '@typescript-eslint/parser@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager': 8.22.0 + '@typescript-eslint/types': 8.22.0 + '@typescript-eslint/typescript-estree': 8.22.0(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.22.0 debug: 4.4.0 - eslint: 9.19.0 - optionalDependencies: + eslint: 9.19.0(jiti@2.4.2) typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.18.0': + '@typescript-eslint/scope-manager@8.22.0': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.22.0 + '@typescript-eslint/visitor-keys': 8.22.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.19.0)(typescript@5.7.3)': + '@typescript-eslint/type-utils@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) - '@typescript-eslint/utils': 7.18.0(eslint@9.19.0)(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.22.0(typescript@5.7.3) + '@typescript-eslint/utils': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) debug: 4.4.0 - eslint: 9.19.0 - ts-api-utils: 1.4.3(typescript@5.7.3) - optionalDependencies: + eslint: 9.19.0(jiti@2.4.2) + ts-api-utils: 2.0.0(typescript@5.7.3) typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@7.18.0': {} + '@typescript-eslint/types@8.22.0': {} - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.7.3)': + '@typescript-eslint/typescript-estree@8.22.0(typescript@5.7.3)': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.22.0 + '@typescript-eslint/visitor-keys': 8.22.0 debug: 4.4.0 - globby: 11.1.0 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.4.3(typescript@5.7.3) - optionalDependencies: + ts-api-utils: 2.0.0(typescript@5.7.3) typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@9.19.0)(typescript@5.7.3)': + '@typescript-eslint/utils@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) - eslint: 9.19.0 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0(jiti@2.4.2)) + '@typescript-eslint/scope-manager': 8.22.0 + '@typescript-eslint/types': 8.22.0 + '@typescript-eslint/typescript-estree': 8.22.0(typescript@5.7.3) + eslint: 9.19.0(jiti@2.4.2) + typescript: 5.7.3 transitivePeerDependencies: - supports-color - - typescript - '@typescript-eslint/visitor-keys@7.18.0': + '@typescript-eslint/visitor-keys@8.22.0': dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 + '@typescript-eslint/types': 8.22.0 + eslint-visitor-keys: 4.2.0 '@yarnpkg/lockfile@1.1.0': {} @@ -4628,9 +4620,9 @@ snapshots: eslint-visitor-keys@4.2.0: {} - eslint@9.19.0: + eslint@9.19.0(jiti@2.4.2): dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0) + '@eslint-community/eslint-utils': 4.4.1(eslint@9.19.0(jiti@2.4.2)) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.19.1 '@eslint/core': 0.10.0 @@ -4664,6 +4656,8 @@ snapshots: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 + optionalDependencies: + jiti: 2.4.2 transitivePeerDependencies: - supports-color @@ -4905,6 +4899,8 @@ snapshots: globals@14.0.0: {} + globals@15.14.0: {} + globby@11.1.0: dependencies: array-union: 2.1.0 @@ -5145,6 +5141,8 @@ snapshots: jest-get-type@29.6.3: {} + jiti@2.4.2: {} + jju@1.4.0: {} joycon@3.1.1: {} @@ -5931,10 +5929,11 @@ snapshots: dependencies: find-up: 4.1.0 - postcss-load-config@6.0.1(yaml@2.7.0): + postcss-load-config@6.0.1(jiti@2.4.2)(yaml@2.7.0): dependencies: lilconfig: 3.1.3 optionalDependencies: + jiti: 2.4.2 yaml: 2.7.0 postcss-selector-parser@6.1.2: @@ -6408,7 +6407,7 @@ snapshots: triple-beam@1.4.1: {} - ts-api-utils@1.4.3(typescript@5.7.3): + ts-api-utils@2.0.0(typescript@5.7.3): dependencies: typescript: 5.7.3 @@ -6424,7 +6423,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.3.6(@microsoft/api-extractor@7.49.1(@types/node@22.12.0))(typescript@5.7.3)(yaml@2.7.0): + tsup@8.3.6(@microsoft/api-extractor@7.49.1(@types/node@22.12.0))(jiti@2.4.2)(typescript@5.7.3)(yaml@2.7.0): dependencies: bundle-require: 5.1.0(esbuild@0.24.2) cac: 6.7.14 @@ -6434,7 +6433,7 @@ snapshots: esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(yaml@2.7.0) + postcss-load-config: 6.0.1(jiti@2.4.2)(yaml@2.7.0) resolve-from: 5.0.0 rollup: 4.32.1 source-map: 0.8.0-beta.0 @@ -6475,6 +6474,16 @@ snapshots: typedarray@0.0.6: {} + typescript-eslint@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.22.0(@typescript-eslint/parser@8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.22.0(eslint@9.19.0(jiti@2.4.2))(typescript@5.7.3) + eslint: 9.19.0(jiti@2.4.2) + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + typescript@5.7.2: {} typescript@5.7.3: {} diff --git a/rpc/src/index.ts b/rpc/src/index.ts index f04e759..1716f00 100644 --- a/rpc/src/index.ts +++ b/rpc/src/index.ts @@ -185,30 +185,21 @@ class Rpc extends Wrapper { eventNameOrArgs?: string | unknown[], args?: unknown[], ) { - _is1StParamPlayer(playerOrEventName) - ? this.log( - 'callClient', - eventNameOrArgs as string, - playerOrEventName, - eventNameOrArgs, - args, - ) - : this.log( - 'callClient', - playerOrEventName as string, - eventNameOrArgs, - ) + if (_is1StParamPlayer(playerOrEventName)) { + this.log( + 'callClient', + eventNameOrArgs as string, + playerOrEventName, + eventNameOrArgs, + args, + ) + } else { + this.log('callClient', playerOrEventName as string, eventNameOrArgs) + } + if (this.forceBrowserDevMode_) return Utils.errorUnknownEnvironment(this.environment_) - function _is1StParamPlayer(x: unknown): x is PlayerMp { - return typeof x === 'object' - } - - function _is2NdParamEventName(x: unknown): x is string { - return typeof x === 'string' - } - if (this.environment_ === Environment.CLIENT) { // client return await this.call( @@ -260,6 +251,14 @@ class Rpc extends Wrapper { mp.trigger(Events.LOCAL_EVENT_LISTENER, dataRaw) return (await this.responseHandler(state.uuid)).data } + + function _is1StParamPlayer(x: unknown): x is PlayerMp { + return typeof x === 'object' + } + + function _is2NdParamEventName(x: unknown): x is string { + return typeof x === 'string' + } } /** @@ -367,30 +366,25 @@ class Rpc extends Wrapper { eventNameOrArgs?: string | unknown[], args?: unknown[], ) { - _is1StParamPlayer(playerOrEventName) - ? this.log( - 'DEV callClient', - eventNameOrArgs as string, - playerOrEventName, - eventNameOrArgs, - args, - ) - : this.log( - 'DEV callClient', - playerOrEventName as string, - eventNameOrArgs, - ) + if (_is1StParamPlayer(playerOrEventName)) { + this.log( + 'DEV callClient', + eventNameOrArgs as string, + playerOrEventName, + eventNameOrArgs, + args, + ) + } else { + this.log( + 'DEV callClient', + playerOrEventName as string, + eventNameOrArgs, + ) + } + if (this.forceBrowserDevMode_) return Utils.errorUnknownEnvironment(this.environment_) - function _is1StParamPlayer(x: unknown): x is PlayerMp { - return typeof x === 'object' - } - - function _is2NdParamEventName(x: unknown): x is string { - return typeof x === 'string' - } - const state: RPCState = { uuid: Utils.generateUUID(), eventName: !_is1StParamPlayer(playerOrEventName) @@ -424,6 +418,14 @@ class Rpc extends Wrapper { } return (await this.responseHandler(state.uuid)).data + + function _is1StParamPlayer(x: unknown): x is PlayerMp { + return typeof x === 'object' + } + + function _is2NdParamEventName(x: unknown): x is string { + return typeof x === 'string' + } } /** diff --git a/rpc/tsconfig.json b/rpc/tsconfig.json index 65a1b3b..b0992b7 100644 --- a/rpc/tsconfig.json +++ b/rpc/tsconfig.json @@ -1,17 +1,16 @@ { "compilerOptions": { - "target": "es6", + "target": "es2022", "module": "commonjs", "moduleResolution": "node", "lib": [ - "ES6", + "es2022", "dom" ], "declaration": true, "declarationMap": true, "sourceMap": true, - "outDir": "bin", "esModuleInterop": true, "strict": true, diff --git a/tsconfig.json b/tsconfig.json index f01dbdf..e876cef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ESNext", + "target": "es2022", "lib": [ "ESNext", "ES2019",