Skip to content

Commit 677ee67

Browse files
generatedunixname89002005232357facebook-github-bot
authored andcommitted
Revert D79993649 (#53217)
Summary: Pull Request resolved: #53217 Changelog: [Internal] Fix rn-tester jobs This diff reverts D79993649 (The context such as a Sandcastle job, Task, SEV, etc. was not provided.) Depends on D79993649 Reviewed By: cortinico Differential Revision: D80030502 fbshipit-source-id: 1feee2e2ae6a1edbeb755687aecb2a25d9759a90
1 parent cc71f9c commit 677ee67

File tree

1 file changed

+2
-23
lines changed
  • packages/react-native/scripts/codegen/generate-artifacts-executor

1 file changed

+2
-23
lines changed

packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -204,27 +204,8 @@ function findExternalLibraries(
204204
paths: [projectRoot],
205205
});
206206
} catch (e) {
207+
// require.resolve fails if the dependency is a local node module.
207208
if (
208-
// require.resolve fails if the `./package.json` subpath is not explicitly defined in the library's `exports` field in its package.json
209-
'code' in e &&
210-
e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED'
211-
) {
212-
// find the closest library's package.json with the search paths
213-
// $FlowFixMe[prop-missing]
214-
const paths: Array<string> = require.main.paths;
215-
for (const nodeModulesPath of paths) {
216-
const packageJsonFilePath = path.join(
217-
nodeModulesPath,
218-
dependency,
219-
'package.json',
220-
);
221-
if (fs.existsSync(packageJsonFilePath)) {
222-
configFilePath = packageJsonFilePath;
223-
break;
224-
}
225-
}
226-
} else if (
227-
// require.resolve fails if the dependency is a local node module.
228209
dependencies[dependency].startsWith('.') || // handles relative paths
229210
dependencies[dependency].startsWith('/') // handles absolute paths
230211
) {
@@ -233,9 +214,7 @@ function findExternalLibraries(
233214
pkgJson.dependencies[dependency],
234215
'package.json',
235216
);
236-
}
237-
238-
if (!configFilePath) {
217+
} else {
239218
return [];
240219
}
241220
}

0 commit comments

Comments
 (0)