From d1a8d50b35030959124dc4e11a530d331755aefd Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Fri, 27 Feb 2026 06:22:10 -0800 Subject: [PATCH] Restore publishing of `.d.ts` files Summary: https://github.com/facebook/metro/pull/1627 inadvertently broke publishing of `.d.ts` files, which are meant to be copied to the build directory alongside `.js` files prior to publishing, because `tinyglobby`, unlike `glob`, defaults to producing relative paths, breaking a `filePath.replace()`. This affected 0.83.4, 0.84.0 and 0.84.1. This restores it, we'll backport to 0.83. Changelog: ``` - **[Fix]**: Restore accidentally removed publication of TypeScript types ``` Differential Revision: D94666464 --- scripts/build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 8cbff2cb61..e4116336e3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -72,8 +72,10 @@ function buildPackage(p /*: string */) { const typesDir = path.resolve(p, TYPES_DIR); const buildDir = path.resolve(p, BUILD_DIR); const pattern = path.resolve(srcDir, '**/*'); - const files = globSync(pattern, {onlyFiles: true}); - const typescriptDefs = globSync(path.join(typesDir, '**/*.d.ts')); + const files = globSync(pattern, {absolute: true, onlyFiles: true}); + const typescriptDefs = globSync(path.join(typesDir, '**/*.d.ts'), { + absolute: true, + }); process.stdout.write(fixedWidth(`${path.basename(p)}\n`));