File tree Expand file tree Collapse file tree 5 files changed +24
-7
lines changed
cli-config-android/src/config
cli-config-apple/src/config Expand file tree Collapse file tree 5 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,20 @@ import {extractComponentDescriptors} from './extractComponentDescriptors';
5
5
import { unixifyPaths } from '@react-native-community/cli-tools' ;
6
6
7
7
export function findComponentDescriptors ( packageRoot : string ) {
8
- const files = glob . sync ( '**/+(*.js|*.jsx|*.ts|*.tsx)' , {
8
+ let jsSrcsDir = null ;
9
+ try {
10
+ const packageJson = fs . readFileSync (
11
+ path . join ( packageRoot , 'package.json' ) ,
12
+ 'utf8' ,
13
+ ) ;
14
+ jsSrcsDir = JSON . parse ( packageJson ) . codegenConfig . jsSrcsDir ;
15
+ } catch ( error ) {
16
+ // no jsSrcsDir, continue with default glob pattern
17
+ }
18
+ const globPattern = jsSrcsDir
19
+ ? `${ jsSrcsDir } /**/+(*.js|*.jsx|*.ts|*.tsx)`
20
+ : '**/+(*.js|*.jsx|*.ts|*.tsx)' ;
21
+ const files = glob . sync ( globPattern , {
9
22
cwd : unixifyPaths ( packageRoot ) ,
10
23
onlyFiles : true ,
11
24
ignore : [ '**/node_modules/**' ] ,
Original file line number Diff line number Diff line change @@ -14,15 +14,14 @@ export default function findManifest(folder: string) {
14
14
let manifestPaths = glob . sync ( '**/AndroidManifest.xml' , {
15
15
cwd : unixifyPaths ( folder ) ,
16
16
ignore : [
17
- 'node_modules/**' ,
18
17
'**/build/**' ,
19
18
'**/debug/**' ,
20
19
'Examples/**' ,
21
20
'examples/**' ,
22
- '**/Pods/**' ,
23
21
'**/sdks/hermes/android/**' ,
24
22
'**/src/androidTest/**' ,
25
23
'**/src/test/**' ,
24
+ '**/.cxx/**' ,
26
25
] ,
27
26
} ) ;
28
27
if ( manifestPaths . length > 1 ) {
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ export function getMainActivityFiles(
25
25
26
26
return glob . sync ( `**/+(${ patternArray . join ( '|' ) } )` , {
27
27
cwd : unixifyPaths ( folder ) ,
28
+ onlyFiles : true ,
29
+ ignore : [ '**/.cxx/**' ] ,
28
30
} ) ;
29
31
}
30
32
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ import glob from 'fast-glob';
9
9
import { unixifyPaths } from '@react-native-community/cli-tools' ;
10
10
11
11
// These folders will be excluded from search to speed it up
12
- const GLOB_EXCLUDE_PATTERN = [ '**/@(Pods|node_modules|Carthage|vendor)/**' ] ;
12
+ const GLOB_EXCLUDE_PATTERN = [
13
+ '**/@(Pods|node_modules|Carthage|vendor|android)/**' ,
14
+ ] ;
13
15
14
16
export default function findAllPodfilePaths ( cwd : string ) {
15
17
return glob . sync ( '**/Podfile' , {
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ function isValidRNDependency(config: DependencyConfig) {
10
10
11
11
function filterConfig ( config : Config ) {
12
12
const filtered = { ...config } ;
13
+ const dependencies : Record < string , DependencyConfig > = { } ;
13
14
Object . keys ( filtered . dependencies ) . forEach ( ( item ) => {
14
- if ( ! isValidRNDependency ( filtered . dependencies [ item ] ) ) {
15
- delete filtered . dependencies [ item ] ;
15
+ if ( isValidRNDependency ( filtered . dependencies [ item ] ) ) {
16
+ dependencies [ item ] = filtered . dependencies [ item ] ;
16
17
}
17
18
} ) ;
18
- return filtered ;
19
+ return { ... filtered , dependencies } ;
19
20
}
20
21
21
22
export default {
You can’t perform that action at this time.
0 commit comments