File tree Expand file tree Collapse file tree
packages/react-native/scripts
codegen/generate-artifacts-executor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313const CodegenUtils = require ( '../codegen-utils' ) ;
1414const { codegenLog} = require ( './utils' ) ;
1515const fs = require ( 'fs' ) ;
16- const glob = require ( 'glob' ) ;
1716const path = require ( 'path' ) ;
17+ const { globSync} = require ( 'tinyglobby' ) ;
1818
1919function generateSchemaInfos (
2020 libraries /*: $ReadOnlyArray<$FlowFixMe> */ ,
@@ -57,17 +57,18 @@ function extractSupportedApplePlatforms(
5757 dependencyPath /*: string */ ,
5858) /*: ?{[string]: boolean} */ {
5959 codegenLog ( 'Searching for podspec in the project dependencies.' , true ) ;
60- const podspecs = glob . sync ( '*.podspec' , { cwd : dependencyPath } ) ;
60+ const podspecs = globSync ( '*.podspec' , {
61+ cwd : dependencyPath ,
62+ onlyFiles : true ,
63+ absolute : true ,
64+ } ) ;
6165
6266 if ( podspecs . length === 0 ) {
6367 return ;
6468 }
6569
6670 // Take the first podspec found
67- const podspec = fs . readFileSync (
68- path . join ( dependencyPath , podspecs [ 0 ] ) ,
69- 'utf8' ,
70- ) ;
71+ const podspec = fs . readFileSync ( podspecs [ 0 ] , 'utf8' ) ;
7172
7273 /**
7374 * Podspec can have platforms defined in two ways:
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ import type {BuildFlavor, Destination} from './types';
1515const { createLogger} = require ( './utils' ) ;
1616const { execSync} = require ( 'child_process' ) ;
1717const fs = require ( 'fs' ) ;
18- const glob = require ( 'glob' ) ;
1918const path = require ( 'path' ) ;
19+ const { globSync} = require ( 'tinyglobby' ) ;
2020
2121const buildLog = createLogger ( 'SPM' ) ;
2222
@@ -28,8 +28,9 @@ function computeFrameworkPaths(
2828 productsFolder /*: string */ ,
2929) /*: Array<string> */ {
3030 // The frameworks are in the products folder under a platform/buildType folder and are directories ending with .framework
31- const frameworks = glob . sync ( '**/*.framework' , {
31+ const frameworks = globSync ( '**/*.framework' , {
3232 cwd : productsFolder ,
33+ expandDirectories : false ,
3334 absolute : true ,
3435 } ) ;
3536
Original file line number Diff line number Diff line change 99 */
1010
1111const fs = require ( 'fs' ) ;
12- const glob = require ( 'glob' ) ;
1312const path = require ( 'path' ) ;
13+ const { globSync} = require ( 'tinyglobby' ) ;
1414
1515/**
1616 * This regular expression is designed to match function calls to `podspec_sources` within a podspec file.
@@ -32,9 +32,10 @@ function getHeaderFilesFromPodspecs(
3232 rootFolder /*:string*/ ,
3333) /*: { [key: string]: string[] }*/ {
3434 // Find podspec files
35- const podSpecFiles = glob . sync ( '**/*.podspec' , {
35+ const podSpecFiles = globSync ( '**/*.podspec' , {
3636 cwd : rootFolder ,
3737 absolute : true ,
38+ onlyFiles : true ,
3839 } ) ;
3940
4041 const headers /*: { [key: string]: string[] }*/ = { } ;
@@ -66,9 +67,10 @@ function getHeaderFilesFromPodspecs(
6667 const p = path . resolve ( process . cwd ( ) , path . dirname ( podspec ) ) ;
6768 const results = globPatterns
6869 . map ( g => {
69- return glob . sync ( g . replace ( '{h}' , 'h' ) , {
70+ return globSync ( g . replace ( '{h}' , 'h' ) , {
7071 cwd : p ,
7172 absolute : true ,
73+ expandDirectories : false ,
7274 } ) ;
7375 } )
7476 . flat ( ) ;
You can’t perform that action at this time.
0 commit comments