Skip to content

Commit a8d032f

Browse files
authored
fix: remove @react-native-commmunity/cli as a dependency (#1812)
1 parent e611e1a commit a8d032f

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"registry": "https://registry.npmjs.org/"
7878
},
7979
"dependencies": {
80-
"@react-native-community/cli-tools": "^17.0.0",
80+
"find-up": "^7.0.0",
8181
"picocolors": "^1.1.1",
8282
"plist": "^3.1.0"
8383
},

packages/common/src/scripts/common.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
33

4-
import { resolveNodeModuleDir } from '@react-native-community/cli-tools';
4+
import { findUpSync } from 'find-up';
5+
6+
/**
7+
* Source vendored and simplified from @react-native-coommunity/cli
8+
*/
9+
const resolveNodeModuleDir = (root: string, pkgName: string) => {
10+
const packageDir = findUpSync(path.join('node_modules', pkgName), {
11+
cwd: root,
12+
type: 'directory',
13+
});
14+
15+
return packageDir;
16+
};
517

618
const getPackageJson = (filename: string) => {
719
const packageData = fs.readFileSync(filename, 'utf-8');

pnpm-lock.yaml

Lines changed: 3 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)