From f5b21d1c3db56c1fb8457c4fe594dd949738c7e0 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:32:10 +0200 Subject: [PATCH] feat: add Yarn plugin enabling dynamic package extensions --- .changeset/slow-poets-itch.md | 5 + .yarnrc.yml | 2 + docsite/.yarnrc.yml | 1 + .../battery-status/package.json | 5 +- .../web-storage/package.json | 6 +- incubator/build-plugin-firebase/package.json | 5 +- incubator/build/package.json | 5 +- incubator/commitlint-lite/package.json | 5 +- .../esbuild-bundle-analyzer/package.json | 6 +- incubator/patcher-rnmacos/package.json | 6 +- incubator/polyfills/package.json | 5 +- .../package.json | 6 +- incubator/rn-changelog-generator/package.json | 4 - incubator/tools-typescript/package.json | 6 +- .../yarn-plugin-dynamic-extensions/README.md | 88 +++++++++ .../eslint.config.js | 1 + .../yarn-plugin-dynamic-extensions/index.js | 93 ++++++++++ .../package.json | 40 ++++ .../tsconfig.json | 12 ++ package.json | 1 + packages/align-deps/package.json | 4 - .../package.json | 5 +- .../package.json | 6 +- packages/bundle-diff/package.json | 5 +- packages/cli/package.json | 6 +- packages/config/package.json | 5 +- packages/console/package.json | 5 +- .../package.json | 6 +- packages/eslint-config/package.json | 3 +- packages/eslint-plugin/package.json | 6 +- packages/jest-preset/package.json | 6 +- packages/metro-config/package.json | 5 +- .../package.json | 5 +- .../package.json | 6 +- packages/metro-plugin-typescript/package.json | 5 +- packages/metro-resolver-symlinks/package.json | 6 +- .../metro-serializer-esbuild/package.json | 5 +- packages/metro-serializer/package.json | 6 +- packages/metro-service/package.json | 5 +- packages/react-native-auth/package.json | 5 +- packages/react-native-host/package.json | 3 +- packages/react-native-lazy-index/package.json | 5 +- packages/template/package.json | 8 +- packages/test-app/package.json | 10 +- packages/third-party-notices/package.json | 6 +- packages/tools-android/package.json | 5 +- packages/tools-apple/package.json | 5 +- packages/tools-filesystem/package.json | 5 +- packages/tools-language/package.json | 5 +- packages/tools-node/package.json | 5 +- packages/tools-packages/package.json | 5 +- packages/tools-react-native/package.json | 5 +- packages/tools-shell/package.json | 6 +- packages/tools-windows/package.json | 5 +- packages/tools-workspaces/package.json | 5 +- packages/typescript-service/package.json | 5 +- scripts/align-deps-preset.cjs | 15 -- scripts/dependencies.config.js | 49 +++++ scripts/src/commands/test.js | 12 +- yarn.lock | 174 ++---------------- 60 files changed, 362 insertions(+), 383 deletions(-) create mode 100644 .changeset/slow-poets-itch.md create mode 100644 incubator/yarn-plugin-dynamic-extensions/README.md create mode 100644 incubator/yarn-plugin-dynamic-extensions/eslint.config.js create mode 100644 incubator/yarn-plugin-dynamic-extensions/index.js create mode 100644 incubator/yarn-plugin-dynamic-extensions/package.json create mode 100644 incubator/yarn-plugin-dynamic-extensions/tsconfig.json create mode 100644 scripts/dependencies.config.js diff --git a/.changeset/slow-poets-itch.md b/.changeset/slow-poets-itch.md new file mode 100644 index 000000000..eaa359737 --- /dev/null +++ b/.changeset/slow-poets-itch.md @@ -0,0 +1,5 @@ +--- +"@rnx-kit/yarn-plugin-dynamic-extensions": minor +--- + +Added experimental Yarn plugin to enable dynamic package extensions diff --git a/.yarnrc.yml b/.yarnrc.yml index a041b8bca..eff1a55ff 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -41,5 +41,7 @@ packageExtensions: plugins: - path: .yarn/plugins/@yarnpkg/plugin-compat.cjs spec: "@yarnpkg/plugin-compat" + - path: incubator/yarn-plugin-dynamic-extensions/index.js +dynamicPackageExtensions: ./scripts/dependencies.config.js tsEnableAutoTypes: false yarnPath: .yarn/releases/yarn-4.6.0.cjs diff --git a/docsite/.yarnrc.yml b/docsite/.yarnrc.yml index a6c9106de..7f8ed9156 100644 --- a/docsite/.yarnrc.yml +++ b/docsite/.yarnrc.yml @@ -14,5 +14,6 @@ logFilters: level: discard nodeLinker: node-modules npmRegistryServer: "https://registry.npmjs.org" +dynamicPackageExtensions: false tsEnableAutoTypes: false yarnPath: ../.yarn/releases/yarn-4.6.0.cjs diff --git a/incubator/@react-native-webapis/battery-status/package.json b/incubator/@react-native-webapis/battery-status/package.json index d2a809993..936a22c00 100644 --- a/incubator/@react-native-webapis/battery-status/package.json +++ b/incubator/@react-native-webapis/battery-status/package.json @@ -44,11 +44,8 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", "react": "18.3.1", - "react-native": "^0.76.0", - "typescript": "^5.0.0" + "react-native": "^0.76.0" }, "engines": { "node": ">=16.17" diff --git a/incubator/@react-native-webapis/web-storage/package.json b/incubator/@react-native-webapis/web-storage/package.json index 468057130..fa0b03015 100644 --- a/incubator/@react-native-webapis/web-storage/package.json +++ b/incubator/@react-native-webapis/web-storage/package.json @@ -58,12 +58,8 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", "react": "18.3.1", - "react-native": "^0.76.0", - "typescript": "^5.0.0" + "react-native": "^0.76.0" }, "engines": { "node": ">=16.17" diff --git a/incubator/build-plugin-firebase/package.json b/incubator/build-plugin-firebase/package.json index 8c47f37e6..908c05695 100644 --- a/incubator/build-plugin-firebase/package.json +++ b/incubator/build-plugin-firebase/package.json @@ -39,10 +39,7 @@ "@rnx-kit/build": "*", "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", - "@rnx-kit/tsconfig": "*", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@rnx-kit/tsconfig": "*" }, "engines": { "node": ">=18.12" diff --git a/incubator/build/package.json b/incubator/build/package.json index f23c9cc05..8f79ff167 100644 --- a/incubator/build/package.json +++ b/incubator/build/package.json @@ -97,10 +97,7 @@ "@types/git-url-parse": "^9.0.0", "@types/node": "^20.0.0", "@types/qrcode": "^1.4.2", - "@types/yargs": "^16.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/yargs": "^16.0.0" }, "engines": { "node": ">=18.12" diff --git a/incubator/commitlint-lite/package.json b/incubator/commitlint-lite/package.json index be881266a..c028a294e 100644 --- a/incubator/commitlint-lite/package.json +++ b/incubator/commitlint-lite/package.json @@ -36,10 +36,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/incubator/esbuild-bundle-analyzer/package.json b/incubator/esbuild-bundle-analyzer/package.json index 53aa6f9e4..3b8808088 100644 --- a/incubator/esbuild-bundle-analyzer/package.json +++ b/incubator/esbuild-bundle-analyzer/package.json @@ -44,11 +44,7 @@ "@rnx-kit/tsconfig": "*", "@types/jest": "^29.2.1", "@types/node": "^20.0.0", - "@types/yargs": "^16.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/yargs": "^16.0.0" }, "engines": { "node": ">=16.17" diff --git a/incubator/patcher-rnmacos/package.json b/incubator/patcher-rnmacos/package.json index 98231ca15..6c7f5c735 100644 --- a/incubator/patcher-rnmacos/package.json +++ b/incubator/patcher-rnmacos/package.json @@ -35,11 +35,7 @@ "@rnx-kit/tsconfig": "*", "@types/fs-extra": "^9.0.0", "@types/istextorbinary": "^2.3.0", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "dependencies": { "commander": "^4.1.1", diff --git a/incubator/polyfills/package.json b/incubator/polyfills/package.json index b1c9c41a4..d626d4eaa 100644 --- a/incubator/polyfills/package.json +++ b/incubator/polyfills/package.json @@ -48,10 +48,7 @@ "@types/babel__helper-plugin-utils": "^7.0.0", "@types/babel__template": "^7.0.0", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "metro-config": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-config": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/incubator/react-native-error-trace-decorator/package.json b/incubator/react-native-error-trace-decorator/package.json index 27a3842b0..421197fdf 100644 --- a/incubator/react-native-error-trace-decorator/package.json +++ b/incubator/react-native-error-trace-decorator/package.json @@ -32,11 +32,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "@types/yargs": "^16.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/yargs": "^16.0.0" }, "dependencies": { "@rnx-kit/console": "^2.0.0", diff --git a/incubator/rn-changelog-generator/package.json b/incubator/rn-changelog-generator/package.json index 963d9563d..3adb9ee93 100644 --- a/incubator/rn-changelog-generator/package.json +++ b/incubator/rn-changelog-generator/package.json @@ -38,12 +38,8 @@ "@types/node": "^20.0.0", "chalk": "^4.1.0", "deepmerge": "^4.2.2", - "eslint": "^9.0.0", "fast-levenshtein": "^3.0.0", - "jest": "^29.2.1", "p-limit": "^3.1.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0", "yargs": "^16.0.0" }, "engines": { diff --git a/incubator/tools-typescript/package.json b/incubator/tools-typescript/package.json index a80101fb7..1b4e347a0 100644 --- a/incubator/tools-typescript/package.json +++ b/incubator/tools-typescript/package.json @@ -39,11 +39,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/jest-preset": "*", "@rnx-kit/scripts": "*", - "@rnx-kit/tsconfig": "*", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@rnx-kit/tsconfig": "*" }, "peerDependencies": { "typescript": ">=4.7.0" diff --git a/incubator/yarn-plugin-dynamic-extensions/README.md b/incubator/yarn-plugin-dynamic-extensions/README.md new file mode 100644 index 000000000..f014cc7aa --- /dev/null +++ b/incubator/yarn-plugin-dynamic-extensions/README.md @@ -0,0 +1,88 @@ +# @rnx-kit/yarn-plugin-dynamic-extensions + +[![Build](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml/badge.svg)](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml) +[![npm version](https://img.shields.io/npm/v/@rnx-kit/yarn-plugin-dynamic-extensions)](https://www.npmjs.com/package/@rnx-kit/yarn-plugin-dynamic-extensions) + +🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧 + +### THIS TOOL IS EXPERIMENTAL — USE WITH CAUTION + +🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧 + +This is a Yarn plugin that lets you extend the package definitions of your +dependencies, similar to [`packageExtensions`][], but dynamically. + +## Motivation + +Making sure a large number of packages are using the same version of +dependencies, like `eslint` or `typescript`, can involve a lot of manual work. +It is easy to make mistakes, especially if these packages span across multiple +repositories. + +This plugin allows you to manage all dependencies across multiple repositories +from a central location. + +## Installation + +```sh +yarn plugin import https://raw.githubusercontent.com/microsoft/rnx-kit/main/incubator/yarn-plugin-dynamic-extensions/index.js +``` + +## Usage + +Create a module that will return package extensions. In the following example, +we create a module that adds `typescript` to all packages: + +```js +/** + * @param {Object} workspace The package currently being processed + * @param {string} workspace.cwd Path of the current package + * @param {Object} workspace.manifest The content of `package.json` + * @returns {{ + * dependencies?: Record; + * peerDependencies?: Record; + * peerDependenciesMeta?: Record; + * }} + */ +export default function ({ cwd, manifest }) { + return { + dependencies: { + typescript: "^5.0.0", + }, + }; +} +``` + +The function will receive context on the currently processed package, and is +expected to return a map similar to the one for [`packageExtensions`][]. + +For a more complete example, take a look at how we use it in +[`rnx-kit`](https://github.com/microsoft/rnx-kit/blob/main/scripts/dependencies.config.js). + +Add the configuration in your `.yarnrc.yml`: + +```yaml +dynamicPackageExtensions: ./my-dependencies.config.js +``` + +If you run `yarn install` now, Yarn will install `typescript` in all your +packages. To verify, try running `tsc`: + +``` +% yarn tsc --version +Version 5.7.3 +``` + +Other Yarn commands will also work as if you had installed dependencies +explicitly as you normally would. For example, `yarn why`: + +``` +% yarn why typescript +└─ @rnx-kit/yarn-plugin-dynamic-extensions@workspace:incubator/yarn-plugin-dynamic-extensions + └─ typescript@npm:5.7.3 (via npm:^5.0.0) +``` + + + +[`packageExtensions`]: + https://yarnpkg.com/configuration/yarnrc#packageExtensions diff --git a/incubator/yarn-plugin-dynamic-extensions/eslint.config.js b/incubator/yarn-plugin-dynamic-extensions/eslint.config.js new file mode 100644 index 000000000..89ed77c6f --- /dev/null +++ b/incubator/yarn-plugin-dynamic-extensions/eslint.config.js @@ -0,0 +1 @@ +module.exports = require("@rnx-kit/eslint-config"); diff --git a/incubator/yarn-plugin-dynamic-extensions/index.js b/incubator/yarn-plugin-dynamic-extensions/index.js new file mode 100644 index 000000000..d1dc7239a --- /dev/null +++ b/incubator/yarn-plugin-dynamic-extensions/index.js @@ -0,0 +1,93 @@ +// @ts-check + +/** + * @import { Configuration, Hooks, Manifest, PackageExtensionData, Plugin } from "@yarnpkg/core"; + * @typedef {{ cwd: string; manifest: Manifest["raw"]; }} Workspace; + */ + +const DYNAMIC_PACKAGE_EXTENSIONS_KEY = "dynamicPackageExtensions"; + +// This module *must* be CommonJS because `actions/setup-node` (and probably +// other GitHub actions) does not support ESM. Yarn itself does. +exports.name = "@rnx-kit/yarn-plugin-dynamic-extensions"; + +/** @type {(require: NodeJS.Require) => Plugin} */ +exports.factory = (require) => { + const { Project, SettingsType, structUtils } = require("@yarnpkg/core"); + + /** + * @param {Configuration} configuration + * @param {string} projectRoot + * @returns {Promise<((ws: Workspace) => PackageExtensionData | undefined) | void>} + */ + async function loadUserExtensions(configuration, projectRoot) { + const packageExtensions = configuration.get(DYNAMIC_PACKAGE_EXTENSIONS_KEY); + if ( + typeof packageExtensions !== "string" || + packageExtensions === "false" + ) { + return; + } + + const path = require("node:path"); + const { pathToFileURL } = require("node:url"); + + // On Windows, import paths must include the `file:` protocol. + const url = pathToFileURL(path.resolve(projectRoot, packageExtensions)); + const external = await import(url.toString()); + return external?.default ?? external; + } + + /** @type {Plugin["configuration"] & Record} */ + const configuration = {}; + configuration[DYNAMIC_PACKAGE_EXTENSIONS_KEY] = { + description: "Path to module providing package extensions", + type: SettingsType.STRING, + }; + + return { + configuration, + hooks: { + registerPackageExtensions: async ( + configuration, + registerPackageExtension + ) => { + const { projectCwd } = configuration; + if (!projectCwd) { + return; + } + + const { workspace } = await Project.find(configuration, projectCwd); + if (!workspace) { + return; + } + + // @ts-expect-error Cannot find module or its corresponding type declarations + const { npath } = require("@yarnpkg/fslib"); + + const root = npath.fromPortablePath(projectCwd); + const getUserExtensions = await loadUserExtensions(configuration, root); + if (!getUserExtensions) { + return; + } + + workspace.project.workspacesByCwd.forEach(({ cwd, manifest }) => { + const { name, version, raw } = manifest; + if (!name || !version) { + return; + } + + /** @type {Workspace} */ + const workspace = { cwd: npath.fromPortablePath(cwd), manifest: raw }; + const data = getUserExtensions(workspace); + if (!data) { + return; + } + + const descriptor = structUtils.makeDescriptor(name, version); + registerPackageExtension(descriptor, data); + }); + }, + }, + }; +}; diff --git a/incubator/yarn-plugin-dynamic-extensions/package.json b/incubator/yarn-plugin-dynamic-extensions/package.json new file mode 100644 index 000000000..e5b24be2e --- /dev/null +++ b/incubator/yarn-plugin-dynamic-extensions/package.json @@ -0,0 +1,40 @@ +{ + "name": "@rnx-kit/yarn-plugin-dynamic-extensions", + "version": "0.0.1", + "description": "EXPERIMENTAL - USE WITH CAUTION - yarn-plugin-dynamic-extensions", + "homepage": "https://github.com/microsoft/rnx-kit/tree/main/incubator/yarn-plugin-dynamic-extensions#readme", + "license": "MIT", + "author": { + "name": "Microsoft Open Source", + "email": "microsoftopensource@users.noreply.github.com" + }, + "files": [ + "index.js" + ], + "main": "index.js", + "exports": { + ".": "./index.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/microsoft/rnx-kit", + "directory": "incubator/yarn-plugin-dynamic-extensions" + }, + "engines": { + "node": ">=18.12", + "yarn": ">=4.0" + }, + "scripts": { + "build": "rnx-kit-scripts build", + "format": "rnx-kit-scripts format", + "lint": "rnx-kit-scripts lint", + "test": "rnx-kit-scripts test" + }, + "devDependencies": { + "@rnx-kit/eslint-config": "*", + "@rnx-kit/scripts": "*", + "@rnx-kit/tsconfig": "*", + "@yarnpkg/core": "^4.0.0" + }, + "experimental": true +} diff --git a/incubator/yarn-plugin-dynamic-extensions/tsconfig.json b/incubator/yarn-plugin-dynamic-extensions/tsconfig.json new file mode 100644 index 000000000..2164ed44a --- /dev/null +++ b/incubator/yarn-plugin-dynamic-extensions/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@rnx-kit/tsconfig/tsconfig.esm.json", + "compilerOptions": { + "target": "esnext", + "module": "nodenext", + "moduleResolution": "nodenext", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "noEmit": true + }, + "include": ["index.js"] +} diff --git a/package.json b/package.json index 078da8caf..03318b194 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "swiftlint" ], "ignoreDependencies": [ + "@rnx-kit/jest-preset", "@types/*", "eslint", "jest", diff --git a/packages/align-deps/package.json b/packages/align-deps/package.json index 598384b7c..5fd95f90d 100644 --- a/packages/align-deps/package.json +++ b/packages/align-deps/package.json @@ -48,14 +48,10 @@ "@types/semver": "^7.0.0", "@types/yargs": "^16.0.0", "detect-indent": "^6.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", "markdown-table": "^3.0.0", "package-json": "^10.0.0", - "prettier": "^3.0.0", "prompts": "^2.4.0", "semver": "^7.0.0", - "typescript": "^5.0.0", "yargs": "^16.0.0" }, "engines": { diff --git a/packages/babel-plugin-import-path-remapper/package.json b/packages/babel-plugin-import-path-remapper/package.json index 543e51093..4a17d58df 100644 --- a/packages/babel-plugin-import-path-remapper/package.json +++ b/packages/babel-plugin-import-path-remapper/package.json @@ -34,10 +34,7 @@ "@rnx-kit/tsconfig": "*", "@types/babel__core": "^7.0.0", "@types/babel__helper-plugin-utils": "^7.0.0", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/babel-preset-metro-react-native/package.json b/packages/babel-preset-metro-react-native/package.json index 91f2efc86..a535ee763 100644 --- a/packages/babel-preset-metro-react-native/package.json +++ b/packages/babel-preset-metro-react-native/package.json @@ -57,11 +57,7 @@ "@types/babel__core": "^7.0.0", "@types/jest": "^29.2.1", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "metro-react-native-babel-preset": "^0.76.5", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-react-native-babel-preset": "^0.76.5" }, "engines": { "node": ">=16.17" diff --git a/packages/bundle-diff/package.json b/packages/bundle-diff/package.json index 96e666965..0b1ba32de 100644 --- a/packages/bundle-diff/package.json +++ b/packages/bundle-diff/package.json @@ -32,10 +32,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/cli/package.json b/packages/cli/package.json index 0a1f751c5..10de7eccd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -83,18 +83,14 @@ "@types/jest": "^29.2.1", "@types/node": "^20.0.0", "@types/qrcode": "^1.4.2", - "eslint": "^9.0.0", - "jest": "^29.2.1", "markdown-table": "^3.0.0", "metro": "^0.81.0", "metro-babel-transformer": "^0.81.0", "metro-config": "^0.81.0", - "prettier": "^3.0.0", "react": "18.3.1", "react-native": "^0.76.0", "tsx": "^4.15.0", - "type-fest": "^4.0.0", - "typescript": "^5.0.0" + "type-fest": "^4.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/config/package.json b/packages/config/package.json index a0fd01fa5..b0a8cc048 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -52,10 +52,7 @@ "@types/lodash.merge": "^4.6.9", "@types/node": "^20.0.0", "@types/semver": "^7.0.0", - "eslint": "^9.0.0", - "metro": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/console/package.json b/packages/console/package.json index 5ba909843..345126652 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -38,10 +38,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/esbuild-plugin-import-path-remapper/package.json b/packages/esbuild-plugin-import-path-remapper/package.json index 3d9951349..4fb93569b 100644 --- a/packages/esbuild-plugin-import-path-remapper/package.json +++ b/packages/esbuild-plugin-import-path-remapper/package.json @@ -31,11 +31,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "esbuild": "^0.25.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "esbuild": "^0.25.0" }, "engines": { "node": ">=16.17" diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 9d56f6d3c..74ab24594 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -29,8 +29,7 @@ "eslint": "^9.0.0" }, "devDependencies": { - "eslint": "^9.0.0", - "prettier": "^3.0.0" + "eslint": "^9.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 99db28f77..00d51da99 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -62,11 +62,7 @@ "@types/jest": "^29.2.1", "@types/node": "^20.0.0", "@typescript-eslint/parser": "^8.0.0", - "@typescript-eslint/types": "^8.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@typescript-eslint/types": "^8.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/jest-preset/package.json b/packages/jest-preset/package.json index 3721be92a..e0d783d9c 100644 --- a/packages/jest-preset/package.json +++ b/packages/jest-preset/package.json @@ -48,12 +48,8 @@ "@rnx-kit/tsconfig": "*", "@types/jest": "^29.2.1", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", "react": "18.3.1", - "react-native": "^0.76.0", - "typescript": "^5.0.0" + "react-native": "^0.76.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-config/package.json b/packages/metro-config/package.json index 5cd3ebd96..6122b4ba2 100644 --- a/packages/metro-config/package.json +++ b/packages/metro-config/package.json @@ -46,15 +46,12 @@ "@rnx-kit/tsconfig": "*", "@types/babel__core": "^7.0.0", "@types/connect": "^3.4.36", - "eslint": "^9.0.0", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-resolver": "^0.81.0", - "prettier": "^3.0.0", "react": "18.3.1", "react-native": "^0.76.0", - "type-fest": "^4.0.0", - "typescript": "^5.0.0" + "type-fest": "^4.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-plugin-cyclic-dependencies-detector/package.json b/packages/metro-plugin-cyclic-dependencies-detector/package.json index 51813616b..82689dc71 100644 --- a/packages/metro-plugin-cyclic-dependencies-detector/package.json +++ b/packages/metro-plugin-cyclic-dependencies-detector/package.json @@ -35,10 +35,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "metro": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-plugin-duplicates-checker/package.json b/packages/metro-plugin-duplicates-checker/package.json index 0c7d29c77..6533525fa 100644 --- a/packages/metro-plugin-duplicates-checker/package.json +++ b/packages/metro-plugin-duplicates-checker/package.json @@ -40,13 +40,9 @@ "@rnx-kit/tsconfig": "*", "@types/jest": "^29.2.1", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", "memfs": "^4.0.0", "metro": "^0.81.0", - "metro-source-map": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-source-map": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-plugin-typescript/package.json b/packages/metro-plugin-typescript/package.json index 383ff9691..0d0b28aee 100644 --- a/packages/metro-plugin-typescript/package.json +++ b/packages/metro-plugin-typescript/package.json @@ -39,10 +39,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "metro": "^0.81.0", - "prettier": "^3.0.0" + "metro": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-resolver-symlinks/package.json b/packages/metro-resolver-symlinks/package.json index d5e888e8c..ea15f2d25 100644 --- a/packages/metro-resolver-symlinks/package.json +++ b/packages/metro-resolver-symlinks/package.json @@ -38,11 +38,7 @@ "@rnx-kit/tsconfig": "*", "@types/jest": "^29.2.1", "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "metro-resolver": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-resolver": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-serializer-esbuild/package.json b/packages/metro-serializer-esbuild/package.json index 23f6dc90d..f4bf25249 100644 --- a/packages/metro-serializer-esbuild/package.json +++ b/packages/metro-serializer-esbuild/package.json @@ -49,15 +49,12 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "eslint": "^9.0.0", "lodash-es": "^4.17.21", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-transform-worker": "^0.81.0", - "prettier": "^3.0.0", "react": "18.3.1", - "react-native": "^0.76.0", - "typescript": "^5.0.0" + "react-native": "^0.76.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-serializer/package.json b/packages/metro-serializer/package.json index 4bd8d8fcf..50491f304 100644 --- a/packages/metro-serializer/package.json +++ b/packages/metro-serializer/package.json @@ -36,11 +36,7 @@ "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", "@types/semver": "^7.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "metro": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/metro-service/package.json b/packages/metro-service/package.json index ff3294312..ea53f6e79 100644 --- a/packages/metro-service/package.json +++ b/packages/metro-service/package.json @@ -56,15 +56,12 @@ "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", "@types/node-fetch": "^2.6.5", - "eslint": "^9.0.0", "flow-remove-types": "~2.259.0", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-core": "^0.81.0", "metro-resolver": "^0.81.0", - "metro-runtime": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-runtime": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/react-native-auth/package.json b/packages/react-native-auth/package.json index 98accd166..34c08ec3c 100644 --- a/packages/react-native-auth/package.json +++ b/packages/react-native-auth/package.json @@ -45,11 +45,8 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "eslint": "^9.0.0", - "prettier": "^3.0.0", "react": "18.3.1", - "react-native": "^0.76.0", - "typescript": "^5.0.0" + "react-native": "^0.76.0" }, "engines": { "node": ">=16.17" diff --git a/packages/react-native-host/package.json b/packages/react-native-host/package.json index 9cfc1e130..61a969a0f 100644 --- a/packages/react-native-host/package.json +++ b/packages/react-native-host/package.json @@ -30,8 +30,7 @@ "react-native": ">=0.66" }, "devDependencies": { - "@rnx-kit/scripts": "*", - "prettier": "^3.0.0" + "@rnx-kit/scripts": "*" }, "engines": { "node": ">=16.17" diff --git a/packages/react-native-lazy-index/package.json b/packages/react-native-lazy-index/package.json index 007e00665..e485c1fbc 100644 --- a/packages/react-native-lazy-index/package.json +++ b/packages/react-native-lazy-index/package.json @@ -49,10 +49,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/template/package.json b/packages/template/package.json index b10b30438..f70fd2621 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -21,7 +21,7 @@ "directory": "packages/template" }, "engines": { - "node": ">=16.17" + "node": ">=18.12" }, "scripts": { "build": "rnx-kit-scripts build", @@ -33,11 +33,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/jest-preset": "*", "@rnx-kit/scripts": "*", - "@rnx-kit/tsconfig": "*", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@rnx-kit/tsconfig": "*" }, "jest": { "preset": "@rnx-kit/jest-preset/private" diff --git a/packages/test-app/package.json b/packages/test-app/package.json index d0f63237f..5464afc0b 100644 --- a/packages/test-app/package.json +++ b/packages/test-app/package.json @@ -65,12 +65,9 @@ "@rnx-kit/tsconfig": "workspace:*", "@testing-library/react-native": "^12.4.3", "@types/react": "^18.0.0", - "eslint": "^9.0.0", "jest": "^29.2.1", - "prettier": "^3.0.0", "react-native-test-app": "^4.0.0", - "react-test-renderer": "18.3.1", - "typescript": "^5.0.0" + "react-test-renderer": "18.3.1" }, "rnx-kit": { "kitType": "app", @@ -192,11 +189,8 @@ "core-windows", "core/testing", "babel-preset-react-native", - "eslint", - "prettier", "react", - "test-app", - "typescript" + "test-app" ] } } diff --git a/packages/third-party-notices/package.json b/packages/third-party-notices/package.json index 483c3c1b1..1cd50bd96 100644 --- a/packages/third-party-notices/package.json +++ b/packages/third-party-notices/package.json @@ -45,11 +45,7 @@ "@types/jest": "^29.2.1", "@types/node": "^20.0.0", "@types/yargs": "^16.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "metro-source-map": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-source-map": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-android/package.json b/packages/tools-android/package.json index 5b813be88..ee28be3ad 100644 --- a/packages/tools-android/package.json +++ b/packages/tools-android/package.json @@ -40,10 +40,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-apple/package.json b/packages/tools-apple/package.json index 5a6788998..ccea35eaf 100644 --- a/packages/tools-apple/package.json +++ b/packages/tools-apple/package.json @@ -61,10 +61,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-filesystem/package.json b/packages/tools-filesystem/package.json index f58a5f7fd..c5d8d743e 100644 --- a/packages/tools-filesystem/package.json +++ b/packages/tools-filesystem/package.json @@ -43,10 +43,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-language/package.json b/packages/tools-language/package.json index a0abacdc4..f57f26757 100644 --- a/packages/tools-language/package.json +++ b/packages/tools-language/package.json @@ -46,10 +46,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-node/package.json b/packages/tools-node/package.json index d596cbb91..74e47c4d4 100644 --- a/packages/tools-node/package.json +++ b/packages/tools-node/package.json @@ -60,10 +60,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-packages/package.json b/packages/tools-packages/package.json index 55a06d1de..b7c6f57c1 100644 --- a/packages/tools-packages/package.json +++ b/packages/tools-packages/package.json @@ -44,9 +44,6 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" } } diff --git a/packages/tools-react-native/package.json b/packages/tools-react-native/package.json index cece2307d..83bfc334d 100644 --- a/packages/tools-react-native/package.json +++ b/packages/tools-react-native/package.json @@ -74,14 +74,11 @@ "@rnx-kit/tools-filesystem": "*", "@rnx-kit/tsconfig": "*", "@types/node": "^20.0.0", - "eslint": "^9.0.0", "metro": "^0.81.0", "metro-config": "^0.81.0", "metro-core": "^0.81.0", "metro-resolver": "^0.81.0", - "metro-source-map": "^0.81.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "metro-source-map": "^0.81.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-shell/package.json b/packages/tools-shell/package.json index 0afdeba7a..75f7c3156 100644 --- a/packages/tools-shell/package.json +++ b/packages/tools-shell/package.json @@ -55,11 +55,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/jest": "^29.2.1", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "jest": "^29.2.1", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-windows/package.json b/packages/tools-windows/package.json index ac212f05b..d1f914434 100644 --- a/packages/tools-windows/package.json +++ b/packages/tools-windows/package.json @@ -41,10 +41,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/tools-workspaces/package.json b/packages/tools-workspaces/package.json index c5b2d94f2..b5ddfff88 100644 --- a/packages/tools-workspaces/package.json +++ b/packages/tools-workspaces/package.json @@ -47,10 +47,7 @@ "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", "@types/micromatch": "^4.0.0", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/packages/typescript-service/package.json b/packages/typescript-service/package.json index 674f63779..3fc9c5e20 100644 --- a/packages/typescript-service/package.json +++ b/packages/typescript-service/package.json @@ -35,10 +35,7 @@ "@rnx-kit/eslint-config": "*", "@rnx-kit/scripts": "*", "@rnx-kit/tsconfig": "*", - "@types/node": "^20.0.0", - "eslint": "^9.0.0", - "prettier": "^3.0.0", - "typescript": "^5.0.0" + "@types/node": "^20.0.0" }, "engines": { "node": ">=16.17" diff --git a/scripts/align-deps-preset.cjs b/scripts/align-deps-preset.cjs index 52ba0ffcd..f08bea7f7 100644 --- a/scripts/align-deps-preset.cjs +++ b/scripts/align-deps-preset.cjs @@ -63,11 +63,6 @@ const profile = { version: "^0.25.0", devOnly: true, }, - eslint: { - name: "eslint", - version: "^9.0.0", - devOnly: true, - }, "find-up": { name: "find-up", version: "^5.0.0", @@ -80,11 +75,6 @@ const profile = { name: "pkg-dir", version: "^5.0.0", }, - prettier: { - name: "prettier", - version: "^3.0.0", - devOnly: true, - }, semver: { name: "semver", version: "^7.0.0", @@ -94,11 +84,6 @@ const profile = { version: "^4.0.0", devOnly: true, }, - typescript: { - name: "typescript", - version: "^5.0.0", - devOnly: true, - }, yargs: { name: "yargs", version: dependencies.yargs, diff --git a/scripts/dependencies.config.js b/scripts/dependencies.config.js new file mode 100644 index 000000000..574b94821 --- /dev/null +++ b/scripts/dependencies.config.js @@ -0,0 +1,49 @@ +import * as fs from "node:fs"; +import * as path from "node:path"; +import { URL } from "node:url"; + +function always() { + return true; +} + +function lookForFile(filename) { + return (cwd) => fs.existsSync(path.join(cwd, filename)); +} + +function needsJest(cwd, manifest) { + return "jest" in manifest || fs.existsSync(path.join(cwd, "jest.config.js")); +} + +const COMMON_DEPENDENCIES = [ + ["eslint", lookForFile("eslint.config.js")], + ["jest", needsJest], + ["prettier", always], + ["typescript", lookForFile("tsconfig.json")], +]; + +const getDependencyVersion = (() => { + let deps; + return (name) => { + if (!deps) { + const url = new URL("package.json", import.meta.url); + const manifest = fs.readFileSync(url, { encoding: "utf-8" }); + deps = JSON.parse(manifest)["dependencies"]; + } + + return deps[name]; + }; +})(); + +/* eslint-disable-next-line no-restricted-exports */ +export default function ({ cwd, manifest }) { + let extensions = undefined; + + for (const [pkg, test] of COMMON_DEPENDENCIES) { + if (test(cwd, manifest)) { + extensions ||= { dependencies: {} }; + extensions.dependencies[pkg] = getDependencyVersion(pkg); + } + } + + return extensions; +} diff --git a/scripts/src/commands/test.js b/scripts/src/commands/test.js index 4f9526486..69f119cf9 100644 --- a/scripts/src/commands/test.js +++ b/scripts/src/commands/test.js @@ -1,12 +1,16 @@ // @ts-check -import * as fs from "node:fs/promises"; +import * as fs from "node:fs"; import { execute, runScript } from "../process.js"; +function useJest(cwd = process.cwd()) { + const options = /** @type {const} */ ({ encoding: "utf-8" }); + const manifest = fs.readFileSync(cwd + "/package.json", options); + return manifest.includes('"jest"') || fs.existsSync(cwd + "/jest.config.js"); +} + /** @type {import("../process.js").Command} */ export async function test(_args, rawArgs = []) { - const options = /** @type {const} */ ({ encoding: "utf-8" }); - const manifest = await fs.readFile(process.cwd() + "/package.json", options); - if (manifest.includes('"jest"')) { + if (useJest()) { await runScript("jest", "--passWithNoTests", ...rawArgs); } else { const tests = diff --git a/yarn.lock b/yarn.lock index 0424fc6bf..e650325c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3376,11 +3376,8 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" - typescript: "npm:^5.0.0" peerDependencies: react: ">=18.2.0" react-native: ">=0.74.0" @@ -3396,12 +3393,8 @@ __metadata: "@rnx-kit/eslint-config": "npm:*" "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" - typescript: "npm:^5.0.0" peerDependencies: "@callstack/react-native-visionos": ">=0.74" react: ">=18.2.0" @@ -3752,14 +3745,10 @@ __metadata: "@types/semver": "npm:^7.0.0" "@types/yargs": "npm:^16.0.0" detect-indent: "npm:^6.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" markdown-table: "npm:^3.0.0" package-json: "npm:^10.0.0" - prettier: "npm:^3.0.0" prompts: "npm:^2.4.0" semver: "npm:^7.0.0" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: rnx-align-deps: lib/index.js @@ -3779,9 +3768,6 @@ __metadata: "@types/babel__core": "npm:^7.0.0" "@types/babel__helper-plugin-utils": "npm:^7.0.0" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -3802,11 +3788,7 @@ __metadata: "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" babel-plugin-const-enum: "npm:^1.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro-react-native-babel-preset: "npm:^0.76.5" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: "@babel/core": ^7.20.0 "@babel/plugin-transform-typescript": ^7.20.0 @@ -3831,9 +3813,6 @@ __metadata: "@rnx-kit/eslint-config": "npm:*" "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: "@rnx-kit/build": ">=0.7.0" languageName: unknown @@ -3861,13 +3840,10 @@ __metadata: "@types/qrcode": "npm:^1.4.2" "@types/yargs": "npm:^16.0.0" env-paths: "npm:^3.0.0" - eslint: "npm:^9.0.0" git-url-parse: "npm:^15.0.0" node-fetch: "npm:^3.3.2" ora: "npm:^8.0.0" - prettier: "npm:^3.0.0" qrcode: "npm:^1.5.0" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: rnx-build: lib/cli.js @@ -3883,9 +3859,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" bin: rnx-bundle-diff: lib/cli.js languageName: unknown @@ -3923,20 +3896,16 @@ __metadata: "@types/node": "npm:^20.0.0" "@types/qrcode": "npm:^1.4.2" commander: "npm:^11.1.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" markdown-table: "npm:^3.0.0" metro: "npm:^0.81.0" metro-babel-transformer: "npm:^0.81.0" metro-config: "npm:^0.81.0" ora: "npm:^5.4.1" - prettier: "npm:^3.0.0" qrcode: "npm:^1.5.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" tsx: "npm:^4.15.0" type-fest: "npm:^4.0.0" - typescript: "npm:^5.0.0" peerDependencies: jest: ">=26.0" react-native: ">=0.64" @@ -3958,9 +3927,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" bin: commitlint-lite: lib/cli.js languageName: unknown @@ -3983,12 +3949,9 @@ __metadata: "@types/lodash.merge": "npm:^4.6.9" "@types/node": "npm:^20.0.0" "@types/semver": "npm:^7.0.0" - eslint: "npm:^9.0.0" lodash.merge: "npm:^4.6.2" metro: "npm:^0.81.0" - prettier: "npm:^3.0.0" semver: "npm:^7.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4000,9 +3963,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4022,10 +3982,6 @@ __metadata: "@types/node": "npm:^20.0.0" "@types/yargs": "npm:^16.0.0" chalk: "npm:^4.1.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: rnx-analyzer: ./lib/cli.js @@ -4042,10 +3998,6 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" esbuild: "npm:^0.25.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4056,7 +4008,6 @@ __metadata: "@microsoft/eslint-plugin-sdl": "npm:^1.0.0" "@rnx-kit/eslint-plugin": "workspace:*" eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" peerDependencies: eslint: ^9.0.0 languageName: unknown @@ -4078,12 +4029,8 @@ __metadata: "@typescript-eslint/parser": "npm:^8.0.0" "@typescript-eslint/types": "npm:^8.0.0" enhanced-resolve: "npm:^5.8.3" - eslint: "npm:^9.0.0" eslint-plugin-react: "npm:^7.35.2" eslint-plugin-react-hooks: "npm:^5.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" typescript-eslint: "npm:^8.0.0" peerDependencies: eslint: ">=8.57.0" @@ -4112,13 +4059,9 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" find-up: "npm:^5.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" - typescript: "npm:^5.0.0" peerDependencies: react-native: ^0.0.0-0 || >=0.63 peerDependenciesMeta: @@ -4141,15 +4084,12 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/babel__core": "npm:^7.0.0" "@types/connect": "npm:^3.4.36" - eslint: "npm:^9.0.0" metro: "npm:^0.81.0" metro-config: "npm:^0.81.0" metro-resolver: "npm:^0.81.0" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" type-fest: "npm:^4.0.0" - typescript: "npm:^5.0.0" peerDependencies: "@react-native/metro-config": "*" react: "*" @@ -4171,10 +4111,7 @@ __metadata: "@rnx-kit/tools-node": "npm:^3.0.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" metro: "npm:^0.81.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4191,13 +4128,9 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" memfs: "npm:^4.0.0" metro: "npm:^0.81.0" metro-source-map: "npm:^0.81.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" bin: check-duplicates: lib/index.js languageName: unknown @@ -4217,10 +4150,7 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@rnx-kit/typescript-service": "npm:^2.0.0" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro: "npm:^0.81.0" - prettier: "npm:^3.0.0" typescript: "npm:>=4.7.0" languageName: unknown linkType: soft @@ -4239,11 +4169,7 @@ __metadata: "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" enhanced-resolve: "npm:^5.8.3" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro-resolver: "npm:^0.81.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4271,16 +4197,13 @@ __metadata: "@types/node": "npm:^20.0.0" esbuild: "npm:^0.25.0" esbuild-plugin-lodash: "npm:^1.2.0" - eslint: "npm:^9.0.0" fast-glob: "npm:^3.2.7" lodash-es: "npm:^4.17.21" metro: "npm:^0.81.0" metro-config: "npm:^0.81.0" metro-transform-worker: "npm:^0.81.0" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4295,12 +4218,8 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" "@types/semver": "npm:^7.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro: "npm:^0.81.0" - prettier: "npm:^3.0.0" semver: "npm:^7.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4318,7 +4237,6 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" "@types/node-fetch": "npm:^2.6.5" - eslint: "npm:^9.0.0" flow-remove-types: "npm:~2.259.0" metro: "npm:^0.81.0" metro-config: "npm:^0.81.0" @@ -4326,8 +4244,6 @@ __metadata: metro-resolver: "npm:^0.81.0" metro-runtime: "npm:^0.81.0" node-fetch: "npm:^2.6.7" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: "@office-iss/react-native-win32": "*" "@react-native/metro-config": "*" @@ -4354,12 +4270,8 @@ __metadata: "@types/istextorbinary": "npm:^2.3.0" "@types/node": "npm:^20.0.0" commander: "npm:^4.1.1" - eslint: "npm:^9.0.0" fs-extra: "npm:^10.0.0" istextorbinary: "npm:^3.3.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" winston: "npm:^3.2.1" bin: patcher-rnmacos: lib/index.js @@ -4382,10 +4294,7 @@ __metadata: "@types/babel__helper-plugin-utils": "npm:^7.0.0" "@types/babel__template": "npm:^7.0.0" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" metro-config: "npm:^0.81.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: "@react-native/js-polyfills": "*" peerDependenciesMeta: @@ -4407,11 +4316,8 @@ __metadata: "@rnx-kit/eslint-config": "npm:*" "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" - typescript: "npm:^5.0.0" peerDependencies: react: 16.11.0 || 16.13.1 || 17.0.1 || 17.0.2 || 18.0.0 || 18.1.0 || 18.2.0 || ^18.2.0 || 18.3.1 react-native: ^0.62.3 || ^0.63.2 || ^0.64.2 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0 || ^0.74.0 || ^0.75.0 || ^0.76.0 || ^0.77.0 @@ -4429,12 +4335,8 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" "@types/yargs": "npm:^16.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro-symbolicate: "npm:^0.81.0" - prettier: "npm:^3.0.0" source-map: "npm:^0.5.6" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: react-native-error-trace-decorator: lib/cli.js @@ -4446,7 +4348,6 @@ __metadata: resolution: "@rnx-kit/react-native-host@workspace:packages/react-native-host" dependencies: "@rnx-kit/scripts": "npm:*" - prettier: "npm:^3.0.0" peerDependencies: react-native: ">=0.66" languageName: unknown @@ -4462,9 +4363,6 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" babel-plugin-codegen: "npm:^4.1.5" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: react-native: ">=0.59" languageName: unknown @@ -4494,12 +4392,8 @@ __metadata: "@types/node": "npm:^20.0.0" chalk: "npm:^4.1.0" deepmerge: "npm:^4.2.2" - eslint: "npm:^9.0.0" fast-levenshtein: "npm:^3.0.0" - jest: "npm:^29.2.1" p-limit: "npm:^3.1.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: rn-changelog-generator: lib/index.js @@ -4541,10 +4435,6 @@ __metadata: "@rnx-kit/jest-preset": "npm:*" "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4584,15 +4474,12 @@ __metadata: "@rnx-kit/tsconfig": "workspace:*" "@testing-library/react-native": "npm:^12.4.3" "@types/react": "npm:^18.0.0" - eslint: "npm:^9.0.0" jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" react: "npm:18.3.1" react-native: "npm:^0.76.0" react-native-test-app: "npm:^4.0.0" react-native-windows: "npm:^0.76.0" react-test-renderer: "npm:18.3.1" - typescript: "npm:^5.0.0" bin: rnx: ../cli/bin/rnx-cli.cjs rnx.reason: Workaround for Node not being able to find `rnx-cli` because of Yarn virtual packages @@ -4614,12 +4501,8 @@ __metadata: "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" "@types/yargs": "npm:^16.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" metro-source-map: "npm:^0.81.0" - prettier: "npm:^3.0.0" spdx-expression-parse: "npm:^4.0.0" - typescript: "npm:^5.0.0" yargs: "npm:^16.0.0" bin: build-tpn: ./lib/build-tpn.js @@ -4635,9 +4518,6 @@ __metadata: "@rnx-kit/tools-shell": "npm:^0.2.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4650,10 +4530,7 @@ __metadata: "@rnx-kit/tools-shell": "npm:^0.2.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" fast-xml-parser: "npm:^4.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4665,9 +4542,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4679,9 +4553,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4693,9 +4564,6 @@ __metadata: "@rnx-kit/scripts": "npm:*" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4709,9 +4577,6 @@ __metadata: "@rnx-kit/tools-workspaces": "npm:^0.2.1" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4727,14 +4592,11 @@ __metadata: "@rnx-kit/tools-node": "npm:^3.0.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" metro: "npm:^0.81.0" metro-config: "npm:^0.81.0" metro-core: "npm:^0.81.0" metro-resolver: "npm:^0.81.0" metro-source-map: "npm:^0.81.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4748,10 +4610,6 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/jest": "npm:^29.2.1" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4768,10 +4626,6 @@ __metadata: "@rnx-kit/tools-react-native": "npm:^2.0.0" "@rnx-kit/tsconfig": "npm:*" "@rnx-kit/typescript-service": "npm:^2.0.0" - eslint: "npm:^9.0.0" - jest: "npm:^29.2.1" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: typescript: ">=4.7.0" languageName: unknown @@ -4786,10 +4640,7 @@ __metadata: "@rnx-kit/tools-shell": "npm:^0.2.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" fast-xml-parser: "npm:^4.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4802,14 +4653,11 @@ __metadata: "@rnx-kit/tsconfig": "npm:*" "@types/micromatch": "npm:^4.0.0" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" fast-glob: "npm:^3.2.7" find-up: "npm:^5.0.0" micromatch: "npm:^4.0.0" - prettier: "npm:^3.0.0" read-yaml-file: "npm:^2.1.0" strip-json-comments: "npm:^3.1.1" - typescript: "npm:^5.0.0" languageName: unknown linkType: soft @@ -4830,14 +4678,22 @@ __metadata: "@rnx-kit/tools-node": "npm:^3.0.0" "@rnx-kit/tsconfig": "npm:*" "@types/node": "npm:^20.0.0" - eslint: "npm:^9.0.0" - prettier: "npm:^3.0.0" - typescript: "npm:^5.0.0" peerDependencies: typescript: ">=4.0" languageName: unknown linkType: soft +"@rnx-kit/yarn-plugin-dynamic-extensions@workspace:incubator/yarn-plugin-dynamic-extensions": + version: 0.0.0-use.local + resolution: "@rnx-kit/yarn-plugin-dynamic-extensions@workspace:incubator/yarn-plugin-dynamic-extensions" + dependencies: + "@rnx-kit/eslint-config": "npm:*" + "@rnx-kit/scripts": "npm:*" + "@rnx-kit/tsconfig": "npm:*" + "@yarnpkg/core": "npm:^4.0.0" + languageName: unknown + linkType: soft + "@shikijs/engine-oniguruma@npm:^1.25.1": version: 1.26.1 resolution: "@shikijs/engine-oniguruma@npm:1.26.1" @@ -5564,7 +5420,7 @@ __metadata: languageName: node linkType: hard -"@yarnpkg/core@npm:^4.1.6, @yarnpkg/core@npm:^4.2.0": +"@yarnpkg/core@npm:^4.0.0, @yarnpkg/core@npm:^4.1.6, @yarnpkg/core@npm:^4.2.0": version: 4.2.0 resolution: "@yarnpkg/core@npm:4.2.0" dependencies: @@ -15164,12 +15020,12 @@ __metadata: linkType: hard "typescript@npm:>=4.7.0, typescript@npm:^5.0.0": - version: 5.7.2 - resolution: "typescript@npm:5.7.2" + version: 5.7.3 + resolution: "typescript@npm:5.7.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/a873118b5201b2ef332127ef5c63fb9d9c155e6fdbe211cbd9d8e65877283797cca76546bad742eea36ed7efbe3424a30376818f79c7318512064e8625d61622 + checksum: 10c0/b7580d716cf1824736cc6e628ab4cd8b51877408ba2be0869d2866da35ef8366dd6ae9eb9d0851470a39be17cbd61df1126f9e211d8799d764ea7431d5435afa languageName: node linkType: hard