expo-updates 0.25.0 → 0.25.1
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 +10 -0
- package/android/build.gradle +2 -2
- package/build/ExpoUpdates.web.d.ts.map +1 -1
- package/build/Updates.js.map +1 -1
- package/build/UpdatesEmitter.d.ts.map +1 -1
- package/build/UpdatesEmitter.js.map +1 -1
- package/cli/build/assetsVerifyAsync.js +8 -7
- package/cli/build/configureCodeSigningAsync.js +2 -1
- package/cli/build/generateCodeSigningAsync.js +2 -1
- package/cli/build/generateFingerprint.js +4 -1
- package/cli/build/syncConfigurationToNativeAsync.js +2 -1
- package/cli/build/utils/args.js +4 -3
- package/cli/build/utils/dir.js +2 -1
- package/cli/build/utils/errors.js +2 -2
- package/cli/build/utils/log.js +9 -8
- package/cli/build/utils/modifyConfigAsync.js +2 -1
- package/cli/src/generateFingerprint.ts +5 -1
- package/ios/EXUpdates.podspec +1 -1
- package/package.json +2 -2
- package/utils/build/createFingerprintAsync.js +2 -1
- package/utils/build/createFingerprintForBuildAsync.js +2 -1
- package/utils/build/createManifestForBuildAsync.js +3 -2
- package/utils/build/filterPlatformAssetScales.js +2 -1
- package/utils/build/findUpProjectRoot.js +2 -1
- package/utils/build/resolveRuntimeVersionAsync.js +2 -1
- package/utils/build/vcs.js +1 -1
- package/utils/build/workflow.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.25.1 — 2024-04-22
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Add --debug option to fingerprint:generate command. ([#28311](https://github.com/expo/expo/pull/28311) by [@wschurman](https://github.com/wschurman))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Bumped the underlying SQLite version to 3.45.3 on iOS. ([#28358](https://github.com/expo/expo/pull/28358) by [@kudo](https://github.com/kudo))
|
|
22
|
+
|
|
13
23
|
## 0.25.0 — 2024-04-18
|
|
14
24
|
|
|
15
25
|
### 🛠 Breaking changes
|
package/android/build.gradle
CHANGED
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|
|
2
2
|
apply plugin: 'kotlin-kapt'
|
|
3
3
|
|
|
4
4
|
group = 'host.exp.exponent'
|
|
5
|
-
version = '0.25.
|
|
5
|
+
version = '0.25.1'
|
|
6
6
|
|
|
7
7
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
8
8
|
apply from: expoModulesCorePlugin
|
|
@@ -48,7 +48,7 @@ android {
|
|
|
48
48
|
namespace "expo.modules.updates"
|
|
49
49
|
defaultConfig {
|
|
50
50
|
versionCode 31
|
|
51
|
-
versionName '0.25.
|
|
51
|
+
versionName '0.25.1'
|
|
52
52
|
consumerProguardFiles("proguard-rules.pro")
|
|
53
53
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoUpdates.web.d.ts","sourceRoot":"","sources":["../src/ExpoUpdates.web.ts"],"names":[],"mappings":";cACkB,
|
|
1
|
+
{"version":3,"file":"ExpoUpdates.web.d.ts","sourceRoot":"","sources":["../src/ExpoUpdates.web.ts"],"names":[],"mappings":";cACkB,QAAQ,IAAI,CAAC;;AAD/B,wBAIE"}
|
package/build/Updates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.js","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,WAAW,MAAM,eAAe,CAAC;AAWxC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAY,CAAC,CAAC,WAAW,CAAC,SAAS,CA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';\nimport {\n LocalAssets,\n Manifest,\n UpdateCheckResult,\n UpdateFetchResult,\n UpdatesCheckAutomaticallyValue,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * Whether expo-updates is enabled. This may be false in a variety of cases including:\n * - enabled set to false in configuration\n * - missing or invalid URL in configuration\n * - missing runtime version or SDK version in configuration\n * - error accessing storage on device during initialization\n *\n * When false, the embedded update is loaded.\n */\nexport const isEnabled: boolean = !!ExpoUpdates.isEnabled;\n\n/**\n * The UUID that uniquely identifies the currently running update. The\n * UUID is represented in its canonical string form and will always use lowercase letters.\n * This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.\n * @example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n */\nexport const updateId: string | null =\n ExpoUpdates.updateId && typeof ExpoUpdates.updateId === 'string'\n ? ExpoUpdates.updateId.toLowerCase()\n : null;\n\n/**\n * The channel name of the current build, if configured for use with EAS Update. `null` otherwise.\n *\n * Expo Go and development builds are not set to a specific channel and can run any updates compatible with their native runtime. Therefore, this value will always be `null` when running an update on Expo Go or a development build.\n */\nexport const channel: string | null = ExpoUpdates.channel ?? null;\n\n/**\n * The runtime version of the current build.\n */\nexport const runtimeVersion: string | null = ExpoUpdates.runtimeVersion ?? null;\n\nconst _checkAutomaticallyMapNativeToJS = {\n ALWAYS: 'ON_LOAD',\n ERROR_RECOVERY_ONLY: 'ON_ERROR_RECOVERY',\n NEVER: 'NEVER',\n WIFI_ONLY: 'WIFI_ONLY',\n};\n\n/**\n * Determines if and when expo-updates checks for and downloads updates automatically on startup.\n */\nexport const checkAutomatically: UpdatesCheckAutomaticallyValue | null =\n _checkAutomaticallyMapNativeToJS[ExpoUpdates.checkAutomatically] ?? null;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const localAssets: LocalAssets = ExpoUpdates.localAssets ?? {};\n\n/**\n * `expo-updates` does its very best to always launch monotonically newer versions of your app so\n * you don't need to worry about backwards compatibility when you put out an update. In very rare\n * cases, it's possible that `expo-updates` may need to fall back to the update that's embedded in\n * the app binary, even after newer updates have been downloaded and run (an \"emergency launch\").\n * This boolean will be `true` if the app is launching under this fallback mechanism and `false`\n * otherwise. If you are concerned about backwards compatibility of future updates to your app, you\n * can use this constant to provide special behavior for this rare case.\n */\nexport const isEmergencyLaunch = ExpoUpdates.isEmergencyLaunch;\n\n/**\n * If `isEmergencyLaunch` is set to true, this will contain a string error message describing\n * what failed during initialization.\n */\nexport const emergencyLaunchReason = ExpoUpdates.emergencyLaunchReason;\n\n/**\n * This will be true if the currently running update is the one embedded in the build,\n * and not one downloaded from the updates server.\n */\nexport const isEmbeddedLaunch: boolean = ExpoUpdates.isEmbeddedLaunch || false;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const isUsingEmbeddedAssets: boolean = ExpoUpdates.isUsingEmbeddedAssets || false;\n\n/**\n * If `expo-updates` is enabled, this is the\n * [manifest](/versions/latest/sdk/constants/#manifest) (or\n * [classic manifest](/versions/latest/sdk/constants/#appmanifest))\n * object for the update that's currently running.\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this object is\n * empty.\n */\nexport const manifest: Partial<Manifest> =\n (ExpoUpdates.manifestString ? JSON.parse(ExpoUpdates.manifestString) : ExpoUpdates.manifest) ??\n {};\n\n/**\n * If `expo-updates` is enabled, this is a `Date` object representing the creation time of the update that's currently running (whether it was embedded or downloaded at runtime).\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this value is\n * null.\n */\nexport const createdAt: Date | null = ExpoUpdates.commitTime\n ? new Date(ExpoUpdates.commitTime)\n : null;\n\n/**\n * During non-expo development we block accessing the updates API methods on the JS side, but when developing in\n * Expo Go or a development client build, the controllers should have control over which API methods should\n * be allowed.\n */\nconst shouldDeferToNativeForAPIMethodAvailabilityInDevelopment =\n !!ExpoUpdates.shouldDeferToNativeForAPIMethodAvailabilityInDevelopment;\n\n/**\n * Developer tool is set when a project is served by `expo start`.\n */\nconst isUsingDeveloperTool =\n 'extra' in manifest ? !!manifest.extra?.expoGo?.developer?.tool : false;\n\nconst manualUpdatesInstructions =\n 'To test usage of the expo-updates JS API in your app, make a release build with `npx expo run:ios --configuration Release` or ' +\n '`npx expo run:android --variant Release`.';\n\n/**\n * Instructs the app to reload using the most recently downloaded version. This is useful for\n * triggering a newly downloaded update to launch without the user needing to manually restart the\n * app.\n *\n * It is not recommended to place any meaningful logic after a call to `await\n * Updates.reloadAsync()`. This is because the promise is resolved after verifying that the app can\n * be reloaded, and immediately before posting an asynchronous task to the main thread to actually\n * reload the app. It is unsafe to make any assumptions about whether any more JS code will be\n * executed after the `Updates.reloadAsync` method call resolves, since that depends on the OS and\n * the state of the native module and main threads.\n *\n * This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you\n * try to do so. It also rejects when expo-updates is not enabled.\n *\n * @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or\n * rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production\n * mode, it most likely means you have installed the module incorrectly. Double check you've\n * followed the installation instructions. In particular, on iOS ensure that you set the `bridge`\n * property on `EXUpdatesAppController` with a pointer to the `RCTBridge` you want to reload, and on\n * Android ensure you either call `UpdatesController.initialize` with the instance of\n * `ReactApplication` you want to reload, or call `UpdatesController.setReactNativeHost` with the\n * proper instance of `ReactNativeHost`.\n */\nexport async function reloadAsync(): Promise<void> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot use the Updates module in development mode in a production app. ${manualUpdatesInstructions}`\n );\n }\n await ExpoUpdates.reload();\n}\n\n/**\n * Checks the server to see if a newly deployed update to your project is available. Does not\n * actually download the update. This method cannot be used in development mode, and the returned\n * promise will be rejected if you try to do so.\n *\n * Checking for an update uses a device's bandwidth and battery life like any network call.\n * Additionally, updates served by Expo may be rate limited. A good rule of thumb to check for\n * updates judiciously is to check when the user launches or foregrounds the app. Avoid polling for\n * updates in a frequent loop.\n *\n * @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function checkForUpdateAsync(): Promise<UpdateCheckResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot check for updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.checkForUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * Retrieves the current extra params.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function getExtraParamsAsync(): Promise<Record<string, string>> {\n return await ExpoUpdates.getExtraParamsAsync();\n}\n\n/**\n * Sets an extra param if value is non-null, otherwise unsets the param.\n * Extra params are sent as an [Expo Structured Field Value Dictionary](https://docs.expo.dev/technical-specs/expo-sfv-0/)\n * in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function setExtraParamAsync(\n key: string,\n value: string | null | undefined\n): Promise<void> {\n return await ExpoUpdates.setExtraParamAsync(key, value ?? null);\n}\n\n/**\n * Retrieves the most recent expo-updates log entries.\n *\n * @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to 3600000 ms (1 hour).\n *\n * @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;\n *\n * The promise rejects if there is an unexpected error in retrieving the logs.\n */\nexport async function readLogEntriesAsync(maxAge: number = 3600000): Promise<UpdatesLogEntry[]> {\n return await ExpoUpdates.readLogEntriesAsync(maxAge);\n}\n\n/**\n * Clears existing expo-updates log entries.\n *\n * > For now, this operation does nothing on the client. Once log persistence has been\n * > implemented, this operation will actually remove existing logs.\n *\n * @return A promise that fulfills if the clear operation was successful.\n *\n * The promise rejects if there is an unexpected error in clearing the logs.\n *\n */\nexport async function clearLogEntriesAsync(): Promise<void> {\n await ExpoUpdates.clearLogEntriesAsync();\n}\n\n/**\n * Downloads the most recently deployed update to your project from server to the device's local\n * storage. This method cannot be used in development mode, and the returned promise will be\n * rejected if you try to do so.\n *\n > **Note:** [`reloadAsync()`](#updatesreloadasync) can be called after promise resolution to\n * reload the app using the most recently downloaded version. Otherwise, the update will be applied\n * on the next app cold start.\n *\n * @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function fetchUpdateAsync(): Promise<UpdateFetchResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot fetch updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.fetchUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * @hidden\n */\nexport function clearUpdateCacheExperimentalAsync(_sdkVersion?: string) {\n console.warn(\n \"This method is no longer necessary. `expo-updates` now automatically deletes your app's old bundle files!\"\n );\n}\n\n/**\n * @hidden\n */\nexport function transformNativeStateMachineContext(\n originalNativeContext: UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n): UpdatesNativeStateMachineContext {\n const nativeContext = { ...originalNativeContext };\n if (nativeContext.latestManifestString) {\n nativeContext.latestManifest = JSON.parse(nativeContext.latestManifestString);\n delete nativeContext.latestManifestString;\n }\n if (nativeContext.downloadedManifestString) {\n nativeContext.downloadedManifest = JSON.parse(nativeContext.downloadedManifestString);\n delete nativeContext.downloadedManifestString;\n }\n if (nativeContext.lastCheckForUpdateTimeString) {\n nativeContext.lastCheckForUpdateTime = new Date(nativeContext.lastCheckForUpdateTimeString);\n delete nativeContext.lastCheckForUpdateTimeString;\n }\n if (nativeContext.rollbackString) {\n nativeContext.rollback = JSON.parse(nativeContext.rollbackString);\n delete nativeContext.rollbackString;\n }\n return nativeContext;\n}\n\n/**\n * @hidden\n */\nexport async function getNativeStateMachineContextAsync(): Promise<UpdatesNativeStateMachineContext> {\n const nativeContext = await ExpoUpdates.getNativeStateMachineContextAsync();\n return transformNativeStateMachineContext(nativeContext);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Updates.js","sourceRoot":"","sources":["../src/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,WAAW,MAAM,eAAe,CAAC;AAWxC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAY,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GACnB,WAAW,CAAC,QAAQ,IAAI,OAAO,WAAW,CAAC,QAAQ,KAAK,QAAQ;IAC9D,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE;IACpC,CAAC,CAAC,IAAI,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAkB,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkB,WAAW,CAAC,cAAc,IAAI,IAAI,CAAC;AAEhF,MAAM,gCAAgC,GAAG;IACvC,MAAM,EAAE,SAAS;IACjB,mBAAmB,EAAE,mBAAmB;IACxC,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,W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AAwB,CAAC;KAC/C;IACD,IAAI,aAAa,CAAC,4BAA4B,EAAE;QAC9C,aAAa,CAAC,sBAAsB,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;QAC5F,OAAO,aAAa,CAAC,4BAA4B,CAAC;KACnD;IACD,IAAI,aAAa,CAAC,cAAc,EAAE;QAChC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAClE,OAAO,aAAa,CAAC,cAAc,CAAC;KACrC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC;IACrD,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,iCAAiC,EAAE,CAAC;IAC5E,OAAO,kCAAkC,CAAC,aAAa,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\n\nimport ExpoUpdates from './ExpoUpdates';\nimport {\n LocalAssets,\n Manifest,\n UpdateCheckResult,\n UpdateFetchResult,\n UpdatesCheckAutomaticallyValue,\n UpdatesLogEntry,\n UpdatesNativeStateMachineContext,\n} from './Updates.types';\n\n/**\n * Whether expo-updates is enabled. This may be false in a variety of cases including:\n * - enabled set to false in configuration\n * - missing or invalid URL in configuration\n * - missing runtime version or SDK version in configuration\n * - error accessing storage on device during initialization\n *\n * When false, the embedded update is loaded.\n */\nexport const isEnabled: boolean = !!ExpoUpdates.isEnabled;\n\n/**\n * The UUID that uniquely identifies the currently running update. The\n * UUID is represented in its canonical string form and will always use lowercase letters.\n * This value is `null` when running in a local development environment or any other environment where `expo-updates` is disabled.\n * @example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n */\nexport const updateId: string | null =\n ExpoUpdates.updateId && typeof ExpoUpdates.updateId === 'string'\n ? ExpoUpdates.updateId.toLowerCase()\n : null;\n\n/**\n * The channel name of the current build, if configured for use with EAS Update. `null` otherwise.\n *\n * Expo Go and development builds are not set to a specific channel and can run any updates compatible with their native runtime. Therefore, this value will always be `null` when running an update on Expo Go or a development build.\n */\nexport const channel: string | null = ExpoUpdates.channel ?? null;\n\n/**\n * The runtime version of the current build.\n */\nexport const runtimeVersion: string | null = ExpoUpdates.runtimeVersion ?? null;\n\nconst _checkAutomaticallyMapNativeToJS = {\n ALWAYS: 'ON_LOAD',\n ERROR_RECOVERY_ONLY: 'ON_ERROR_RECOVERY',\n NEVER: 'NEVER',\n WIFI_ONLY: 'WIFI_ONLY',\n};\n\n/**\n * Determines if and when expo-updates checks for and downloads updates automatically on startup.\n */\nexport const checkAutomatically: UpdatesCheckAutomaticallyValue | null =\n _checkAutomaticallyMapNativeToJS[ExpoUpdates.checkAutomatically] ?? null;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const localAssets: LocalAssets = ExpoUpdates.localAssets ?? {};\n\n/**\n * `expo-updates` does its very best to always launch monotonically newer versions of your app so\n * you don't need to worry about backwards compatibility when you put out an update. In very rare\n * cases, it's possible that `expo-updates` may need to fall back to the update that's embedded in\n * the app binary, even after newer updates have been downloaded and run (an \"emergency launch\").\n * This boolean will be `true` if the app is launching under this fallback mechanism and `false`\n * otherwise. If you are concerned about backwards compatibility of future updates to your app, you\n * can use this constant to provide special behavior for this rare case.\n */\nexport const isEmergencyLaunch = ExpoUpdates.isEmergencyLaunch;\n\n/**\n * If `isEmergencyLaunch` is set to true, this will contain a string error message describing\n * what failed during initialization.\n */\nexport const emergencyLaunchReason = ExpoUpdates.emergencyLaunchReason;\n\n/**\n * This will be true if the currently running update is the one embedded in the build,\n * and not one downloaded from the updates server.\n */\nexport const isEmbeddedLaunch: boolean = ExpoUpdates.isEmbeddedLaunch || false;\n\n// @docsMissing\n/**\n * @hidden\n */\nexport const isUsingEmbeddedAssets: boolean = ExpoUpdates.isUsingEmbeddedAssets || false;\n\n/**\n * If `expo-updates` is enabled, this is the\n * [manifest](/versions/latest/sdk/constants/#manifest) (or\n * [classic manifest](/versions/latest/sdk/constants/#appmanifest))\n * object for the update that's currently running.\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this object is\n * empty.\n */\nexport const manifest: Partial<Manifest> =\n (ExpoUpdates.manifestString ? JSON.parse(ExpoUpdates.manifestString) : ExpoUpdates.manifest) ??\n {};\n\n/**\n * If `expo-updates` is enabled, this is a `Date` object representing the creation time of the update that's currently running (whether it was embedded or downloaded at runtime).\n *\n * In development mode, or any other environment in which `expo-updates` is disabled, this value is\n * null.\n */\nexport const createdAt: Date | null = ExpoUpdates.commitTime\n ? new Date(ExpoUpdates.commitTime)\n : null;\n\n/**\n * During non-expo development we block accessing the updates API methods on the JS side, but when developing in\n * Expo Go or a development client build, the controllers should have control over which API methods should\n * be allowed.\n */\nconst shouldDeferToNativeForAPIMethodAvailabilityInDevelopment =\n !!ExpoUpdates.shouldDeferToNativeForAPIMethodAvailabilityInDevelopment;\n\n/**\n * Developer tool is set when a project is served by `expo start`.\n */\nconst isUsingDeveloperTool =\n 'extra' in manifest ? !!manifest.extra?.expoGo?.developer?.tool : false;\n\nconst manualUpdatesInstructions =\n 'To test usage of the expo-updates JS API in your app, make a release build with `npx expo run:ios --configuration Release` or ' +\n '`npx expo run:android --variant Release`.';\n\n/**\n * Instructs the app to reload using the most recently downloaded version. This is useful for\n * triggering a newly downloaded update to launch without the user needing to manually restart the\n * app.\n *\n * It is not recommended to place any meaningful logic after a call to `await\n * Updates.reloadAsync()`. This is because the promise is resolved after verifying that the app can\n * be reloaded, and immediately before posting an asynchronous task to the main thread to actually\n * reload the app. It is unsafe to make any assumptions about whether any more JS code will be\n * executed after the `Updates.reloadAsync` method call resolves, since that depends on the OS and\n * the state of the native module and main threads.\n *\n * This method cannot be used in Expo Go or development mode, and the returned promise will be rejected if you\n * try to do so. It also rejects when expo-updates is not enabled.\n *\n * @return A promise that fulfills right before the reload instruction is sent to the JS runtime, or\n * rejects if it cannot find a reference to the JS runtime. If the promise is rejected in production\n * mode, it most likely means you have installed the module incorrectly. Double check you've\n * followed the installation instructions. In particular, on iOS ensure that you set the `bridge`\n * property on `EXUpdatesAppController` with a pointer to the `RCTBridge` you want to reload, and on\n * Android ensure you either call `UpdatesController.initialize` with the instance of\n * `ReactApplication` you want to reload, or call `UpdatesController.setReactNativeHost` with the\n * proper instance of `ReactNativeHost`.\n */\nexport async function reloadAsync(): Promise<void> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot use the Updates module in development mode in a production app. ${manualUpdatesInstructions}`\n );\n }\n await ExpoUpdates.reload();\n}\n\n/**\n * Checks the server to see if a newly deployed update to your project is available. Does not\n * actually download the update. This method cannot be used in development mode, and the returned\n * promise will be rejected if you try to do so.\n *\n * Checking for an update uses a device's bandwidth and battery life like any network call.\n * Additionally, updates served by Expo may be rate limited. A good rule of thumb to check for\n * updates judiciously is to check when the user launches or foregrounds the app. Avoid polling for\n * updates in a frequent loop.\n *\n * @return A promise that fulfills with an [`UpdateCheckResult`](#updatecheckresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function checkForUpdateAsync(): Promise<UpdateCheckResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot check for updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.checkForUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * Retrieves the current extra params.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function getExtraParamsAsync(): Promise<Record<string, string>> {\n return await ExpoUpdates.getExtraParamsAsync();\n}\n\n/**\n * Sets an extra param if value is non-null, otherwise unsets the param.\n * Extra params are sent as an [Expo Structured Field Value Dictionary](https://docs.expo.dev/technical-specs/expo-sfv-0/)\n * in the `Expo-Extra-Params` header of update requests. A compliant update server may use these params when selecting an update to serve.\n *\n * This method cannot be used in Expo Go or development mode. It also rejects when expo-updates is not enabled.\n */\nexport async function setExtraParamAsync(\n key: string,\n value: string | null | undefined\n): Promise<void> {\n return await ExpoUpdates.setExtraParamAsync(key, value ?? null);\n}\n\n/**\n * Retrieves the most recent expo-updates log entries.\n *\n * @param maxAge Sets the max age of retrieved log entries in milliseconds. Default to 3600000 ms (1 hour).\n *\n * @return A promise that fulfills with an array of [`UpdatesLogEntry`](#updateslogentry) objects;\n *\n * The promise rejects if there is an unexpected error in retrieving the logs.\n */\nexport async function readLogEntriesAsync(maxAge: number = 3600000): Promise<UpdatesLogEntry[]> {\n return await ExpoUpdates.readLogEntriesAsync(maxAge);\n}\n\n/**\n * Clears existing expo-updates log entries.\n *\n * > For now, this operation does nothing on the client. Once log persistence has been\n * > implemented, this operation will actually remove existing logs.\n *\n * @return A promise that fulfills if the clear operation was successful.\n *\n * The promise rejects if there is an unexpected error in clearing the logs.\n *\n */\nexport async function clearLogEntriesAsync(): Promise<void> {\n await ExpoUpdates.clearLogEntriesAsync();\n}\n\n/**\n * Downloads the most recently deployed update to your project from server to the device's local\n * storage. This method cannot be used in development mode, and the returned promise will be\n * rejected if you try to do so.\n *\n > **Note:** [`reloadAsync()`](#updatesreloadasync) can be called after promise resolution to\n * reload the app using the most recently downloaded version. Otherwise, the update will be applied\n * on the next app cold start.\n *\n * @return A promise that fulfills with an [`UpdateFetchResult`](#updatefetchresult) object.\n *\n * The promise rejects in Expo Go or if the app is in development mode, or if there is an unexpected error or\n * timeout communicating with the server. It also rejects when expo-updates is not enabled.\n */\nexport async function fetchUpdateAsync(): Promise<UpdateFetchResult> {\n if (\n (__DEV__ || isUsingDeveloperTool) &&\n !shouldDeferToNativeForAPIMethodAvailabilityInDevelopment\n ) {\n throw new CodedError(\n 'ERR_UPDATES_DISABLED',\n `You cannot fetch updates in development mode. ${manualUpdatesInstructions}`\n );\n }\n\n const result = await ExpoUpdates.fetchUpdateAsync();\n if ('manifestString' in result) {\n const { manifestString, ...rest } = result;\n return {\n ...rest,\n manifest: JSON.parse(manifestString),\n };\n }\n return result;\n}\n\n/**\n * @hidden\n */\nexport function clearUpdateCacheExperimentalAsync(_sdkVersion?: string) {\n console.warn(\n \"This method is no longer necessary. `expo-updates` now automatically deletes your app's old bundle files!\"\n );\n}\n\n/**\n * @hidden\n */\nexport function transformNativeStateMachineContext(\n originalNativeContext: UpdatesNativeStateMachineContext & {\n latestManifestString?: string;\n downloadedManifestString?: string;\n lastCheckForUpdateTimeString?: string;\n rollbackString?: string;\n }\n): UpdatesNativeStateMachineContext {\n const nativeContext = { ...originalNativeContext };\n if (nativeContext.latestManifestString) {\n nativeContext.latestManifest = JSON.parse(nativeContext.latestManifestString);\n delete nativeContext.latestManifestString;\n }\n if (nativeContext.downloadedManifestString) {\n nativeContext.downloadedManifest = JSON.parse(nativeContext.downloadedManifestString);\n delete nativeContext.downloadedManifestString;\n }\n if (nativeContext.lastCheckForUpdateTimeString) {\n nativeContext.lastCheckForUpdateTime = new Date(nativeContext.lastCheckForUpdateTimeString);\n delete nativeContext.lastCheckForUpdateTimeString;\n }\n if (nativeContext.rollbackString) {\n nativeContext.rollback = JSON.parse(nativeContext.rollbackString);\n delete nativeContext.rollbackString;\n }\n return nativeContext;\n}\n\n/**\n * @hidden\n */\nexport async function getNativeStateMachineContextAsync(): Promise<UpdatesNativeStateMachineContext> {\n const nativeContext = await ExpoUpdates.getNativeStateMachineContextAsync();\n return transformNativeStateMachineContext(nativeContext);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdatesEmitter.d.ts","sourceRoot":"","sources":["../src/UpdatesEmitter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAuBrE;;;GAGG;AACH,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"UpdatesEmitter.d.ts","sourceRoot":"","sources":["../src/UpdatesEmitter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAuBrE;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qBACtB,6BAA6B,KAAK,IAAI,0CAGzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAAW,6BAA6B,SAE5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdatesEmitter.js","sourceRoot":"","sources":["../src/UpdatesEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kCAAkC,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,mBAAmB,GAAG,IAAI,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;AACtE,mBAAmB,CAAC,WAAW,CAAC,oCAAoC,EAAE,2BAA2B,CAAC,CAAC;AAEnG,IAAI,eAAe,GAA0B,IAAI,CAAC;AAClD,SAAS,kBAAkB;IACzB,IAAI,CAAC,eAAe,EAAE
|
|
1
|
+
{"version":3,"file":"UpdatesEmitter.js","sourceRoot":"","sources":["../src/UpdatesEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kCAAkC,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,mBAAmB,GAAG,IAAI,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;AACtE,mBAAmB,CAAC,WAAW,CAAC,oCAAoC,EAAE,2BAA2B,CAAC,CAAC;AAEnG,IAAI,eAAe,GAA0B,IAAI,CAAC;AAClD,SAAS,kBAAkB;IACzB,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,IAAI,cAAc,EAAE,CAAC;KACxC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,qCAAqC;AACrC,SAAS,2BAA2B,CAAC,MAAW;IAC9C,IAAI,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAChC;IACD,SAAS,CAAC,OAAO,GAAG,kCAAkC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1E,kBAAkB,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,QAAwD,EACxD,EAAE;IACF,OAAO,kBAAkB,EAAE,CAAC,WAAW,CAAC,8BAA8B,EAAE,QAAQ,CAAC,CAAC;AACpF,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAE,EAAE;IAC/E,2BAA2B,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC","sourcesContent":["import { EventEmitter as NativeEventEmitter } from 'expo-modules-core';\nimport { EventEmitter as JsEventEmitter } from 'fbemitter';\n\nimport ExpoUpdatesModule from './ExpoUpdates';\nimport { transformNativeStateMachineContext } from './Updates';\nimport type { UpdatesNativeStateChangeEvent } from './Updates.types';\n\nconst _nativeEventEmitter = new NativeEventEmitter(ExpoUpdatesModule);\n_nativeEventEmitter.addListener('Expo.nativeUpdatesStateChangeEvent', _emitNativeStateChangeEvent);\n\nlet _jsEventEmitter: JsEventEmitter | null = null;\nfunction _getJsEventEmitter(): JsEventEmitter {\n if (!_jsEventEmitter) {\n _jsEventEmitter = new JsEventEmitter();\n }\n return _jsEventEmitter;\n}\n\n// Reemits native state change events\nfunction _emitNativeStateChangeEvent(params: any) {\n let newParams = { ...params };\n if (typeof params === 'string') {\n newParams = JSON.parse(params);\n }\n newParams.context = transformNativeStateMachineContext(newParams.context);\n _getJsEventEmitter().emit('Expo.updatesStateChangeEvent', newParams);\n}\n\n/**\n * Add listener for state change events\n * @hidden\n */\nexport const addUpdatesStateChangeListener = (\n listener: (event: UpdatesNativeStateChangeEvent) => void\n) => {\n return _getJsEventEmitter().addListener('Expo.updatesStateChangeEvent', listener);\n};\n\n/**\n * Allows JS to emit a simulated native state change event (used in unit testing)\n * @hidden\n */\nexport const emitTestStateChangeEvent = (event: UpdatesNativeStateChangeEvent) => {\n _emitNativeStateChangeEvent(event);\n};\n"]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMissingAssetsAsync =
|
|
4
|
-
exports.getBuildManifestAsync = getBuildManifestAsync;
|
|
5
|
-
exports.getBuildManifestHashSet = getBuildManifestHashSet;
|
|
6
|
-
exports.getFullAssetDumpAsync = getFullAssetDumpAsync;
|
|
7
|
-
exports.getFullAssetDumpHashSet = getFullAssetDumpHashSet;
|
|
8
|
-
exports.getExportedMetadataAsync = getExportedMetadataAsync;
|
|
9
|
-
exports.getExportedMetadataHashSet = getExportedMetadataHashSet;
|
|
3
|
+
exports.getExportedMetadataHashSet = exports.getExportedMetadataAsync = exports.getFullAssetDumpHashSet = exports.getFullAssetDumpAsync = exports.getBuildManifestHashSet = exports.getBuildManifestAsync = exports.getMissingAssetsAsync = void 0;
|
|
10
4
|
const fs_1 = require("fs");
|
|
11
5
|
const errors_1 = require("./utils/errors");
|
|
12
6
|
const debug = require('debug')('expo-updates:assets:verify');
|
|
@@ -45,6 +39,7 @@ async function getMissingAssetsAsync(buildManifestPath, exportMetadataPath, asse
|
|
|
45
39
|
});
|
|
46
40
|
return missingAssets;
|
|
47
41
|
}
|
|
42
|
+
exports.getMissingAssetsAsync = getMissingAssetsAsync;
|
|
48
43
|
/**
|
|
49
44
|
* Reads and returns the embedded manifest (app.manifest) for a build.
|
|
50
45
|
*
|
|
@@ -58,6 +53,7 @@ async function getBuildManifestAsync(buildManifestPath) {
|
|
|
58
53
|
const buildManifest = JSON.parse(buildManifestString);
|
|
59
54
|
return buildManifest;
|
|
60
55
|
}
|
|
56
|
+
exports.getBuildManifestAsync = getBuildManifestAsync;
|
|
61
57
|
/**
|
|
62
58
|
* Extracts the set of asset hashes from a build manifest.
|
|
63
59
|
*
|
|
@@ -67,6 +63,7 @@ async function getBuildManifestAsync(buildManifestPath) {
|
|
|
67
63
|
function getBuildManifestHashSet(buildManifest) {
|
|
68
64
|
return new Set((buildManifest.assets ?? []).map((asset) => asset.packagerHash));
|
|
69
65
|
}
|
|
66
|
+
exports.getBuildManifestHashSet = getBuildManifestHashSet;
|
|
70
67
|
/**
|
|
71
68
|
* Reads and extracts the asset dump for an exported bundle.
|
|
72
69
|
*
|
|
@@ -78,6 +75,7 @@ async function getFullAssetDumpAsync(assetMapPath) {
|
|
|
78
75
|
const assetMap = new Map(Object.entries(JSON.parse(assetMapString)));
|
|
79
76
|
return assetMap;
|
|
80
77
|
}
|
|
78
|
+
exports.getFullAssetDumpAsync = getFullAssetDumpAsync;
|
|
81
79
|
/**
|
|
82
80
|
* Extracts the set of asset hashes from an asset dump.
|
|
83
81
|
*
|
|
@@ -96,6 +94,7 @@ function getFullAssetDumpHashSet(assetDump) {
|
|
|
96
94
|
fullAssetHashMap,
|
|
97
95
|
};
|
|
98
96
|
}
|
|
97
|
+
exports.getFullAssetDumpHashSet = getFullAssetDumpHashSet;
|
|
99
98
|
/**
|
|
100
99
|
* Reads and extracts the metadata.json from an exported bundle.
|
|
101
100
|
*
|
|
@@ -107,6 +106,7 @@ async function getExportedMetadataAsync(exportedMetadataPath) {
|
|
|
107
106
|
const metadata = JSON.parse(metadataString);
|
|
108
107
|
return metadata;
|
|
109
108
|
}
|
|
109
|
+
exports.getExportedMetadataAsync = getExportedMetadataAsync;
|
|
110
110
|
/**
|
|
111
111
|
* Extracts the set of asset hashes from an exported bundle's metadata for a given platform.
|
|
112
112
|
*
|
|
@@ -123,3 +123,4 @@ function getExportedMetadataHashSet(metadata, platform) {
|
|
|
123
123
|
// Asset paths in the export metadata are of the form 'assets/<hash string>'
|
|
124
124
|
return new Set(assets.map((asset) => asset.path.substring(7, asset.path.length)));
|
|
125
125
|
}
|
|
126
|
+
exports.getExportedMetadataHashSet = getExportedMetadataHashSet;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.configureCodeSigningAsync =
|
|
6
|
+
exports.configureCodeSigningAsync = void 0;
|
|
7
7
|
const code_signing_certificates_1 = require("@expo/code-signing-certificates");
|
|
8
8
|
const config_1 = require("@expo/config");
|
|
9
9
|
const fs_1 = require("fs");
|
|
@@ -41,3 +41,4 @@ async function configureCodeSigningAsync(projectRoot, { certificateInput, keyInp
|
|
|
41
41
|
});
|
|
42
42
|
(0, log_1.log)(`Code signing configuration written to app configuration.`);
|
|
43
43
|
}
|
|
44
|
+
exports.configureCodeSigningAsync = configureCodeSigningAsync;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateCodeSigningAsync =
|
|
6
|
+
exports.generateCodeSigningAsync = void 0;
|
|
7
7
|
const code_signing_certificates_1 = require("@expo/code-signing-certificates");
|
|
8
8
|
const assert_1 = __importDefault(require("assert"));
|
|
9
9
|
const fs_1 = require("fs");
|
|
@@ -42,3 +42,4 @@ async function generateCodeSigningAsync(projectRoot, { certificateValidityDurati
|
|
|
42
42
|
(0, log_1.log)(`Generated code signing certificate output in ${certificateOutputDir}.`);
|
|
43
43
|
(0, log_1.log)(`To automatically configure this project for code signing, run \`yarn expo-updates codesigning:configure --certificate-input-directory=${certificateOutput} --key-input-directory=${keyOutput}\`.`);
|
|
44
44
|
}
|
|
45
|
+
exports.generateCodeSigningAsync = generateCodeSigningAsync;
|
|
@@ -37,6 +37,7 @@ const generateFingerprint = async (argv) => {
|
|
|
37
37
|
// Types
|
|
38
38
|
'--help': Boolean,
|
|
39
39
|
'--platform': String,
|
|
40
|
+
'--debug': Boolean,
|
|
40
41
|
// Aliases
|
|
41
42
|
'-h': '--help',
|
|
42
43
|
}, argv ?? []);
|
|
@@ -50,6 +51,7 @@ Generate fingerprint for use in expo-updates runtime version
|
|
|
50
51
|
|
|
51
52
|
Options
|
|
52
53
|
--platform <string> Platform to generate a fingerprint for
|
|
54
|
+
--debug Whether to include verbose debug information in output
|
|
53
55
|
-h, --help Output usage information
|
|
54
56
|
`, 0);
|
|
55
57
|
}
|
|
@@ -61,11 +63,12 @@ Generate fingerprint for use in expo-updates runtime version
|
|
|
61
63
|
if (!['ios', 'android'].includes(platform)) {
|
|
62
64
|
throw new errors_1.CommandError(`Invalid platform argument: ${platform}`);
|
|
63
65
|
}
|
|
66
|
+
const debug = args['--debug'];
|
|
64
67
|
const projectRoot = (0, args_1.getProjectRoot)(args);
|
|
65
68
|
let result;
|
|
66
69
|
try {
|
|
67
70
|
const workflow = await resolveWorkflowAsync(projectRoot, platform);
|
|
68
|
-
result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true });
|
|
71
|
+
result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true, debug });
|
|
69
72
|
}
|
|
70
73
|
catch (e) {
|
|
71
74
|
throw new errors_1.CommandError(e.message);
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.syncConfigurationToNativeAsync =
|
|
6
|
+
exports.syncConfigurationToNativeAsync = void 0;
|
|
7
7
|
const config_1 = require("@expo/config");
|
|
8
8
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
9
9
|
const plist_1 = __importDefault(require("@expo/plist"));
|
|
@@ -27,6 +27,7 @@ async function syncConfigurationToNativeAsync(options) {
|
|
|
27
27
|
break;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
exports.syncConfigurationToNativeAsync = syncConfigurationToNativeAsync;
|
|
30
31
|
async function syncConfigurationToNativeAndroidAsync(options) {
|
|
31
32
|
const { exp } = (0, config_1.getConfig)(options.projectRoot, {
|
|
32
33
|
isPublicConfig: true,
|
package/cli/build/utils/args.js
CHANGED
|
@@ -26,9 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getProjectRoot =
|
|
30
|
-
exports.assertArgs = assertArgs;
|
|
31
|
-
exports.requireArg = requireArg;
|
|
29
|
+
exports.requireArg = exports.assertArgs = exports.getProjectRoot = void 0;
|
|
32
30
|
// Common utilities for interacting with `args` library.
|
|
33
31
|
// These functions should be used by every command.
|
|
34
32
|
const arg_1 = __importDefault(require("arg"));
|
|
@@ -47,6 +45,7 @@ function getProjectRoot(args) {
|
|
|
47
45
|
}
|
|
48
46
|
return projectRoot;
|
|
49
47
|
}
|
|
48
|
+
exports.getProjectRoot = getProjectRoot;
|
|
50
49
|
/**
|
|
51
50
|
* Parse args and assert unknown options.
|
|
52
51
|
*
|
|
@@ -67,6 +66,7 @@ function assertArgs(schema, argv) {
|
|
|
67
66
|
throw error;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
69
|
+
exports.assertArgs = assertArgs;
|
|
70
70
|
function requireArg(args, name) {
|
|
71
71
|
const value = args[name];
|
|
72
72
|
if (value === undefined || value === null) {
|
|
@@ -74,3 +74,4 @@ function requireArg(args, name) {
|
|
|
74
74
|
}
|
|
75
75
|
return value;
|
|
76
76
|
}
|
|
77
|
+
exports.requireArg = requireArg;
|
package/cli/build/utils/dir.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureDirAsync =
|
|
3
|
+
exports.ensureDirAsync = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
function ensureDirAsync(path) {
|
|
6
6
|
return fs_1.promises.mkdir(path, { recursive: true });
|
|
7
7
|
}
|
|
8
|
+
exports.ensureDirAsync = ensureDirAsync;
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CommandError = void 0;
|
|
7
|
-
exports.logCmdError = logCmdError;
|
|
6
|
+
exports.logCmdError = exports.CommandError = void 0;
|
|
8
7
|
const assert_1 = require("assert");
|
|
9
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
9
|
const log_1 = require("./log");
|
|
@@ -39,3 +38,4 @@ function logCmdError(error) {
|
|
|
39
38
|
const errorDetails = error.stack ? '\n' + chalk_1.default.gray(error.stack) : '';
|
|
40
39
|
(0, log_1.exit)(chalk_1.default.red(error.toString()) + errorDetails);
|
|
41
40
|
}
|
|
41
|
+
exports.logCmdError = logCmdError;
|
package/cli/build/utils/log.js
CHANGED
|
@@ -3,38 +3,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.time =
|
|
7
|
-
exports.timeEnd = timeEnd;
|
|
8
|
-
exports.error = error;
|
|
9
|
-
exports.exception = exception;
|
|
10
|
-
exports.warn = warn;
|
|
11
|
-
exports.log = log;
|
|
12
|
-
exports.clear = clear;
|
|
13
|
-
exports.exit = exit;
|
|
6
|
+
exports.exit = exports.clear = exports.log = exports.warn = exports.exception = exports.error = exports.timeEnd = exports.time = void 0;
|
|
14
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
8
|
function time(label) {
|
|
16
9
|
console.time(label);
|
|
17
10
|
}
|
|
11
|
+
exports.time = time;
|
|
18
12
|
function timeEnd(label) {
|
|
19
13
|
console.timeEnd(label);
|
|
20
14
|
}
|
|
15
|
+
exports.timeEnd = timeEnd;
|
|
21
16
|
function error(...message) {
|
|
22
17
|
console.error(...message);
|
|
23
18
|
}
|
|
19
|
+
exports.error = error;
|
|
24
20
|
/** Print an error and provide additional info (the stack trace) in debug mode. */
|
|
25
21
|
function exception(e) {
|
|
26
22
|
error(chalk_1.default.red(e.toString()) + (process.env.EXPO_DEBUG ? '\n' + chalk_1.default.gray(e.stack) : ''));
|
|
27
23
|
}
|
|
24
|
+
exports.exception = exception;
|
|
28
25
|
function warn(...message) {
|
|
29
26
|
console.warn(...message.map((value) => chalk_1.default.yellow(value)));
|
|
30
27
|
}
|
|
28
|
+
exports.warn = warn;
|
|
31
29
|
function log(...message) {
|
|
32
30
|
console.log(...message);
|
|
33
31
|
}
|
|
32
|
+
exports.log = log;
|
|
34
33
|
/** Clear the terminal of all text. */
|
|
35
34
|
function clear() {
|
|
36
35
|
process.stdout.write(process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H');
|
|
37
36
|
}
|
|
37
|
+
exports.clear = clear;
|
|
38
38
|
/** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
|
|
39
39
|
function exit(message, code = 1) {
|
|
40
40
|
if (message instanceof Error) {
|
|
@@ -51,3 +51,4 @@ function exit(message, code = 1) {
|
|
|
51
51
|
}
|
|
52
52
|
process.exit(code);
|
|
53
53
|
}
|
|
54
|
+
exports.exit = exit;
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.attemptModification =
|
|
29
|
+
exports.attemptModification = void 0;
|
|
30
30
|
const config_1 = require("@expo/config");
|
|
31
31
|
const chalk_1 = __importDefault(require("chalk"));
|
|
32
32
|
const Log = __importStar(require("./log"));
|
|
@@ -42,6 +42,7 @@ async function attemptModification(projectRoot, edits, exactEdits) {
|
|
|
42
42
|
warnAboutConfigAndThrow(modification.type, modification.message, exactEdits);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
exports.attemptModification = attemptModification;
|
|
45
46
|
function logNoConfig() {
|
|
46
47
|
Log.log(chalk_1.default.yellow(`No Expo config was found. Please create an Expo config (${chalk_1.default.bold `app.json`} or ${chalk_1.default.bold `app.config.js`}) in your project root.`));
|
|
47
48
|
}
|
|
@@ -12,6 +12,7 @@ export const generateFingerprint: Command = async (argv) => {
|
|
|
12
12
|
// Types
|
|
13
13
|
'--help': Boolean,
|
|
14
14
|
'--platform': String,
|
|
15
|
+
'--debug': Boolean,
|
|
15
16
|
// Aliases
|
|
16
17
|
'-h': '--help',
|
|
17
18
|
},
|
|
@@ -29,6 +30,7 @@ Generate fingerprint for use in expo-updates runtime version
|
|
|
29
30
|
|
|
30
31
|
Options
|
|
31
32
|
--platform <string> Platform to generate a fingerprint for
|
|
33
|
+
--debug Whether to include verbose debug information in output
|
|
32
34
|
-h, --help Output usage information
|
|
33
35
|
`,
|
|
34
36
|
0
|
|
@@ -45,12 +47,14 @@ Generate fingerprint for use in expo-updates runtime version
|
|
|
45
47
|
throw new CommandError(`Invalid platform argument: ${platform}`);
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
const debug = args['--debug'];
|
|
51
|
+
|
|
48
52
|
const projectRoot = getProjectRoot(args);
|
|
49
53
|
|
|
50
54
|
let result;
|
|
51
55
|
try {
|
|
52
56
|
const workflow = await resolveWorkflowAsync(projectRoot, platform);
|
|
53
|
-
result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true });
|
|
57
|
+
result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true, debug });
|
|
54
58
|
} catch (e: any) {
|
|
55
59
|
throw new CommandError(e.message);
|
|
56
60
|
}
|
package/ios/EXUpdates.podspec
CHANGED
|
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
|
|
|
28
28
|
s.dependency 'EXManifests'
|
|
29
29
|
s.dependency 'EASClient'
|
|
30
30
|
s.dependency 'ReachabilitySwift'
|
|
31
|
-
s.dependency 'sqlite3', '~> 3.
|
|
31
|
+
s.dependency 'sqlite3', '~> 3.45.3+1'
|
|
32
32
|
|
|
33
33
|
unless defined?(install_modules_dependencies)
|
|
34
34
|
# `install_modules_dependencies` is defined from react_native_pods.rb.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
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",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"expo": "*"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "0897aeadb926491a457bcd67d83360956994ee82"
|
|
71
71
|
}
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createFingerprintAsync =
|
|
26
|
+
exports.createFingerprintAsync = void 0;
|
|
27
27
|
const Fingerprint = __importStar(require("@expo/fingerprint"));
|
|
28
28
|
async function createFingerprintAsync(projectRoot, platform, workflow, options) {
|
|
29
29
|
if (workflow === 'generic') {
|
|
@@ -42,3 +42,4 @@ async function createFingerprintAsync(projectRoot, platform, workflow, options)
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
exports.createFingerprintAsync = createFingerprintAsync;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createFingerprintForBuildAsync =
|
|
6
|
+
exports.createFingerprintForBuildAsync = void 0;
|
|
7
7
|
const config_1 = require("@expo/config");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -49,3 +49,4 @@ async function createFingerprintForBuildAsync(platform, possibleProjectRoot, des
|
|
|
49
49
|
}
|
|
50
50
|
fs_1.default.writeFileSync(path_1.default.join(destinationDir, 'fingerprint'), fingerprint.hash);
|
|
51
51
|
}
|
|
52
|
+
exports.createFingerprintForBuildAsync = createFingerprintForBuildAsync;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createManifestForBuildAsync =
|
|
6
|
+
exports.createManifestForBuildAsync = void 0;
|
|
7
7
|
const exportEmbedAsync_1 = require("@expo/cli/build/src/export/embed/exportEmbedAsync");
|
|
8
8
|
const metroAssetLocalPath_1 = require("@expo/cli/build/src/export/metroAssetLocalPath");
|
|
9
9
|
const paths_1 = require("@expo/config/paths");
|
|
@@ -32,7 +32,7 @@ async function createManifestForBuildAsync(platform, possibleProjectRoot, destin
|
|
|
32
32
|
platform,
|
|
33
33
|
entryFile,
|
|
34
34
|
minify: false,
|
|
35
|
-
dev: process.env.CONFIGURATION === 'Debug',
|
|
35
|
+
dev: process.env.CONFIGURATION === 'Debug',
|
|
36
36
|
sourcemapUseAbsolutePath: false,
|
|
37
37
|
};
|
|
38
38
|
const { server, bundleRequest } = (await (0, exportEmbedAsync_1.createMetroServerAndBundleRequestAsync)(projectRoot, options));
|
|
@@ -83,6 +83,7 @@ async function createManifestForBuildAsync(platform, possibleProjectRoot, destin
|
|
|
83
83
|
});
|
|
84
84
|
fs_1.default.writeFileSync(path_1.default.join(destinationDir, 'app.manifest'), JSON.stringify(manifest));
|
|
85
85
|
}
|
|
86
|
+
exports.createManifestForBuildAsync = createManifestForBuildAsync;
|
|
86
87
|
/**
|
|
87
88
|
* Resolve the relative entry file using Expo's resolution method.
|
|
88
89
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// copied from https://github.com/react-native-community/cli/blob/48136adfb814d335e957e22129d049c4a05c8759/packages/cli/src/commands/bundle/filterPlatformAssetScales.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.filterPlatformAssetScales =
|
|
4
|
+
exports.filterPlatformAssetScales = void 0;
|
|
5
5
|
const ALLOWED_SCALES = {
|
|
6
6
|
ios: [1, 2, 3],
|
|
7
7
|
};
|
|
@@ -29,3 +29,4 @@ function filterPlatformAssetScales(platform, scales) {
|
|
|
29
29
|
}
|
|
30
30
|
return result;
|
|
31
31
|
}
|
|
32
|
+
exports.filterPlatformAssetScales = filterPlatformAssetScales;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findUpProjectRoot =
|
|
6
|
+
exports.findUpProjectRoot = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
function findUpProjectRoot(cwd) {
|
|
@@ -17,3 +17,4 @@ function findUpProjectRoot(cwd) {
|
|
|
17
17
|
return findUpProjectRoot(path_1.default.dirname(cwd));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
exports.findUpProjectRoot = findUpProjectRoot;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveRuntimeVersionAsync =
|
|
3
|
+
exports.resolveRuntimeVersionAsync = void 0;
|
|
4
4
|
const config_1 = require("@expo/config");
|
|
5
5
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
6
|
const createFingerprintAsync_1 = require("./createFingerprintAsync");
|
|
@@ -29,3 +29,4 @@ async function resolveRuntimeVersionAsync(projectRoot, platform, options) {
|
|
|
29
29
|
workflow,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
exports.resolveRuntimeVersionAsync = resolveRuntimeVersionAsync;
|
package/utils/build/vcs.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = getVCSClientAsync;
|
|
7
6
|
const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
|
|
8
7
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
9
8
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
@@ -17,6 +16,7 @@ async function getVCSClientAsync(projectDir) {
|
|
|
17
16
|
return new NoVCSClient(projectDir);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
19
|
+
exports.default = getVCSClientAsync;
|
|
20
20
|
class GitClient {
|
|
21
21
|
async getRootPathAsync() {
|
|
22
22
|
return (await (0, spawn_async_1.default)('git', ['rev-parse', '--show-toplevel'])).stdout.trim();
|
package/utils/build/workflow.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.resolveWorkflowAsync =
|
|
6
|
+
exports.resolveWorkflowAsync = void 0;
|
|
7
7
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -32,3 +32,4 @@ async function resolveWorkflowAsync(projectDir, platform) {
|
|
|
32
32
|
}
|
|
33
33
|
return 'managed';
|
|
34
34
|
}
|
|
35
|
+
exports.resolveWorkflowAsync = resolveWorkflowAsync;
|