Skip to content

Commit

Permalink
fix(cli): avoid building __typetests__ files (#27089)
Browse files Browse the repository at this point in the history
# 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

<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->

- [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).
  • Loading branch information
byCedric committed Mar 28, 2024
1 parent a4df766 commit ec0f971
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@expo/cli/CHANGELOG.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/@expo/cli/taskfile.js
Expand Up @@ -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');
Expand Down

0 comments on commit ec0f971

Please sign in to comment.