xref: /expo/packages/@expo/cli/src/utils/env.ts (revision 98ecfc87)
1import { boolish, int, string } from 'getenv';
2
3/** Skip warning users about a dirty git status */
4export const EXPO_NO_GIT_STATUS = boolish('EXPO_NO_GIT_STATUS', false);
5
6/** Enable profiling metrics */
7export const EXPO_PROFILE = boolish('EXPO_PROFILE', false);
8
9/** Enable debug logging */
10export const EXPO_DEBUG = boolish('EXPO_DEBUG', false);
11
12/** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */
13export const EXPO_BETA = boolish('EXPO_BETA', false);
14
15/** Enable staging API environment */
16export const EXPO_STAGING = boolish('EXPO_STAGING', false);
17
18/** Enable local API environment */
19export const EXPO_LOCAL = boolish('EXPO_LOCAL', false);
20
21/** Is running in non-interactive CI mode */
22export const CI = boolish('CI', false);
23
24/** Disable telemetry (analytics) */
25export const EXPO_NO_TELEMETRY = boolish('EXPO_NO_TELEMETRY', false);
26
27/** local directory to the universe repo for testing locally */
28export const EXPO_UNIVERSE_DIR = string('EXPO_UNIVERSE_DIR', '');
29
30/** @deprecated Default Webpack host string */
31export const WEB_HOST = string('WEB_HOST', '0.0.0.0');
32
33// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP
34
35// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD
36
37class Env {
38  /** Disable auto web setup */
39  get EXPO_NO_WEB_SETUP() {
40    return boolish('EXPO_NO_WEB_SETUP', false);
41  }
42  /** Disable auto TypeScript setup */
43  get EXPO_NO_TYPESCRIPT_SETUP() {
44    return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);
45  }
46  /** Disable all API caches. Does not disable bundler caches. */
47  get EXPO_NO_CACHE() {
48    return boolish('EXPO_NO_CACHE', false);
49  }
50  /** Enable the experimental interstitial app select page. */
51  get EXPO_ENABLE_INTERSTITIAL_PAGE() {
52    return boolish('EXPO_ENABLE_INTERSTITIAL_PAGE', false);
53  }
54  /** The React Metro port that's baked into react-native scripts and tools. */
55  get RCT_METRO_PORT() {
56    return int('RCT_METRO_PORT', 0);
57  }
58}
59
60export const env = new Env();
61