diff --git a/src/env.ts b/src/env/common.ts similarity index 100% rename from src/env.ts rename to src/env/common.ts diff --git a/src/env/index.ts b/src/env/index.ts new file mode 100644 index 0000000000..fa7e85f5b1 --- /dev/null +++ b/src/env/index.ts @@ -0,0 +1,20 @@ +import {nativeBuildVersion} from 'expo-application' + +import packageJson from '#/../package.json' +import {BUNDLE_IDENTIFIER, IS_TESTFLIGHT} from '#/env/common' + +export * from '#/env/common' + +/** + * The semver version of the app, specified in our `package.json`.file. On + * iOs/Android, the native build version is appended to the semver version, so + * that it can be used to identify a specific build. + */ +export const APP_VERSION = `${packageJson.version}.${nativeBuildVersion}` + +/** + * The short commit hash and environment of the current bundle. + */ +export const APP_METADATA = `${BUNDLE_IDENTIFIER} (${ + __DEV__ ? 'dev' : IS_TESTFLIGHT ? 'tf' : 'prod' +})` diff --git a/src/env/index.web.ts b/src/env/index.web.ts new file mode 100644 index 0000000000..575bf50daa --- /dev/null +++ b/src/env/index.web.ts @@ -0,0 +1,16 @@ +import packageJson from '#/../package.json' +import {BUNDLE_IDENTIFIER} from '#/env/common' + +export * from '#/env/common' + +/** + * The semver version of the app, specified in our `package.json`.file. On + * iOs/Android, the native build version is appended to the semver version, so + * that it can be used to identify a specific build. + */ +export const APP_VERSION = packageJson.version + +/** + * The short commit hash and environment of the current bundle. + */ +export const APP_METADATA = `${BUNDLE_IDENTIFIER} (${__DEV__ ? 'dev' : 'prod'})`