IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

[FEATURE] Add validation for authoring app_id values in config (android and iOS) #2268

Open jfmcquade opened 3 months ago

jfmcquade commented 3 months ago

What? Follow-up to #2256, see this comment thread.

Authors supply a value for app_id in the deployment config, one for each target native platform (android.app_id and ios.app_id). Validation should be applied to these strings so that an error is thrown if the string does not fit the naming rules for the respective platforms (android and ios).

Why? Currently (as of #2256), authors can enter a value for ios.app_id that contains underscores, which will be replaced with hyphens when populating the android config files. However, it could cause some confusion if the value of io.app_id as it appears in the deployment config file does not match the value as appears in App Store Connect.

How? The validation should probably take place as part of the yarn workflow <platform> configure action.

Possible regexes: Android: ^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$ iOS: ^[a-zA-Z][a-zA-Z0-9]*(\.[a-zA-Z0-9-]+)+$