From ec0f971b457ca25361725fa1abd4f4937ca61bd1 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Thu, 28 Mar 2024 17:00:18 +0100 Subject: [PATCH] fix(cli): avoid building `__typetests__` files (#27089) # Why During load-time benchmarking of individual files, I noticed we are building `__typetests__` into the `build` directory of the cli. This would then be included in the release itself. See https://cdn.jsdelivr.net/npm/@expo/cli@0.17.5/build/src/start/server/type-generation/__typetests__/ # How - Exclude `**/__typetests__/**` when building with SWC # Test Plan Minor change, and testable through `npm pack`. Make sure `build` does not include the `__typetests__` folder. # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --- packages/@expo/cli/CHANGELOG.md | 1 + packages/@expo/cli/taskfile.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@expo/cli/CHANGELOG.md b/packages/@expo/cli/CHANGELOG.md index b159da4d58bcf..651b05cd9fd03 100644 --- a/packages/@expo/cli/CHANGELOG.md +++ b/packages/@expo/cli/CHANGELOG.md @@ -36,6 +36,7 @@ - Update to remove `ExpoRequest/ExpoResponse` imports from `@expo/server`. ([#27261](https://github.com/expo/expo/pull/27261) by [@kitten](https://github.com/kitten)) - Update the legacy inspector overrides to new device middleware API. ([#27425](https://github.com/expo/expo/pull/27425) by [@byCedric](https://github.com/byCedric)) - Add new telemetry API to replace legacy analytics. ([#27787](https://github.com/expo/expo/pull/27787) by [@byCedric](https://github.com/byCedric)) +- Skip building and packing `__typetests__` files. ([#27089](https://github.com/expo/expo/pull/27089) by [@byCedric](https://github.com/byCedric)) ### 📚 3rd party library updates diff --git a/packages/@expo/cli/taskfile.js b/packages/@expo/cli/taskfile.js index 67be998d578a5..2905216f86902 100644 --- a/packages/@expo/cli/taskfile.js +++ b/packages/@expo/cli/taskfile.js @@ -11,7 +11,7 @@ export async function bin(task, opts) { export async function cli(task, opts) { await task .source('src/**/*.+(js|ts)', { - ignore: ['**/__tests__/**', '**/__mocks__/**'], + ignore: ['**/__tests__/**', '**/__mocks__/**', '**/__typetests__/**'], }) .swc('cli', { dev: opts.dev }) .target('build/src');