expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.61k stars 477 forks source link

`expo export` support plaform configuration in config #2678

Closed petrleocompel closed 3 years ago

petrleocompel commented 3 years ago

Description

export ignores platforms from app.json.

Expected Behavior

export command will look in app.json on plaforms and builds only supported platforms

Observed Behavior

export command builds ios and android. No matter what.

➜ yarn export
yarn run v1.22.4
$ expo export -p https://demo.expo.io
Starting Metro Bundler.
Building iOS bundle
Building Android bundle
Finished building JavaScript bundle in 10908ms.
Building source maps
Finished building JavaScript bundle in 7190ms.
Finished building JavaScript bundle in 92ms.
Building asset maps
Finished building JavaScript bundle in 76ms.
Finished building JavaScript bundle in 496ms.
Finished building JavaScript bundle in 491ms.
Finished saving JS Bundles.
Analyzing assets
Saving assets
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/AntDesign.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Entypo.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Entypo.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/EvilIcons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/EvilIcons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Feather.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Feather.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Fontisto.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Fontisto.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/FontAwesome.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/FontAwesome5Free.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/FontAwesome5Free_meta.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Foundation.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Foundation.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Ionicons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Ionicons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/MaterialCommunityIcons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialIcons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/MaterialIcons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Octicons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Octicons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/SimpleLineIcons.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/SimpleLineIcons.json
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Zocial.ttf
saving /node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Zocial.json
saving /assets/splash.png
saving /assets/icon.png
Files successfully saved.

Processing asset bundle patterns:
- /Users/petrleocompel/tmp/expo-export-platform-issue/**/*
Export was successful. Your exported files can be found in dist
✨  Done in 26.82s.

Environment

➜ expo diagnostics

  Expo CLI 3.27.7 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.4.0 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.4 - /usr/local/bin/npm
    Managers:
      CocoaPods: 1.9.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
      Android SDK:
        API Levels: 23, 25, 26, 27, 28, 29
        Build Tools: 26.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.2
    IDEs:
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~39.0.2 => 39.0.2
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.2.tar.gz => 0.63.2
      react-native-web: ~0.13.12 => 0.13.13
    Expo Workflow: managed

Reproducible Demo

Repo here -> https://github.com/petrleocompel/expo-export-platform-issue Only needed thing to reproduce is to change platforms in app.json and run expo export.

petrleocompel commented 3 years ago

I would try to help if somebody would point me in right direction. :slightly_frowning_face:

petrleocompel commented 3 years ago

bump - No response after such a long time.... Dont wanna get it stale.

EvanBacon commented 3 years ago

I think we'd rather have something like expo export --platform android since this would line up with the eas build command, and eject, prebuild, future bundle command...

petrleocompel commented 3 years ago

That is acceptable. I don’t know if that makes sense when platform won’t be listed in app.json but thats up to somebody else.

If command parameter would exist i would be still happy 😊