expo-updates 0.18.7 → 0.18.8

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,12 +10,17 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.18.8 — 2023-07-04
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 0.18.7 — 2023-06-30
14
18
 
15
19
  ### 🐛 Bug fixes
16
20
 
17
21
  - Fix expo-extra-params header. ([#23206](https://github.com/expo/expo/pull/23206) by [@wschurman](https://github.com/wschurman))
18
22
  - [iOS] Fix response header casing bug. ([#23234](https://github.com/expo/expo/pull/23234) by [@wschurman](https://github.com/wschurman))
23
+ - Fix tsconfig paths and other SDK 49 Metro features. ([#23276](https://github.com/expo/expo/pull/23276) by [@EvanBacon](https://github.com/EvanBacon))
19
24
 
20
25
  ## 0.18.6 — 2023-06-29
21
26
 
@@ -69,7 +74,7 @@ _This version does not introduce any user-facing changes._
69
74
  - [Android] Load updates in background thread and prevent ANR from initial launch. ([#20273](https://github.com/expo/expo/pull/20273) by [@kudo](https://github.com/kudo))
70
75
  - Added support for React Native 0.72. ([#22588](https://github.com/expo/expo/pull/22588) by [@kudo](https://github.com/kudo))
71
76
  - Added the Brotli compression support for EAS Update on Android. ([#22982](https://github.com/expo/expo/pull/22982) by [@kudo](https://github.com/kudo))
72
- - [Android][iOS] State machine implementation. ([#22845](https://github.com/expo/expo/pull/22845) by [@douglowder](https://github.com/douglowder))
77
+ - [Android][ios] State machine implementation. ([#22845](https://github.com/expo/expo/pull/22845) by [@douglowder](https://github.com/douglowder))
73
78
 
74
79
  ### 🐛 Bug fixes
75
80
 
@@ -4,7 +4,7 @@ apply plugin: 'kotlin-kapt'
4
4
  apply plugin: 'maven-publish'
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '0.18.7'
7
+ version = '0.18.8'
8
8
 
9
9
  def ex_updates_native_debug = System.getenv("EX_UPDATES_NATIVE_DEBUG") == "1" ? "true" : "false"
10
10
 
@@ -70,7 +70,7 @@ android {
70
70
  minSdkVersion safeExtGet("minSdkVersion", 21)
71
71
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
72
72
  versionCode 31
73
- versionName '0.18.7'
73
+ versionName '0.18.8'
74
74
  consumerProguardFiles("proguard-rules.pro")
75
75
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
76
76
 
@@ -1 +1 @@
1
- {"version":3,"file":"UpdatesStateMachine.d.ts","sourceRoot":"","sources":["../../src/statemachine/UpdatesStateMachine.ts"],"names":[],"mappings":"AAEA,oBAAY,6BAA6B;IACvC,KAAK,UAAU;IACf,wBAAwB,2BAA2B;IACnD,0BAA0B,6BAA6B;IACvD,WAAW,eAAe;IAC1B,QAAQ,aAAa;IACrB,iBAAiB,qBAAqB;IACtC,cAAc,kBAAkB;IAChC,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,6BAA6B,CAAC;IACpC,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB;AAuDD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;0OA2D9B,CAAC"}
1
+ {"version":3,"file":"UpdatesStateMachine.d.ts","sourceRoot":"","sources":["../../src/statemachine/UpdatesStateMachine.ts"],"names":[],"mappings":"AAEA,oBAAY,6BAA6B;IACvC,KAAK,UAAU;IACf,wBAAwB,2BAA2B;IACnD,0BAA0B,6BAA6B;IACvD,WAAW,eAAe;IAC1B,QAAQ,aAAa;IACrB,iBAAiB,qBAAqB;IACtC,cAAc,kBAAkB;IAChC,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,6BAA6B,CAAC;IACpC,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB;AAwDD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;0OA2D9B,CAAC"}
@@ -18,7 +18,7 @@ const checkCompleteAvailableAction = assign({
18
18
  checkError: () => undefined,
19
19
  isChecking: () => false,
20
20
  isUpdateAvailable: () => true,
21
- isRollback: (context, event) => event.body?.isRollBackToEmbedded,
21
+ isRollback: (context, event) => Boolean(event.body?.isRollBackToEmbedded),
22
22
  });
23
23
  const checkCompleteUnavailableAction = assign({
24
24
  latestManifest: () => undefined,
@@ -29,7 +29,7 @@ const checkCompleteUnavailableAction = assign({
29
29
  });
30
30
  const checkErrorAction = assign({
31
31
  isChecking: () => false,
32
- checkError: (event) => new Error(event.body?.message || 'checkError'),
32
+ checkError: (context, event) => new Error(event.body?.message || 'checkError'),
33
33
  });
34
34
  const downloadCompleteAction = assign({
35
35
  downloadedManifest: (context, event) => event.body?.manifest || context.downloadedManifest,
@@ -40,7 +40,7 @@ const downloadCompleteAction = assign({
40
40
  isUpdateAvailable: (context, event) => event.body?.manifest !== undefined || context.isUpdateAvailable,
41
41
  });
42
42
  const downloadErrorAction = assign({
43
- downloadError: (event) => new Error(event.body?.message || 'downloadError'),
43
+ downloadError: (context, event) => new Error(event.body?.message || 'downloadError'),
44
44
  isDownloading: () => false,
45
45
  });
46
46
  const check = assign({
@@ -1 +1 @@
1
- {"version":3,"file":"UpdatesStateMachine.js","sourceRoot":"","sources":["../../src/statemachine/UpdatesStateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,MAAM,CAAN,IAAY,6BASX;AATD,WAAY,6BAA6B;IACvC,gDAAe,CAAA;IACf,oFAAmD,CAAA;IACnD,wFAAuD,CAAA;IACvD,2DAA0B,CAAA;IAC1B,sDAAqB,CAAA;IACrB,uEAAsC,CAAA;IACtC,iEAAgC,CAAA;IAChC,oDAAmB,CAAA;AACrB,CAAC,EATW,6BAA6B,KAA7B,6BAA6B,QASxC;AAoCD;;GAEG;AACH,MAAM,4BAA4B,GAAG,MAAM,CAAC;IAC1C,cAAc,EAAE,CAAC,OAAmC,EAAE,KAA+B,EAAE,EAAE,CACvF,KAAK,CAAC,IAAI,EAAE,QAAQ,IAAI,SAAS;IACnC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;IAC3B,UAAU,EAAE,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AE;oBACxB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,8BAA8B,CAAC;iBAC1C;gBACD,UAAU,EAAE;oBACV,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,gBAAgB,CAAC;iBAC5B;aACF;SACF;QACD,WAAW,EAAE;YACX,EAAE,EAAE;gBACF,gBAAgB,EAAE;oBAChB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,sBAAsB,CAAC;iBAClC;gBACD,aAAa,EAAE;oBACb,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;SACd;KACF;CACF,CAAC,CAAC","sourcesContent":["import { createMachine, assign } from 'xstate';\n\nexport enum UpdatesStateMachineEventTypes {\n CHECK = 'check',\n CHECK_COMPLETE_AVAILABLE = 'checkCompleteAvailable',\n CHECK_COMPLETE_UNAVAILABLE = 'checkCompleteUnavailable',\n CHECK_ERROR = 'checkError',\n DOWNLOAD = 'download',\n DOWNLOAD_COMPLETE = 'downloadComplete',\n DOWNLOAD_ERROR = 'downloadError',\n RESTART = 'restart',\n}\n\n/**\n * Simplified model for an update manifest\n */\nexport type Manifest = {\n updateId: string;\n};\n\n/**\n * Model for an update event\n */\nexport type UpdatesStateMachineEvent = {\n type: UpdatesStateMachineEventTypes;\n body: {\n message?: string;\n manifest?: Manifest;\n isRollBackToEmbedded?: boolean;\n };\n};\n\n/**\n * The context structure (analogous to what is exposed in @expo/use-updates)\n */\nexport interface UpdatesStateMachineContext {\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n latestManifest?: Manifest;\n isChecking: boolean;\n isDownloading: boolean;\n isRollback: boolean;\n downloadedManifest?: Manifest;\n checkError?: Error;\n downloadError?: Error;\n}\n\n/**\n * Actions that modify the context\n */\nconst checkCompleteAvailableAction = assign({\n latestManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || undefined,\n checkError: () => undefined,\n isChecking: () => false,\n isUpdateAvailable: () => true,\n isRollback: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.isRollBackToEmbedded,\n});\n\nconst checkCompleteUnavailableAction = assign({\n latestManifest: () => undefined,\n checkError: () => undefined,\n isChecking: () => false,\n isUpdateAvailable: () => false,\n isRollback: () => false,\n});\n\nconst checkErrorAction = assign({\n isChecking: () => false,\n checkError: (event: UpdatesStateMachineEvent) => new Error(event.body?.message || 'checkError'),\n});\n\nconst downloadCompleteAction = assign({\n downloadedManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || context.downloadedManifest,\n latestManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || context.latestManifest,\n downloadError: () => undefined,\n isDownloading: () => false,\n isUpdatePending: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n !!(event.body?.manifest || context.downloadedManifest),\n isUpdateAvailable: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest !== undefined || context.isUpdateAvailable,\n});\n\nconst downloadErrorAction = assign({\n downloadError: (event: UpdatesStateMachineEvent) =>\n new Error(event.body?.message || 'downloadError'),\n isDownloading: () => false,\n});\n\nconst check = assign({\n isChecking: (context: UpdatesStateMachineContext) => true,\n});\n\nconst download = assign({\n isDownloading: (context: UpdatesStateMachineContext) => true,\n});\n\n/**\n * Model of the expo-updates state machine, written in Typescript.\n * The actual implementations of this state machine will be in Swift on iOS and Kotlin on Android.\n */\nexport const UpdatesStateMachine = createMachine<UpdatesStateMachineContext>({\n id: 'Updates',\n initial: 'idle',\n context: {\n isChecking: false,\n isDownloading: false,\n isUpdateAvailable: false,\n isUpdatePending: false,\n isRollback: false,\n },\n predictableActionArguments: true,\n states: {\n idle: {\n on: {\n check: {\n target: 'checking',\n actions: check,\n },\n download: {\n target: 'downloading',\n actions: download,\n },\n restart: {\n target: 'restarting',\n },\n },\n },\n checking: {\n on: {\n checkCompleteAvailable: {\n target: 'idle',\n actions: [checkCompleteAvailableAction],\n },\n checkCompleteUnavailable: {\n target: 'idle',\n actions: [checkCompleteUnavailableAction],\n },\n checkError: {\n target: 'idle',\n actions: [checkErrorAction],\n },\n },\n },\n downloading: {\n on: {\n downloadComplete: {\n target: 'idle',\n actions: [downloadCompleteAction],\n },\n downloadError: {\n target: 'idle',\n actions: [downloadErrorAction],\n },\n },\n },\n restarting: {\n type: 'final',\n },\n },\n});\n"]}
1
+ {"version":3,"file":"UpdatesStateMachine.js","sourceRoot":"","sources":["../../src/statemachine/UpdatesStateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,MAAM,CAAN,IAAY,6BASX;AATD,WAAY,6BAA6B;IACvC,gDAAe,CAAA;IACf,oFAAmD,CAAA;IACnD,wFAAuD,CAAA;IACvD,2DAA0B,CAAA;IAC1B,sDAAqB,CAAA;IACrB,uEAAsC,CAAA;IACtC,iEAAgC,CAAA;IAChC,oDAAmB,CAAA;AACrB,CAAC,EATW,6BAA6B,KAA7B,6BAA6B,QASxC;AAoCD;;GAEG;AACH,MAAM,4BAA4B,GAAG,MAAM,CAAC;IAC1C,cAAc,EAAE,CAAC,OAAmC,EAAE,KAA+B,EAAE,EAAE,CACvF,KAAK,CAAC,IAAI,EAAE,QAAQ,IAAI,SAAS;IACnC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;IAC3B,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI;IAC7B,UAAU,EAAE,CAAC,OAAmC,EAAE,KAA+B,EAAE,EAAE,CACnF,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,oBAAoB,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,8BAA8B,GAAG,MAAM,CAAC;IAC5C,cAAc,EAAE,GA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AAgB,EAAE;oBAChB,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,sBAAsB,CAAC;iBAClC;gBACD,aAAa,EAAE;oBACb,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;SACd;KACF;CACF,CAAC,CAAC","sourcesContent":["import { createMachine, assign } from 'xstate';\n\nexport enum UpdatesStateMachineEventTypes {\n CHECK = 'check',\n CHECK_COMPLETE_AVAILABLE = 'checkCompleteAvailable',\n CHECK_COMPLETE_UNAVAILABLE = 'checkCompleteUnavailable',\n CHECK_ERROR = 'checkError',\n DOWNLOAD = 'download',\n DOWNLOAD_COMPLETE = 'downloadComplete',\n DOWNLOAD_ERROR = 'downloadError',\n RESTART = 'restart',\n}\n\n/**\n * Simplified model for an update manifest\n */\nexport type Manifest = {\n updateId: string;\n};\n\n/**\n * Model for an update event\n */\nexport type UpdatesStateMachineEvent = {\n type: UpdatesStateMachineEventTypes;\n body: {\n message?: string;\n manifest?: Manifest;\n isRollBackToEmbedded?: boolean;\n };\n};\n\n/**\n * The context structure (analogous to what is exposed in @expo/use-updates)\n */\nexport interface UpdatesStateMachineContext {\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n latestManifest?: Manifest;\n isChecking: boolean;\n isDownloading: boolean;\n isRollback: boolean;\n downloadedManifest?: Manifest;\n checkError?: Error;\n downloadError?: Error;\n}\n\n/**\n * Actions that modify the context\n */\nconst checkCompleteAvailableAction = assign({\n latestManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || undefined,\n checkError: () => undefined,\n isChecking: () => false,\n isUpdateAvailable: () => true,\n isRollback: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n Boolean(event.body?.isRollBackToEmbedded),\n});\n\nconst checkCompleteUnavailableAction = assign({\n latestManifest: () => undefined,\n checkError: () => undefined,\n isChecking: () => false,\n isUpdateAvailable: () => false,\n isRollback: () => false,\n});\n\nconst checkErrorAction = assign({\n isChecking: () => false,\n checkError: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n new Error(event.body?.message || 'checkError'),\n});\n\nconst downloadCompleteAction = assign({\n downloadedManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || context.downloadedManifest,\n latestManifest: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest || context.latestManifest,\n downloadError: () => undefined,\n isDownloading: () => false,\n isUpdatePending: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n !!(event.body?.manifest || context.downloadedManifest),\n isUpdateAvailable: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n event.body?.manifest !== undefined || context.isUpdateAvailable,\n});\n\nconst downloadErrorAction = assign({\n downloadError: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>\n new Error(event.body?.message || 'downloadError'),\n isDownloading: () => false,\n});\n\nconst check = assign({\n isChecking: (context: UpdatesStateMachineContext) => true,\n});\n\nconst download = assign({\n isDownloading: (context: UpdatesStateMachineContext) => true,\n});\n\n/**\n * Model of the expo-updates state machine, written in Typescript.\n * The actual implementations of this state machine will be in Swift on iOS and Kotlin on Android.\n */\nexport const UpdatesStateMachine = createMachine<UpdatesStateMachineContext>({\n id: 'Updates',\n initial: 'idle',\n context: {\n isChecking: false,\n isDownloading: false,\n isUpdateAvailable: false,\n isUpdatePending: false,\n isRollback: false,\n },\n predictableActionArguments: true,\n states: {\n idle: {\n on: {\n check: {\n target: 'checking',\n actions: check,\n },\n download: {\n target: 'downloading',\n actions: download,\n },\n restart: {\n target: 'restarting',\n },\n },\n },\n checking: {\n on: {\n checkCompleteAvailable: {\n target: 'idle',\n actions: [checkCompleteAvailableAction],\n },\n checkCompleteUnavailable: {\n target: 'idle',\n actions: [checkCompleteUnavailableAction],\n },\n checkError: {\n target: 'idle',\n actions: [checkErrorAction],\n },\n },\n },\n downloading: {\n on: {\n downloadComplete: {\n target: 'idle',\n actions: [downloadCompleteAction],\n },\n downloadError: {\n target: 'idle',\n actions: [downloadErrorAction],\n },\n },\n },\n restarting: {\n type: 'final',\n },\n },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-updates",
3
- "version": "0.18.7",
3
+ "version": "0.18.8",
4
4
  "description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,7 +42,6 @@
42
42
  "@expo/code-signing-certificates": "0.0.5",
43
43
  "@expo/config": "~8.1.0",
44
44
  "@expo/config-plugins": "~7.2.0",
45
- "@expo/metro-config": "~0.10.0",
46
45
  "arg": "4.1.0",
47
46
  "expo-eas-client": "~0.6.0",
48
47
  "expo-manifests": "~0.7.0",
@@ -65,5 +64,5 @@
65
64
  "peerDependencies": {
66
65
  "expo": "*"
67
66
  },
68
- "gitHead": "554e8b88a1a5d7f54c67cdb66e928a0adfb8731d"
67
+ "gitHead": "cf90d5c30c2a08a6493ebfa8aa3791aa70666759"
69
68
  }
@@ -1,5 +1,5 @@
1
+ const { loadMetroConfigAsync } = require('@expo/cli/build/src/start/server/metro/instantiateMetro');
1
2
  const { resolveEntryPoint } = require('@expo/config/paths');
2
- const { loadAsync } = require('@expo/metro-config');
3
3
  const crypto = require('crypto');
4
4
  const fs = require('fs');
5
5
  const Server = require('metro/src/Server');
@@ -52,7 +52,13 @@ function getRelativeEntryPoint(projectRoot, platform) {
52
52
 
53
53
  let metroConfig;
54
54
  try {
55
- metroConfig = await loadAsync(projectRoot);
55
+ // Load the metro config the same way it would be loaded in Expo CLI.
56
+ // This ensures dynamic features like tsconfig paths can be used.
57
+ metroConfig = (
58
+ await loadMetroConfigAsync(projectRoot, {
59
+ // No config options can be passed to this point.
60
+ })
61
+ ).config;
56
62
  } catch (e) {
57
63
  let message = `Error loading Metro config and Expo app config: ${e.message}\n\nMake sure your project is configured properly and your app.json / app.config.js is valid.`;
58
64
  if (process.env.EAS_BUILD) {
@@ -55,7 +55,7 @@ const checkCompleteAvailableAction = assign({
55
55
  isChecking: () => false,
56
56
  isUpdateAvailable: () => true,
57
57
  isRollback: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>
58
- event.body?.isRollBackToEmbedded,
58
+ Boolean(event.body?.isRollBackToEmbedded),
59
59
  });
60
60
 
61
61
  const checkCompleteUnavailableAction = assign({
@@ -68,7 +68,8 @@ const checkCompleteUnavailableAction = assign({
68
68
 
69
69
  const checkErrorAction = assign({
70
70
  isChecking: () => false,
71
- checkError: (event: UpdatesStateMachineEvent) => new Error(event.body?.message || 'checkError'),
71
+ checkError: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>
72
+ new Error(event.body?.message || 'checkError'),
72
73
  });
73
74
 
74
75
  const downloadCompleteAction = assign({
@@ -85,7 +86,7 @@ const downloadCompleteAction = assign({
85
86
  });
86
87
 
87
88
  const downloadErrorAction = assign({
88
- downloadError: (event: UpdatesStateMachineEvent) =>
89
+ downloadError: (context: UpdatesStateMachineContext, event: UpdatesStateMachineEvent) =>
89
90
  new Error(event.body?.message || 'downloadError'),
90
91
  isDownloading: () => false,
91
92
  });