From 55e4338c9d50c0ea9404b3eaf8a0a29007d09a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sun, 8 Jun 2025 21:05:17 +0200 Subject: [PATCH 1/5] Add prettier --- .prettierignore | 13 + eslint.config.js | 2 + package-lock.json | 1134 +++++++++++++++++++------------------------ package.json | 8 +- prettier.config.mjs | 10 + 5 files changed, 532 insertions(+), 635 deletions(-) create mode 100644 .prettierignore create mode 100644 prettier.config.mjs diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..0277d061 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +# Ignore artifacts +dist +build +Pods +target +.cxx + +# Ignore hermes +packages/host/hermes +packages/node-addon-examples/examples +packages/node-tests/node +packages/node-tests/tests +packages/node-tests/*.generated.js diff --git a/eslint.config.js b/eslint.config.js index 360cbeaf..6c9c816d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,6 +4,7 @@ import { globalIgnores } from "eslint/config"; import globals from "globals"; import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; +import eslintConfigPrettier from "eslint-config-prettier/flat"; export default tseslint.config( globalIgnores([".nx/**"]), @@ -14,6 +15,7 @@ export default tseslint.config( globalIgnores(["packages/ferric-example/ferric_example.d.ts"]), eslint.configs.recommended, tseslint.configs.recommended, + eslintConfigPrettier, { files: [ "apps/test-app/*.js", diff --git a/package-lock.json b/package-lock.json index cf6c2324..6b0ae9be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,14 +18,16 @@ "devDependencies": { "@changesets/cli": "^2.29.5", "@eslint/js": "^9.19.0", + "@prettier/plugin-oxc": "^0.0.4", "@reporters/github": "^1.7.2", "@tsconfig/node22": "^22.0.0", "@tsconfig/react-native": "3.0.5", "@types/node": "^22.13.0", "eslint": "^9.19.0", + "eslint-config-prettier": "^10.1.5", "globals": "^16.0.0", + "prettier": "^3.6.2", "react-native": "0.79.5", - "tsx": "^4.19.3", "typescript": "^5.7.3", "typescript-eslint": "^8.22.0" } @@ -2117,6 +2119,22 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/@changesets/apply-release-plan/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@changesets/apply-release-plan/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -2473,460 +2491,51 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/@emnapi/core": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", - "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.0.4", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", - "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", - "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", - "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", - "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", - "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", - "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", - "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", - "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", - "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", - "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", - "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", - "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", - "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", - "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", - "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", - "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", - "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", - "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", - "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", - "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", - "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", - "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", - "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", - "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", - "cpu": [ - "x64" - ], + "node_modules/@changesets/write/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], + "bin": { + "prettier": "bin-prettier.js" + }, "engines": { - "node": ">=18" + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", - "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", - "cpu": [ - "arm64" - ], - "dev": true, + "node_modules/@emnapi/core": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", + "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", "license": "MIT", "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@emnapi/wasi-threads": "1.0.4", + "tslib": "^2.4.0" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", - "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", - "cpu": [ - "ia32" - ], - "dev": true, + "node_modules/@emnapi/runtime": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", + "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", "license": "MIT", "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", - "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", - "cpu": [ - "x64" - ], - "dev": true, + "node_modules/@emnapi/wasi-threads": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", + "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", "license": "MIT", "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "tslib": "^2.4.0" } }, "node_modules/@eslint-community/eslint-utils": { @@ -5069,152 +4678,430 @@ "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", "license": "MIT", "engines": { - "node": ">= 20" + "node": ">= 20" + } + }, + "node_modules/@octokit/core": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.2.tgz", + "integrity": "sha512-ODsoD39Lq6vR6aBgvjTnA3nZGliknKboc9Gtxr7E4WDNqY24MxANKcuDQSF0jzapvGb3KWOEDrKfve4HoWGK+g==", + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.1", + "@octokit/request": "^10.0.2", + "@octokit/request-error": "^7.0.0", + "@octokit/types": "^14.0.0", + "before-after-hook": "^4.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/endpoint": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.0.tgz", + "integrity": "sha512-hoYicJZaqISMAI3JfaDr1qMNi48OctWuOih1m80bkYow/ayPw6Jj52tqWJ6GEoFTk1gBqfanSoI1iY99Z5+ekQ==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/graphql": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.1.tgz", + "integrity": "sha512-j1nQNU1ZxNFx2ZtKmL4sMrs4egy5h65OMDmSbVyuCzjOcwsHq6EaYjOTGXPQxgfiN8dJ4CriYHk6zF050WEULg==", + "license": "MIT", + "dependencies": { + "@octokit/request": "^10.0.2", + "@octokit/types": "^14.0.0", + "universal-user-agent": "^7.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "25.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", + "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-13.1.0.tgz", + "integrity": "sha512-16iNOa4rTTjaWtfsPGJcYYL79FJakseX8TQFIPfVuSPC3s5nkS/DSNQPFPc5lJHgEDBWNMxSApHrEymNblhA9w==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.1.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-6.0.0.tgz", + "integrity": "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-16.0.0.tgz", + "integrity": "sha512-kJVUQk6/dx/gRNLWUnAWKFs1kVPn5O5CYZyssyEoNYaFedqZxsfYs7DwI3d67hGz4qOwaJ1dpm07hOAD1BXx6g==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.1.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/request": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.2.tgz", + "integrity": "sha512-iYj4SJG/2bbhh+iIpFmG5u49DtJ4lipQ+aPakjL9OKpsGY93wM8w06gvFbEQxcMsZcCvk5th5KkIm2m8o14aWA==", + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^11.0.0", + "@octokit/request-error": "^7.0.0", + "@octokit/types": "^14.0.0", + "fast-content-type-parse": "^3.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/request-error": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.0.0.tgz", + "integrity": "sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^14.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/rest": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.0.tgz", + "integrity": "sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA==", + "license": "MIT", + "dependencies": { + "@octokit/core": "^7.0.2", + "@octokit/plugin-paginate-rest": "^13.0.1", + "@octokit/plugin-request-log": "^6.0.0", + "@octokit/plugin-rest-endpoint-methods": "^16.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/types": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", + "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^25.1.0" + } + }, + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.74.0.tgz", + "integrity": "sha512-lgq8TJq22eyfojfa2jBFy2m66ckAo7iNRYDdyn9reXYA3I6Wx7tgGWVx1JAp1lO+aUiqdqP/uPlDaETL9tqRcg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.74.0.tgz", + "integrity": "sha512-xbY/io/hkARggbpYEMFX6CwFzb7f4iS6WuBoBeZtdqRWfIEi7sm/uYWXfyVeB8uqOATvJ07WRFC2upI8PSI83g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.74.0.tgz", + "integrity": "sha512-FIj2gAGtFaW0Zk+TnGyenMUoRu1ju+kJ/h71D77xc1owOItbFZFGa+4WSVck1H8rTtceeJlK+kux+vCjGFCl9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.74.0.tgz", + "integrity": "sha512-W1I+g5TJg0TRRMHgEWNWsTIfe782V3QuaPgZxnfPNmDMywYdtlzllzclBgaDq6qzvZCCQc/UhvNb37KWTCTj8A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.74.0.tgz", + "integrity": "sha512-gxqkyRGApeVI8dgvJ19SYe59XASW3uVxF1YUgkE7peW/XIg5QRAOVTFKyTjI9acYuK1MF6OJHqx30cmxmZLtiQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.74.0.tgz", + "integrity": "sha512-jpnAUP4Fa93VdPPDzxxBguJmldj/Gpz7wTXKFzpAueqBMfZsy9KNC+0qT2uZ9HGUDMzNuKw0Se3bPCpL/gfD2Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" } }, - "node_modules/@octokit/core": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.2.tgz", - "integrity": "sha512-ODsoD39Lq6vR6aBgvjTnA3nZGliknKboc9Gtxr7E4WDNqY24MxANKcuDQSF0jzapvGb3KWOEDrKfve4HoWGK+g==", + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.74.0.tgz", + "integrity": "sha512-fcWyM7BNfCkHqIf3kll8fJctbR/PseL4RnS2isD9Y3FFBhp4efGAzhDaxIUK5GK7kIcFh1P+puIRig8WJ6IMVQ==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.1", - "@octokit/request": "^10.0.2", - "@octokit/request-error": "^7.0.0", - "@octokit/types": "^14.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" + "node": ">=20.0.0" } }, - "node_modules/@octokit/endpoint": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.0.tgz", - "integrity": "sha512-hoYicJZaqISMAI3JfaDr1qMNi48OctWuOih1m80bkYow/ayPw6Jj52tqWJ6GEoFTk1gBqfanSoI1iY99Z5+ekQ==", + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.74.0.tgz", + "integrity": "sha512-AMY30z/C77HgiRRJX7YtVUaelKq1ex0aaj28XoJu4SCezdS8i0IftUNTtGS1UzGjGZB8zQz5SFwVy4dRu4GLwg==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^14.0.0", - "universal-user-agent": "^7.0.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" + "node": ">=20.0.0" } }, - "node_modules/@octokit/graphql": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.1.tgz", - "integrity": "sha512-j1nQNU1ZxNFx2ZtKmL4sMrs4egy5h65OMDmSbVyuCzjOcwsHq6EaYjOTGXPQxgfiN8dJ4CriYHk6zF050WEULg==", + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.74.0.tgz", + "integrity": "sha512-/RZAP24TgZo4vV/01TBlzRqs0R7E6xvatww4LnmZEBBulQBU/SkypDywfriFqWuFoa61WFXPV7sLcTjJGjim/w==", + "cpu": [ + "riscv64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/request": "^10.0.2", - "@octokit/types": "^14.0.0", - "universal-user-agent": "^7.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" + "node": ">=20.0.0" } }, - "node_modules/@octokit/openapi-types": { - "version": "25.1.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.1.0.tgz", - "integrity": "sha512-idsIggNXUKkk0+BExUn1dQ92sfysJrje03Q0bv0e+KPLrvyqZF8MnBpFz8UNfYDwB3Ie7Z0TByjWfzxt7vseaA==", - "license": "MIT" - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-13.1.0.tgz", - "integrity": "sha512-16iNOa4rTTjaWtfsPGJcYYL79FJakseX8TQFIPfVuSPC3s5nkS/DSNQPFPc5lJHgEDBWNMxSApHrEymNblhA9w==", + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.74.0.tgz", + "integrity": "sha512-620J1beNAlGSPBD+Msb3ptvrwxu04B8iULCH03zlf0JSLy/5sqlD6qBs0XUVkUJv1vbakUw1gfVnUQqv0UTuEg==", + "cpu": [ + "s390x" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^14.1.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" + "node": ">=20.0.0" } }, - "node_modules/@octokit/plugin-request-log": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-6.0.0.tgz", - "integrity": "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q==", + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.74.0.tgz", + "integrity": "sha512-WBFgQmGtFnPNzHyLKbC1wkYGaRIBxXGofO0+hz1xrrkPgbxbJS1Ukva1EB8sPaVBBQ52Bdc2GjLSp721NWRvww==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" + "node": ">=20.0.0" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-16.0.0.tgz", - "integrity": "sha512-kJVUQk6/dx/gRNLWUnAWKFs1kVPn5O5CYZyssyEoNYaFedqZxsfYs7DwI3d67hGz4qOwaJ1dpm07hOAD1BXx6g==", + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.74.0.tgz", + "integrity": "sha512-y4mapxi0RGqlp3t6Sm+knJlAEqdKDYrEue2LlXOka/F2i4sRN0XhEMPiSOB3ppHmvK4I2zY2XBYTsX1Fel0fAg==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^14.1.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" + "node": ">=20.0.0" } }, - "node_modules/@octokit/request": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.2.tgz", - "integrity": "sha512-iYj4SJG/2bbhh+iIpFmG5u49DtJ4lipQ+aPakjL9OKpsGY93wM8w06gvFbEQxcMsZcCvk5th5KkIm2m8o14aWA==", + "node_modules/@oxc-parser/binding-wasm32-wasi": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.74.0.tgz", + "integrity": "sha512-yDS9bRDh5ymobiS2xBmjlrGdUuU61IZoJBaJC5fELdYT5LJNBXlbr3Yc6m2PWfRJwkH6Aq5fRvxAZ4wCbkGa8w==", + "cpu": [ + "wasm32" + ], + "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@octokit/endpoint": "^11.0.0", - "@octokit/request-error": "^7.0.0", - "@octokit/types": "^14.0.0", - "fast-content-type-parse": "^3.0.0", - "universal-user-agent": "^7.0.2" + "@napi-rs/wasm-runtime": "^0.2.11" }, "engines": { - "node": ">= 20" + "node": ">=14.0.0" } }, - "node_modules/@octokit/request-error": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.0.0.tgz", - "integrity": "sha512-KRA7VTGdVyJlh0cP5Tf94hTiYVVqmt2f3I6mnimmaVz4UG3gQV/k4mDJlJv3X67iX6rmN7gSHCF8ssqeMnmhZg==", + "node_modules/@oxc-parser/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", + "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", + "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@octokit/types": "^14.0.0" - }, + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.10.0" + } + }, + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.74.0.tgz", + "integrity": "sha512-XFWY52Rfb4N5wEbMCTSBMxRkDLGbAI9CBSL24BIDywwDJMl31gHEVlmHdCDRoXAmanCI6gwbXYTrWe0HvXJ7Aw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">= 20" + "node": ">=20.0.0" } }, - "node_modules/@octokit/rest": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.0.tgz", - "integrity": "sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA==", + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.74.0.tgz", + "integrity": "sha512-1D3x6iU2apLyfTQHygbdaNbX3nZaHu4yaXpD7ilYpoLo7f0MX0tUuoDrqJyJrVGqvyXgc0uz4yXz9tH9ZZhvvg==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/core": "^7.0.2", - "@octokit/plugin-paginate-rest": "^13.0.1", - "@octokit/plugin-request-log": "^6.0.0", - "@octokit/plugin-rest-endpoint-methods": "^16.0.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">= 20" + "node": ">=20.0.0" } }, - "node_modules/@octokit/types": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-14.1.0.tgz", - "integrity": "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g==", + "node_modules/@oxc-project/types": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.74.0.tgz", + "integrity": "sha512-KOw/RZrVlHGhCXh1RufBFF7Nuo7HdY5w1lRJukM/igIl6x9qtz8QycDvZdzb4qnHO7znrPyo2sJrFJK2eKHgfQ==", + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/openapi-types": "^25.1.0" + "funding": { + "url": "https://github.com/sponsors/Boshen" } }, "node_modules/@pkgjs/parseargs": { @@ -5227,6 +5114,22 @@ "node": ">=14" } }, + "node_modules/@prettier/plugin-oxc": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@prettier/plugin-oxc/-/plugin-oxc-0.0.4.tgz", + "integrity": "sha512-UGXe+g/rSRbglL0FOJiar+a+nUrst7KaFmsg05wYbKiInGWP6eAj/f8A2Uobgo5KxEtb2X10zeflNH6RK2xeIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "oxc-parser": "0.74.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@react-native-community/cli": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-18.0.0.tgz", @@ -7988,47 +7891,6 @@ "node": ">= 0.4" } }, - "node_modules/esbuild": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", - "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.2", - "@esbuild/android-arm": "0.25.2", - "@esbuild/android-arm64": "0.25.2", - "@esbuild/android-x64": "0.25.2", - "@esbuild/darwin-arm64": "0.25.2", - "@esbuild/darwin-x64": "0.25.2", - "@esbuild/freebsd-arm64": "0.25.2", - "@esbuild/freebsd-x64": "0.25.2", - "@esbuild/linux-arm": "0.25.2", - "@esbuild/linux-arm64": "0.25.2", - "@esbuild/linux-ia32": "0.25.2", - "@esbuild/linux-loong64": "0.25.2", - "@esbuild/linux-mips64el": "0.25.2", - "@esbuild/linux-ppc64": "0.25.2", - "@esbuild/linux-riscv64": "0.25.2", - "@esbuild/linux-s390x": "0.25.2", - "@esbuild/linux-x64": "0.25.2", - "@esbuild/netbsd-arm64": "0.25.2", - "@esbuild/netbsd-x64": "0.25.2", - "@esbuild/openbsd-arm64": "0.25.2", - "@esbuild/openbsd-x64": "0.25.2", - "@esbuild/sunos-x64": "0.25.2", - "@esbuild/win32-arm64": "0.25.2", - "@esbuild/win32-ia32": "0.25.2", - "@esbuild/win32-x64": "0.25.2" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -8117,6 +7979,22 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", + "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-scope": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", @@ -8822,19 +8700,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-tsconfig": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", - "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -11183,6 +11048,39 @@ "dev": true, "license": "MIT" }, + "node_modules/oxc-parser": { + "version": "0.74.0", + "resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.74.0.tgz", + "integrity": "sha512-2tDN/ttU8WE6oFh8EzKNam7KE7ZXSG5uXmvX85iNzxdJfMssDWcj3gpYzZi1E04XuE7m3v1dVWl/8BE886vPGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "^0.74.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-parser/binding-android-arm64": "0.74.0", + "@oxc-parser/binding-darwin-arm64": "0.74.0", + "@oxc-parser/binding-darwin-x64": "0.74.0", + "@oxc-parser/binding-freebsd-x64": "0.74.0", + "@oxc-parser/binding-linux-arm-gnueabihf": "0.74.0", + "@oxc-parser/binding-linux-arm-musleabihf": "0.74.0", + "@oxc-parser/binding-linux-arm64-gnu": "0.74.0", + "@oxc-parser/binding-linux-arm64-musl": "0.74.0", + "@oxc-parser/binding-linux-riscv64-gnu": "0.74.0", + "@oxc-parser/binding-linux-s390x-gnu": "0.74.0", + "@oxc-parser/binding-linux-x64-gnu": "0.74.0", + "@oxc-parser/binding-linux-x64-musl": "0.74.0", + "@oxc-parser/binding-wasm32-wasi": "0.74.0", + "@oxc-parser/binding-win32-arm64-msvc": "0.74.0", + "@oxc-parser/binding-win32-x64-msvc": "0.74.0" + } + }, "node_modules/p-filter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", @@ -11432,16 +11330,16 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -12011,16 +11909,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -12886,26 +12774,6 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, - "node_modules/tsx": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.3.tgz", - "integrity": "sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.25.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index 1216fa69..a6e0ecad 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "clean": "tsc --build --clean", "dev": "tsc --build --watch", "lint": "eslint .", + "prettier:check": "prettier --experimental-cli --check .", + "prettier:write": "prettier --experimental-cli --write .", "test": "npm run test --workspace react-native-node-api --workspace cmake-rn --workspace gyp-to-cmake --workspace node-addon-examples", "bootstrap": "npm run build && npm run bootstrap --workspaces --if-present", "prerelease": "npm run build && npm run prerelease --workspaces --if-present", @@ -41,15 +43,17 @@ "devDependencies": { "@changesets/cli": "^2.29.5", "@eslint/js": "^9.19.0", + "@prettier/plugin-oxc": "^0.0.4", "@reporters/github": "^1.7.2", "@tsconfig/node22": "^22.0.0", "@tsconfig/react-native": "3.0.5", "@types/node": "^22.13.0", "eslint": "^9.19.0", + "eslint-config-prettier": "^10.1.5", "globals": "^16.0.0", + "prettier": "^3.6.2", "react-native": "0.79.5", "typescript": "^5.7.3", - "typescript-eslint": "^8.22.0", - "tsx": "^4.19.3" + "typescript-eslint": "^8.22.0" } } diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 00000000..1603a699 --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,10 @@ +/** + * @satisfies {import("prettier").Config} + * @see https://prettier.io/docs/en/configuration.html + */ + +const config = { + plugins: ["@prettier/plugin-oxc"], +}; + +export default config; From 0afb81e8951e0689c1b1cbaa2bb838adabdae17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sun, 8 Jun 2025 21:05:41 +0200 Subject: [PATCH 2/5] Run prettier:check on CI --- .github/workflows/check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 01cc1f58..c84b9b62 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,6 +26,7 @@ jobs: node-version: lts/jod - run: npm ci - run: npm run lint + - run: npm run prettier:check unit-tests: strategy: fail-fast: false From b3d018372388d3d5104694a466e72a93f6799ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sat, 26 Jul 2025 10:18:04 +0200 Subject: [PATCH 3/5] Ran prettier:write --- apps/test-app/App.tsx | 4 +- apps/test-app/babel.config.js | 4 +- apps/test-app/react-native.config.js | 3 +- docs/HOW-IT-WORKS.md | 2 +- eslint.config.js | 8 +-- packages/cmake-rn/src/cli.ts | 52 +++++++-------- packages/cmake-rn/src/headers.ts | 8 +-- packages/cmake-rn/src/platforms.ts | 4 +- packages/cmake-rn/src/platforms/android.ts | 26 ++++---- packages/cmake-rn/src/platforms/apple.ts | 16 ++--- packages/cmake-rn/src/platforms/types.ts | 8 +-- packages/cmake-rn/src/weak-node-api.ts | 8 +-- packages/ferric/src/banner.ts | 2 +- packages/ferric/src/build.ts | 64 +++++++++---------- packages/ferric/src/cargo.ts | 34 +++++----- packages/ferric/src/errors.ts | 4 +- packages/ferric/src/napi-rs.ts | 8 +-- packages/ferric/src/rustup.ts | 4 +- packages/ferric/src/targets.ts | 12 ++-- packages/gyp-to-cmake/src/cli.ts | 11 ++-- packages/gyp-to-cmake/src/gyp.test.ts | 2 +- packages/gyp-to-cmake/src/gyp.ts | 14 ++-- packages/gyp-to-cmake/src/transformer.test.ts | 8 ++- packages/gyp-to-cmake/src/transformer.ts | 4 +- .../generate-weak-node-api-injector.ts | 2 +- .../host/scripts/generate-weak-node-api.ts | 2 +- packages/host/scripts/node-api-functions.ts | 16 ++--- .../host/src/node/babel-plugin/plugin.test.ts | 12 ++-- packages/host/src/node/babel-plugin/plugin.ts | 8 +-- packages/host/src/node/cli/android.ts | 2 +- packages/host/src/node/cli/apple.ts | 25 ++++---- packages/host/src/node/cli/hermes.ts | 20 +++--- packages/host/src/node/cli/link-modules.ts | 18 +++--- packages/host/src/node/cli/options.ts | 2 +- packages/host/src/node/cli/program.ts | 32 +++++----- packages/host/src/node/path-utils.test.ts | 46 ++++++------- packages/host/src/node/path-utils.ts | 50 +++++++-------- packages/host/src/node/prebuilds/android.ts | 4 +- packages/host/src/node/prebuilds/apple.ts | 14 ++-- packages/host/src/node/prebuilds/triplets.ts | 6 +- packages/host/src/node/test-utils.ts | 2 +- packages/host/src/node/weak-node-api.ts | 2 +- .../scripts/build-examples.mts | 2 +- .../scripts/copy-examples.mts | 6 +- .../scripts/verify-prebuilds.mts | 16 ++--- packages/node-addon-examples/src/index.ts | 24 +++---- 46 files changed, 314 insertions(+), 307 deletions(-) diff --git a/apps/test-app/App.tsx b/apps/test-app/App.tsx index 27fca38e..3fa20d0e 100644 --- a/apps/test-app/App.tsx +++ b/apps/test-app/App.tsx @@ -13,7 +13,7 @@ import { suites as nodeAddonExamplesSuites } from "@react-native-node-api/node-a function describeIf( condition: boolean, title: string, - fn: (this: Mocha.Suite) => void + fn: (this: Mocha.Suite) => void, ) { return condition ? describe(title, fn) : describe.skip(title, fn); } @@ -31,7 +31,7 @@ function loadTests({ }: Context) { describeIf(nodeAddonExamples, "Node Addon Examples", () => { for (const [suiteName, examples] of Object.entries( - nodeAddonExamplesSuites + nodeAddonExamplesSuites, )) { describe(suiteName, () => { for (const [exampleName, requireExample] of Object.entries(examples)) { diff --git a/apps/test-app/babel.config.js b/apps/test-app/babel.config.js index 175e8359..8ea846e2 100644 --- a/apps/test-app/babel.config.js +++ b/apps/test-app/babel.config.js @@ -1,5 +1,5 @@ module.exports = { - presets: ['module:@react-native/babel-preset'], + presets: ["module:@react-native/babel-preset"], // plugins: [['module:react-native-node-api/babel-plugin', { stripPathSuffix: true }]], - plugins: ['module:react-native-node-api/babel-plugin'], + plugins: ["module:react-native-node-api/babel-plugin"], }; diff --git a/apps/test-app/react-native.config.js b/apps/test-app/react-native.config.js index e15e25b5..dab1d107 100644 --- a/apps/test-app/react-native.config.js +++ b/apps/test-app/react-native.config.js @@ -1,4 +1,3 @@ - const project = (() => { try { const { configureProjects } = require("react-native-test-app"); @@ -25,4 +24,4 @@ const project = (() => { module.exports = { ...(project ? { project } : undefined), -}; \ No newline at end of file +}; diff --git a/docs/HOW-IT-WORKS.md b/docs/HOW-IT-WORKS.md index d677bd25..f35762c8 100644 --- a/docs/HOW-IT-WORKS.md +++ b/docs/HOW-IT-WORKS.md @@ -25,7 +25,7 @@ The generated code looks something like this: ```javascript module.exports = require("react-native-node-api").requireNodeAddon( - "calculator-lib--prebuild" + "calculator-lib--prebuild", ); ``` diff --git a/eslint.config.js b/eslint.config.js index 6c9c816d..2a41bd78 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,8 +2,8 @@ import { globalIgnores } from "eslint/config"; import globals from "globals"; -import eslint from '@eslint/js'; -import tseslint from 'typescript-eslint'; +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; import eslintConfigPrettier from "eslint-config-prettier/flat"; export default tseslint.config( @@ -21,7 +21,7 @@ export default tseslint.config( "apps/test-app/*.js", "packages/node-addon-examples/*.js", "packages/host/babel-plugin.js", - "packages/host/react-native.config.js" + "packages/host/react-native.config.js", ], languageOptions: { parserOptions: { @@ -40,7 +40,7 @@ export default tseslint.config( files: [ "packages/gyp-to-cmake/bin/*.js", "packages/host/bin/*.mjs", - "packages/host/scripts/*.mjs" + "packages/host/scripts/*.mjs", ], languageOptions: { globals: { diff --git a/packages/cmake-rn/src/cli.ts b/packages/cmake-rn/src/cli.ts index 56c8dac9..b9070c31 100644 --- a/packages/cmake-rn/src/cli.ts +++ b/packages/cmake-rn/src/cli.ts @@ -25,12 +25,12 @@ EventEmitter.defaultMaxListeners = 100; const verboseOption = new Option( "--verbose", - "Print more output during the build" + "Print more output during the build", ).default(process.env.CI === "true"); const sourcePathOption = new Option( "--source ", - "Specify the source directory containing a CMakeLists.txt file" + "Specify the source directory containing a CMakeLists.txt file", ).default(process.cwd()); // TODO: Add "MinSizeRel" and "RelWithDebInfo" @@ -48,7 +48,7 @@ const defaultTargets = CMAKE_RN_TARGETS ? CMAKE_RN_TARGETS.split(",") : []; for (const target of defaultTargets) { assert( (allTargets as string[]).includes(target), - `Unexpected target in CMAKE_RN_TARGETS: ${target}` + `Unexpected target in CMAKE_RN_TARGETS: ${target}`, ); } @@ -56,32 +56,32 @@ const targetOption = new Option("--target ", "Targets to build for") .choices(allTargets) .default( defaultTargets, - "CMAKE_RN_TARGETS environment variable split by ','" + "CMAKE_RN_TARGETS environment variable split by ','", ); const buildPathOption = new Option( "--build ", - "Specify the build directory to store the configured CMake project" + "Specify the build directory to store the configured CMake project", ); const cleanOption = new Option( "--clean", - "Delete the build directory before configuring the project" + "Delete the build directory before configuring the project", ); const outPathOption = new Option( "--out ", - "Specify the output directory to store the final build artifacts" + "Specify the output directory to store the final build artifacts", ).default(false, "./{build}/{configuration}"); const noAutoLinkOption = new Option( "--no-auto-link", - "Don't mark the output as auto-linkable by react-native-node-api" + "Don't mark the output as auto-linkable by react-native-node-api", ); const noWeakNodeApiLinkageOption = new Option( "--no-weak-node-api-linkage", - "Don't pass the path of the weak-node-api library from react-native-node-api" + "Don't pass the path of the weak-node-api library from react-native-node-api", ); let program = new Command("cmake-rn") @@ -99,7 +99,7 @@ let program = new Command("cmake-rn") for (const platform of platforms) { const allOption = new Option( `--${platform.id}`, - `Enable all ${platform.name} triplets` + `Enable all ${platform.name} triplets`, ); program = program.addOption(allOption); program = platform.amendCommand(program); @@ -133,13 +133,13 @@ program = program.action( } if (targets.size === 0) { throw new Error( - "Found no default targets: Install some platform specific build tools" + "Found no default targets: Install some platform specific build tools", ); } else { console.error( chalk.yellowBright("ℹ"), "Using default targets", - chalk.dim("(" + [...targets].join(", ") + ")") + chalk.dim("(" + [...targets].join(", ") + ")"), ); } } @@ -162,20 +162,20 @@ program = program.action( // Configure every triplet project const targetsSummary = chalk.dim( - `(${getTargetsSummary(targetContexts)})` + `(${getTargetsSummary(targetContexts)})`, ); await oraPromise( Promise.all( targetContexts.map(({ platform, ...context }) => - configureProject(platform, context, baseOptions) - ) + configureProject(platform, context, baseOptions), + ), ), { text: `Configuring projects ${targetsSummary}`, isSilent: baseOptions.verbose, successText: `Configured projects ${targetsSummary}`, failText: ({ message }) => `Failed to configure projects: ${message}`, - } + }, ); // Build every triplet project @@ -189,20 +189,20 @@ program = program.action( force: true, }); await buildProject(platform, context, baseOptions); - }) + }), ), { text: "Building projects", isSilent: baseOptions.verbose, successText: "Built projects", failText: ({ message }) => `Failed to build projects: ${message}`, - } + }, ); // Perform post-build steps for each platform in sequence for (const platform of platforms) { const relevantTargets = targetContexts.filter(({ target }) => - platformHasTarget(platform, target) + platformHasTarget(platform, target), ); if (relevantTargets.length == 0) { continue; @@ -212,7 +212,7 @@ program = program.action( outputPath: baseOptions.out || baseOptions.source, targets: relevantTargets, }, - baseOptions + baseOptions, ); } } catch (error) { @@ -221,11 +221,11 @@ program = program.action( } throw error; } - } + }, ); function getTargetsSummary( - targetContexts: { target: string; platform: Platform }[] + targetContexts: { target: string; platform: Platform }[], ) { const targetsPerPlatform: Record = {}; for (const { target, platform } of targetContexts) { @@ -257,7 +257,7 @@ function getTargetBuildPath(buildPath: string, target: unknown) { async function configureProject( platform: Platform>, context: TargetContext, - options: BaseOpts + options: BaseOpts, ) { const { target, buildPath, outputPath } = context; const { verbose, source, weakNodeApiLinkage } = options; @@ -286,14 +286,14 @@ async function configureProject( { outputMode: verbose ? "inherit" : "buffered", outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined, - } + }, ); } async function buildProject( platform: Platform>, context: TargetContext, - options: BaseOpts + options: BaseOpts, ) { const { target, buildPath } = context; const { verbose, configuration } = options; @@ -310,7 +310,7 @@ async function buildProject( { outputMode: verbose ? "inherit" : "buffered", outputPrefix: verbose ? chalk.dim(`[${target}] `) : undefined, - } + }, ); } diff --git a/packages/cmake-rn/src/headers.ts b/packages/cmake-rn/src/headers.ts index 61510846..5ca91be8 100644 --- a/packages/cmake-rn/src/headers.ts +++ b/packages/cmake-rn/src/headers.ts @@ -11,7 +11,7 @@ const require = createRequire(import.meta.url); export function getNodeApiHeadersPath(): string { try { const packagePath = path.dirname( - require.resolve("node-api-headers/package.json") + require.resolve("node-api-headers/package.json"), ); const result = path.join(packagePath, "include"); const stat = fs.statSync(packagePath); @@ -22,7 +22,7 @@ export function getNodeApiHeadersPath(): string { `Failed resolve Node-API headers: Did you install the 'node-api-headers' package?`, { cause: error, - } + }, ); } } @@ -33,7 +33,7 @@ export function getNodeApiHeadersPath(): string { export function getNodeAddonHeadersPath(): string { try { const packagePath = path.dirname( - require.resolve("node-addon-api/package.json") + require.resolve("node-addon-api/package.json"), ); return packagePath; } catch (error) { @@ -41,7 +41,7 @@ export function getNodeAddonHeadersPath(): string { `Failed resolve Node-API addon headers: Did you install the 'node-addon-api' package?`, { cause: error, - } + }, ); } } diff --git a/packages/cmake-rn/src/platforms.ts b/packages/cmake-rn/src/platforms.ts index 0692a3a4..5f333a1c 100644 --- a/packages/cmake-rn/src/platforms.ts +++ b/packages/cmake-rn/src/platforms.ts @@ -9,14 +9,14 @@ export const allTargets = [...android.targets, ...apple.targets] as const; export function platformHasTarget

( platform: P, - target: unknown + target: unknown, ): target is P["targets"][number] { return (platform.targets as unknown[]).includes(target); } export function findPlatformForTarget(target: unknown) { const platform = Object.values(platforms).find((platform) => - platformHasTarget(platform, target) + platformHasTarget(platform, target), ); assert(platform, `Unable to determine platform from target: ${target}`); return platform; diff --git a/packages/cmake-rn/src/platforms/android.ts b/packages/cmake-rn/src/platforms/android.ts index 51e2ab76..63397aa0 100644 --- a/packages/cmake-rn/src/platforms/android.ts +++ b/packages/cmake-rn/src/platforms/android.ts @@ -28,12 +28,12 @@ export const ANDROID_ARCHITECTURES = { const ndkVersionOption = new Option( "--ndk-version ", - "The NDK version to use for Android builds" + "The NDK version to use for Android builds", ).default(DEFAULT_NDK_VERSION); const androidSdkVersionOption = new Option( "--android-sdk-version ", - "The Android SDK version to use for Android builds" + "The Android SDK version to use for Android builds", ).default(DEFAULT_ANDROID_SDK_VERSION); type AndroidOpts = { ndkVersion: string; androidSdkVersion: string }; @@ -65,22 +65,22 @@ export const platform: Platform = { const { ANDROID_HOME } = process.env; assert( typeof ANDROID_HOME === "string", - "Missing env variable ANDROID_HOME" + "Missing env variable ANDROID_HOME", ); assert( fs.existsSync(ANDROID_HOME), - `Expected the Android SDK at ${ANDROID_HOME}` + `Expected the Android SDK at ${ANDROID_HOME}`, ); const installNdkCommand = `sdkmanager --install "ndk;${ndkVersion}"`; const ndkPath = path.resolve(ANDROID_HOME, "ndk", ndkVersion); assert( fs.existsSync(ndkPath), - `Missing Android NDK v${ndkVersion} (at ${ndkPath}) - run: ${installNdkCommand}` + `Missing Android NDK v${ndkVersion} (at ${ndkPath}) - run: ${installNdkCommand}`, ); const toolchainPath = path.join( ndkPath, - "build/cmake/android.toolchain.cmake" + "build/cmake/android.toolchain.cmake", ); const architecture = ANDROID_ARCHITECTURES[target]; @@ -130,7 +130,7 @@ export const platform: Platform = { targets.map(async ({ target, outputPath }) => { assert( fs.existsSync(outputPath), - `Expected a directory at ${outputPath}` + `Expected a directory at ${outputPath}`, ); // Expect binary file(s), either .node or .so const dirents = await fs.promises.readdir(outputPath, { @@ -140,16 +140,16 @@ export const platform: Platform = { .filter( (dirent) => dirent.isFile() && - (dirent.name.endsWith(".so") || dirent.name.endsWith(".node")) + (dirent.name.endsWith(".so") || dirent.name.endsWith(".node")), ) .map((dirent) => path.join(dirent.parentPath, dirent.name)); assert.equal(result.length, 1, "Expected exactly one library file"); return [target, result[0]] as const; - }) - ) + }), + ), ) as Record; const androidLibsFilename = determineAndroidLibsFilename( - Object.values(libraryPathByTriplet) + Object.values(libraryPathByTriplet), ); const androidLibsOutputPath = path.resolve(outputPath, androidLibsFilename); @@ -162,11 +162,11 @@ export const platform: Platform = { { text: "Assembling Android libs directory", successText: `Android libs directory assembled into ${chalk.dim( - path.relative(process.cwd(), androidLibsOutputPath) + path.relative(process.cwd(), androidLibsOutputPath), )}`, failText: ({ message }) => `Failed to assemble Android libs directory: ${message}`, - } + }, ); }, }; diff --git a/packages/cmake-rn/src/platforms/apple.ts b/packages/cmake-rn/src/platforms/apple.ts index b5ad0b1c..ce091dc4 100644 --- a/packages/cmake-rn/src/platforms/apple.ts +++ b/packages/cmake-rn/src/platforms/apple.ts @@ -89,7 +89,7 @@ export function getAppleBuildArgs() { const xcframeworkExtensionOption = new Option( "--xcframework-extension", - "Don't rename the xcframework to .apple.node" + "Don't rename the xcframework to .apple.node", ).default(false); type AppleOpts = { @@ -135,14 +135,14 @@ export const platform: Platform = { }, async postBuild( { outputPath, targets }, - { configuration, autoLink, xcframeworkExtension } + { configuration, autoLink, xcframeworkExtension }, ) { const libraryPaths = await Promise.all( targets.map(async ({ outputPath }) => { const configSpecificPath = path.join(outputPath, configuration); assert( fs.existsSync(configSpecificPath), - `Expected a directory at ${configSpecificPath}` + `Expected a directory at ${configSpecificPath}`, ); // Expect binary file(s), either .node or .dylib const files = await fs.promises.readdir(configSpecificPath); @@ -157,18 +157,18 @@ export const platform: Platform = { return newFilePath; } else { throw new Error( - `Expected a .node or .dylib file, but found ${file}` + `Expected a .node or .dylib file, but found ${file}`, ); } }); assert.equal(result.length, 1, "Expected exactly one library file"); return await result[0]; - }) + }), ); const frameworkPaths = libraryPaths.map(createAppleFramework); const xcframeworkFilename = determineXCFrameworkFilename( frameworkPaths, - xcframeworkExtension ? ".xcframework" : ".apple.node" + xcframeworkExtension ? ".xcframework" : ".apple.node", ); // Create the xcframework @@ -183,10 +183,10 @@ export const platform: Platform = { { text: "Assembling XCFramework", successText: `XCFramework assembled into ${chalk.dim( - path.relative(process.cwd(), xcframeworkOutputPath) + path.relative(process.cwd(), xcframeworkOutputPath), )}`, failText: ({ message }) => `Failed to assemble XCFramework: ${message}`, - } + }, ); }, }; diff --git a/packages/cmake-rn/src/platforms/types.ts b/packages/cmake-rn/src/platforms/types.ts index 5406cc48..fb7c8f5f 100644 --- a/packages/cmake-rn/src/platforms/types.ts +++ b/packages/cmake-rn/src/platforms/types.ts @@ -23,7 +23,7 @@ export type TargetContext = { export type Platform< Targets extends string[] = string[], Opts extends commander.OptionValues = Record, - Command = ExtendedCommand + Command = ExtendedCommand, > = { /** * Used to identify the platform in the CLI. @@ -54,14 +54,14 @@ export type Platform< */ configureArgs( context: TargetContext, - options: BaseOpts & Opts + options: BaseOpts & Opts, ): string[]; /** * Platform specific arguments passed to CMake to build a target project. */ buildArgs( context: TargetContext, - options: BaseOpts & Opts + options: BaseOpts & Opts, ): string[]; /** * Called to combine multiple targets into a single prebuilt artefact. @@ -74,6 +74,6 @@ export type Platform< outputPath: string; targets: TargetContext[]; }, - options: BaseOpts & Opts + options: BaseOpts & Opts, ): Promise; }; diff --git a/packages/cmake-rn/src/weak-node-api.ts b/packages/cmake-rn/src/weak-node-api.ts index 4db8d667..0e247fa6 100644 --- a/packages/cmake-rn/src/weak-node-api.ts +++ b/packages/cmake-rn/src/weak-node-api.ts @@ -20,11 +20,11 @@ export function getWeakNodeApiPath(triplet: SupportedTriplet): string { if (isAppleTriplet(triplet)) { const xcframeworkPath = path.join( weakNodeApiPath, - "weak-node-api.xcframework" + "weak-node-api.xcframework", ); assert( fs.existsSync(xcframeworkPath), - `Expected an XCFramework at ${xcframeworkPath}` + `Expected an XCFramework at ${xcframeworkPath}`, ); return xcframeworkPath; } else if (isAndroidTriplet(triplet)) { @@ -32,7 +32,7 @@ export function getWeakNodeApiPath(triplet: SupportedTriplet): string { weakNodeApiPath, "weak-node-api.android.node", ANDROID_ARCHITECTURES[triplet], - "libweak-node-api.so" + "libweak-node-api.so", ); assert(fs.existsSync(libraryPath), `Expected library at ${libraryPath}`); return libraryPath; @@ -46,7 +46,7 @@ export function getWeakNodeApiVariables(triplet: SupportedTriplet) { for (const includePath of includePaths) { assert( !includePath.includes(";"), - `Include path with a ';' is not supported: ${includePath}` + `Include path with a ';' is not supported: ${includePath}`, ); } return { diff --git a/packages/ferric/src/banner.ts b/packages/ferric/src/banner.ts index c9c136f3..820b681d 100644 --- a/packages/ferric/src/banner.ts +++ b/packages/ferric/src/banner.ts @@ -25,6 +25,6 @@ export function printBanner() { LINES.map((line, lineNumber, lines) => { const ratio = lineNumber / lines.length; return chalk.rgb(Math.round(250 - 100 * ratio), 0, 0)(line); - }).join("\n") + }).join("\n"), ); } diff --git a/packages/ferric/src/build.ts b/packages/ferric/src/build.ts index 48c10d8b..aaf97d77 100644 --- a/packages/ferric/src/build.ts +++ b/packages/ferric/src/build.ts @@ -47,7 +47,7 @@ async function generateEntrypoint({ getBlockComment(), `module.exports = require('./${libraryName}.node');`, ].join("\n\n") + "\n", - "utf8" + "utf8", ); } @@ -73,7 +73,7 @@ function getDefaultTargets() { { instructions: "Pass only valid targets via FERRIC_TARGETS (or remove them)", - } + }, ); } return result as (typeof ALL_TARGETS)[number][]; @@ -86,20 +86,20 @@ const appleTarget = new Option("--apple", "Use all Apple targets"); const androidTarget = new Option("--android", "Use all Android targets"); const ndkVersionOption = new Option( "--ndk-version ", - "The NDK version to use for Android builds" + "The NDK version to use for Android builds", ).default(DEFAULT_NDK_VERSION); const xcframeworkExtensionOption = new Option( "--xcframework-extension", - "Don't rename the xcframework to .apple.node" + "Don't rename the xcframework to .apple.node", ).default(false); const outputPathOption = new Option( "--output ", - "Writing outputs to this directory" + "Writing outputs to this directory", ).default(process.cwd()); const configurationOption = new Option( "--configuration ", - "Build configuration" + "Build configuration", ) .choices(["debug", "release"]) .default("debug"); @@ -153,11 +153,11 @@ export const buildCommand = new Command("build") chalk.yellowBright("ℹ"), chalk.dim( `Using default targets, pass ${chalk.italic( - "--android" + "--android", )}, ${chalk.italic("--apple")} or individual ${chalk.italic( - "--target" - )} options, to avoid this.` - ) + "--target", + )} options, to avoid this.`, + ), ); } ensureCargo(); @@ -175,8 +175,8 @@ export const buildCommand = new Command("build") Promise.all( appleTargets.map( async (target) => - [target, await build({ configuration, target })] as const - ) + [target, await build({ configuration, target })] as const, + ), ), Promise.all( androidTargets.map( @@ -189,15 +189,15 @@ export const buildCommand = new Command("build") ndkVersion, androidApiLevel: ANDROID_API_LEVEL, }), - ] as const - ) + ] as const, + ), ), ]), { text: `Building ${targetsDescription}`, successText: `Built ${targetsDescription}`, failText: (error: Error) => `Failed to build: ${error.message}`, - } + }, ); if (androidLibraries.length > 0) { @@ -205,15 +205,15 @@ export const buildCommand = new Command("build") androidLibraries.map(([target, outputPath]) => [ ANDROID_TRIPLET_PER_TARGET[target], outputPath, - ]) + ]), ) as Record; const androidLibsFilename = determineAndroidLibsFilename( - Object.values(libraryPathByTriplet) + Object.values(libraryPathByTriplet), ); const androidLibsOutputPath = path.resolve( outputPath, - androidLibsFilename + androidLibsFilename, ); await oraPromise( @@ -225,11 +225,11 @@ export const buildCommand = new Command("build") { text: "Assembling Android libs directory", successText: `Android libs directory assembled into ${prettyPath( - androidLibsOutputPath + androidLibsOutputPath, )}`, failText: ({ message }) => `Failed to assemble Android libs directory: ${message}`, - } + }, ); } @@ -238,13 +238,13 @@ export const buildCommand = new Command("build") const frameworkPaths = libraryPaths.map(createAppleFramework); const xcframeworkFilename = determineXCFrameworkFilename( frameworkPaths, - xcframeworkExtension ? ".xcframework" : ".apple.node" + xcframeworkExtension ? ".xcframework" : ".apple.node", ); // Create the xcframework const xcframeworkOutputPath = path.resolve( outputPath, - xcframeworkFilename + xcframeworkFilename, ); await oraPromise( @@ -256,11 +256,11 @@ export const buildCommand = new Command("build") { text: "Assembling XCFramework", successText: `XCFramework assembled into ${chalk.dim( - path.relative(process.cwd(), xcframeworkOutputPath) + path.relative(process.cwd(), xcframeworkOutputPath), )}`, failText: ({ message }) => `Failed to assemble XCFramework: ${message}`, - } + }, ); } @@ -280,11 +280,11 @@ export const buildCommand = new Command("build") { text: "Generating TypeScript declarations", successText: `Generated TypeScript declarations ${prettyPath( - declarationsPath + declarationsPath, )}`, failText: (error) => `Failed to generate TypeScript declarations: ${error.message}`, - } + }, ); const entrypointPath = path.join(outputPath, `${libraryName}.js`); @@ -297,11 +297,11 @@ export const buildCommand = new Command("build") { text: `Generating entrypoint`, successText: `Generated entrypoint into ${prettyPath( - entrypointPath + entrypointPath, )}`, failText: (error) => `Failed to generate entrypoint: ${error.message}`, - } + }, ); } catch (error) { process.exitCode = 1; @@ -318,18 +318,18 @@ export const buildCommand = new Command("build") chalk.green("FIX"), error.fix.command ? chalk.dim("Run: ") + error.fix.command - : error.fix.instructions + : error.fix.instructions, ); } } else { throw error; } } - } + }, ); async function combineLibraries( - libraries: Readonly<[AppleTargetName, string]>[] + libraries: Readonly<[AppleTargetName, string]>[], ): Promise { const result = []; const darwinLibraries = []; @@ -352,7 +352,7 @@ async function combineLibraries( successText: "Combined Darwin libraries into a universal library", failText: (error) => `Failed to combine Darwin libraries: ${error.message}`, - } + }, ); return [...result, universalPath]; } diff --git a/packages/ferric/src/cargo.ts b/packages/ferric/src/cargo.ts index a910ffb2..e63ac74a 100644 --- a/packages/ferric/src/cargo.ts +++ b/packages/ferric/src/cargo.ts @@ -54,7 +54,7 @@ export function ensureCargo() { } catch (error) { throw new UsageError( "You need a Rust toolchain: https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo", - { cause: error } + { cause: error }, ); } } @@ -76,9 +76,9 @@ type BuildOptions = { export async function build(options: BuildOptions) { const { target, configuration } = options; - const args = ["build", "--target", target] - if (configuration.toLowerCase() === 'release') { - args.push('--release') + const args = ["build", "--target", target]; + if (configuration.toLowerCase() === "release") { + args.push("--release"); } await spawn("cargo", args, { outputMode: "buffered", @@ -91,14 +91,14 @@ export async function build(options: BuildOptions) { process.cwd(), "target", target, - configuration + configuration, ); const dynamicLibraryFile = fs .readdirSync(targetOutputPath) .filter((file) => file.endsWith(".so") || file.endsWith(".dylib")); assert( dynamicLibraryFile.length === 1, - `Expected a single shared object file in ${targetOutputPath}` + `Expected a single shared object file in ${targetOutputPath}`, ); return joinPathAndAssertExistence(targetOutputPath, dynamicLibraryFile[0]); } @@ -130,7 +130,7 @@ export function getWeakNodeApiFrameworkPath(target: AppleTargetName) { return joinPathAndAssertExistence( weakNodeApiPath, "weak-node-api.xcframework", - APPLE_XCFRAMEWORK_CHILDS_PER_TARGET[target] + APPLE_XCFRAMEWORK_CHILDS_PER_TARGET[target], ); } @@ -138,7 +138,7 @@ export function getWeakNodeApiAndroidLibraryPath(target: AndroidTargetName) { return joinPathAndAssertExistence( weakNodeApiPath, "weak-node-api.android.node", - ANDROID_ARCH_PR_TARGET[target] + ANDROID_ARCH_PR_TARGET[target], ); } @@ -156,7 +156,7 @@ export function getTargetEnvironmentVariables({ `Missing ANDROID_HOME environment variable`, { instructions: "Set ANDROID_HOME to the Android SDK directory", - } + }, ); const ndkPath = path.join(ANDROID_HOME, "ndk", ndkVersion); assertFixable(fs.existsSync(ndkPath), `Expected NDK at ${ndkPath}`, { @@ -179,35 +179,35 @@ export function getTargetEnvironmentVariables({ ].join(String.fromCharCode(0x1f)), CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( toolchainBinPath, - `aarch64-linux-android${androidApiLevel}-clang${cmdMaybe}` + `aarch64-linux-android${androidApiLevel}-clang${cmdMaybe}`, ), CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER: joinPathAndAssertExistence( toolchainBinPath, - `armv7a-linux-androideabi${androidApiLevel}-clang${cmdMaybe}` + `armv7a-linux-androideabi${androidApiLevel}-clang${cmdMaybe}`, ), CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( toolchainBinPath, - `x86_64-linux-android${androidApiLevel}-clang${cmdMaybe}` + `x86_64-linux-android${androidApiLevel}-clang${cmdMaybe}`, ), CARGO_TARGET_I686_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( toolchainBinPath, - `i686-linux-android${androidApiLevel}-clang${cmdMaybe}` + `i686-linux-android${androidApiLevel}-clang${cmdMaybe}`, ), TARGET_CC: joinPathAndAssertExistence( toolchainBinPath, - `${targetArch}-linux-${targetPlatform}-clang${cmdMaybe}` + `${targetArch}-linux-${targetPlatform}-clang${cmdMaybe}`, ), TARGET_CXX: joinPathAndAssertExistence( toolchainBinPath, - `${targetArch}-linux-${targetPlatform}-clang++${cmdMaybe}` + `${targetArch}-linux-${targetPlatform}-clang++${cmdMaybe}`, ), TARGET_AR: joinPathAndAssertExistence( toolchainBinPath, - `llvm-ar${exeMaybe}` + `llvm-ar${exeMaybe}`, ), TARGET_RANLIB: joinPathAndAssertExistence( toolchainBinPath, - `llvm-ranlib${exeMaybe}` + `llvm-ranlib${exeMaybe}`, ), ANDROID_NDK: ndkPath, PATH: `${toolchainBinPath}:${process.env.PATH}`, diff --git a/packages/ferric/src/errors.ts b/packages/ferric/src/errors.ts index b27489b9..fbdc8480 100644 --- a/packages/ferric/src/errors.ts +++ b/packages/ferric/src/errors.ts @@ -15,7 +15,7 @@ export class UsageError extends Error { constructor( message: string, - { fix, cause }: { cause?: unknown; fix?: Fix } = {} + { fix, cause }: { cause?: unknown; fix?: Fix } = {}, ) { super(message, { cause }); this.fix = fix; @@ -25,7 +25,7 @@ export class UsageError extends Error { export function assertFixable( value: unknown, message: string, - fix: Fix + fix: Fix, ): asserts value { try { assert(value, message); diff --git a/packages/ferric/src/napi-rs.ts b/packages/ferric/src/napi-rs.ts index 95330b39..fbba24e3 100644 --- a/packages/ferric/src/napi-rs.ts +++ b/packages/ferric/src/napi-rs.ts @@ -32,7 +32,7 @@ export async function generateTypeScriptDeclarations({ }: TypeScriptDeclarationsOptions) { // Using a temporary directory to avoid polluting crate with any other side-effects for generating TypeScript declarations const tempPath = fs.realpathSync( - fs.mkdtempSync(path.join(PACKAGE_ROOT, "dts-tmp-")) + fs.mkdtempSync(path.join(PACKAGE_ROOT, "dts-tmp-")), ); const finalOutputPath = path.join(outputPath, outputFilename); try { @@ -40,7 +40,7 @@ export async function generateTypeScriptDeclarations({ await fs.promises.writeFile( path.join(tempPath, "package.json"), "{}", - "utf8" + "utf8", ); const tempOutputPath = path.join(tempPath, outputFilename); // Call into napi.rs to generate TypeScript declarations @@ -55,12 +55,12 @@ export async function generateTypeScriptDeclarations({ // Override the banner assert( fs.existsSync(tempOutputPath), - `Expected napi.rs to emit ${tempOutputPath}` + `Expected napi.rs to emit ${tempOutputPath}`, ); const contents = await fs.promises.readFile(tempOutputPath, "utf8"); const patchedContents = contents.replace( "/* auto-generated by NAPI-RS */", - getBlockComment() + getBlockComment(), ); // Copy out the generated TypeScript declarations await fs.promises.writeFile(finalOutputPath, patchedContents, { diff --git a/packages/ferric/src/rustup.ts b/packages/ferric/src/rustup.ts index c4b101a6..b246c0c0 100644 --- a/packages/ferric/src/rustup.ts +++ b/packages/ferric/src/rustup.ts @@ -9,12 +9,12 @@ export function getInstalledTargets() { .execFileSync("rustup", ["target", "list", "--installed"], { encoding: "utf-8", }) - .split("\n") + .split("\n"), ); } catch (error) { throw new UsageError( "You need a Rust toolchain: https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo", - { cause: error } + { cause: error }, ); } } diff --git a/packages/ferric/src/targets.ts b/packages/ferric/src/targets.ts index 0ad090a4..c1990d16 100644 --- a/packages/ferric/src/targets.ts +++ b/packages/ferric/src/targets.ts @@ -66,14 +66,14 @@ export function ensureInstalledTargets(expectedTargets: Set) { `You're missing ${ missingTargets.size } targets - to fix this, run:\n\n${chalk.italic( - `rustup target add ${[...missingTargets].join(" ")}` - )}` + `rustup target add ${[...missingTargets].join(" ")}`, + )}`, ); } } export function isAndroidTarget( - target: TargetName + target: TargetName, ): target is AndroidTargetName { return ANDROID_TARGETS.includes(target as (typeof ANDROID_TARGETS)[number]); } @@ -84,15 +84,15 @@ export function isAppleTarget(target: TargetName): target is AppleTargetName { export function filterTargetsByPlatform( targets: Set, - platform: "android" + platform: "android", ): AndroidTargetName[]; export function filterTargetsByPlatform( targets: Set, - platform: "apple" + platform: "apple", ): AppleTargetName[]; export function filterTargetsByPlatform( targets: Set, - platform: "apple" | "android" + platform: "apple" | "android", ) { if (platform === "android") { return [...targets].filter(isAndroidTarget); diff --git a/packages/gyp-to-cmake/src/cli.ts b/packages/gyp-to-cmake/src/cli.ts index 77a4f92d..91b64b9c 100644 --- a/packages/gyp-to-cmake/src/cli.ts +++ b/packages/gyp-to-cmake/src/cli.ts @@ -26,7 +26,7 @@ export function transformBindingGypFile( disallowUnknownProperties, projectName = generateProjectName(gypPath), ...restOfOptions - }: TransformOptions + }: TransformOptions, ) { console.log("Transforming", gypPath); const gyp = readBindingFile(gypPath, disallowUnknownProperties); @@ -42,7 +42,7 @@ export function transformBindingGypFile( export function transformBindingGypsRecursively( directoryPath: string, - options: TransformOptions + options: TransformOptions, ) { const entries = fs.readdirSync(directoryPath, { withFileTypes: true }); for (const entry of entries) { @@ -57,11 +57,14 @@ export function transformBindingGypsRecursively( export const program = new Command("gyp-to-cmake") .description("Transform binding.gyp to CMakeLists.txt") - .option("--no-path-transforms", "Don't transform output from command expansions (replacing '\\' with '/')") + .option( + "--no-path-transforms", + "Don't transform output from command expansions (replacing '\\' with '/')", + ) .argument( "[path]", "Path to the binding.gyp file or directory to traverse recursively", - process.cwd() + process.cwd(), ) .action((targetPath: string, { pathTransforms }) => { const options: TransformOptions = { diff --git a/packages/gyp-to-cmake/src/gyp.test.ts b/packages/gyp-to-cmake/src/gyp.test.ts index 5528bff8..0734e25c 100644 --- a/packages/gyp-to-cmake/src/gyp.test.ts +++ b/packages/gyp-to-cmake/src/gyp.test.ts @@ -28,7 +28,7 @@ describe("gyp.assertRoot", () => { { targets: [{ target_name: "", sources: [], extra: "not allowed" }], }, - true + true, ); }, /Unexpected property: extra/); }); diff --git a/packages/gyp-to-cmake/src/gyp.ts b/packages/gyp-to-cmake/src/gyp.ts index fdd209ef..c1d17341 100644 --- a/packages/gyp-to-cmake/src/gyp.ts +++ b/packages/gyp-to-cmake/src/gyp.ts @@ -16,7 +16,7 @@ export type GypBinding = { function assertNoExtraProperties( input: T, - expectedKeys: string[] + expectedKeys: string[], ) { for (const key of Object.keys(input)) { if (!expectedKeys.includes(key)) { @@ -27,7 +27,7 @@ function assertNoExtraProperties( export function assertTarget( target: unknown, - disallowUnknownProperties = false + disallowUnknownProperties = false, ): asserts target is GypTarget { assert(typeof target === "object" && target !== null, "Expected an object"); assert("target_name" in target, "Expected a 'target_name' property"); @@ -36,17 +36,17 @@ export function assertTarget( assert(Array.isArray(sources), "Expected a 'sources' array"); assert( sources.every((source) => typeof source === "string"), - "Expected all sources to be strings" + "Expected all sources to be strings", ); if ("include_dirs" in target) { const { include_dirs } = target; assert( Array.isArray(include_dirs), - "Expected 'include_dirs' to be an array" + "Expected 'include_dirs' to be an array", ); assert( include_dirs.every((dir) => typeof dir === "string"), - "Expected all include_dirs to be strings" + "Expected all include_dirs to be strings", ); } if (disallowUnknownProperties) { @@ -56,7 +56,7 @@ export function assertTarget( export function assertBinding( json: unknown, - disallowUnknownProperties = false + disallowUnknownProperties = false, ): asserts json is GypBinding { assert(typeof json === "object" && json !== null, "Expected an object"); assert("targets" in json, "Expected a 'targets' property"); @@ -72,7 +72,7 @@ export function assertBinding( export function readBindingFile( path: string, - disallowUnknownProperties = false + disallowUnknownProperties = false, ): GypBinding { try { const contents = fs.readFileSync(path, "utf-8"); diff --git a/packages/gyp-to-cmake/src/transformer.test.ts b/packages/gyp-to-cmake/src/transformer.test.ts index cfea9e14..06d62f8f 100644 --- a/packages/gyp-to-cmake/src/transformer.test.ts +++ b/packages/gyp-to-cmake/src/transformer.test.ts @@ -46,7 +46,9 @@ describe("bindingGypToCmakeLists", () => { }, }); - assert(output.includes("add_library(foo SHARED file/with/win32/separator.cc")); + assert( + output.includes("add_library(foo SHARED file/with/win32/separator.cc"), + ); }); it("escapes spaces in source filenames", () => { @@ -117,9 +119,9 @@ describe("bindingGypToCmakeLists", () => { assert( output.includes( - "target_compile_definitions(foo PRIVATE FOO BAR=value)" + "target_compile_definitions(foo PRIVATE FOO BAR=value)", ), - `Expected output to include target_compile_definitions:\n${output}` + `Expected output to include target_compile_definitions:\n${output}`, ); }); }); diff --git a/packages/gyp-to-cmake/src/transformer.ts b/packages/gyp-to-cmake/src/transformer.ts index d6fbeb65..01096501 100644 --- a/packages/gyp-to-cmake/src/transformer.ts +++ b/packages/gyp-to-cmake/src/transformer.ts @@ -105,7 +105,7 @@ export function bindingGypToCmakeLists({ ? [ `target_compile_definitions(${targetName} PRIVATE ${escapedJoinedDefines})`, ] - : []) + : []), // or // `set_target_properties(${targetName} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO)`, ); @@ -117,7 +117,7 @@ export function bindingGypToCmakeLists({ "if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)", " # Generate node.lib", " execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})", - "endif()" + "endif()", ); return lines.join("\n"); diff --git a/packages/host/scripts/generate-weak-node-api-injector.ts b/packages/host/scripts/generate-weak-node-api-injector.ts index 010288a0..d5adfd83 100644 --- a/packages/host/scripts/generate-weak-node-api-injector.ts +++ b/packages/host/scripts/generate-weak-node-api-injector.ts @@ -63,7 +63,7 @@ export function generateSource(functions: FunctionDecl[]) { ${functions .filter( ({ kind, name }) => - kind === "engine" || IMPLEMENTED_RUNTIME_FUNCTIONS.includes(name) + kind === "engine" || IMPLEMENTED_RUNTIME_FUNCTIONS.includes(name), ) .flatMap(({ name }) => `.${name} = ${name},`) .join("\n")} diff --git a/packages/host/scripts/generate-weak-node-api.ts b/packages/host/scripts/generate-weak-node-api.ts index 23a3c89d..1090de41 100644 --- a/packages/host/scripts/generate-weak-node-api.ts +++ b/packages/host/scripts/generate-weak-node-api.ts @@ -21,7 +21,7 @@ export function generateHeader(functions: FunctionDecl[]) { ({ returnType, noReturn, name, argumentTypes }) => `${returnType} ${ noReturn ? " __attribute__((noreturn))" : "" - }(*${name})(${argumentTypes.join(", ")});` + }(*${name})(${argumentTypes.join(", ")});`, ), "};", "typedef void(*InjectHostFunction)(const WeakNodeApiHost&);", diff --git a/packages/host/scripts/node-api-functions.ts b/packages/host/scripts/node-api-functions.ts index ad532ae1..b2a22a15 100644 --- a/packages/host/scripts/node-api-functions.ts +++ b/packages/host/scripts/node-api-functions.ts @@ -20,7 +20,7 @@ const clangAstDump = z.object({ qualType: z.string(), }) .optional(), - }) + }), ), }); @@ -49,7 +49,7 @@ export function getNodeApiHeaderAST(version: NodeApiVersion) { encoding: "utf-8", // Emitting the AST can produce a lot of output maxBuffer: 1024 * 1024 * 10, - } + }, ); const parsed = JSON.parse(output); return clangAstDump.parse(parsed); @@ -86,24 +86,24 @@ export function getNodeApiFunctions(version: NodeApiVersion = "v8") { assert(node.type, `Expected type for ${node.name}`); const match = node.type.qualType.match( - /^(?[^(]+) \((?[^)]+)\)/ + /^(?[^(]+) \((?[^)]+)\)/, ); assert( match && match.groups, - `Failed to parse function type: ${node.type.qualType}` + `Failed to parse function type: ${node.type.qualType}`, ); const { returnType, argumentTypes } = match.groups; assert( returnType, - `Failed to get return type from ${node.type.qualType}` + `Failed to get return type from ${node.type.qualType}`, ); assert( argumentTypes, - `Failed to get argument types from ${argumentTypes}` + `Failed to get argument types from ${argumentTypes}`, ); assert( returnType === "napi_status" || returnType === "void", - `Expected return type to be napi_status, got ${returnType}` + `Expected return type to be napi_status, got ${returnType}`, ); nodeApiFunctions.push({ @@ -128,7 +128,7 @@ export function getNodeApiFunctions(version: NodeApiVersion = "v8") { for (const knownSymbol of allSymbols) { if (!foundSymbols.has(knownSymbol)) { throw new Error( - `Missing symbol '${knownSymbol}' in the AST for Node API ${version}` + `Missing symbol '${knownSymbol}' in the AST for Node API ${version}`, ); } } diff --git a/packages/host/src/node/babel-plugin/plugin.test.ts b/packages/host/src/node/babel-plugin/plugin.test.ts index 349864b9..5f34563a 100644 --- a/packages/host/src/node/babel-plugin/plugin.test.ts +++ b/packages/host/src/node/babel-plugin/plugin.test.ts @@ -16,13 +16,13 @@ type TestTransformationOptions = { function itTransforms( title: string, - { files, inputFilePath, assertion, options = {} }: TestTransformationOptions + { files, inputFilePath, assertion, options = {} }: TestTransformationOptions, ) { it(`transforms ${title}`, (context: TestContext) => { const tempDirectoryPath = setupTempDirectory(context, files); const result = transformFileSync( path.join(tempDirectoryPath, inputFilePath), - { plugins: [[plugin, options]] } + { plugins: [[plugin, options]] }, ); assert(result, "Expected transformation to produce a result"); const { code } = result; @@ -36,12 +36,12 @@ function assertIncludes(needle: string, { reverse = false } = {}) { if (reverse) { assert( !code.includes(needle), - `Expected code to not include: ${needle}, got ${code}` + `Expected code to not include: ${needle}, got ${code}`, ); } else { assert( code.includes(needle), - `Expected code to include: ${needle}, got ${code}` + `Expected code to include: ${needle}, got ${code}`, ); } }; @@ -91,7 +91,7 @@ describe("plugin", () => { inputFilePath: "index.js", options: { pathSuffix: "keep" }, assertion: assertIncludes( - `requireNodeAddon("my-package--sub-dir-my-addon")` + `requireNodeAddon("my-package--sub-dir-my-addon")`, ), }); @@ -170,7 +170,7 @@ describe("plugin", () => { inputFilePath: "index.js", options: { pathSuffix: "keep" }, assertion: assertIncludes( - `requireNodeAddon("my-package--build-Release-my-addon")` + `requireNodeAddon("my-package--build-Release-my-addon")`, ), }); diff --git a/packages/host/src/node/babel-plugin/plugin.ts b/packages/host/src/node/babel-plugin/plugin.ts index 92792910..6b9937cb 100644 --- a/packages/host/src/node/babel-plugin/plugin.ts +++ b/packages/host/src/node/babel-plugin/plugin.ts @@ -36,7 +36,7 @@ function assertOptions(opts: unknown): asserts opts is PluginOptions { export function replaceWithRequireNodeAddon( p: NodePath, modulePath: string, - naming: NamingStrategy + naming: NamingStrategy, ) { const requireCallArgument = getLibraryName(modulePath, naming); p.replaceWith( @@ -45,10 +45,10 @@ export function replaceWithRequireNodeAddon( t.callExpression(t.identifier("require"), [ t.stringLiteral("react-native-node-api"), ]), - t.identifier("requireNodeAddon") + t.identifier("requireNodeAddon"), ), - [t.stringLiteral(requireCallArgument)] - ) + [t.stringLiteral(requireCallArgument)], + ), ); } diff --git a/packages/host/src/node/cli/android.ts b/packages/host/src/node/cli/android.ts index 4acae601..2fb2f92a 100644 --- a/packages/host/src/node/cli/android.ts +++ b/packages/host/src/node/cli/android.ts @@ -55,7 +55,7 @@ export async function linkAndroidDir({ const libraryPath = path.join(libraryDirent.parentPath, libraryDirent.name); await fs.promises.rename( libraryPath, - path.join(archPath, `lib${libraryName}.so`) + path.join(archPath, `lib${libraryName}.so`), ); } await fs.promises.rm(path.join(outputPath, MAGIC_FILENAME), { diff --git a/packages/host/src/node/cli/apple.ts b/packages/host/src/node/cli/apple.ts index 47be74d1..a04405cb 100644 --- a/packages/host/src/node/cli/apple.ts +++ b/packages/host/src/node/cli/apple.ts @@ -30,7 +30,7 @@ export async function updateInfoPlist({ // TODO: Use a proper plist parser const updatedContents = infoPlistContents.replaceAll( oldLibraryName, - newLibraryName + newLibraryName, ); await fs.promises.writeFile(filePath, updatedContents, "utf-8"); } @@ -45,7 +45,7 @@ export async function linkXcframework({ const newLibraryName = getLibraryName(modulePath, naming); const outputPath = getLinkedModuleOutputPath(platform, modulePath, naming); const tempPath = await fs.promises.mkdtemp( - path.join(os.tmpdir(), `react-native-node-api-${newLibraryName}-`) + path.join(os.tmpdir(), `react-native-node-api-${newLibraryName}-`), ); try { if (incremental && fs.existsSync(outputPath)) { @@ -67,7 +67,7 @@ export async function linkXcframework({ // Following extracted function mimics `glob("*/*.framework/")` function globFrameworkDirs( startPath: string, - fn: (parentPath: string, name: string) => Promise + fn: (parentPath: string, name: string) => Promise, ) { return fs .readdirSync(startPath, { withFileTypes: true }) @@ -79,10 +79,11 @@ export async function linkXcframework({ .filter( (frameworkEntry) => frameworkEntry.isDirectory() && - path.extname(frameworkEntry.name) === ".framework" + path.extname(frameworkEntry.name) === ".framework", ) - .flatMap(async (frameworkEntry) => - await fn(tripletPath, frameworkEntry.name) + .flatMap( + async (frameworkEntry) => + await fn(tripletPath, frameworkEntry.name), ); }); } @@ -94,18 +95,18 @@ export async function linkXcframework({ const oldLibraryPath = path.join(frameworkPath, oldLibraryName); const newFrameworkPath = path.join( tripletPath, - `${newLibraryName}.framework` + `${newLibraryName}.framework`, ); const newLibraryPath = path.join(newFrameworkPath, newLibraryName); assert( fs.existsSync(oldLibraryPath), - `Expected a library at '${oldLibraryPath}'` + `Expected a library at '${oldLibraryPath}'`, ); // Rename the library await fs.promises.rename( oldLibraryPath, // Cannot use newLibraryPath here, because the framework isn't renamed yet - path.join(frameworkPath, newLibraryName) + path.join(frameworkPath, newLibraryName), ); // Rename the framework await fs.promises.rename(frameworkPath, newFrameworkPath); @@ -121,7 +122,7 @@ export async function linkXcframework({ ], { outputMode: "buffered", - } + }, ); // Update the Info.plist file for the framework await updateInfoPlist({ @@ -130,7 +131,7 @@ export async function linkXcframework({ newLibraryName, }); return newFrameworkPath; - }) + }), ); // Create a new xcframework from the renamed frameworks @@ -147,7 +148,7 @@ export async function linkXcframework({ ], { outputMode: "buffered", - } + }, ); return { diff --git a/packages/host/src/node/cli/hermes.ts b/packages/host/src/node/cli/hermes.ts index a7c875a5..4fddebe6 100644 --- a/packages/host/src/node/cli/hermes.ts +++ b/packages/host/src/node/cli/hermes.ts @@ -19,7 +19,7 @@ export const command = new Command("vendor-hermes") .option( "--force", "Don't check timestamps of input files to skip unnecessary rebuilds", - false + false, ) .action(async (from, { force, silent }) => { try { @@ -29,12 +29,12 @@ export const command = new Command("vendor-hermes") require.resolve("react-native/package.json", { // Ensures we'll be patching the React Native package actually used by the app paths: [appPackageRoot], - }) + }), ); const hermesVersionPath = path.join( reactNativePath, "sdks", - ".hermesversion" + ".hermesversion", ); const hermesVersion = fs.readFileSync(hermesVersionPath, "utf8").trim(); if (!silent) { @@ -43,7 +43,7 @@ export const command = new Command("vendor-hermes") const reactNativeJsiPath = path.join( reactNativePath, - "ReactCommon/jsi/jsi/" + "ReactCommon/jsi/jsi/", ); const hermesPath = path.join(HOST_PACKAGE_ROOT, "hermes"); @@ -56,7 +56,7 @@ export const command = new Command("vendor-hermes") failText: (error) => `Failed to remove existing Hermes clone: ${error.message}`, isEnabled: !silent, - } + }, ); } if (!fs.existsSync(hermesPath)) { @@ -77,7 +77,7 @@ export const command = new Command("vendor-hermes") ], { outputMode: "buffered", - } + }, ), { text: `Cloning custom Hermes into ${prettyPath(hermesPath)}`, @@ -85,14 +85,14 @@ export const command = new Command("vendor-hermes") failText: (err) => `Failed to clone custom Hermes: ${err.message}`, isEnabled: !silent, - } + }, ); } catch (error) { if (error instanceof SpawnFailure) { error.flushOutput("both"); console.error( `\n🛑 React Native uses the ${hermesVersion} tag and cloning our fork failed.`, - `Please see the Node-API package's peer dependency on "react-native" for supported versions.` + `Please see the Node-API package's peer dependency on "react-native" for supported versions.`, ); process.exitCode = 1; return; @@ -105,7 +105,7 @@ export const command = new Command("vendor-hermes") assert( fs.existsSync(hermesJsiPath), - `Hermes JSI path does not exist: ${hermesJsiPath}` + `Hermes JSI path does not exist: ${hermesJsiPath}`, ); await oraPromise( @@ -118,7 +118,7 @@ export const command = new Command("vendor-hermes") failText: (err) => `Failed to copy JSI from Hermes to React Native: ${err.message}`, isEnabled: !silent, - } + }, ); console.log(hermesPath); } catch (error) { diff --git a/packages/host/src/node/cli/link-modules.ts b/packages/host/src/node/cli/link-modules.ts index 5bb18d80..883c3e21 100644 --- a/packages/host/src/node/cli/link-modules.ts +++ b/packages/host/src/node/cli/link-modules.ts @@ -14,7 +14,7 @@ import { import chalk from "chalk"; export type ModuleLinker = ( - options: LinkModuleOptions + options: LinkModuleOptions, ) => Promise; export type LinkModulesOptions = { @@ -71,8 +71,8 @@ export async function linkModules({ const absoluteModulePaths = Object.values(dependenciesByName).flatMap( (dependency) => dependency.modulePaths.map((modulePath) => - path.join(dependency.path, modulePath) - ) + path.join(dependency.path, modulePath), + ), ); if (hasDuplicateLibraryNames(absoluteModulePaths, naming)) { @@ -100,13 +100,13 @@ export async function linkModules({ throw error; } } - }) + }), ); } export async function pruneLinkedModules( platform: PlatformName, - linkedModules: ModuleOutput[] + linkedModules: ModuleOutput[], ) { if (linkedModules.some(({ failure }) => failure)) { // Don't prune if any of the modules failed to copy @@ -122,17 +122,17 @@ export async function pruneLinkedModules( console.log( "🧹Deleting", prettyPath(candidatePath), - chalk.dim("(no longer linked)") + chalk.dim("(no longer linked)"), ); await fs.promises.rm(candidatePath, { recursive: true, force: true }); } - }) + }), ); } export function hasDuplicateLibraryNames( modulePaths: string[], - naming: NamingStrategy + naming: NamingStrategy, ): boolean { const libraryNames = modulePaths.map((modulePath) => { return getLibraryName(modulePath, naming); @@ -144,7 +144,7 @@ export function hasDuplicateLibraryNames( export function getLinkedModuleOutputPath( platform: PlatformName, modulePath: string, - naming: NamingStrategy + naming: NamingStrategy, ): string { const libraryName = getLibraryName(modulePath, naming); if (platform === "android") { diff --git a/packages/host/src/node/cli/options.ts b/packages/host/src/node/cli/options.ts index 3e8b512b..1f81f306 100644 --- a/packages/host/src/node/cli/options.ts +++ b/packages/host/src/node/cli/options.ts @@ -9,7 +9,7 @@ if (typeof NODE_API_PATH_SUFFIX === "string") { export const pathSuffixOption = new Option( "--path-suffix ", - "Controls how the path of the addon inside a package is transformed into a library name" + "Controls how the path of the addon inside a package is transformed into a library name", ) .choices(PATH_SUFFIX_CHOICES) .default(NODE_API_PATH_SUFFIX || "strip"); diff --git a/packages/host/src/node/cli/program.ts b/packages/host/src/node/cli/program.ts index 0b629245..0c98021d 100644 --- a/packages/host/src/node/cli/program.ts +++ b/packages/host/src/node/cli/program.ts @@ -29,7 +29,7 @@ import { linkAndroidDir } from "./android"; EventEmitter.defaultMaxListeners = 100; export const program = new Command("react-native-node-api").addCommand( - vendorHermes + vendorHermes, ); function getLinker(platform: PlatformName): ModuleLinker { @@ -58,12 +58,12 @@ program .option( "--force", "Don't check timestamps of input files to skip unnecessary rebuilds", - false + false, ) .option( "--prune", "Delete vendored modules that are no longer auto-linked", - true + true, ) .option("--android", "Link Android modules") .option("--apple", "Link Apple modules") @@ -81,7 +81,7 @@ program if (platforms.length === 0) { console.error( `No platform specified, pass one or more of:`, - ...PLATFORMS.map((platform) => chalk.bold(`\n --${platform}`)) + ...PLATFORMS.map((platform) => chalk.bold(`\n --${platform}`)), ); process.exitCode = 1; return; @@ -101,16 +101,16 @@ program }), { text: `Linking ${platformDisplayName} Node-API modules into ${prettyPath( - platformOutputPath + platformOutputPath, )}`, successText: `Linked ${platformDisplayName} Node-API modules into ${prettyPath( - platformOutputPath + platformOutputPath, )}`, failText: (error) => `Failed to link ${platformDisplayName} Node-API modules into ${prettyPath( - platformOutputPath + platformOutputPath, )}: ${error.message}`, - } + }, ); if (modules.length === 0) { @@ -130,14 +130,14 @@ program "Skipped", prettyPath(originalPath), prettyOutputPath, - "(up to date)" + "(up to date)", ); } else { console.log( chalk.greenBright("⚭"), "Linked", prettyPath(originalPath), - prettyOutputPath + prettyOutputPath, ); } } @@ -148,7 +148,7 @@ program "\n", chalk.redBright("✖"), "Failed to copy", - prettyPath(originalPath) + prettyPath(originalPath), ); console.error(failure.message); failure.flushOutput("both"); @@ -181,7 +181,7 @@ program const dependencyCount = Object.keys(dependencies).length; const xframeworkCount = Object.values(dependencies).reduce( (acc, { modulePaths }) => acc + modulePaths.length, - 0 + 0, ); console.log( "Found", @@ -190,17 +190,17 @@ program chalk.greenBright(dependencyCount), dependencyCount === 1 ? "package" : "packages", "from", - prettyPath(rootPath) + prettyPath(rootPath), ); for (const [dependencyName, dependency] of Object.entries(dependencies)) { console.log( chalk.blueBright(dependencyName), "→", - prettyPath(dependency.path) + prettyPath(dependency.path), ); logModulePaths( dependency.modulePaths.map((p) => path.join(dependency.path, p)), - { pathSuffix } + { pathSuffix }, ); } } @@ -209,7 +209,7 @@ program program .command("info ") .description( - "Utility to print, module path, the hash of a single Android library" + "Utility to print, module path, the hash of a single Android library", ) .addOption(pathSuffixOption) .action((pathInput, { pathSuffix }) => { diff --git a/packages/host/src/node/path-utils.test.ts b/packages/host/src/node/path-utils.test.ts index 3b1fafba..8195e373 100644 --- a/packages/host/src/node/path-utils.test.ts +++ b/packages/host/src/node/path-utils.test.ts @@ -75,12 +75,12 @@ describe("isNodeApiModule", () => { try { assert.equal( isNodeApiModule(path.join(tempDirectoryPath, "addon")), - false + false, ); } finally { restoreReadPermissions(tempDirectoryPath); } - } + }, ); it("throws when module file exists but is not readable", (context) => { @@ -92,7 +92,7 @@ describe("isNodeApiModule", () => { try { assert.throws( () => isNodeApiModule(path.join(tempDirectoryPath, "addon")), - /Found an unreadable module addon\.android\.node/ + /Found an unreadable module addon\.android\.node/, ); } finally { restoreReadPermissions(candidate); @@ -112,7 +112,7 @@ describe("isNodeApiModule", () => { assert.equal(isNodeApiModule(path.join(tempDirectoryPath, "addon")), true); assert.equal( isNodeApiModule(path.join(tempDirectoryPath, "addon.node")), - true + true, ); assert.equal(isNodeApiModule(path.join(tempDirectoryPath, "nope")), false); }); @@ -127,7 +127,7 @@ describe("isNodeApiModule", () => { removeReadPermissions(unreadable); assert.throws( () => isNodeApiModule(path.join(tempDirectoryPath, "addon")), - /Found an unreadable module addon\.android\.node/ + /Found an unreadable module addon\.android\.node/, ); restoreReadPermissions(unreadable); }); @@ -151,7 +151,7 @@ describe("determineModuleContext", () => { { const { packageName, relativePath } = determineModuleContext( - path.join(tempDirectoryPath, "some-dir/some-file.node") + path.join(tempDirectoryPath, "some-dir/some-file.node"), ); assert.equal(packageName, "my-package"); assert.equal(relativePath, "some-dir/some-file"); @@ -165,7 +165,7 @@ describe("determineModuleContext", () => { { const { packageName, relativePath } = determineModuleContext( - path.join(tempDirectoryPath, "some-dir/libsome-file.node") + path.join(tempDirectoryPath, "some-dir/libsome-file.node"), ); assert.equal(packageName, "my-package"); assert.equal(relativePath, "some-dir/some-file"); @@ -182,7 +182,7 @@ describe("determineModuleContext", () => { { const { packageName, relativePath } = determineModuleContext( - path.join(tempDirectoryPath, "sub-package-a/some-file.node") + path.join(tempDirectoryPath, "sub-package-a/some-file.node"), ); assert.equal(packageName, "my-sub-package-a"); assert.equal(relativePath, "some-file"); @@ -190,7 +190,7 @@ describe("determineModuleContext", () => { { const { packageName, relativePath } = determineModuleContext( - path.join(tempDirectoryPath, "sub-package-b/some-file.node") + path.join(tempDirectoryPath, "sub-package-b/some-file.node"), ); assert.equal(packageName, "my-sub-package-b"); assert.equal(relativePath, "some-file"); @@ -210,14 +210,14 @@ describe("getLibraryName", () => { getLibraryName(path.join(tempDirectoryPath, "addon"), { pathSuffix: "keep", }), - "my-package--addon" + "my-package--addon", ); assert.equal( getLibraryName(path.join(tempDirectoryPath, "sub-directory/addon"), { pathSuffix: "keep", }), - "my-package--sub-directory-addon" + "my-package--sub-directory-addon", ); }); @@ -232,14 +232,14 @@ describe("getLibraryName", () => { getLibraryName(path.join(tempDirectoryPath, "addon"), { pathSuffix: "strip", }), - "my-package--addon" + "my-package--addon", ); assert.equal( getLibraryName(path.join(tempDirectoryPath, "sub-directory", "addon"), { pathSuffix: "strip", }), - "my-package--addon" + "my-package--addon", ); }); @@ -254,14 +254,14 @@ describe("getLibraryName", () => { getLibraryName(path.join(tempDirectoryPath, "addon"), { pathSuffix: "omit", }), - "my-package" + "my-package", ); assert.equal( getLibraryName(path.join(tempDirectoryPath, "sub-directory", "addon"), { pathSuffix: "omit", }), - "my-package" + "my-package", ); }); }); @@ -296,7 +296,7 @@ describe("findPackageDependencyPaths", () => { }); const result = findPackageDependencyPaths( - path.join(tempDir, "test-package/src/index.js") + path.join(tempDir, "test-package/src/index.js"), ); assert.deepEqual(result, { @@ -394,7 +394,7 @@ describe("findNodeApiModulePaths", () => { } finally { restoreReadPermissions(tempDir); } - } + }, ); }); @@ -405,7 +405,7 @@ describe("findNodeApiModulePathsByDependency", () => { "app/package.json": JSON.stringify({ name: "app", dependencies: Object.fromEntries( - packagesNames.map((packageName) => [packageName, "^1.0.0"]) + packagesNames.map((packageName) => [packageName, "^1.0.0"]), ), }), ...Object.fromEntries( @@ -419,7 +419,7 @@ describe("findNodeApiModulePathsByDependency", () => { "index.js": "", "addon.apple.node/react-native-node-api-module": "", }, - ]) + ]), ), }); @@ -461,14 +461,14 @@ describe("determineModuleContext", () => { readCount++; } return orig(...args); - } + }, ); const ctx1 = determineModuleContext( - path.join(tempDir, "subdir1/file1.node") + path.join(tempDir, "subdir1/file1.node"), ); const ctx2 = determineModuleContext( - path.join(tempDir, "subdir2/file2.node") + path.join(tempDir, "subdir2/file2.node"), ); assert.equal(ctx1.packageName, "cached-pkg"); assert.equal(ctx2.packageName, "cached-pkg"); @@ -497,7 +497,7 @@ describe("findNodeAddonForBindings()", () => { // Act const actualPath = await findNodeAddonForBindings( name, - tempDirectoryPath + tempDirectoryPath, ); // Assert const expectedAbsPath = path.join(tempDirectoryPath, relPath); diff --git a/packages/host/src/node/path-utils.ts b/packages/host/src/node/path-utils.ts index c92115cc..f0fa846a 100644 --- a/packages/host/src/node/path-utils.ts +++ b/packages/host/src/node/path-utils.ts @@ -22,15 +22,15 @@ export const PATH_SUFFIX_CHOICES = ["strip", "keep", "omit"] as const; export type PathSuffixChoice = (typeof PATH_SUFFIX_CHOICES)[number]; export function assertPathSuffix( - value: unknown + value: unknown, ): asserts value is PathSuffixChoice { assert( typeof value === "string", - `Expected a string, got ${typeof value} (${value})` + `Expected a string, got ${typeof value} (${value})`, ); assert( (PATH_SUFFIX_CHOICES as readonly string[]).includes(value), - `Expected one of ${PATH_SUFFIX_CHOICES.join(", ")}` + `Expected one of ${PATH_SUFFIX_CHOICES.join(", ")}`, ); } @@ -61,7 +61,7 @@ export function isNodeApiModule(modulePath: string): boolean { // HACK: Take a shortcut (if applicable): existing `.node` files are addons try { fs.accessSync( - modulePath.endsWith(".node") ? modulePath : `${modulePath}.node` + modulePath.endsWith(".node") ? modulePath : `${modulePath}.node`, ); return true; } catch { @@ -131,7 +131,7 @@ export function stripExtension(modulePath: string) { return modulePath; } }, - modulePath + modulePath, ); } @@ -145,7 +145,7 @@ export type ModuleContext = { */ export function determineModuleContext( modulePath: string, - originalPath = modulePath + originalPath = modulePath, ): ModuleContext { // Locate nearest package directory const pkgDir = packageDirectorySync({ cwd: modulePath }); @@ -158,7 +158,7 @@ export function determineModuleContext( const pkg = readPackageSync({ cwd: pkgDir }); assert( typeof pkg.name === "string", - "Expected package.json to have a name" + "Expected package.json to have a name", ); pkgName = pkg.name; packageNameCache.set(pkgDir, pkgName); @@ -191,19 +191,19 @@ export function getLibraryName(modulePath: string, naming: NamingStrategy) { : `${escapedPackageName}--${escapePath( naming.pathSuffix === "strip" ? path.basename(relativePath) - : relativePath + : relativePath, )}`; } export function prettyPath(p: string) { return chalk.dim( - path.relative(process.cwd(), p) || chalk.italic("current directory") + path.relative(process.cwd(), p) || chalk.italic("current directory"), ); } export function resolvePackageRoot( requireFromPackageRoot: NodeJS.Require, - packageName: string + packageName: string, ): string | undefined { try { const resolvedPath = requireFromPackageRoot.resolve(packageName); @@ -217,7 +217,7 @@ export function resolvePackageRoot( export function logModulePaths( modulePaths: string[], // TODO: Default to iterating and printing for all supported naming strategies - naming: NamingStrategy + naming: NamingStrategy, ) { const pathsPerName = new Map(); for (const modulePath of modulePaths) { @@ -237,7 +237,7 @@ export function logModulePaths( ? chalk.redBright(prettyPath(modulePath)) : prettyPath(modulePath); return `\n ↳ ${line}`; - }) + }), ); } } @@ -247,13 +247,13 @@ export function logModulePaths( * return a record mapping from each dependencies of that package to their path on disk. */ export function findPackageDependencyPaths( - fromPath: string + fromPath: string, ): Record { const packageRoot = packageDirectorySync({ cwd: fromPath }); assert(packageRoot, `Could not find package root from ${fromPath}`); const requireFromPackageRoot = createRequire( - path.join(packageRoot, "noop.js") + path.join(packageRoot, "noop.js"), ); const { dependencies = {} } = readPackageSync({ cwd: packageRoot }); @@ -263,13 +263,13 @@ export function findPackageDependencyPaths( .map((dependencyName) => { const resolvedDependencyRoot = resolvePackageRoot( requireFromPackageRoot, - dependencyName + dependencyName, ); return resolvedDependencyRoot ? [dependencyName, resolvedDependencyRoot] : undefined; }) - .filter((item) => typeof item !== "undefined") + .filter((item) => typeof item !== "undefined"), ); } @@ -285,7 +285,7 @@ export const DEFAULT_EXCLUDE_PATTERNS = [ export function hasPlatformExtension( platform: PlatformName | Readonly, - fileName: string + fileName: string, ): boolean { if (typeof platform === "string") { return fileName.endsWith(PLATFORM_EXTENSIONS[platform]); @@ -305,7 +305,7 @@ export type FindNodeApiModuleOptions = { */ export async function findNodeApiModulePaths( options: FindNodeApiModuleOptions, - suffix = "" + suffix = "", ): Promise { const { fromPath, @@ -338,7 +338,7 @@ export async function findNodeApiModulePaths( // Traverse into the child directory // Pushing result into a list instead of awaiting immediately to parallelize the search pendingResults.push( - findNodeApiModulePaths(options, path.join(suffix, dirent.name)) + findNodeApiModulePaths(options, path.join(suffix, dirent.name)), ); } } @@ -402,16 +402,16 @@ export async function findNodeApiModulePathsByDependency({ { path: dependencyPath, modulePaths: absoluteModulePaths.map((p) => - path.relative(dependencyPath, p) + path.relative(dependencyPath, p), ), }, ] as const; - }) + }), ); // Return an object by dependency name return Object.fromEntries( // Remove any dependencies without Node-API module paths - resultEntries.filter(([, { modulePaths }]) => modulePaths.length > 0) + resultEntries.filter(([, { modulePaths }]) => modulePaths.length > 0), ); } @@ -422,16 +422,16 @@ export async function findNodeApiModulePathsByDependency({ export function determineLibraryBasename(libraryPaths: string[]) { assert( libraryPaths.length > 0, - "Expected at least one library path to determine its basename" + "Expected at least one library path to determine its basename", ); const libraryNames = libraryPaths.map((p) => // Strip the "lib" prefix and any file extension - path.basename(p, path.extname(p)).replace(/^lib/, "") + path.basename(p, path.extname(p)).replace(/^lib/, ""), ); const candidates = new Set(libraryNames); assert( candidates.size === 1, - `Expected all libraries to share name, got: ${[...candidates].join(", ")}` + `Expected all libraries to share name, got: ${[...candidates].join(", ")}`, ); const [name] = candidates; return name; diff --git a/packages/host/src/node/prebuilds/android.ts b/packages/host/src/node/prebuilds/android.ts index b999d8e3..b24b422b 100644 --- a/packages/host/src/node/prebuilds/android.ts +++ b/packages/host/src/node/prebuilds/android.ts @@ -47,7 +47,7 @@ export async function createAndroidLibsDirectory({ for (const [triplet, libraryPath] of Object.entries(libraryPathByTriplet)) { assert( fs.existsSync(libraryPath), - `Library not found: ${libraryPath} for triplet ${triplet}` + `Library not found: ${libraryPath} for triplet ${triplet}`, ); const arch = ANDROID_ARCHITECTURES[triplet as AndroidTriplet]; const archOutputPath = path.join(outputPath, arch); @@ -68,7 +68,7 @@ export async function createAndroidLibsDirectory({ await fs.promises.writeFile( path.join(outputPath, "react-native-node-api-module"), "", - "utf8" + "utf8", ); } return outputPath; diff --git a/packages/host/src/node/prebuilds/apple.ts b/packages/host/src/node/prebuilds/apple.ts index 769f7857..9b7765fb 100644 --- a/packages/host/src/node/prebuilds/apple.ts +++ b/packages/host/src/node/prebuilds/apple.ts @@ -51,7 +51,7 @@ export function createAppleFramework(libraryPath: string) { const libraryName = path.basename(libraryPath, path.extname(libraryPath)); const frameworkPath = path.join( path.dirname(libraryPath), - `${libraryName}.framework` + `${libraryName}.framework`, ); // Create the framework from scratch fs.rmSync(frameworkPath, { recursive: true, force: true }); @@ -71,7 +71,7 @@ export function createAppleFramework(libraryPath: string) { CFBundleVersion: "1", NSPrincipalClass: "", }), - "utf8" + "utf8", ); const newLibraryPath = path.join(frameworkPath, libraryName); // TODO: Consider copying the library instead of renaming it @@ -111,7 +111,7 @@ export async function createXCframework({ ], { outputMode: "buffered", - } + }, ); if (xcodeOutputPath !== outputPath) { // Rename the xcframework to the original output path @@ -123,7 +123,7 @@ export async function createXCframework({ fs.writeFileSync( path.join(outputPath, "react-native-node-api-module"), "", - "utf8" + "utf8", ); } } @@ -134,7 +134,7 @@ export async function createXCframework({ */ export function determineXCFrameworkFilename( frameworkPaths: string[], - extension: ".xcframework" | ".apple.node" = ".xcframework" + extension: ".xcframework" | ".apple.node" = ".xcframework", ) { const name = determineLibraryBasename(frameworkPaths); return `${name}${extension}`; @@ -145,11 +145,11 @@ export async function createUniversalAppleLibrary(libraryPaths: string[]) { const filenames = new Set(libraryPaths.map((p) => path.basename(p))); assert( filenames.size === 1, - "Expected all darwin libraries to have the same name" + "Expected all darwin libraries to have the same name", ); const [filename] = filenames; const lipoParentPath = fs.realpathSync( - fs.mkdtempSync(path.join(os.tmpdir(), "ferric-lipo-output-")) + fs.mkdtempSync(path.join(os.tmpdir(), "ferric-lipo-output-")), ); const outputPath = path.join(lipoParentPath, filename); await spawn("lipo", ["-create", "-output", outputPath, ...libraryPaths], { diff --git a/packages/host/src/node/prebuilds/triplets.ts b/packages/host/src/node/prebuilds/triplets.ts index 60bff46f..7471b15b 100644 --- a/packages/host/src/node/prebuilds/triplets.ts +++ b/packages/host/src/node/prebuilds/triplets.ts @@ -33,19 +33,19 @@ export const SUPPORTED_TRIPLETS = [ export type SupportedTriplet = (typeof SUPPORTED_TRIPLETS)[number]; export function isSupportedTriplet( - triplet: unknown + triplet: unknown, ): triplet is SupportedTriplet { return (SUPPORTED_TRIPLETS as readonly unknown[]).includes(triplet); } export function isAndroidTriplet( - triplet: SupportedTriplet + triplet: SupportedTriplet, ): triplet is AndroidTriplet { return (ANDROID_TRIPLETS as readonly unknown[]).includes(triplet); } export function isAppleTriplet( - triplet: SupportedTriplet + triplet: SupportedTriplet, ): triplet is AppleTriplet { return (APPLE_TRIPLETS as readonly unknown[]).includes(triplet); } diff --git a/packages/host/src/node/test-utils.ts b/packages/host/src/node/test-utils.ts index 3fd67386..fb7abaf5 100644 --- a/packages/host/src/node/test-utils.ts +++ b/packages/host/src/node/test-utils.ts @@ -21,7 +21,7 @@ function writeFiles(fromPath: string, files: FileMap) { export function setupTempDirectory(context: TestContext, files: FileMap) { const tempDirectoryPath = fs.realpathSync( - fs.mkdtempSync(path.join(os.tmpdir(), "react-native-node-api-test-")) + fs.mkdtempSync(path.join(os.tmpdir(), "react-native-node-api-test-")), ); context.after(() => { diff --git a/packages/host/src/node/weak-node-api.ts b/packages/host/src/node/weak-node-api.ts index df29834f..02e3befe 100644 --- a/packages/host/src/node/weak-node-api.ts +++ b/packages/host/src/node/weak-node-api.ts @@ -6,5 +6,5 @@ export const weakNodeApiPath = path.resolve(__dirname, "../../weak-node-api"); assert( fs.existsSync(weakNodeApiPath), - `Expected Weak Node API path to exist: ${weakNodeApiPath}` + `Expected Weak Node API path to exist: ${weakNodeApiPath}`, ); diff --git a/packages/node-addon-examples/scripts/build-examples.mts b/packages/node-addon-examples/scripts/build-examples.mts index a8d587e9..fd590eb6 100644 --- a/packages/node-addon-examples/scripts/build-examples.mts +++ b/packages/node-addon-examples/scripts/build-examples.mts @@ -13,7 +13,7 @@ for (const projectDirectory of projectDirectories) { { cwd: projectDirectory, stdio: "inherit", - } + }, ); console.log(); } diff --git a/packages/node-addon-examples/scripts/copy-examples.mts b/packages/node-addon-examples/scripts/copy-examples.mts index 426f07dd..4b41bd20 100644 --- a/packages/node-addon-examples/scripts/copy-examples.mts +++ b/packages/node-addon-examples/scripts/copy-examples.mts @@ -58,7 +58,7 @@ console.log("Copying files to", EXAMPLES_DIR); const require = createRequire(import.meta.url); const EXAMPLES_PACKAGE_PATH = require.resolve( - "node-addon-examples/package.json" + "node-addon-examples/package.json", ); const SRC_DIR = path.join(path.dirname(EXAMPLES_PACKAGE_PATH), "src"); console.log("Copying files from", SRC_DIR); @@ -73,7 +73,7 @@ for (const src of ALLOW_LIST) { if (fs.existsSync(destPath)) { console.warn( - `Destination path ${destPath} already exists - skipping copy of ${src}.` + `Destination path ${destPath} already exists - skipping copy of ${src}.`, ); continue; } @@ -93,7 +93,7 @@ for (const src of ALLOW_LIST) { fs.writeFileSync( path.join(entry.parentPath, entry.name), JSON.stringify(packageJson, null, 2), - "utf-8" + "utf-8", ); } } diff --git a/packages/node-addon-examples/scripts/verify-prebuilds.mts b/packages/node-addon-examples/scripts/verify-prebuilds.mts index 666eeba3..cdbd312b 100644 --- a/packages/node-addon-examples/scripts/verify-prebuilds.mts +++ b/packages/node-addon-examples/scripts/verify-prebuilds.mts @@ -21,7 +21,7 @@ async function verifyAndroidPrebuild(dirent: fs.Dirent) { "Verifying Android prebuild", dirent.name, "in", - dirent.parentPath + dirent.parentPath, ); for (const arch of EXPECTED_ANDROID_ARCHS) { const archDir = path.join(dirent.parentPath, dirent.name, arch); @@ -31,7 +31,7 @@ async function verifyAndroidPrebuild(dirent: fs.Dirent) { assert(file.isFile()); assert( !file.name.endsWith(".node"), - `Unexpected .node file: ${path.join(file.parentPath, file.name)}` + `Unexpected .node file: ${path.join(file.parentPath, file.name)}`, ); } } @@ -46,7 +46,7 @@ async function verifyApplePrebuild(dirent: fs.Dirent) { })) { assert( file.isDirectory(), - "Expected only directories in xcframework arch directory" + "Expected only directories in xcframework arch directory", ); assert(file.name.endsWith(".framework"), "Expected framework directory"); const frameworkDir = path.join(file.parentPath, file.name); @@ -57,12 +57,12 @@ async function verifyApplePrebuild(dirent: fs.Dirent) { assert.equal( file.name, "Headers", - "Unexpected directory in xcframework" + "Unexpected directory in xcframework", ); } else { assert( file.isFile(), - "Expected only directory and files in framework" + "Expected only directory and files in framework", ); if (file.name === "Info.plist") { // TODO: Verify the contents of the Info.plist file @@ -72,8 +72,8 @@ async function verifyApplePrebuild(dirent: fs.Dirent) { !file.name.endsWith(".node"), `Didn't expected a .node file in xcframework: ${path.join( frameworkDir, - file.name - )}` + file.name, + )}`, ); } } @@ -92,7 +92,7 @@ for await (const dirent of fs.promises.glob("**/*.*.node", { await verifyApplePrebuild(dirent); } else { throw new Error( - `Unexpected prebuild file: ${dirent.name} in ${dirent.parentPath}` + `Unexpected prebuild file: ${dirent.name} in ${dirent.parentPath}`, ); } } diff --git a/packages/node-addon-examples/src/index.ts b/packages/node-addon-examples/src/index.ts index d2228f84..e77f5a17 100644 --- a/packages/node-addon-examples/src/index.ts +++ b/packages/node-addon-examples/src/index.ts @@ -15,7 +15,9 @@ function assertLogs(cb: () => void, expectedMessages: string[]) { cb(); if (expectedMessages.length > 0) { errors.push( - new Error(`Missing expected message(s): ${expectedMessages.join(", ")}`) + new Error( + `Missing expected message(s): ${expectedMessages.join(", ")}`, + ), ); } } finally { @@ -37,61 +39,61 @@ export const suites: Record< assertLogs( () => require("../examples/1-getting-started/1_hello_world/napi/hello.js"), - ["world"] + ["world"], ), "1_hello_world/node-addon-api": () => assertLogs( () => require("../examples/1-getting-started/1_hello_world/node-addon-api/hello.js"), - ["world"] + ["world"], ), "1_hello_world/node-addon-api-addon-class": () => assertLogs( () => require("../examples/1-getting-started/1_hello_world/node-addon-api-addon-class/hello.js"), - ["world"] + ["world"], ), "2_function_arguments/napi": () => assertLogs( () => require("../examples/1-getting-started/2_function_arguments/napi/addon.js"), - ["This should be eight: 8"] + ["This should be eight: 8"], ), "2_function_arguments/node-addon-api": () => assertLogs( () => require("../examples/1-getting-started/2_function_arguments/node-addon-api/addon.js"), - ["This should be eight: 8"] + ["This should be eight: 8"], ), "3_callbacks/napi": () => assertLogs( () => require("../examples/1-getting-started/3_callbacks/napi/addon.js"), - ["hello world"] + ["hello world"], ), "3_callbacks/node-addon-api": () => assertLogs( () => require("../examples/1-getting-started/3_callbacks/node-addon-api/addon.js"), - ["hello world"] + ["hello world"], ), "4_object_factory/napi": () => assertLogs( () => require("../examples/1-getting-started/4_object_factory/napi/addon.js"), - ["hello world"] + ["hello world"], ), "4_object_factory/node-addon-api": () => assertLogs( () => require("../examples/1-getting-started/4_object_factory/node-addon-api/addon.js"), - ["hello world"] + ["hello world"], ), "5_function_factory": () => assertLogs( () => require("../examples/1-getting-started/5_function_factory/napi/addon.js"), - ["hello world"] + ["hello world"], ), }, "5-async-work": { From 78cca98e7c6eaa66714e656ba2089993376edd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sat, 26 Jul 2025 10:29:49 +0200 Subject: [PATCH 4/5] Add tsx to root package --- package-lock.json | 528 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 529 insertions(+) diff --git a/package-lock.json b/package-lock.json index 6b0ae9be..e3d811c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "globals": "^16.0.0", "prettier": "^3.6.2", "react-native": "0.79.5", + "tsx": "^4.20.3", "typescript": "^5.7.3", "typescript-eslint": "^8.22.0" } @@ -2538,6 +2539,448 @@ "tslib": "^2.4.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz", + "integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz", + "integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz", + "integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz", + "integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz", + "integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz", + "integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz", + "integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz", + "integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz", + "integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz", + "integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz", + "integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz", + "integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz", + "integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz", + "integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz", + "integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz", + "integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz", + "integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz", + "integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz", + "integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz", + "integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz", + "integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz", + "integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz", + "integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz", + "integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz", + "integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz", + "integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.6.1.tgz", @@ -7891,6 +8334,48 @@ "node": ">= 0.4" } }, + "node_modules/esbuild": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.8.tgz", + "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.8", + "@esbuild/android-arm": "0.25.8", + "@esbuild/android-arm64": "0.25.8", + "@esbuild/android-x64": "0.25.8", + "@esbuild/darwin-arm64": "0.25.8", + "@esbuild/darwin-x64": "0.25.8", + "@esbuild/freebsd-arm64": "0.25.8", + "@esbuild/freebsd-x64": "0.25.8", + "@esbuild/linux-arm": "0.25.8", + "@esbuild/linux-arm64": "0.25.8", + "@esbuild/linux-ia32": "0.25.8", + "@esbuild/linux-loong64": "0.25.8", + "@esbuild/linux-mips64el": "0.25.8", + "@esbuild/linux-ppc64": "0.25.8", + "@esbuild/linux-riscv64": "0.25.8", + "@esbuild/linux-s390x": "0.25.8", + "@esbuild/linux-x64": "0.25.8", + "@esbuild/netbsd-arm64": "0.25.8", + "@esbuild/netbsd-x64": "0.25.8", + "@esbuild/openbsd-arm64": "0.25.8", + "@esbuild/openbsd-x64": "0.25.8", + "@esbuild/openharmony-arm64": "0.25.8", + "@esbuild/sunos-x64": "0.25.8", + "@esbuild/win32-arm64": "0.25.8", + "@esbuild/win32-ia32": "0.25.8", + "@esbuild/win32-x64": "0.25.8" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -8700,6 +9185,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", + "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -11909,6 +12407,16 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -12774,6 +13282,26 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tsx": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz", + "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index a6e0ecad..c7ff7c2f 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "globals": "^16.0.0", "prettier": "^3.6.2", "react-native": "0.79.5", + "tsx": "^4.20.3", "typescript": "^5.7.3", "typescript-eslint": "^8.22.0" } From f18f6cc601a3393c400142347c4e5a0b99f7c285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Sat, 26 Jul 2025 10:31:21 +0200 Subject: [PATCH 5/5] Combine ignored patterns --- eslint.config.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 2a41bd78..9b1b463e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -7,12 +7,13 @@ import tseslint from "typescript-eslint"; import eslintConfigPrettier from "eslint-config-prettier/flat"; export default tseslint.config( - globalIgnores([".nx/**"]), - globalIgnores(["**/dist/**"]), - globalIgnores(["apps/test-app/ios/**"]), - globalIgnores(["packages/host/hermes/**"]), - globalIgnores(["packages/node-addon-examples/examples/**"]), - globalIgnores(["packages/ferric-example/ferric_example.d.ts"]), + globalIgnores([ + "**/dist/**", + "apps/test-app/ios/**", + "packages/host/hermes/**", + "packages/node-addon-examples/examples/**", + "packages/ferric-example/ferric_example.d.ts", + ]), eslint.configs.recommended, tseslint.configs.recommended, eslintConfigPrettier,