From e55694b754fbb7fa89f8957353652a455937d641 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 25 Nov 2025 13:49:45 +0000 Subject: [PATCH 1/4] Upgrade to `glob@^13.0.0` --- package.json | 2 +- packages/react-native-codegen/package.json | 2 +- packages/react-native/package.json | 2 +- private/cxx-public-api/package.json | 2 +- yarn.lock | 48 +++++++++++++++++++++- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d17cb16fc1318f..db71ed913761b7 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "eslint-plugin-relay": "^1.8.3", "flow-api-translator": "0.29.1", "flow-bin": "^0.275.0", - "glob": "^7.1.1", + "glob": "^13.0.0", "hermes-eslint": "0.29.1", "hermes-transform": "0.29.1", "inquirer": "^7.1.0", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 8cf46eb3efd9ca..64d437042d0b94 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -31,7 +31,7 @@ "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.25.3", - "glob": "^7.1.1", + "glob": "^13.0.0", "hermes-parser": "0.29.1", "invariant": "^2.2.4", "nullthrows": "^1.1.1", diff --git a/packages/react-native/package.json b/packages/react-native/package.json index cad0c82ce2ebef..88efa03c8dd932 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -177,7 +177,7 @@ "base64-js": "^1.5.1", "commander": "^12.0.0", "flow-enums-runtime": "^0.0.6", - "glob": "^7.1.1", + "glob": "^13.0.0", "invariant": "^2.2.4", "jest-environment-node": "^29.7.0", "memoize-one": "^5.0.0", diff --git a/private/cxx-public-api/package.json b/private/cxx-public-api/package.json index 11e3c5cb75eab4..65dce13244edfb 100644 --- a/private/cxx-public-api/package.json +++ b/private/cxx-public-api/package.json @@ -12,7 +12,7 @@ "license": "MIT", "private": true, "dependencies": { - "glob": "^7.1.1", + "glob": "^13.0.0", "ini": "^5.0.0" } } diff --git a/yarn.lock b/yarn.lock index a552058a9b0448..de02e0f0a9173c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1465,6 +1465,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@isaacs/balanced-match@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz#3081dadbc3460661b751e7591d7faea5df39dd29" + integrity sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ== + +"@isaacs/brace-expansion@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz#4b3dabab7d8e75a429414a96bd67bf4c1d13e0f3" + integrity sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA== + dependencies: + "@isaacs/balanced-match" "^4.0.1" + "@isaacs/ttlcache@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" @@ -5077,7 +5089,16 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" -glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-13.0.0.tgz#9d9233a4a274fc28ef7adce5508b7ef6237a1be3" + integrity sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA== + dependencies: + minimatch "^10.1.1" + minipass "^7.1.2" + path-scurry "^2.0.0" + +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -6682,6 +6703,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^11.0.0: + version "11.2.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.2.2.tgz#40fd37edffcfae4b2940379c0722dc6eeaa75f24" + integrity sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -7369,6 +7395,13 @@ minimatch@9.0.3: dependencies: brace-expansion "^2.0.1" +minimatch@^10.1.1: + version "10.1.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.1.1.tgz#e6e61b9b0c1dcab116b5a7d1458e8b6ae9e73a55" + integrity sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ== + dependencies: + "@isaacs/brace-expansion" "^5.0.0" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -7395,6 +7428,11 @@ minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -7839,6 +7877,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.1.tgz#4b6572376cfd8b811fca9cd1f5c24b3cbac0fe10" + integrity sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA== + dependencies: + lru-cache "^11.0.0" + minipass "^7.1.2" + path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" From bc3c19a3e90ce4e727ea4daedf1e385d92a5cf0c Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 25 Nov 2025 14:40:33 +0000 Subject: [PATCH 2/4] Replace `flow-typed/npm/glob_v7.x.x.js` with `glob_v13.x.x.js` --- flow-typed/npm/glob_v13.x.x.js | 275 +++++++++++++++++++++++++++++++++ flow-typed/npm/glob_v7.x.x.js | 79 ---------- 2 files changed, 275 insertions(+), 79 deletions(-) create mode 100644 flow-typed/npm/glob_v13.x.x.js delete mode 100644 flow-typed/npm/glob_v7.x.x.js diff --git a/flow-typed/npm/glob_v13.x.x.js b/flow-typed/npm/glob_v13.x.x.js new file mode 100644 index 00000000000000..e15af8b07e4222 --- /dev/null +++ b/flow-typed/npm/glob_v13.x.x.js @@ -0,0 +1,275 @@ +declare module "glob" { + import typeof FSModule from 'fs'; + + declare type MinimatchOptions = {| + debug?: boolean, + nobrace?: boolean, + noglobstar?: boolean, + dot?: boolean, + noext?: boolean, + nocase?: boolean, + nonull?: boolean, + matchBase?: boolean, + nocomment?: boolean, + nonegate?: boolean, + flipNegate?: boolean + |}; + + declare type IgnoreLike = {| + ignored?: (p: Path) => boolean, + childrenIgnored?: (p: Path) => boolean, + add?: (ignore: string) => void, + |}; + + declare type GlobOptions = {| + absolute?: boolean, + allowWindowsEscape?: boolean, + cwd?: string | URL, + dot?: boolean, + dotRelative?: boolean, + follow?: boolean, + ignore?: string | string[] | IgnoreLike, + magicalBraces?: boolean, + mark?: boolean, + matchBase?: boolean, + maxDepth?: number, + nobrace?: boolean, + nocase?: boolean, + nodir?: boolean, + noext?: boolean, + noglobstar?: boolean, + platform?: 'darwin' | 'win32' | 'linux', + realpath?: boolean, + root?: string, + // NOTE: Instance of `PathScurry`, untyped here to simplify types + scurry?: mixed, + stat?: boolean, + signal?: AbortSignal, + windowsPathsNoEscape?: boolean, + withFileTypes?: boolean, + fs?: FSModule, + debug?: boolean, + posix?: boolean, + includeChildMatches?: boolean, + |}; + + declare class Path { + // Dirent name retyped as string + name: string; + + // Dirent methods + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isDirectory(): boolean; + isFIFO(): boolean; + isFile(): boolean; + isSocket(): boolean; + isSymbolicLink(): boolean; + + root: Path; + roots: { + [k: string]: Path; + }; + parent?: Path; + nocase: boolean; + isCWD: boolean; + splitSep: string | RegExp; + sep: string; + +dev: number | void; + +mode: number | void; + +nlink: number | void; + +uid: number | void; + +gid: number | void; + +rdev: number | void; + +blksize: number | void; + +ino: number | void; + +size: number | void; + +blocks: number | void; + +atimeMs: number | void; + +mtimeMs: number | void; + +ctimeMs: number | void; + +birthtimeMs: number | void; + +atime: Date | void; + +mtime: Date | void; + +ctime: Date | void; + +birthtime: Date | void; + +parentPath: string; + +path: string; + +depth: number; + resolve(path?: string): Path; + relative(): string; + relativePosix(): string; + fullpath(): string; + fullpathPosix(): string; + lstatCached(): Path | void; + readlinkCached(): Path | void; + realpathCached(): Path | void; + readdirCached(): Path[]; + canReadlink(): boolean; + calledReaddir(): boolean; + isENOENT(): boolean; + isNamed(n: string): boolean; + readlink(): Promise; + readlinkSync(): Path | void; + lstat(): Promise; + lstatSync(): Path | void; + readdirCB(cb: (err: Error | null, entries: Path[]) => mixed, allowZalgo?: boolean): void; + readdir(): Promise; + readdirSync(): Path[]; + canReaddir(): boolean; + shouldWalk(dirs: Set, walkFilter?: (e: Path) => boolean): boolean; + realpath(): Promise; + realpathSync(): Path | void; + }; + + declare type GlobOptionsWithFileTypesTrue = {| + ...GlobOptions, + withFileTypes: true; + absolute?: void; + mark?: void; + posix?: void; + |}; + + declare type GlobOptionsWithFileTypesFalse = {| + ...GlobOptions, + withFileTypes?: false; + |}; + + declare type GlobOptionsWithFileTypesUnset = {| + ...GlobOptions, + withFileTypes: void; + |}; + + declare type Result = Opts extends GlobOptionsWithFileTypesTrue + ? Path + : Opts extends GlobOptionsWithFileTypesFalse + ? string + : Opts extends GlobOptionsWithFileTypesUnset + ? string : string | Path; + + declare type Results = Result[]; + + // NOTE: Left out GLOBSTAR identity + declare type MMPattern = string | RegExp | {}; + + declare class Pattern { + +length: number; + pattern(): MMPattern; + isString(): boolean; + isGlobstar(): boolean; + isRegExp(): boolean; + globString(): string; + hasMore(): boolean; + rest(): Pattern | null; + isUNC(): boolean; + isDrive(): boolean; + isAbsolute(): boolean; + root(): string; + checkFollowGlobstar(): boolean; + markFollowGlobstar(): boolean; + } + + declare class Glob { + opts: Opts; + patterns: Pattern[]; + + constructor(pattern: string | string[], options: Opts): this; + walk(): Promise>; + // stream(): Minipass, Result>; + // streamSync(): Minipass, Result>; + iterateSync(): Iterator>; + iterate(): AsyncIterator>; + @@iterator(): Iterator>; + @@asyncIterator(): AsyncIterator>; + + // GlobOptions + absolute?: boolean, + allowWindowsEscape?: boolean, + cwd?: string | URL, + dot?: boolean, + dotRelative?: boolean, + follow?: boolean, + ignore?: string | string[] | IgnoreLike, + magicalBraces?: boolean, + mark?: boolean, + matchBase?: boolean, + maxDepth?: number, + nobrace?: boolean, + nocase?: boolean, + nodir?: boolean, + noext?: boolean, + noglobstar?: boolean, + platform?: 'darwin' | 'win32' | 'linux', + realpath?: boolean, + root?: string, + // NOTE: Instance of `PathScurry`, untyped here to simplify types + scurry?: mixed, + stat?: boolean, + signal?: AbortSignal, + windowsPathsNoEscape?: boolean, + withFileTypes?: boolean, + fs?: FSModule, + debug?: boolean, + posix?: boolean, + includeChildMatches?: boolean, + } + + declare class GlobSync { + (pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[]; + (pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[]; + (pattern: string | string[], options?: GlobOptionsWithFileTypesUnset): string[]; + (pattern: string | string[], options: GlobOptions): Path[] | string[]; + } + + declare class GlobIterateSync { + (pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Iterator; + (pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Iterator; + (pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | void): Iterator; + (pattern: string | string[], options: GlobOptions): Iterator | Iterator; + } + + declare class GlobIterate { + (pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncIterator; + (pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncIterator; + (pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | void): AsyncIterator; + (pattern: string | string[], options: GlobOptions): AsyncIterator | AsyncIterator; + sync: GlobIterateSync; + } + + declare class GlobModule { + glob: GlobModule; + + Glob: typeof Glob; + + (pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise; + (pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise; + (pattern: string | string[], options: GlobOptions): Promise; + (pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | void): Promise; + + globIterateSync: GlobIterateSync; + globIterate: GlobIterate; + iterateSync: GlobIterateSync; + iterate: GlobIterate; + globSync: GlobSync; + sync: GlobSync; + + /* + globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; + globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; + globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass; + globStreamSync(pattern: string | string[], options: GlobOptions): Minipass | Minipass; + + globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass; + globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass; + globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | void): Minipass; + globStream(pattern: string | string[], options: GlobOptions): Minipass | Minipass; + */ + + hasMagic(pattern: string, options?: GlobOptions): boolean; + + // escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + // unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + } + + declare module.exports: GlobModule; +} diff --git a/flow-typed/npm/glob_v7.x.x.js b/flow-typed/npm/glob_v7.x.x.js deleted file mode 100644 index 4bd3df6cb98420..00000000000000 --- a/flow-typed/npm/glob_v7.x.x.js +++ /dev/null @@ -1,79 +0,0 @@ -// flow-typed signature: d2a519d7d007e9ba3e5bf2ac3ff76eca -// flow-typed version: f243e51ed7/glob_v7.x.x/flow_>=v0.104.x - -declare module "glob" { - declare type MinimatchOptions = {| - debug?: boolean, - nobrace?: boolean, - noglobstar?: boolean, - dot?: boolean, - noext?: boolean, - nocase?: boolean, - nonull?: boolean, - matchBase?: boolean, - nocomment?: boolean, - nonegate?: boolean, - flipNegate?: boolean - |}; - - declare type Options = {| - ...MinimatchOptions, - cwd?: string, - root?: string, - nomount?: boolean, - mark?: boolean, - nosort?: boolean, - stat?: boolean, - silent?: boolean, - strict?: boolean, - cache?: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }, - statCache?: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }, - symlinks?: { [path: string]: boolean | void, ... }, - realpathCache?: { [path: string]: string, ... }, - sync?: boolean, - nounique?: boolean, - nodir?: boolean, - ignore?: string | $ReadOnlyArray, - follow?: boolean, - realpath?: boolean, - absolute?: boolean - |}; - - /** - * Called when an error occurs, or matches are found - * err - * matches: filenames found matching the pattern - */ - declare type CallBack = (err: ?Error, matches: Array) => void; - - declare class Glob extends events$EventEmitter { - constructor(pattern: string): this; - constructor(pattern: string, callback: CallBack): this; - constructor(pattern: string, options: Options, callback: CallBack): this; - - minimatch: {...}; - options: Options; - aborted: boolean; - cache: { [path: string]: boolean | "DIR" | "FILE" | $ReadOnlyArray, ... }; - statCache: { [path: string]: boolean | { isDirectory(): boolean, ... } | void, ... }; - symlinks: { [path: string]: boolean | void, ... }; - realpathCache: { [path: string]: string, ... }; - found: Array; - - pause(): void; - resume(): void; - abort(): void; - } - - declare class GlobModule { - Glob: Class; - - (pattern: string, callback: CallBack): void; - (pattern: string, options: Options, callback: CallBack): void; - - hasMagic(pattern: string, options?: Options): boolean; - sync(pattern: string, options?: Options): Array; - } - - declare module.exports: GlobModule; -} From 5609b7c328cd1d309a3621704cfe97b107be35fb Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 25 Nov 2025 15:08:53 +0000 Subject: [PATCH 3/4] Update use of glob --- packages/react-native-codegen/scripts/build.js | 3 +-- .../src/cli/combine/combine-js-to-schema.js | 9 +++------ private/cxx-public-api/public-api.js | 16 +++++++--------- scripts/build-types/BuildApiSnapshot.js | 6 +++++- scripts/build/build.js | 12 ++++++++---- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/packages/react-native-codegen/scripts/build.js b/packages/react-native-codegen/scripts/build.js index 862ccdd759860f..7df52948c58347 100644 --- a/packages/react-native-codegen/scripts/build.js +++ b/packages/react-native-codegen/scripts/build.js @@ -106,8 +106,7 @@ function buildFile(file, silent) { } const srcDir = path.resolve(__dirname, '..', SRC_DIR); -const pattern = path.resolve(srcDir, '**/*'); -const files = glob.sync(pattern, {nodir: true}); +const files = glob.sync('**/*', {nodir: true, cwd: srcDir}); process.stdout.write(fixedWidth(`${path.basename(PACKAGE_DIR)}\n`)); diff --git a/packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js b/packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js index e16d98e64a5484..e732a86274e69d 100644 --- a/packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js +++ b/packages/react-native-codegen/src/cli/combine/combine-js-to-schema.js @@ -66,13 +66,10 @@ function expandDirectoriesIntoFiles( if (!fs.lstatSync(file).isDirectory()) { return [file]; } - const filePattern = path.sep === '\\' ? file.replace(/\\/g, '/') : file; - return glob.sync(`${filePattern}/**/*{,.fb}.{js,ts,tsx}`, { + return glob.sync('**/*{,.fb}.{js,ts,tsx}', { nodir: true, - // TODO: This will remove the need of slash substitution above for Windows, - // but it requires glob@v9+; with the package currenlty relying on - // glob@7.1.1; and flow-typed repo not having definitions for glob@9+. - // windowsPathsNoEscape: true, + absolute: true, + cwd: file, }); }) .filter(element => filterJSFile(element, platform, exclude)); diff --git a/private/cxx-public-api/public-api.js b/private/cxx-public-api/public-api.js index 2c7758bb1cd8ab..f967e624a386e0 100644 --- a/private/cxx-public-api/public-api.js +++ b/private/cxx-public-api/public-api.js @@ -179,17 +179,15 @@ function main() { let start = performance.now(); - let files /*: string[]*/ = []; - for (const searchGlob of config.include) { - // glob 7 doesn't support searchGlob as a string[] - files = files.concat( - glob.sync(searchGlob, { + const files = Array.from( + new Set( + glob.sync(config.include, { ignore: config.exclude, - root: GLOB_PROJECT_ROOT, + cwd: GLOB_PROJECT_ROOT, + absolute: true, }), - ); - } - files = Array.from(new Set(files)); + ), + ); // Sort the files to make the output deterministic files.sort(); diff --git a/scripts/build-types/BuildApiSnapshot.js b/scripts/build-types/BuildApiSnapshot.js index 815f251b125fc1..51fa632fcfe5d5 100644 --- a/scripts/build-types/BuildApiSnapshot.js +++ b/scripts/build-types/BuildApiSnapshot.js @@ -202,7 +202,11 @@ async function preparePackagesInTempDir( }), ); - const typeDefs = glob.sync(`${tempDirectory}/**/*.d.ts`); + const typeDefs = glob.sync('**/*.d.ts', { + nodir: true, + absolute: true, + cwd: tempDirectory, + }); await Promise.all( typeDefs.map(async file => { const source = await fs.readFile(file, 'utf-8'); diff --git a/scripts/build/build.js b/scripts/build/build.js index 884e9d9115eb7f..b2b3f53f149858 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -104,8 +104,10 @@ async function buildPackage(packageName /*: string */) { const entryPoints = await getEntryPoints(packageName); const files = glob - .sync(path.resolve(PACKAGES_DIR, packageName, SRC_DIR, '**/*'), { + .sync('**/*', { nodir: true, + absolute: true, + cwd: path.resolve(PACKAGES_DIR, packageName, SRC_DIR), }) .filter( file => @@ -429,9 +431,11 @@ function normalizeExportsTarget(target /*: string */) /*: string */ { } function validateTypeScriptDefs(packageName /*: string */) { - const files = glob.sync( - path.resolve(PACKAGES_DIR, packageName, BUILD_DIR, '**/*.d.ts'), - ); + const files = glob.sync('**/*.d.ts', { + nodir: true, + absolute: true, + cwd: path.resolve(PACKAGES_DIR, packageName, BUILD_DIR), + }); const compilerOptions = { ...getTypeScriptCompilerOptions(packageName), noEmit: true, From 732afef433701c8351df43fb654edffda1a4dc6f Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 25 Nov 2025 15:17:29 +0000 Subject: [PATCH 4/4] Bump to `rimraf@^6.1.2` --- package.json | 2 +- packages/react-native-codegen/package.json | 2 +- .../react-native-compatibility-check/package.json | 2 +- .../package.json | 2 +- yarn.lock | 13 +++++++++++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index db71ed913761b7..34034c2f2f8cd6 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "prettier-plugin-hermes-parser": "0.29.1", "react": "19.1.0", "react-test-renderer": "19.1.0", - "rimraf": "^3.0.2", + "rimraf": "^6.1.2", "shelljs": "^0.8.5", "signedsource": "^1.0.0", "supports-color": "^7.1.0", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 64d437042d0b94..42cf402998f4fe 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -48,7 +48,7 @@ "hermes-estree": "0.29.1", "micromatch": "^4.0.4", "prettier": "2.8.8", - "rimraf": "^3.0.2" + "rimraf": "^6.1.2" }, "peerDependencies": { "@babel/core": "*" diff --git a/packages/react-native-compatibility-check/package.json b/packages/react-native-compatibility-check/package.json index 4c09df79641fa0..7022508b7e0250 100644 --- a/packages/react-native-compatibility-check/package.json +++ b/packages/react-native-compatibility-check/package.json @@ -33,6 +33,6 @@ }, "devDependencies": { "flow-remove-types": "^2.237.2", - "rimraf": "^3.0.2" + "rimraf": "^6.1.2" } } diff --git a/private/react-native-codegen-typescript-test/package.json b/private/react-native-codegen-typescript-test/package.json index 194757e06849c9..b98e2352dcf8fa 100644 --- a/private/react-native-codegen-typescript-test/package.json +++ b/private/react-native-codegen-typescript-test/package.json @@ -28,7 +28,7 @@ "@babel/preset-env": "^7.25.3", "@types/jest": "^29.5.3", "jest": "^29.7.0", - "rimraf": "^3.0.2" + "rimraf": "^6.1.2" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" diff --git a/yarn.lock b/yarn.lock index de02e0f0a9173c..757fa1d201906f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7778,6 +7778,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -8440,6 +8445,14 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-6.1.2.tgz#9a0f3cea2ab853e81291127422116ecf2a86ae89" + integrity sha512-cFCkPslJv7BAXJsYlK1dZsbP8/ZNLkCAQ0bi1hf5EKX2QHegmDFEFA6QhuYJlk7UDdc+02JjO80YSOrWPpw06g== + dependencies: + glob "^13.0.0" + package-json-from-dist "^1.0.1" + roarr@^2.15.3: version "2.15.4" resolved "https://registry.yarnpkg.com/roarr/-/roarr-2.15.4.tgz#f5fe795b7b838ccfe35dc608e0282b9eba2e7afd"