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 7ee7c11..7dc907c 100644 Binary files a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db and b/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db differ 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 bd854bc..0000000 Binary files a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-shm and /dev/null differ 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 51c08a8..0000000 Binary files a/.nx/workspace-data/21ca3d83-9b5b-4113-b9ed-ba2fda3643de.db-wal and /dev/null differ diff --git a/.nx/workspace-data/d/daemon.log b/.nx/workspace-data/d/daemon.log index 9fb30b1..b3cb39c 100644 --- a/.nx/workspace-data/d/daemon.log +++ b/.nx/workspace-data/d/daemon.log @@ -328,3 +328,49 @@ [NX Daemon Server] - 2025-01-28T21:03:34.968Z - [WATCHER]: Processing file changes in outputs [NX Daemon Server] - 2025-01-28T21:03:39.693Z - [WATCHER]: Processing file changes in outputs [NX Daemon Server] - 2025-01-28T21:03:42.830Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:07:25.853Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:07:42.031Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:07:42.032Z - [WATCHER]: 1 file(s) created or restored, 0 file(s) modified, 1 file(s) deleted +[NX Daemon Server] - 2025-01-28T21:07:42.140Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph... +[NX Daemon Server] - 2025-01-28T21:07:42.140Z - [REQUEST]: .oldeslintrc.yaml +[NX Daemon Server] - 2025-01-28T21:07:42.140Z - [REQUEST]: .eslintrc.yaml +[NX Daemon Server] - 2025-01-28T21:07:42.145Z - Time taken for 'hash changed files from watcher' 0.3180000002030283ms +[NX Daemon Server] - 2025-01-28T21:07:42.162Z - Time taken for 'build-project-configs' 14.27530000009574ms +[NX Daemon Server] - 2025-01-28T21:07:42.184Z - [SYNC]: collect registered sync generators +[NX Daemon Server] - 2025-01-28T21:07:42.185Z - [SYNC]: project graph hash is the same, not collecting task sync generators +[NX Daemon Server] - 2025-01-28T21:07:42.185Z - [SYNC]: nx.json hash is the same, not collecting global sync generators +[NX Daemon Server] - 2025-01-28T21:07:42.185Z - Time taken for 'total execution time for createProjectGraph()' 20.54340000008233ms +[NX Daemon Server] - 2025-01-28T21:09:14.009Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:09:14.010Z - [WATCHER]: eslint.config.js was modified +[NX Daemon Server] - 2025-01-28T21:09:14.210Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph... +[NX Daemon Server] - 2025-01-28T21:09:14.210Z - [REQUEST]: eslint.config.js +[NX Daemon Server] - 2025-01-28T21:09:14.210Z - [REQUEST]: +[NX Daemon Server] - 2025-01-28T21:09:14.214Z - Time taken for 'hash changed files from watcher' 0.22069999994710088ms +[NX Daemon Server] - 2025-01-28T21:09:14.224Z - Time taken for 'build-project-configs' 9.737299999920651ms +[NX Daemon Server] - 2025-01-28T21:09:14.238Z - [SYNC]: collect registered sync generators +[NX Daemon Server] - 2025-01-28T21:09:14.239Z - [SYNC]: project graph hash is the same, not collecting task sync generators +[NX Daemon Server] - 2025-01-28T21:09:14.239Z - [SYNC]: nx.json hash is the same, not collecting global sync generators +[NX Daemon Server] - 2025-01-28T21:09:14.239Z - Time taken for 'total execution time for createProjectGraph()' 10.550400000065565ms +[NX Daemon Server] - 2025-01-28T21:09:37.019Z - [WATCHER]: _tmp_18004_21f1dd632cb13e0ffbcd4df63c0df122 was deleted +[NX Daemon Server] - 2025-01-28T21:09:37.020Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:09:37.435Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph... +[NX Daemon Server] - 2025-01-28T21:09:37.435Z - [REQUEST]: +[NX Daemon Server] - 2025-01-28T21:09:37.435Z - [REQUEST]: _tmp_18004_21f1dd632cb13e0ffbcd4df63c0df122 +[NX Daemon Server] - 2025-01-28T21:09:37.439Z - Time taken for 'hash changed files from watcher' 0.2675000000745058ms +[NX Daemon Server] - 2025-01-28T21:09:37.448Z - Time taken for 'build-project-configs' 8.281700000166893ms +[NX Daemon Server] - 2025-01-28T21:09:37.464Z - [SYNC]: collect registered sync generators +[NX Daemon Server] - 2025-01-28T21:09:37.464Z - [SYNC]: project graph hash is the same, not collecting task sync generators +[NX Daemon Server] - 2025-01-28T21:09:37.465Z - [SYNC]: nx.json hash is the same, not collecting global sync generators +[NX Daemon Server] - 2025-01-28T21:09:37.465Z - Time taken for 'total execution time for createProjectGraph()' 12.658899999922141ms +[NX Daemon Server] - 2025-01-28T21:09:40.932Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:09:40.933Z - [WATCHER]: pnpm-lock.yaml.4131020564 was modified +[NX Daemon Server] - 2025-01-28T21:09:41.043Z - [WATCHER]: Processing file changes in outputs +[NX Daemon Server] - 2025-01-28T21:09:41.044Z - [WATCHER]: Stopping the watcher for D:\hub\rage-framework (sources) +[NX Daemon Server] - 2025-01-28T21:09:41.044Z - [WATCHER]: Stopping the watcher for D:\hub\rage-framework (outputs) + +> 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",