expo-constants 12.1.3 → 13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,39 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 13.0.2 — 2022-02-01
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 13.0.1 — 2022-01-20
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Fix the `PhaseScriptExecution` build errors when the `source_login_scripts.sh` failed to load. ([#15890](https://github.com/expo/expo/pull/15890) by [@kudo](https://github.com/kudo))
24
+
25
+ ## 13.0.0 — 2021-12-03
26
+
27
+ ### 🛠 Breaking changes
28
+
29
+ - Remove deprecated `Constants.deviceId`. ([#15280](https://github.com/expo/expo/pull/15280) by [@Simek](https://github.com/Simek))
30
+ - Remove legacy `Constants.linkingUrl` alias. ([#15280](https://github.com/expo/expo/pull/15280) by [@Simek](https://github.com/Simek))
31
+
32
+ ### 💡 Others
33
+
34
+ - Add missing `null` to the `Constants.buildNumber` type. ([#15280](https://github.com/expo/expo/pull/15280) by [@Simek](https://github.com/Simek))
35
+
36
+ ## 12.2.0 — 2021-11-17
37
+
38
+ ### 🐛 Bug fixes
39
+
40
+ - Fix NODE_BINARY not found build error when using nvm via zsh ([#14895](https://github.com/expo/expo/pull/14895) by [@filipengberg](https://github.com/filipengberg))
41
+
42
+ ### 💡 Others
43
+
44
+ - Extract nested objects from current types to new, separate types - `ExpoGoPackagerOpts` and `ManifestExtra`. ([#15113](https://github.com/expo/expo/pull/15113) by [@Simek](https://github.com/Simek))
45
+
13
46
  ## 12.1.3 — 2021-10-22
14
47
 
15
48
  ### 🐛 Bug fixes
@@ -1,9 +1,9 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '12.1.3'
6
+ version = '13.0.2'
7
7
 
8
8
  apply from: "../scripts/get-app-config-android.gradle"
9
9
 
@@ -22,27 +22,25 @@ buildscript {
22
22
  }
23
23
  }
24
24
 
25
- //Upload android library to maven with javadoc and android sources
26
- configurations {
27
- deployerJars
28
- }
29
-
30
- //Creating sources with comments
25
+ // Creating sources with comments
31
26
  task androidSourcesJar(type: Jar) {
32
27
  classifier = 'sources'
33
28
  from android.sourceSets.main.java.srcDirs
34
29
  }
35
30
 
36
- //Put the androidSources and javadoc to the artifacts
37
- artifacts {
38
- archives androidSourcesJar
39
- }
40
-
41
- uploadArchives {
42
- repositories {
43
- mavenDeployer {
44
- configuration = configurations.deployerJars
45
- repository(url: mavenLocal().url)
31
+ afterEvaluate {
32
+ publishing {
33
+ publications {
34
+ release(MavenPublication) {
35
+ from components.release
36
+ // Add additional sourcesJar to artifacts
37
+ artifact(androidSourcesJar)
38
+ }
39
+ }
40
+ repositories {
41
+ maven {
42
+ url = mavenLocal().url
43
+ }
46
44
  }
47
45
  }
48
46
  }
@@ -63,7 +61,7 @@ android {
63
61
  minSdkVersion safeExtGet("minSdkVersion", 21)
64
62
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
65
63
  versionCode 33
66
- versionName "12.1.3"
64
+ versionName "13.0.2"
67
65
  }
68
66
  lintOptions {
69
67
  abortOnError false
@@ -41,59 +41,28 @@ if (!rawManifest && ExponentConstants && ExponentConstants.manifest) {
41
41
  const { name, appOwnership, ...nativeConstants } = (ExponentConstants || {});
42
42
  let warnedAboutDeviceYearClass = false;
43
43
  let warnedAboutIosModel = false;
44
- let warnedAboutInstallationId = false;
45
- let warnedAboutDeviceId = false;
46
- let warnedAboutLinkingUrl = false;
47
44
  const constants = {
48
45
  ...nativeConstants,
49
46
  // Ensure this is null in bare workflow
50
47
  appOwnership: appOwnership ?? null,
51
48
  };
52
- const constantsPropertiesGetter = {
53
- // Deprecated fields
54
- deviceYearClass() {
55
- if (!warnedAboutDeviceYearClass) {
56
- console.warn(`Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`);
57
- warnedAboutDeviceYearClass = true;
58
- }
59
- return nativeConstants.deviceYearClass;
60
- },
61
- // Deprecated fields
62
- installationId() {
63
- if (!warnedAboutInstallationId) {
64
- console.warn(`Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`);
65
- warnedAboutInstallationId = true;
66
- }
67
- return nativeConstants.installationId;
68
- },
69
- // Legacy aliases
70
- deviceId() {
71
- if (!warnedAboutDeviceId) {
72
- console.warn(`Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`);
73
- warnedAboutDeviceId = true;
74
- }
75
- return nativeConstants.installationId;
76
- },
77
- linkingUrl() {
78
- if (!warnedAboutLinkingUrl) {
79
- console.warn(`Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`);
80
- warnedAboutLinkingUrl = true;
81
- }
82
- return nativeConstants.linkingUri;
83
- },
84
- manifest() {
85
- const maybeManifest = getManifest();
86
- if (!maybeManifest || !isAppManifest(maybeManifest)) {
87
- return null;
88
- }
89
- return maybeManifest;
49
+ Object.defineProperties(constants, {
50
+ // Deprecated field
51
+ deviceYearClass: {
52
+ get() {
53
+ if (!warnedAboutDeviceYearClass) {
54
+ console.warn(`Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`);
55
+ warnedAboutDeviceYearClass = true;
56
+ }
57
+ return nativeConstants.deviceYearClass;
58
+ },
59
+ enumerable: false,
90
60
  },
91
- manifest2() {
92
- const maybeManifest = getManifest();
93
- if (!maybeManifest || !isManifest(maybeManifest)) {
94
- return null;
95
- }
96
- return maybeManifest;
61
+ installationId: {
62
+ get() {
63
+ return nativeConstants.installationId;
64
+ },
65
+ enumerable: false,
97
66
  },
98
67
  /**
99
68
  * Use `manifest` property by default.
@@ -101,54 +70,70 @@ const constantsPropertiesGetter = {
101
70
  * It behaves similarly to the original one, but suppresses warning upon no manifest available.
102
71
  * `expo-asset` uses it to prevent users from seeing mentioned warning.
103
72
  */
104
- __unsafeNoWarnManifest() {
105
- const maybeManifest = getManifest(true);
106
- if (!maybeManifest || !isAppManifest(maybeManifest)) {
107
- return null;
108
- }
109
- return maybeManifest;
73
+ __unsafeNoWarnManifest: {
74
+ get() {
75
+ const maybeManifest = getManifest(true);
76
+ if (!maybeManifest || !isAppManifest(maybeManifest)) {
77
+ return null;
78
+ }
79
+ return maybeManifest;
80
+ },
81
+ enumerable: false,
110
82
  },
111
- __unsafeNoWarnManifest2() {
112
- const maybeManifest = getManifest(true);
113
- if (!maybeManifest || !isManifest(maybeManifest)) {
114
- return null;
115
- }
116
- return maybeManifest;
83
+ __unsafeNoWarnManifest2: {
84
+ get() {
85
+ const maybeManifest = getManifest(true);
86
+ if (!maybeManifest || !isManifest(maybeManifest)) {
87
+ return null;
88
+ }
89
+ return maybeManifest;
90
+ },
91
+ enumerable: false,
117
92
  },
118
- };
119
- definePropertiesGetter(constants, constantsPropertiesGetter);
120
- Object.defineProperty(constants, '__rawManifest_TEST', {
121
- get() {
122
- return rawManifest;
93
+ manifest: {
94
+ get() {
95
+ const maybeManifest = getManifest();
96
+ if (!maybeManifest || !isAppManifest(maybeManifest)) {
97
+ return null;
98
+ }
99
+ return maybeManifest;
100
+ },
101
+ enumerable: true,
123
102
  },
124
- set(value) {
125
- rawManifest = value;
103
+ manifest2: {
104
+ get() {
105
+ const maybeManifest = getManifest();
106
+ if (!maybeManifest || !isManifest(maybeManifest)) {
107
+ return null;
108
+ }
109
+ return maybeManifest;
110
+ },
111
+ enumerable: true,
112
+ },
113
+ __rawManifest_TEST: {
114
+ get() {
115
+ return rawManifest;
116
+ },
117
+ set(value) {
118
+ rawManifest = value;
119
+ },
120
+ enumerable: false,
126
121
  },
127
- // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
128
- enumerable: false,
129
122
  });
130
123
  // Add deprecation warning for `platform.ios.model`
131
124
  if (constants?.platform?.ios) {
132
125
  const originalModel = nativeConstants.platform.ios.model;
133
- definePropertiesGetter(constants.platform.ios, {
134
- model() {
126
+ Object.defineProperty(constants.platform.ios, 'model', {
127
+ get() {
135
128
  if (!warnedAboutIosModel) {
136
129
  console.warn(`Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`);
137
130
  warnedAboutIosModel = true;
138
131
  }
139
132
  return originalModel;
140
133
  },
134
+ enumerable: false,
141
135
  });
142
136
  }
143
- function definePropertiesGetter(target, props) {
144
- for (const [name, func] of Object.entries(props)) {
145
- Object.defineProperty(target, name, {
146
- get: func,
147
- // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
148
- enumerable: false,
149
- });
150
- }
151
- }
152
137
  function isAppManifest(manifest) {
153
138
  return !isManifest(manifest);
154
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAGL,YAAY,EAEZ,oBAAoB,EAKpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAEL,YAAY,EAEZ,oBAAoB,EAIpB,kBAAkB,GAEnB,CAAC;AAEF,IAAI,CAAC,iBAAiB,EAAE;IACtB,OAAO,CAAC,IAAI,CACV,wGAAwG,CACzG,CAAC;CACH;AAED,IAAI,WAAW,GAAkC,IAAI,CAAC;AACtD,gEAAgE;AACh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AC;KACF,CAAC,CAAC;CACJ;AAGD,SAAS,sBAAsB,CAAC,MAAc,EAAE,KAAoB;IAClE,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAChD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE;YAClC,GAAG,EAAE,IAAI;YACT,sHAAsH;YACtH,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAgC;IACrD,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,UAAU,CAAC,QAAgC;IAClD,OAAO,UAAU,IAAI,QAAQ,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,eAAe,GAAG,KAAK;IAC1C,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,mBAAmB,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;QACxE,IACE,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,IAAI;YAClE,QAAQ,CAAC,EAAE,KAAK,KAAK,EACrB;YACA,IAAI,CAAC,eAAe,EAAE;gBACpB,OAAO,CAAC,IAAI,CACV,yBAAyB,mBAAmB,kKAAkK,CAC/M,CAAC;aACH;SACF;aAAM,IACL,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,WAAW;YACzE,eAAe,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,UAAU,EACxE;YACA,sEAAsE;YACtE,mEAAmE;YACnE,MAAM,IAAI,UAAU,CAClB,oCAAoC,EACpC,yBAAyB,mBAAmB,sBAAsB,CACnE,CAAC;SACH;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,SAAsB,CAAC","sourcesContent":["import { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n Manifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n};\n\nif (!ExponentConstants) {\n console.warn(\n \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n );\n}\n\nlet rawManifest: AppManifest | Manifest | null = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n let updatesManifest;\n if (NativeModulesProxy.ExpoUpdates.manifest) {\n updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n }\n if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n rawManifest = updatesManifest;\n }\n}\n\n// If dev-launcher defines a non-empty manifest, prefer that one\nif (NativeModules.EXDevLauncher) {\n let devLauncherManifest;\n if (NativeModules.EXDevLauncher.manifestString) {\n devLauncherManifest = JSON.parse(NativeModules.EXDevLauncher.manifestString);\n }\n\n if (devLauncherManifest && Object.keys(devLauncherManifest).length > 0) {\n rawManifest = devLauncherManifest;\n }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!rawManifest && ExponentConstants && ExponentConstants.manifest) {\n rawManifest = ExponentConstants.manifest;\n // On Android we pass the manifest in JSON form so this step is necessary\n if (typeof rawManifest === 'string') {\n rawManifest = JSON.parse(rawManifest);\n }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nlet warnedAboutDeviceYearClass = false;\nlet warnedAboutIosModel = false;\nlet warnedAboutInstallationId = false;\nlet warnedAboutDeviceId = false;\nlet warnedAboutLinkingUrl = false;\n\nconst constants: Constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n};\n\nconst constantsPropertiesGetter: AccessorProps = {\n // Deprecated fields\n deviceYearClass() {\n if (!warnedAboutDeviceYearClass) {\n console.warn(\n `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`\n );\n warnedAboutDeviceYearClass = true;\n }\n return nativeConstants.deviceYearClass;\n },\n // Deprecated fields\n installationId() {\n if (!warnedAboutInstallationId) {\n console.warn(\n `Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`\n );\n warnedAboutInstallationId = true;\n }\n return nativeConstants.installationId;\n },\n // Legacy aliases\n deviceId() {\n if (!warnedAboutDeviceId) {\n console.warn(\n `Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`\n );\n warnedAboutDeviceId = true;\n }\n return nativeConstants.installationId;\n },\n linkingUrl() {\n if (!warnedAboutLinkingUrl) {\n console.warn(\n `Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`\n );\n warnedAboutLinkingUrl = true;\n }\n return nativeConstants.linkingUri;\n },\n manifest(): AppManifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n manifest2(): Manifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n /**\n * Use `manifest` property by default.\n * This property is only used for internal purposes.\n * It behaves similarly to the original one, but suppresses warning upon no manifest available.\n * `expo-asset` uses it to prevent users from seeing mentioned warning.\n */\n __unsafeNoWarnManifest(): AppManifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n __unsafeNoWarnManifest2(): Manifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n};\ndefinePropertiesGetter(constants, constantsPropertiesGetter);\n\nObject.defineProperty(constants, '__rawManifest_TEST', {\n get(): AppManifest | Manifest | null {\n return rawManifest;\n },\n set(value: AppManifest | Manifest | null) {\n rawManifest = value;\n },\n // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.\n enumerable: false,\n});\n\n// Add deprecation warning for `platform.ios.model`\nif (constants?.platform?.ios) {\n const originalModel = nativeConstants.platform.ios.model;\n definePropertiesGetter(constants.platform.ios, {\n model() {\n if (!warnedAboutIosModel) {\n console.warn(\n `Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`\n );\n warnedAboutIosModel = true;\n }\n return originalModel;\n },\n });\n}\n\ntype AccessorProps = Record<string, () => any>;\nfunction definePropertiesGetter(target: object, props: AccessorProps) {\n for (const [name, func] of Object.entries(props)) {\n Object.defineProperty(target, name, {\n get: func,\n // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.\n enumerable: false,\n });\n }\n}\n\nfunction isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {\n return !isManifest(manifest);\n}\n\nfunction isManifest(manifest: AppManifest | Manifest): manifest is Manifest {\n return 'metadata' in manifest;\n}\n\nfunction getManifest(suppressWarning = false): AppManifest | Manifest | null {\n if (!rawManifest) {\n const invalidManifestType = rawManifest === null ? 'null' : 'undefined';\n if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n Platform.OS !== 'web'\n ) {\n if (!suppressWarning) {\n console.warn(\n `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n );\n }\n } else if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n ) {\n // If we somehow get here, this is a truly exceptional state to be in.\n // Constants.manifest should *always* be defined in those contexts.\n throw new CodedError(\n 'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n `Constants.manifest is ${invalidManifestType}, must be an object.`\n );\n }\n }\n return rawManifest;\n}\n\nexport default constants as Constants;\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAGL,YAAY,EAEZ,oBAAoB,EAKpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAEL,YAAY,EAEZ,oBAAoB,EAIpB,kBAAkB,GAEnB,CAAC;AAEF,IAAI,CAAC,iBAAiB,EAAE;IACtB,OAAO,CAAC,IAAI,CACV,wGAAwG,CACzG,CAAC;CACH;AAED,IAAI,WAAW,GAAkC,IAAI,CAAC;AACtD,gEAAgE;AAChE,IAAI,kBAAkB,CAAC,WAAW,EAAE;IAClC,IAAI,eAAe,CAAC;IACpB,IAAI,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE;QAC3C,eAAe,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC;KAC3D;SAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,cAAc,EAAE;QACxD,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;KAC7E;IACD,IAAI,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9D,WAAW,GAAG,eAAe,CAAC;KAC/B;CACF;AAED,gEAAgE;AACh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CAAC","sourcesContent":["import { CodedError, NativeModulesProxy } from 'expo-modules-core';\nimport { Platform, NativeModules } from 'react-native';\n\nimport {\n AndroidManifest,\n AppManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n Manifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n AndroidManifest,\n AppOwnership,\n Constants,\n ExecutionEnvironment,\n IOSManifest,\n NativeConstants,\n PlatformManifest,\n UserInterfaceIdiom,\n WebManifest,\n};\n\nif (!ExponentConstants) {\n console.warn(\n \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n );\n}\n\nlet rawManifest: AppManifest | Manifest | null = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n let updatesManifest;\n if (NativeModulesProxy.ExpoUpdates.manifest) {\n updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n }\n if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n rawManifest = updatesManifest;\n }\n}\n\n// If dev-launcher defines a non-empty manifest, prefer that one\nif (NativeModules.EXDevLauncher) {\n let devLauncherManifest;\n if (NativeModules.EXDevLauncher.manifestString) {\n devLauncherManifest = JSON.parse(NativeModules.EXDevLauncher.manifestString);\n }\n\n if (devLauncherManifest && Object.keys(devLauncherManifest).length > 0) {\n rawManifest = devLauncherManifest;\n }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!rawManifest && ExponentConstants && ExponentConstants.manifest) {\n rawManifest = ExponentConstants.manifest;\n // On Android we pass the manifest in JSON form so this step is necessary\n if (typeof rawManifest === 'string') {\n rawManifest = JSON.parse(rawManifest);\n }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nlet warnedAboutDeviceYearClass = false;\nlet warnedAboutIosModel = false;\n\nconst constants: Constants = {\n ...nativeConstants,\n // Ensure this is null in bare workflow\n appOwnership: appOwnership ?? null,\n};\n\nObject.defineProperties(constants, {\n // Deprecated field\n deviceYearClass: {\n get() {\n if (!warnedAboutDeviceYearClass) {\n console.warn(\n `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`\n );\n warnedAboutDeviceYearClass = true;\n }\n return nativeConstants.deviceYearClass;\n },\n enumerable: false,\n },\n installationId: {\n get() {\n return nativeConstants.installationId;\n },\n enumerable: false,\n },\n /**\n * Use `manifest` property by default.\n * This property is only used for internal purposes.\n * It behaves similarly to the original one, but suppresses warning upon no manifest available.\n * `expo-asset` uses it to prevent users from seeing mentioned warning.\n */\n __unsafeNoWarnManifest: {\n get(): AppManifest | Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n __unsafeNoWarnManifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest(true);\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: false,\n },\n manifest: {\n get(): AppManifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isAppManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n manifest2: {\n get(): Manifest | null {\n const maybeManifest = getManifest();\n if (!maybeManifest || !isManifest(maybeManifest)) {\n return null;\n }\n return maybeManifest;\n },\n enumerable: true,\n },\n __rawManifest_TEST: {\n get(): AppManifest | Manifest | null {\n return rawManifest;\n },\n set(value: AppManifest | Manifest | null) {\n rawManifest = value;\n },\n enumerable: false,\n },\n});\n\n// Add deprecation warning for `platform.ios.model`\nif (constants?.platform?.ios) {\n const originalModel = nativeConstants.platform.ios.model;\n Object.defineProperty(constants.platform.ios, 'model', {\n get() {\n if (!warnedAboutIosModel) {\n console.warn(\n `Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`\n );\n warnedAboutIosModel = true;\n }\n return originalModel;\n },\n enumerable: false,\n });\n}\n\nfunction isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {\n return !isManifest(manifest);\n}\n\nfunction isManifest(manifest: AppManifest | Manifest): manifest is Manifest {\n return 'metadata' in manifest;\n}\n\nfunction getManifest(suppressWarning = false): AppManifest | Manifest | null {\n if (!rawManifest) {\n const invalidManifestType = rawManifest === null ? 'null' : 'undefined';\n if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n Platform.OS !== 'web'\n ) {\n if (!suppressWarning) {\n console.warn(\n `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n );\n }\n } else if (\n nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n ) {\n // If we somehow get here, this is a truly exceptional state to be in.\n // Constants.manifest should *always* be defined in those contexts.\n throw new CodedError(\n 'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n `Constants.manifest is ${invalidManifestType}, must be an object.`\n );\n }\n }\n return rawManifest;\n}\n\nexport default constants as Constants;\n"]}
@@ -1,7 +1,16 @@
1
1
  import { ExpoConfig } from '@expo/config-types';
2
2
  export declare enum AppOwnership {
3
+ /**
4
+ * It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
5
+ */
3
6
  Standalone = "standalone",
7
+ /**
8
+ * The experience is running inside of the Expo Go app.
9
+ */
4
10
  Expo = "expo",
11
+ /**
12
+ * It has been opened through a link from a standalone app.
13
+ */
5
14
  Guest = "guest"
6
15
  }
7
16
  export declare enum ExecutionEnvironment {
@@ -9,23 +18,53 @@ export declare enum ExecutionEnvironment {
9
18
  Standalone = "standalone",
10
19
  StoreClient = "storeClient"
11
20
  }
21
+ /**
22
+ * Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
23
+ * as `unsupported`.
24
+ */
12
25
  export declare enum UserInterfaceIdiom {
13
26
  Handset = "handset",
14
27
  Tablet = "tablet",
15
28
  Unsupported = "unsupported"
16
29
  }
17
30
  export interface IOSManifest {
18
- buildNumber: string;
31
+ /**
32
+ * The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.
33
+ * In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This
34
+ * may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest
35
+ * can be updated, whereas this value will never change for a given native binary.
36
+ * The value is set to `null` in case you run your app in Expo Go.
37
+ */
38
+ buildNumber: string | null;
39
+ /**
40
+ * The Apple internal model identifier for this device, e.g. `iPhone1,1`.
41
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).
42
+ */
19
43
  platform: string;
20
44
  /**
21
- * @deprecated Moved to `expo-device` - `Device.modelName`
45
+ * The human-readable model name of this device, e.g. `"iPhone 7 Plus"` if it can be determined,
46
+ * otherwise will be `null`.
47
+ * @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).
22
48
  */
23
49
  model: string | null;
50
+ /**
51
+ * The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.
52
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).
53
+ */
24
54
  userInterfaceIdiom: UserInterfaceIdiom;
55
+ /**
56
+ * The version of iOS running on this device, e.g. `10.3`.
57
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).
58
+ */
25
59
  systemVersion: string;
26
60
  [key: string]: any;
27
61
  }
28
62
  export interface AndroidManifest {
63
+ /**
64
+ * The version code set by `android.versionCode` in app.json.
65
+ * The value is set to `null` in case you run your app in Expo Go.
66
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
67
+ */
29
68
  versionCode: number;
30
69
  [key: string]: any;
31
70
  }
@@ -45,16 +84,17 @@ export declare type Manifest = {
45
84
  launchAsset: ManifestAsset;
46
85
  assets: ManifestAsset[];
47
86
  metadata: object;
48
- extra?: ClientScopingConfig & {
49
- expoClient?: ExpoClientConfig;
50
- expoGo?: ExpoGoConfig;
51
- eas?: EASConfig;
52
- };
87
+ extra?: ManifestExtra;
88
+ };
89
+ export declare type ManifestExtra = ClientScopingConfig & {
90
+ expoClient?: ExpoClientConfig;
91
+ expoGo?: ExpoGoConfig;
92
+ eas?: EASConfig;
53
93
  };
54
94
  export declare type EASConfig = {
55
95
  /**
56
- * The ID for this project if it's using EAS. UUID. This value will not change when a project is transferred
57
- * between accounts or renamed.
96
+ * The ID for this project if it's using EAS. UUID. This value will not change when a project is
97
+ * transferred between accounts or renamed.
58
98
  */
59
99
  projectId?: string;
60
100
  };
@@ -73,19 +113,22 @@ export declare type ExpoGoConfig = {
73
113
  tool?: string;
74
114
  [key: string]: any;
75
115
  };
76
- packagerOpts?: {
77
- hostType?: string;
78
- dev?: boolean;
79
- strict?: boolean;
80
- minify?: boolean;
81
- urlType?: string;
82
- urlRandomness?: string;
83
- lanType?: string;
84
- [key: string]: any;
85
- };
116
+ packagerOpts?: ExpoGoPackagerOpts;
117
+ };
118
+ export declare type ExpoGoPackagerOpts = {
119
+ hostType?: string;
120
+ dev?: boolean;
121
+ strict?: boolean;
122
+ minify?: boolean;
123
+ urlType?: string;
124
+ urlRandomness?: string;
125
+ lanType?: string;
126
+ [key: string]: any;
86
127
  };
87
128
  export declare type ExpoClientConfig = ExpoConfig & {
88
- /** Published Apps Only */
129
+ /**
130
+ * Published apps only.
131
+ */
89
132
  releaseId?: string;
90
133
  revisionId?: string;
91
134
  releaseChannel?: string;
@@ -94,8 +137,8 @@ export declare type ExpoClientConfig = ExpoConfig & {
94
137
  publishedTime?: string;
95
138
  /**
96
139
  * The Expo account name and slug for this project.
97
- * @deprecated - Prefer `projectId` or `originalFullName` instead for identification and `scopeKey` for
98
- * scoping due to immutability.
140
+ * @deprecated Prefer `projectId` or `originalFullName` instead for identification and
141
+ * `scopeKey` for scoping due to immutability.
99
142
  */
100
143
  id?: string;
101
144
  /**
@@ -112,6 +155,7 @@ export declare type ExpoClientConfig = ExpoConfig & {
112
155
  currentFullName?: string;
113
156
  };
114
157
  /**
158
+ * @hidden
115
159
  * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest
116
160
  */
117
161
  export declare type AppManifest = ExpoClientConfig & ExpoGoConfig & EASConfig & ClientScopingConfig & {
@@ -131,34 +175,63 @@ export interface PlatformManifest {
131
175
  developer?: string;
132
176
  [key: string]: any;
133
177
  }
178
+ /**
179
+ * @hidden
180
+ */
134
181
  export interface NativeConstants {
135
182
  name: 'ExponentConstants';
183
+ /**
184
+ * Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow
185
+ * and classic builds; for apps built with EAS Build and in bare workflow, the result is
186
+ * always `null`.
187
+ */
136
188
  appOwnership: AppOwnership | null;
137
189
  debugMode: boolean;
190
+ /**
191
+ * A human-readable name for the device type.
192
+ */
138
193
  deviceName?: string;
139
194
  /**
140
- * @deprecated Moved to `expo-device` - `Device.deviceYearClass`
195
+ * The [device year class](https://github.com/facebook/device-year-class) of this device.
196
+ * @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).
141
197
  */
142
198
  deviceYearClass: number | null;
143
199
  executionEnvironment: ExecutionEnvironment;
144
200
  experienceUrl: string;
145
201
  expoRuntimeVersion: string | null;
146
202
  /**
147
- * The version string of the Expo client currently running.
203
+ * The version string of the Expo Go app currently running.
148
204
  * Returns `null` in bare workflow and web.
149
205
  */
150
206
  expoVersion: string | null;
151
207
  isDetached?: boolean;
152
208
  intentUri?: string;
153
209
  /**
154
- * @deprecated Constants.installationId is deprecated in favor of generating your own ID and
210
+ * An identifier that is unique to this particular device and whose lifetime is at least as long
211
+ * as the installation of the app.
212
+ * @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and
155
213
  * storing it. This API will be removed in SDK 44.
156
214
  */
157
215
  installationId: string;
216
+ /**
217
+ * `true` if the app is running on a device, `false` if running in a simulator or emulator.
218
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).
219
+ */
158
220
  isDevice: boolean;
159
221
  isHeadless: boolean;
160
222
  linkingUri: string;
223
+ /**
224
+ * The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set
225
+ * by `version` in app.json on Android at the time the native app was built.
226
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).
227
+ */
161
228
  nativeAppVersion: string | null;
229
+ /**
230
+ * The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in
231
+ * **app.json** in a standalone app) and the version code set by `android.versionCode` in
232
+ * **app.json** on Android at the time the native app was built.
233
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
234
+ */
162
235
  nativeBuildVersion: string | null;
163
236
  /**
164
237
  * Classic manifest for Expo apps using classic updates.
@@ -170,26 +243,37 @@ export interface NativeConstants {
170
243
  * Returns `null` in bare workflow and when `manifest` is non-null.
171
244
  */
172
245
  manifest2: Manifest | null;
246
+ /**
247
+ * A string that is unique to the current session of your app. It is different across apps and
248
+ * across multiple launches of the same app.
249
+ */
173
250
  sessionId: string;
251
+ /**
252
+ * The default status bar height for the device. Does not factor in changes when location tracking
253
+ * is in use or a phone call is active.
254
+ */
174
255
  statusBarHeight: number;
256
+ /**
257
+ * A list of the system font names available on the current device.
258
+ */
175
259
  systemFonts: string[];
176
260
  systemVersion?: number;
177
- platform?: PlatformManifest;
178
- [key: string]: any;
179
- getWebViewUserAgentAsync: () => Promise<string | null>;
180
- }
181
- export interface Constants extends NativeConstants {
182
261
  /**
183
- * @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.
184
- * This API will be removed in SDK 44.
262
+ * @hidden
185
263
  */
186
- deviceId?: string;
264
+ supportedExpoSdks?: string[];
265
+ platform?: PlatformManifest;
187
266
  /**
188
- * @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the
189
- * Linking API directly. Constants.linkingUrl will be removed in SDK 44.
267
+ * Gets the user agent string which would be included in requests sent by a web view running on
268
+ * this device. This is probably not the same user agent you might be providing in your JS `fetch`
269
+ * requests.
190
270
  */
191
- linkingUrl?: string;
271
+ getWebViewUserAgentAsync: () => Promise<string | null>;
272
+ [key: string]: any;
273
+ }
274
+ export interface Constants extends NativeConstants {
192
275
  /**
276
+ * @hidden
193
277
  * @warning do not use this property. Use `manifest` by default.
194
278
  *
195
279
  * In certain cases accessing manifest via this property
@@ -197,6 +281,7 @@ export interface Constants extends NativeConstants {
197
281
  */
198
282
  __unsafeNoWarnManifest?: AppManifest;
199
283
  /**
284
+ * @hidden
200
285
  * @warning do not use this property. Use `manifest2` by default.
201
286
  *
202
287
  * In certain cases accessing manifest via this property
@@ -1,15 +1,31 @@
1
+ // @needsAudit
1
2
  export var AppOwnership;
2
3
  (function (AppOwnership) {
4
+ /**
5
+ * It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
6
+ */
3
7
  AppOwnership["Standalone"] = "standalone";
8
+ /**
9
+ * The experience is running inside of the Expo Go app.
10
+ */
4
11
  AppOwnership["Expo"] = "expo";
12
+ /**
13
+ * It has been opened through a link from a standalone app.
14
+ */
5
15
  AppOwnership["Guest"] = "guest";
6
16
  })(AppOwnership || (AppOwnership = {}));
17
+ // @docsMissing
7
18
  export var ExecutionEnvironment;
8
19
  (function (ExecutionEnvironment) {
9
20
  ExecutionEnvironment["Bare"] = "bare";
10
21
  ExecutionEnvironment["Standalone"] = "standalone";
11
22
  ExecutionEnvironment["StoreClient"] = "storeClient";
12
23
  })(ExecutionEnvironment || (ExecutionEnvironment = {}));
24
+ // @needsAudit
25
+ /**
26
+ * Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
27
+ * as `unsupported`.
28
+ */
13
29
  export var UserInterfaceIdiom;
14
30
  (function (UserInterfaceIdiom) {
15
31
  UserInterfaceIdiom["Handset"] = "handset";
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.types.js","sourceRoot":"","sources":["../src/Constants.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,iDAAyB,CAAA;IACzB,mDAA2B,CAAA;AAC7B,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;AAC7B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport enum AppOwnership {\n Standalone = 'standalone',\n Expo = 'expo',\n Guest = 'guest',\n}\n\nexport enum ExecutionEnvironment {\n Bare = 'bare',\n Standalone = 'standalone',\n StoreClient = 'storeClient',\n}\n\nexport enum UserInterfaceIdiom {\n Handset = 'handset',\n Tablet = 'tablet',\n Unsupported = 'unsupported',\n}\n\nexport interface IOSManifest {\n buildNumber: string;\n platform: string;\n /**\n * @deprecated Moved to `expo-device` - `Device.modelName`\n */\n model: string | null;\n userInterfaceIdiom: UserInterfaceIdiom;\n systemVersion: string;\n [key: string]: any;\n}\n\nexport interface AndroidManifest {\n versionCode: number;\n [key: string]: any;\n}\n\nexport interface WebManifest {\n [key: string]: any;\n}\n\nexport interface ManifestAsset {\n url: string;\n}\n\n/**\n * A modern manifest.\n */\nexport type Manifest = {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ManifestAsset;\n assets: ManifestAsset[];\n metadata: object;\n extra?: ClientScopingConfig & {\n expoClient?: ExpoClientConfig;\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n };\n};\n\nexport type EASConfig = {\n /**\n * The ID for this project if it's using EAS. UUID. This value will not change when a project is transferred\n * between accounts or renamed.\n */\n projectId?: string;\n};\n\nexport type ClientScopingConfig = {\n /**\n * An opaque unique string for scoping client-side data to this project. This value\n * will not change when a project is transferred between accounts or renamed.\n */\n scopeKey?: string;\n};\n\nexport type ExpoGoConfig = {\n mainModuleName?: string;\n debuggerHost?: string;\n logUrl?: string;\n developer?: {\n tool?: string;\n [key: string]: any;\n };\n packagerOpts?: {\n hostType?: string;\n dev?: boolean;\n strict?: boolean;\n minify?: boolean;\n urlType?: string;\n urlRandomness?: string;\n lanType?: string;\n [key: string]: any;\n };\n};\n\nexport type ExpoClientConfig = ExpoConfig & {\n /** Published Apps Only */\n releaseId?: string;\n revisionId?: string;\n releaseChannel?: string;\n bundleUrl: string;\n hostUri?: string;\n publishedTime?: string;\n\n /**\n * The Expo account name and slug for this project.\n * @deprecated - Prefer `projectId` or `originalFullName` instead for identification and `scopeKey` for\n * scoping due to immutability.\n */\n id?: string;\n\n /**\n * The original Expo account name and slug for this project. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * will not change when a project is transferred between accounts or renamed.\n */\n originalFullName?: string;\n\n /**\n * The Expo account name and slug used for display purposes. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * may change when a project is transferred between accounts or renamed.\n */\n currentFullName?: string;\n};\n\n/**\n * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest\n */\nexport type AppManifest = ExpoClientConfig &\n ExpoGoConfig &\n EASConfig &\n ClientScopingConfig & {\n [key: string]: any;\n };\n\nexport interface PlatformManifest {\n ios?: IOSManifest;\n android?: AndroidManifest;\n web?: WebManifest;\n detach?: {\n scheme?: string;\n [key: string]: any;\n };\n logUrl?: string;\n scheme?: string;\n hostUri?: string;\n developer?: string;\n [key: string]: any;\n}\n\nexport interface NativeConstants {\n name: 'ExponentConstants';\n appOwnership: AppOwnership | null;\n debugMode: boolean;\n deviceName?: string;\n /**\n * @deprecated Moved to `expo-device` - `Device.deviceYearClass`\n */\n deviceYearClass: number | null;\n executionEnvironment: ExecutionEnvironment;\n experienceUrl: string;\n // only nullable on web\n expoRuntimeVersion: string | null;\n /**\n * The version string of the Expo client currently running.\n * Returns `null` in bare workflow and web.\n */\n expoVersion: string | null;\n isDetached?: boolean;\n intentUri?: string;\n /**\n * @deprecated Constants.installationId is deprecated in favor of generating your own ID and\n * storing it. This API will be removed in SDK 44.\n */\n installationId: string;\n isDevice: boolean;\n isHeadless: boolean;\n linkingUri: string;\n nativeAppVersion: string | null;\n nativeBuildVersion: string | null;\n /**\n * Classic manifest for Expo apps using classic updates.\n * Returns `null` in bare workflow and when `manifest2` is non-null.\n */\n manifest: AppManifest | null;\n /**\n * New manifest for Expo apps using modern Expo Updates.\n * Returns `null` in bare workflow and when `manifest` is non-null.\n */\n manifest2: Manifest | null;\n sessionId: string;\n statusBarHeight: number;\n systemFonts: string[];\n systemVersion?: number;\n platform?: PlatformManifest;\n [key: string]: any;\n\n getWebViewUserAgentAsync: () => Promise<string | null>;\n}\n\nexport interface Constants extends NativeConstants {\n /**\n * @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.\n * This API will be removed in SDK 44.\n */\n deviceId?: string;\n /**\n * @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the\n * Linking API directly. Constants.linkingUrl will be removed in SDK 44.\n */\n linkingUrl?: string;\n /**\n * @warning do not use this property. Use `manifest` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest?: AppManifest;\n /**\n * @warning do not use this property. Use `manifest2` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest2?: Manifest;\n}\n"]}
1
+ {"version":3,"file":"Constants.types.js","sourceRoot":"","sources":["../src/Constants.types.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,CAAN,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB;;OAEG;IACH,yCAAyB,CAAA;IACzB;;OAEG;IACH,6BAAa,CAAA;IACb;;OAEG;IACH,+BAAe,CAAA;AACjB,CAAC,EAbW,YAAY,KAAZ,YAAY,QAavB;AAED,eAAe;AACf,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,iDAAyB,CAAA;IACzB,mDAA2B,CAAA;AAC7B,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,cAAc;AACd;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;AAC7B,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\n// @needsAudit\nexport enum AppOwnership {\n /**\n * It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).\n */\n Standalone = 'standalone',\n /**\n * The experience is running inside of the Expo Go app.\n */\n Expo = 'expo',\n /**\n * It has been opened through a link from a standalone app.\n */\n Guest = 'guest',\n}\n\n// @docsMissing\nexport enum ExecutionEnvironment {\n Bare = 'bare',\n Standalone = 'standalone',\n StoreClient = 'storeClient',\n}\n\n// @needsAudit\n/**\n * Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up\n * as `unsupported`.\n */\nexport enum UserInterfaceIdiom {\n Handset = 'handset',\n Tablet = 'tablet',\n Unsupported = 'unsupported',\n}\n\n// @needsAudit\nexport interface IOSManifest {\n /**\n * The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.\n * In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This\n * may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest\n * can be updated, whereas this value will never change for a given native binary.\n * The value is set to `null` in case you run your app in Expo Go.\n */\n buildNumber: string | null;\n /**\n * The Apple internal model identifier for this device, e.g. `iPhone1,1`.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).\n */\n platform: string;\n /**\n * The human-readable model name of this device, e.g. `\"iPhone 7 Plus\"` if it can be determined,\n * otherwise will be `null`.\n * @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).\n */\n model: string | null;\n /**\n * The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).\n */\n userInterfaceIdiom: UserInterfaceIdiom;\n /**\n * The version of iOS running on this device, e.g. `10.3`.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).\n */\n systemVersion: string;\n [key: string]: any;\n}\n\n// @needsAudit\nexport interface AndroidManifest {\n /**\n * The version code set by `android.versionCode` in app.json.\n * The value is set to `null` in case you run your app in Expo Go.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).\n */\n versionCode: number;\n [key: string]: any;\n}\n\nexport interface WebManifest {\n [key: string]: any;\n}\n\n// @docsMissing\nexport interface ManifestAsset {\n url: string;\n}\n\n// @needsAudit @docsMissing\n/**\n * A modern manifest.\n */\nexport type Manifest = {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ManifestAsset;\n assets: ManifestAsset[];\n metadata: object;\n extra?: ManifestExtra;\n};\n\n// @docsMissing\nexport type ManifestExtra = ClientScopingConfig & {\n expoClient?: ExpoClientConfig;\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n};\n\n// @needsAudit\nexport type EASConfig = {\n /**\n * The ID for this project if it's using EAS. UUID. This value will not change when a project is\n * transferred between accounts or renamed.\n */\n projectId?: string;\n};\n\n// @needsAudit\nexport type ClientScopingConfig = {\n /**\n * An opaque unique string for scoping client-side data to this project. This value\n * will not change when a project is transferred between accounts or renamed.\n */\n scopeKey?: string;\n};\n\n// @docsMissing\nexport type ExpoGoConfig = {\n mainModuleName?: string;\n debuggerHost?: string;\n logUrl?: string;\n developer?: {\n tool?: string;\n [key: string]: any;\n };\n packagerOpts?: ExpoGoPackagerOpts;\n};\n\n// @docsMissing\nexport type ExpoGoPackagerOpts = {\n hostType?: string;\n dev?: boolean;\n strict?: boolean;\n minify?: boolean;\n urlType?: string;\n urlRandomness?: string;\n lanType?: string;\n [key: string]: any;\n};\n\nexport type ExpoClientConfig = ExpoConfig & {\n /**\n * Published apps only.\n */\n releaseId?: string;\n revisionId?: string;\n releaseChannel?: string;\n bundleUrl: string;\n hostUri?: string;\n publishedTime?: string;\n /**\n * The Expo account name and slug for this project.\n * @deprecated Prefer `projectId` or `originalFullName` instead for identification and\n * `scopeKey` for scoping due to immutability.\n */\n id?: string;\n /**\n * The original Expo account name and slug for this project. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * will not change when a project is transferred between accounts or renamed.\n */\n originalFullName?: string;\n /**\n * The Expo account name and slug used for display purposes. Formatted like `@username/slug`.\n * When unauthenticated, the username is `@anonymous`. For published projects, this value\n * may change when a project is transferred between accounts or renamed.\n */\n currentFullName?: string;\n};\n\n/**\n * @hidden\n * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest\n */\nexport type AppManifest = ExpoClientConfig &\n ExpoGoConfig &\n EASConfig &\n ClientScopingConfig & {\n [key: string]: any;\n };\n\n// @needsAudit @docsMissing\nexport interface PlatformManifest {\n ios?: IOSManifest;\n android?: AndroidManifest;\n web?: WebManifest;\n detach?: {\n scheme?: string;\n [key: string]: any;\n };\n logUrl?: string;\n scheme?: string;\n hostUri?: string;\n developer?: string;\n [key: string]: any;\n}\n\n// @needsAudit @docsMissing\n/**\n * @hidden\n */\nexport interface NativeConstants {\n name: 'ExponentConstants';\n /**\n * Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow\n * and classic builds; for apps built with EAS Build and in bare workflow, the result is\n * always `null`.\n */\n appOwnership: AppOwnership | null;\n debugMode: boolean;\n /**\n * A human-readable name for the device type.\n */\n deviceName?: string;\n /**\n * The [device year class](https://github.com/facebook/device-year-class) of this device.\n * @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).\n */\n deviceYearClass: number | null;\n executionEnvironment: ExecutionEnvironment;\n experienceUrl: string;\n // only nullable on web\n expoRuntimeVersion: string | null;\n /**\n * The version string of the Expo Go app currently running.\n * Returns `null` in bare workflow and web.\n */\n expoVersion: string | null;\n isDetached?: boolean;\n intentUri?: string;\n /**\n * An identifier that is unique to this particular device and whose lifetime is at least as long\n * as the installation of the app.\n * @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and\n * storing it. This API will be removed in SDK 44.\n */\n installationId: string;\n /**\n * `true` if the app is running on a device, `false` if running in a simulator or emulator.\n * @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).\n */\n isDevice: boolean;\n isHeadless: boolean;\n linkingUri: string;\n /**\n * The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set\n * by `version` in app.json on Android at the time the native app was built.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).\n */\n nativeAppVersion: string | null;\n /**\n * The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in\n * **app.json** in a standalone app) and the version code set by `android.versionCode` in\n * **app.json** on Android at the time the native app was built.\n * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).\n */\n nativeBuildVersion: string | null;\n /**\n * Classic manifest for Expo apps using classic updates.\n * Returns `null` in bare workflow and when `manifest2` is non-null.\n */\n manifest: AppManifest | null;\n /**\n * New manifest for Expo apps using modern Expo Updates.\n * Returns `null` in bare workflow and when `manifest` is non-null.\n */\n manifest2: Manifest | null;\n /**\n * A string that is unique to the current session of your app. It is different across apps and\n * across multiple launches of the same app.\n */\n sessionId: string;\n /**\n * The default status bar height for the device. Does not factor in changes when location tracking\n * is in use or a phone call is active.\n */\n statusBarHeight: number;\n /**\n * A list of the system font names available on the current device.\n */\n systemFonts: string[];\n systemVersion?: number;\n /**\n * @hidden\n */\n supportedExpoSdks?: string[];\n platform?: PlatformManifest;\n /**\n * Gets the user agent string which would be included in requests sent by a web view running on\n * this device. This is probably not the same user agent you might be providing in your JS `fetch`\n * requests.\n */\n getWebViewUserAgentAsync: () => Promise<string | null>;\n [key: string]: any;\n}\n\nexport interface Constants extends NativeConstants {\n /**\n * @hidden\n * @warning do not use this property. Use `manifest` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest?: AppManifest;\n /**\n * @hidden\n * @warning do not use this property. Use `manifest2` by default.\n *\n * In certain cases accessing manifest via this property\n * suppresses important warning about missing manifest.\n */\n __unsafeNoWarnManifest2?: Manifest;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-constants",
3
- "version": "12.1.3",
3
+ "version": "13.0.2",
4
4
  "description": "Provides system information that remains constant throughout the lifetime of your app.",
5
5
  "main": "build/Constants.js",
6
6
  "types": "build/Constants.d.ts",
@@ -34,12 +34,14 @@
34
34
  "preset": "expo-module-scripts"
35
35
  },
36
36
  "dependencies": {
37
- "@expo/config": "^5.0.9",
38
- "expo-modules-core": "~0.4.4",
37
+ "@expo/config": "^6.0.6",
39
38
  "uuid": "^3.3.2"
40
39
  },
41
40
  "devDependencies": {
42
41
  "expo-module-scripts": "^2.0.0"
43
42
  },
44
- "gitHead": "33b6a1b7ac70e664ccbe5965e707c0df6d704549"
43
+ "peerDependencies": {
44
+ "expo": "*"
45
+ },
46
+ "gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
45
47
  }
@@ -4,6 +4,15 @@ set -eo pipefail
4
4
 
5
5
  DEST="$CONFIGURATION_BUILD_DIR"
6
6
  RESOURCE_BUNDLE_NAME="EXConstants.bundle"
7
+ # ref: https://github.com/facebook/react-native/blob/c974cbff04a8d90ac0f856dbada3fc5a75c75b49/scripts/react-native-xcode.sh#L59-L65
8
+ # Path to expo-constants folder inside node_modules
9
+ EXPO_CONSTANTS_PACKAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
+
11
+ # Suppress environment errors from sourcing the login scripts
12
+ set +e
13
+ source "$EXPO_CONSTANTS_PACKAGE_DIR/scripts/source-login-scripts.sh"
14
+ set -e
15
+
7
16
  NODE_BINARY=${NODE_BINARY:-node}
8
17
 
9
18
  if ! [ -x "$(command -v "$NODE_BINARY")" ]; then
@@ -23,9 +32,6 @@ if [ "x$PROJECT_DIR_BASENAME" != "xPods" ]; then
23
32
  exit 0
24
33
  fi
25
34
 
26
- # ref: https://github.com/facebook/react-native/blob/c974cbff04a8d90ac0f856dbada3fc5a75c75b49/scripts/react-native-xcode.sh#L59-L65
27
- # Path to expo-constants folder inside node_modules
28
- EXPO_CONSTANTS_PACKAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
29
35
  # If PROJECT_ROOT is not specified, fallback to use Xcode PROJECT_DIR
30
36
  PROJECT_ROOT=${PROJECT_ROOT:-"$PROJECT_DIR/../.."}
31
37
  PROJECT_ROOT=${PROJECT_ROOT:-"$EXPO_CONSTANTS_PACKAGE_DIR/../.."}
@@ -0,0 +1,47 @@
1
+ # shellcheck shell=bash disable=SC1090,SC1091
2
+
3
+ # @generated by expo-module-scripts
4
+
5
+ # Source login scripts to simulate running in an interactive login shell to
6
+ # configure environment variables as if the user had opened a shell. This
7
+ # script is intended for Xcode build phase scripts on macOS and does not have
8
+ # a shebang so it inherits the current shell.
9
+
10
+ current_shell=$(ps -cp "$$" -o comm="" | sed s/^-//)
11
+
12
+ if [[ "$current_shell" == zsh ]]; then
13
+ # Zsh's setup script order is:
14
+ # /etc/zshenv
15
+ # ~/.zshenv
16
+ # /etc/zprofile
17
+ # ~/.zprofile
18
+ # /etc/zshrc
19
+ # ~/.zshrc
20
+ # /etc/zlogin
21
+ # ~/.zlogin
22
+ # http://zsh.sourceforge.net/Guide/zshguide02.html
23
+
24
+ if [ -f /etc/zshenv ]; then . /etc/zshenv; fi
25
+ if [ -f ~/.zshenv ]; then . ~/.zshenv; fi
26
+ if [ -f /etc/zprofile ]; then . /etc/zprofile; fi
27
+ if [ -f ~/.zprofile ]; then . ~/.zprofile; fi
28
+ if [ -f /etc/zshrc ]; then . /etc/zshrc; fi
29
+ if [ -f ~/.zshrc ]; then . ~/.zshrc; fi
30
+ if [ -f /etc/zlogin ]; then . /etc/zlogin; fi
31
+ if [ -f ~/zlogin ]; then . ~/zlogin; fi
32
+ else
33
+ # Bash's setup script order is:
34
+ # /etc/profile (if it exists)
35
+ # The first of: ~/.bash_profile, ~/.bash_login, and ~/.profile
36
+ # https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
37
+
38
+ if [ -f /etc/profile ]; then . /etc/profile; fi
39
+
40
+ if [ -f ~/.bash_profile ]; then
41
+ . ~/.bash_profile
42
+ elif [ -f ~/.bash_login ]; then
43
+ . ~/.bash_login
44
+ elif [ -f ~/.profile ]; then
45
+ . ~/.profile
46
+ fi
47
+ fi
package/src/Constants.ts CHANGED
@@ -73,9 +73,6 @@ const { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as
73
73
 
74
74
  let warnedAboutDeviceYearClass = false;
75
75
  let warnedAboutIosModel = false;
76
- let warnedAboutInstallationId = false;
77
- let warnedAboutDeviceId = false;
78
- let warnedAboutLinkingUrl = false;
79
76
 
80
77
  const constants: Constants = {
81
78
  ...nativeConstants,
@@ -83,59 +80,25 @@ const constants: Constants = {
83
80
  appOwnership: appOwnership ?? null,
84
81
  };
85
82
 
86
- const constantsPropertiesGetter: AccessorProps = {
87
- // Deprecated fields
88
- deviceYearClass() {
89
- if (!warnedAboutDeviceYearClass) {
90
- console.warn(
91
- `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`
92
- );
93
- warnedAboutDeviceYearClass = true;
94
- }
95
- return nativeConstants.deviceYearClass;
96
- },
97
- // Deprecated fields
98
- installationId() {
99
- if (!warnedAboutInstallationId) {
100
- console.warn(
101
- `Constants.installationId has been deprecated in favor of generating and storing your own ID. Implement it using expo-application's androidId on Android and a storage API such as expo-secure-store on iOS and localStorage on the web. This API will be removed in SDK 44.`
102
- );
103
- warnedAboutInstallationId = true;
104
- }
105
- return nativeConstants.installationId;
106
- },
107
- // Legacy aliases
108
- deviceId() {
109
- if (!warnedAboutDeviceId) {
110
- console.warn(
111
- `Constants.deviceId has been deprecated in favor of generating and storing your own ID. This API will be removed in SDK 44.`
112
- );
113
- warnedAboutDeviceId = true;
114
- }
115
- return nativeConstants.installationId;
116
- },
117
- linkingUrl() {
118
- if (!warnedAboutLinkingUrl) {
119
- console.warn(
120
- `Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the Linking API directly. Constants.linkingUrl will be removed in SDK 44.`
121
- );
122
- warnedAboutLinkingUrl = true;
123
- }
124
- return nativeConstants.linkingUri;
125
- },
126
- manifest(): AppManifest | null {
127
- const maybeManifest = getManifest();
128
- if (!maybeManifest || !isAppManifest(maybeManifest)) {
129
- return null;
130
- }
131
- return maybeManifest;
83
+ Object.defineProperties(constants, {
84
+ // Deprecated field
85
+ deviceYearClass: {
86
+ get() {
87
+ if (!warnedAboutDeviceYearClass) {
88
+ console.warn(
89
+ `Constants.deviceYearClass has been deprecated in favor of expo-device's Device.deviceYearClass property. This API will be removed in SDK 45.`
90
+ );
91
+ warnedAboutDeviceYearClass = true;
92
+ }
93
+ return nativeConstants.deviceYearClass;
94
+ },
95
+ enumerable: false,
132
96
  },
133
- manifest2(): Manifest | null {
134
- const maybeManifest = getManifest();
135
- if (!maybeManifest || !isManifest(maybeManifest)) {
136
- return null;
137
- }
138
- return maybeManifest;
97
+ installationId: {
98
+ get() {
99
+ return nativeConstants.installationId;
100
+ },
101
+ enumerable: false,
139
102
  },
140
103
  /**
141
104
  * Use `manifest` property by default.
@@ -143,39 +106,62 @@ const constantsPropertiesGetter: AccessorProps = {
143
106
  * It behaves similarly to the original one, but suppresses warning upon no manifest available.
144
107
  * `expo-asset` uses it to prevent users from seeing mentioned warning.
145
108
  */
146
- __unsafeNoWarnManifest(): AppManifest | Manifest | null {
147
- const maybeManifest = getManifest(true);
148
- if (!maybeManifest || !isAppManifest(maybeManifest)) {
149
- return null;
150
- }
151
- return maybeManifest;
109
+ __unsafeNoWarnManifest: {
110
+ get(): AppManifest | Manifest | null {
111
+ const maybeManifest = getManifest(true);
112
+ if (!maybeManifest || !isAppManifest(maybeManifest)) {
113
+ return null;
114
+ }
115
+ return maybeManifest;
116
+ },
117
+ enumerable: false,
152
118
  },
153
- __unsafeNoWarnManifest2(): Manifest | Manifest | null {
154
- const maybeManifest = getManifest(true);
155
- if (!maybeManifest || !isManifest(maybeManifest)) {
156
- return null;
157
- }
158
- return maybeManifest;
119
+ __unsafeNoWarnManifest2: {
120
+ get(): Manifest | null {
121
+ const maybeManifest = getManifest(true);
122
+ if (!maybeManifest || !isManifest(maybeManifest)) {
123
+ return null;
124
+ }
125
+ return maybeManifest;
126
+ },
127
+ enumerable: false,
159
128
  },
160
- };
161
- definePropertiesGetter(constants, constantsPropertiesGetter);
162
-
163
- Object.defineProperty(constants, '__rawManifest_TEST', {
164
- get(): AppManifest | Manifest | null {
165
- return rawManifest;
129
+ manifest: {
130
+ get(): AppManifest | null {
131
+ const maybeManifest = getManifest();
132
+ if (!maybeManifest || !isAppManifest(maybeManifest)) {
133
+ return null;
134
+ }
135
+ return maybeManifest;
136
+ },
137
+ enumerable: true,
166
138
  },
167
- set(value: AppManifest | Manifest | null) {
168
- rawManifest = value;
139
+ manifest2: {
140
+ get(): Manifest | null {
141
+ const maybeManifest = getManifest();
142
+ if (!maybeManifest || !isManifest(maybeManifest)) {
143
+ return null;
144
+ }
145
+ return maybeManifest;
146
+ },
147
+ enumerable: true,
148
+ },
149
+ __rawManifest_TEST: {
150
+ get(): AppManifest | Manifest | null {
151
+ return rawManifest;
152
+ },
153
+ set(value: AppManifest | Manifest | null) {
154
+ rawManifest = value;
155
+ },
156
+ enumerable: false,
169
157
  },
170
- // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
171
- enumerable: false,
172
158
  });
173
159
 
174
160
  // Add deprecation warning for `platform.ios.model`
175
161
  if (constants?.platform?.ios) {
176
162
  const originalModel = nativeConstants.platform.ios.model;
177
- definePropertiesGetter(constants.platform.ios, {
178
- model() {
163
+ Object.defineProperty(constants.platform.ios, 'model', {
164
+ get() {
179
165
  if (!warnedAboutIosModel) {
180
166
  console.warn(
181
167
  `Constants.platform.ios.model has been deprecated in favor of expo-device's Device.modelName property. This API will be removed in SDK 45.`
@@ -184,20 +170,10 @@ if (constants?.platform?.ios) {
184
170
  }
185
171
  return originalModel;
186
172
  },
173
+ enumerable: false,
187
174
  });
188
175
  }
189
176
 
190
- type AccessorProps = Record<string, () => any>;
191
- function definePropertiesGetter(target: object, props: AccessorProps) {
192
- for (const [name, func] of Object.entries(props)) {
193
- Object.defineProperty(target, name, {
194
- get: func,
195
- // Prevent the warning from being thrown, or the value from being used when the user interacts with the entire object.
196
- enumerable: false,
197
- });
198
- }
199
- }
200
-
201
177
  function isAppManifest(manifest: AppManifest | Manifest): manifest is AppManifest {
202
178
  return !isManifest(manifest);
203
179
  }
@@ -1,36 +1,80 @@
1
1
  import { ExpoConfig } from '@expo/config-types';
2
2
 
3
+ // @needsAudit
3
4
  export enum AppOwnership {
5
+ /**
6
+ * It is a [standalone app](../../../distribution/building-standalone-apps#building-standalone-apps).
7
+ */
4
8
  Standalone = 'standalone',
9
+ /**
10
+ * The experience is running inside of the Expo Go app.
11
+ */
5
12
  Expo = 'expo',
13
+ /**
14
+ * It has been opened through a link from a standalone app.
15
+ */
6
16
  Guest = 'guest',
7
17
  }
8
18
 
19
+ // @docsMissing
9
20
  export enum ExecutionEnvironment {
10
21
  Bare = 'bare',
11
22
  Standalone = 'standalone',
12
23
  StoreClient = 'storeClient',
13
24
  }
14
25
 
26
+ // @needsAudit
27
+ /**
28
+ * Current supported values are `handset` and `tablet`. Apple TV and CarPlay will show up
29
+ * as `unsupported`.
30
+ */
15
31
  export enum UserInterfaceIdiom {
16
32
  Handset = 'handset',
17
33
  Tablet = 'tablet',
18
34
  Unsupported = 'unsupported',
19
35
  }
20
36
 
37
+ // @needsAudit
21
38
  export interface IOSManifest {
22
- buildNumber: string;
39
+ /**
40
+ * The build number specified in the embedded **Info.plist** value for `CFBundleVersion` in this app.
41
+ * In a standalone app, you can set this with the `ios.buildNumber` value in **app.json**. This
42
+ * may differ from the value in `Constants.manifest.ios.buildNumber` because the manifest
43
+ * can be updated, whereas this value will never change for a given native binary.
44
+ * The value is set to `null` in case you run your app in Expo Go.
45
+ */
46
+ buildNumber: string | null;
47
+ /**
48
+ * The Apple internal model identifier for this device, e.g. `iPhone1,1`.
49
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.modelId`](../device/#devicemodelid).
50
+ */
23
51
  platform: string;
24
52
  /**
25
- * @deprecated Moved to `expo-device` - `Device.modelName`
53
+ * The human-readable model name of this device, e.g. `"iPhone 7 Plus"` if it can be determined,
54
+ * otherwise will be `null`.
55
+ * @deprecated Deprecated. Moved to `expo-device` as [`Device.modelName`](../device/#devicemodelname).
26
56
  */
27
57
  model: string | null;
58
+ /**
59
+ * The user interface idiom of this device, i.e. whether the app is running on an iPhone or an iPad.
60
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.getDeviceTypeAsync()`](../device/#devicegetdevicetypeasync).
61
+ */
28
62
  userInterfaceIdiom: UserInterfaceIdiom;
63
+ /**
64
+ * The version of iOS running on this device, e.g. `10.3`.
65
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.osVersion`](../device/#deviceosversion).
66
+ */
29
67
  systemVersion: string;
30
68
  [key: string]: any;
31
69
  }
32
70
 
71
+ // @needsAudit
33
72
  export interface AndroidManifest {
73
+ /**
74
+ * The version code set by `android.versionCode` in app.json.
75
+ * The value is set to `null` in case you run your app in Expo Go.
76
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
77
+ */
34
78
  versionCode: number;
35
79
  [key: string]: any;
36
80
  }
@@ -39,10 +83,12 @@ export interface WebManifest {
39
83
  [key: string]: any;
40
84
  }
41
85
 
86
+ // @docsMissing
42
87
  export interface ManifestAsset {
43
88
  url: string;
44
89
  }
45
90
 
91
+ // @needsAudit @docsMissing
46
92
  /**
47
93
  * A modern manifest.
48
94
  */
@@ -53,21 +99,26 @@ export type Manifest = {
53
99
  launchAsset: ManifestAsset;
54
100
  assets: ManifestAsset[];
55
101
  metadata: object;
56
- extra?: ClientScopingConfig & {
57
- expoClient?: ExpoClientConfig;
58
- expoGo?: ExpoGoConfig;
59
- eas?: EASConfig;
60
- };
102
+ extra?: ManifestExtra;
61
103
  };
62
104
 
105
+ // @docsMissing
106
+ export type ManifestExtra = ClientScopingConfig & {
107
+ expoClient?: ExpoClientConfig;
108
+ expoGo?: ExpoGoConfig;
109
+ eas?: EASConfig;
110
+ };
111
+
112
+ // @needsAudit
63
113
  export type EASConfig = {
64
114
  /**
65
- * The ID for this project if it's using EAS. UUID. This value will not change when a project is transferred
66
- * between accounts or renamed.
115
+ * The ID for this project if it's using EAS. UUID. This value will not change when a project is
116
+ * transferred between accounts or renamed.
67
117
  */
68
118
  projectId?: string;
69
119
  };
70
120
 
121
+ // @needsAudit
71
122
  export type ClientScopingConfig = {
72
123
  /**
73
124
  * An opaque unique string for scoping client-side data to this project. This value
@@ -76,6 +127,7 @@ export type ClientScopingConfig = {
76
127
  scopeKey?: string;
77
128
  };
78
129
 
130
+ // @docsMissing
79
131
  export type ExpoGoConfig = {
80
132
  mainModuleName?: string;
81
133
  debuggerHost?: string;
@@ -84,41 +136,43 @@ export type ExpoGoConfig = {
84
136
  tool?: string;
85
137
  [key: string]: any;
86
138
  };
87
- packagerOpts?: {
88
- hostType?: string;
89
- dev?: boolean;
90
- strict?: boolean;
91
- minify?: boolean;
92
- urlType?: string;
93
- urlRandomness?: string;
94
- lanType?: string;
95
- [key: string]: any;
96
- };
139
+ packagerOpts?: ExpoGoPackagerOpts;
140
+ };
141
+
142
+ // @docsMissing
143
+ export type ExpoGoPackagerOpts = {
144
+ hostType?: string;
145
+ dev?: boolean;
146
+ strict?: boolean;
147
+ minify?: boolean;
148
+ urlType?: string;
149
+ urlRandomness?: string;
150
+ lanType?: string;
151
+ [key: string]: any;
97
152
  };
98
153
 
99
154
  export type ExpoClientConfig = ExpoConfig & {
100
- /** Published Apps Only */
155
+ /**
156
+ * Published apps only.
157
+ */
101
158
  releaseId?: string;
102
159
  revisionId?: string;
103
160
  releaseChannel?: string;
104
161
  bundleUrl: string;
105
162
  hostUri?: string;
106
163
  publishedTime?: string;
107
-
108
164
  /**
109
165
  * The Expo account name and slug for this project.
110
- * @deprecated - Prefer `projectId` or `originalFullName` instead for identification and `scopeKey` for
111
- * scoping due to immutability.
166
+ * @deprecated Prefer `projectId` or `originalFullName` instead for identification and
167
+ * `scopeKey` for scoping due to immutability.
112
168
  */
113
169
  id?: string;
114
-
115
170
  /**
116
171
  * The original Expo account name and slug for this project. Formatted like `@username/slug`.
117
172
  * When unauthenticated, the username is `@anonymous`. For published projects, this value
118
173
  * will not change when a project is transferred between accounts or renamed.
119
174
  */
120
175
  originalFullName?: string;
121
-
122
176
  /**
123
177
  * The Expo account name and slug used for display purposes. Formatted like `@username/slug`.
124
178
  * When unauthenticated, the username is `@anonymous`. For published projects, this value
@@ -128,6 +182,7 @@ export type ExpoClientConfig = ExpoConfig & {
128
182
  };
129
183
 
130
184
  /**
185
+ * @hidden
131
186
  * A classic manifest https://docs.expo.io/guides/how-expo-works/#expo-manifest
132
187
  */
133
188
  export type AppManifest = ExpoClientConfig &
@@ -137,6 +192,7 @@ export type AppManifest = ExpoClientConfig &
137
192
  [key: string]: any;
138
193
  };
139
194
 
195
+ // @needsAudit @docsMissing
140
196
  export interface PlatformManifest {
141
197
  ios?: IOSManifest;
142
198
  android?: AndroidManifest;
@@ -152,13 +208,26 @@ export interface PlatformManifest {
152
208
  [key: string]: any;
153
209
  }
154
210
 
211
+ // @needsAudit @docsMissing
212
+ /**
213
+ * @hidden
214
+ */
155
215
  export interface NativeConstants {
156
216
  name: 'ExponentConstants';
217
+ /**
218
+ * Returns `expo`, `standalone`, or `guest`. This property only applies to the managed workflow
219
+ * and classic builds; for apps built with EAS Build and in bare workflow, the result is
220
+ * always `null`.
221
+ */
157
222
  appOwnership: AppOwnership | null;
158
223
  debugMode: boolean;
224
+ /**
225
+ * A human-readable name for the device type.
226
+ */
159
227
  deviceName?: string;
160
228
  /**
161
- * @deprecated Moved to `expo-device` - `Device.deviceYearClass`
229
+ * The [device year class](https://github.com/facebook/device-year-class) of this device.
230
+ * @deprecated Deprecated. Moved to `expo-device` as [`Device.deviceYearClass`](../device/#deviceyearclass).
162
231
  */
163
232
  deviceYearClass: number | null;
164
233
  executionEnvironment: ExecutionEnvironment;
@@ -166,21 +235,38 @@ export interface NativeConstants {
166
235
  // only nullable on web
167
236
  expoRuntimeVersion: string | null;
168
237
  /**
169
- * The version string of the Expo client currently running.
238
+ * The version string of the Expo Go app currently running.
170
239
  * Returns `null` in bare workflow and web.
171
240
  */
172
241
  expoVersion: string | null;
173
242
  isDetached?: boolean;
174
243
  intentUri?: string;
175
244
  /**
176
- * @deprecated Constants.installationId is deprecated in favor of generating your own ID and
245
+ * An identifier that is unique to this particular device and whose lifetime is at least as long
246
+ * as the installation of the app.
247
+ * @deprecated `Constants.installationId` is deprecated in favor of generating your own ID and
177
248
  * storing it. This API will be removed in SDK 44.
178
249
  */
179
250
  installationId: string;
251
+ /**
252
+ * `true` if the app is running on a device, `false` if running in a simulator or emulator.
253
+ * @deprecated Deprecated. Use `expo-device`'s [`Device.isDevice`](../device/#deviceisdevice).
254
+ */
180
255
  isDevice: boolean;
181
256
  isHeadless: boolean;
182
257
  linkingUri: string;
258
+ /**
259
+ * The **Info.plist** value for `CFBundleShortVersionString` on iOS and the version name set
260
+ * by `version` in app.json on Android at the time the native app was built.
261
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeApplicationVersion`](../application/#applicationnativeapplicationversion).
262
+ */
183
263
  nativeAppVersion: string | null;
264
+ /**
265
+ * The **Info.plist** value for `CFBundleVersion` on iOS (set with `ios.buildNumber` value in
266
+ * **app.json** in a standalone app) and the version code set by `android.versionCode` in
267
+ * **app.json** on Android at the time the native app was built.
268
+ * @deprecated Deprecated. Use `expo-application`'s [`Application.nativeBuildVersion`](../application/#applicationnativebuildversion).
269
+ */
184
270
  nativeBuildVersion: string | null;
185
271
  /**
186
272
  * Classic manifest for Expo apps using classic updates.
@@ -192,28 +278,38 @@ export interface NativeConstants {
192
278
  * Returns `null` in bare workflow and when `manifest` is non-null.
193
279
  */
194
280
  manifest2: Manifest | null;
281
+ /**
282
+ * A string that is unique to the current session of your app. It is different across apps and
283
+ * across multiple launches of the same app.
284
+ */
195
285
  sessionId: string;
286
+ /**
287
+ * The default status bar height for the device. Does not factor in changes when location tracking
288
+ * is in use or a phone call is active.
289
+ */
196
290
  statusBarHeight: number;
291
+ /**
292
+ * A list of the system font names available on the current device.
293
+ */
197
294
  systemFonts: string[];
198
295
  systemVersion?: number;
296
+ /**
297
+ * @hidden
298
+ */
299
+ supportedExpoSdks?: string[];
199
300
  platform?: PlatformManifest;
200
- [key: string]: any;
201
-
301
+ /**
302
+ * Gets the user agent string which would be included in requests sent by a web view running on
303
+ * this device. This is probably not the same user agent you might be providing in your JS `fetch`
304
+ * requests.
305
+ */
202
306
  getWebViewUserAgentAsync: () => Promise<string | null>;
307
+ [key: string]: any;
203
308
  }
204
309
 
205
310
  export interface Constants extends NativeConstants {
206
311
  /**
207
- * @deprecated Constants.deviceId is deprecated in favor of generating your own ID and storing it.
208
- * This API will be removed in SDK 44.
209
- */
210
- deviceId?: string;
211
- /**
212
- * @deprecated Constants.linkingUrl has been renamed to Constants.linkingUri. Consider using the
213
- * Linking API directly. Constants.linkingUrl will be removed in SDK 44.
214
- */
215
- linkingUrl?: string;
216
- /**
312
+ * @hidden
217
313
  * @warning do not use this property. Use `manifest` by default.
218
314
  *
219
315
  * In certain cases accessing manifest via this property
@@ -221,6 +317,7 @@ export interface Constants extends NativeConstants {
221
317
  */
222
318
  __unsafeNoWarnManifest?: AppManifest;
223
319
  /**
320
+ * @hidden
224
321
  * @warning do not use this property. Use `manifest2` by default.
225
322
  *
226
323
  * In certain cases accessing manifest via this property