fix(metro-resolver-symlinks): print Metro path (#2694)

This commit is contained in:
Tommy Nguyen 2023-09-21 11:23:12 +02:00 коммит произвёл GitHub
Родитель a442ffd400
Коммит 3c65642e4b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,5 @@
---
"@rnx-kit/metro-resolver-symlinks": patch
---
Print the path to the Metro instance that will be monkey patched if `experimental_retryResolvingFromDisk` is enabled

Просмотреть файл

@ -22,6 +22,7 @@
"test": "rnx-kit-scripts test"
},
"dependencies": {
"@rnx-kit/console": "^1.0.0",
"@rnx-kit/tools-node": "^2.0.0",
"@rnx-kit/tools-react-native": "^1.3.2",
"enhanced-resolve": "^5.8.3"

Просмотреть файл

@ -1,3 +1,4 @@
import { info, warn } from "@rnx-kit/console";
import { findMetroPath } from "@rnx-kit/tools-react-native/metro";
import * as fs from "fs";
import * as path from "path";
@ -40,7 +41,7 @@ export function shouldEnableRetryResolvingFromDisk({
experimental_retryResolvingFromDisk !== "force" &&
!supportsRetryResolvingFromDisk()
) {
console.warn(
warn(
"The version of Metro you're using has not been tested with " +
"`experimental_retryResolvingFromDisk`. If you still want to enable " +
"it, please set it to 'force'."
@ -83,6 +84,8 @@ export function patchMetro(options: Options): void {
return;
}
info(`experimental_retryResolvingFromDisk: Patching '${findMetroPath()}'`);
const DependencyGraph = importMetroModule("/src/node-haste/DependencyGraph");
// Patch `_createModuleResolver` and `_doesFileExist` to use `fs.existsSync`.

Просмотреть файл

@ -3787,6 +3787,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rnx-kit/metro-resolver-symlinks@workspace:packages/metro-resolver-symlinks"
dependencies:
"@rnx-kit/console": ^1.0.0
"@rnx-kit/eslint-config": "*"
"@rnx-kit/scripts": "*"
"@rnx-kit/tools-node": ^2.0.0