Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-dolphins-greet.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions packages/metro-resolver-symlinks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion packages/metro-resolver-symlinks/src/utils/patchMetro.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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'."
Expand Down Expand Up @@ -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`.
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down