Skip to content

feature(cli): improve prebuild for arbitrary template platforms#22201

Merged
byCedric merged 8 commits intomainfrom
@bycedric/cli/prebuild-improve-platform-handling
Apr 20, 2023
Merged

feature(cli): improve prebuild for arbitrary template platforms#22201
byCedric merged 8 commits intomainfrom
@bycedric/cli/prebuild-improve-platform-handling

Conversation

@byCedric
Copy link
Copy Markdown
Member

@byCedric byCedric commented Apr 20, 2023

Why

This should improve users who have custom platforms for prebuild, like tvos.

How

  • Lifted the limitation on the expo prebuild --platform flag
  • Check if the template has ./${platform} folder before copying files over

Examples

Platforms existing in the template image
Platforms not existing in the template image

Test Plan

  • $ yarn create expo-app ./test-platforms
  • $ cd ./test-platforms
  • $ yarn expo prebuild --platform windows --template https://github.com/microsoft/react-native-windows-samples/tree/main/samples/AppServiceDemo

The last step should use the ./windows folder from the AppServiceDemo as template files inside this project.

If there are any plugins defined for that platform, they should be picked up automatically.

Checklist

@byCedric byCedric requested a review from EvanBacon as a code owner April 20, 2023 16:33
@byCedric byCedric changed the title @bycedric/cli/prebuild improve platform handling refactor(cli): improve prebuild for arbirtrary template platforms Apr 20, 2023
@byCedric byCedric changed the title refactor(cli): improve prebuild for arbirtrary template platforms refactor(cli): improve prebuild for arbitrary template platforms Apr 20, 2023
@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 20, 2023
@byCedric byCedric marked this pull request as draft April 20, 2023 16:41
@byCedric byCedric changed the title refactor(cli): improve prebuild for arbitrary template platforms feature(cli): improve prebuild for arbitrary template platforms Apr 20, 2023
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 20, 2023
@byCedric byCedric marked this pull request as ready for review April 20, 2023 17:25
@byCedric byCedric merged commit 5492d26 into main Apr 20, 2023
@byCedric byCedric deleted the @bycedric/cli/prebuild-improve-platform-handling branch April 20, 2023 19:49
byCedric added a commit that referenced this pull request Apr 21, 2023
… unknown platforms (#22224)

# Why

Follow-up of #22201

# How

When using arbitrary platforms, like `foobar`, the sort order is not
defined. This results in errors like:


![image](https://user-images.githubusercontent.com/1203991/233685476-24afd065-77a5-4f39-9d09-a49c20dd7b4f.png)

Instead, this change adds a default sorting order of `['dangerous']`
when using arbitrary platforms.

# Test Plan

- Clone the example repository:
https://github.com/byCedric/custom-prebuild-example
- Create a tarball from template `$ cd ./template && npm pack`
- Run `$ expo prebuild --platform macos --template
../template/custom-prebuild-template-1.0.0.tgz`

This should not fail as the screenshot above.

# Checklist

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

- [ ] 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 `expo prebuild` & EAS Build (eg:
updated a module plugin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: passed checks ExpoBot has nothing to complain about

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants