expo-updates 0.25.26 → 0.25.27

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,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.25.27 — 2024-10-08
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [cli] Disable console during runtime and fingeprint evaluation ([#31874](https://github.com/expo/expo/pull/31874) by [@wschurman](https://github.com/wschurman))
18
+
13
19
  ## 0.25.26 — 2024-10-02
14
20
 
15
21
  ### 🐛 Bug fixes
@@ -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.26'
5
+ version = '0.25.27'
6
6
 
7
7
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
8
8
  apply from: expoModulesCorePlugin
@@ -49,7 +49,7 @@ android {
49
49
  namespace "expo.modules.updates"
50
50
  defaultConfig {
51
51
  versionCode 31
52
- versionName '0.25.26'
52
+ versionName '0.25.27'
53
53
  consumerProguardFiles(rnVersion >= versionToNumber(0, 75, 0) ? 'proguard-rules-75.pro' : 'proguard-rules.pro')
54
54
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
55
55
 
@@ -59,7 +59,7 @@ Configure expo-updates code signing for this project and verify setup
59
59
  const certificateInput = (0, args_1.requireArg)(args, '--certificate-input-directory');
60
60
  const keyInput = (0, args_1.requireArg)(args, '--key-input-directory');
61
61
  const keyid = args['--keyid'];
62
- return await configureCodeSigningAsync((0, args_1.getProjectRoot)(args), {
62
+ await configureCodeSigningAsync((0, args_1.getProjectRoot)(args), {
63
63
  certificateInput,
64
64
  keyInput,
65
65
  keyid,
@@ -63,7 +63,7 @@ Generate expo-updates private key, public key, and code signing certificate usin
63
63
  const certificateOutput = (0, args_1.requireArg)(args, '--certificate-output-directory');
64
64
  const certificateValidityDurationYears = (0, args_1.requireArg)(args, '--certificate-validity-duration-years');
65
65
  const certificateCommonName = (0, args_1.requireArg)(args, '--certificate-common-name');
66
- return await generateCodeSigningAsync((0, args_1.getProjectRoot)(args), {
66
+ await generateCodeSigningAsync((0, args_1.getProjectRoot)(args), {
67
67
  certificateValidityDurationYears,
68
68
  keyOutput,
69
69
  certificateOutput,
@@ -32,6 +32,7 @@ const chalk_1 = __importDefault(require("chalk"));
32
32
  const args_1 = require("./utils/args");
33
33
  const errors_1 = require("./utils/errors");
34
34
  const Log = __importStar(require("./utils/log"));
35
+ const withConsoleDisabledAsync_1 = require("./utils/withConsoleDisabledAsync");
35
36
  const generateFingerprint = async (argv) => {
36
37
  const args = (0, args_1.assertArgs)({
37
38
  // Types
@@ -71,14 +72,18 @@ Generate fingerprint for use in expo-updates runtime version
71
72
  }
72
73
  const debug = args['--debug'];
73
74
  const projectRoot = (0, args_1.getProjectRoot)(args);
74
- let result;
75
- try {
76
- const workflow = workflowArg ?? (await resolveWorkflowAsync(projectRoot, platform));
77
- result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true, debug });
78
- }
79
- catch (e) {
80
- throw new errors_1.CommandError(e.message);
81
- }
75
+ const result = await (0, withConsoleDisabledAsync_1.withConsoleDisabledAsync)(async () => {
76
+ try {
77
+ const workflow = workflowArg ?? (await resolveWorkflowAsync(projectRoot, platform));
78
+ return await createFingerprintAsync(projectRoot, platform, workflow, {
79
+ silent: true,
80
+ debug,
81
+ });
82
+ }
83
+ catch (e) {
84
+ throw new errors_1.CommandError(e.message);
85
+ }
86
+ });
82
87
  console.log(JSON.stringify(result));
83
88
  };
84
89
  exports.generateFingerprint = generateFingerprint;
@@ -32,6 +32,7 @@ const chalk_1 = __importDefault(require("chalk"));
32
32
  const args_1 = require("./utils/args");
33
33
  const errors_1 = require("./utils/errors");
34
34
  const Log = __importStar(require("./utils/log"));
35
+ const withConsoleDisabledAsync_1 = require("./utils/withConsoleDisabledAsync");
35
36
  const resolveRuntimeVersion = async (argv) => {
36
37
  const args = (0, args_1.assertArgs)({
37
38
  // Types
@@ -67,18 +68,19 @@ Resolve expo-updates runtime version
67
68
  throw new errors_1.CommandError(`Invalid workflow argument: ${workflow}. Must be either 'managed' or 'generic'`);
68
69
  }
69
70
  const debug = args['--debug'];
70
- let runtimeVersionInfo;
71
- try {
72
- runtimeVersionInfo = await resolveRuntimeVersionAsync((0, args_1.getProjectRoot)(args), platform, {
73
- silent: true,
74
- debug,
75
- }, {
76
- workflowOverride: workflow,
77
- });
78
- }
79
- catch (e) {
80
- throw new errors_1.CommandError(e.message);
81
- }
71
+ const runtimeVersionInfo = await (0, withConsoleDisabledAsync_1.withConsoleDisabledAsync)(async () => {
72
+ try {
73
+ return await resolveRuntimeVersionAsync((0, args_1.getProjectRoot)(args), platform, {
74
+ silent: true,
75
+ debug,
76
+ }, {
77
+ workflowOverride: workflow,
78
+ });
79
+ }
80
+ catch (e) {
81
+ throw new errors_1.CommandError(e.message);
82
+ }
83
+ });
82
84
  console.log(JSON.stringify(runtimeVersionInfo));
83
85
  };
84
86
  exports.resolveRuntimeVersion = resolveRuntimeVersion;
@@ -0,0 +1 @@
1
+ export declare function withConsoleDisabledAsync<T>(block: () => Promise<T>): Promise<T>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withConsoleDisabledAsync = void 0;
4
+ async function withConsoleDisabledAsync(block) {
5
+ const loggingFunctions = {
6
+ log: console.log,
7
+ warn: console.warn,
8
+ error: console.error,
9
+ };
10
+ // Disable logging for this command since the only thing printed to stdout should be the JSON output.
11
+ console.log = function () { };
12
+ console.warn = function () { };
13
+ console.error = function () { };
14
+ try {
15
+ return await block();
16
+ }
17
+ finally {
18
+ // Re-enable logging functions for testing.
19
+ console.log = loggingFunctions.log;
20
+ console.warn = loggingFunctions.warn;
21
+ console.error = loggingFunctions.error;
22
+ }
23
+ }
24
+ exports.withConsoleDisabledAsync = withConsoleDisabledAsync;
@@ -43,7 +43,7 @@ Configure expo-updates code signing for this project and verify setup
43
43
  const keyInput = requireArg(args, '--key-input-directory');
44
44
  const keyid = args['--keyid'];
45
45
 
46
- return await configureCodeSigningAsync(getProjectRoot(args), {
46
+ await configureCodeSigningAsync(getProjectRoot(args), {
47
47
  certificateInput,
48
48
  keyInput,
49
49
  keyid,
@@ -50,7 +50,7 @@ Generate expo-updates private key, public key, and code signing certificate usin
50
50
  );
51
51
  const certificateCommonName = requireArg(args, '--certificate-common-name');
52
52
 
53
- return await generateCodeSigningAsync(getProjectRoot(args), {
53
+ await generateCodeSigningAsync(getProjectRoot(args), {
54
54
  certificateValidityDurationYears,
55
55
  keyOutput,
56
56
  certificateOutput,
@@ -5,6 +5,7 @@ import { Command } from './cli';
5
5
  import { requireArg, assertArgs, getProjectRoot } from './utils/args';
6
6
  import { CommandError } from './utils/errors';
7
7
  import * as Log from './utils/log';
8
+ import { withConsoleDisabledAsync } from './utils/withConsoleDisabledAsync';
8
9
 
9
10
  export const generateFingerprint: Command = async (argv) => {
10
11
  const args = assertArgs(
@@ -60,13 +61,17 @@ Generate fingerprint for use in expo-updates runtime version
60
61
 
61
62
  const projectRoot = getProjectRoot(args);
62
63
 
63
- let result;
64
- try {
65
- const workflow = workflowArg ?? (await resolveWorkflowAsync(projectRoot, platform));
66
- result = await createFingerprintAsync(projectRoot, platform, workflow, { silent: true, debug });
67
- } catch (e: any) {
68
- throw new CommandError(e.message);
69
- }
64
+ const result = await withConsoleDisabledAsync(async () => {
65
+ try {
66
+ const workflow = workflowArg ?? (await resolveWorkflowAsync(projectRoot, platform));
67
+ return await createFingerprintAsync(projectRoot, platform, workflow, {
68
+ silent: true,
69
+ debug,
70
+ });
71
+ } catch (e: any) {
72
+ throw new CommandError(e.message);
73
+ }
74
+ });
70
75
 
71
76
  console.log(JSON.stringify(result));
72
77
  };
@@ -5,6 +5,7 @@ import { Command } from './cli';
5
5
  import { requireArg, assertArgs, getProjectRoot } from './utils/args';
6
6
  import { CommandError } from './utils/errors';
7
7
  import * as Log from './utils/log';
8
+ import { withConsoleDisabledAsync } from './utils/withConsoleDisabledAsync';
8
9
 
9
10
  export const resolveRuntimeVersion: Command = async (argv) => {
10
11
  const args = assertArgs(
@@ -57,21 +58,23 @@ Resolve expo-updates runtime version
57
58
 
58
59
  const debug = args['--debug'];
59
60
 
60
- let runtimeVersionInfo;
61
- try {
62
- runtimeVersionInfo = await resolveRuntimeVersionAsync(
63
- getProjectRoot(args),
64
- platform,
65
- {
66
- silent: true,
67
- debug,
68
- },
69
- {
70
- workflowOverride: workflow,
71
- }
72
- );
73
- } catch (e: any) {
74
- throw new CommandError(e.message);
75
- }
61
+ const runtimeVersionInfo = await withConsoleDisabledAsync(async () => {
62
+ try {
63
+ return await resolveRuntimeVersionAsync(
64
+ getProjectRoot(args),
65
+ platform,
66
+ {
67
+ silent: true,
68
+ debug,
69
+ },
70
+ {
71
+ workflowOverride: workflow,
72
+ }
73
+ );
74
+ } catch (e: any) {
75
+ throw new CommandError(e.message);
76
+ }
77
+ });
78
+
76
79
  console.log(JSON.stringify(runtimeVersionInfo));
77
80
  };
@@ -0,0 +1,20 @@
1
+ export async function withConsoleDisabledAsync<T>(block: () => Promise<T>): Promise<T> {
2
+ const loggingFunctions = {
3
+ log: console.log,
4
+ warn: console.warn,
5
+ error: console.error,
6
+ };
7
+ // Disable logging for this command since the only thing printed to stdout should be the JSON output.
8
+ console.log = function () {};
9
+ console.warn = function () {};
10
+ console.error = function () {};
11
+
12
+ try {
13
+ return await block();
14
+ } finally {
15
+ // Re-enable logging functions for testing.
16
+ console.log = loggingFunctions.log;
17
+ console.warn = loggingFunctions.warn;
18
+ console.error = loggingFunctions.error;
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-updates",
3
- "version": "0.25.26",
3
+ "version": "0.25.27",
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": "c4e3aca2a633a6ece2ef3a970edec1d0a347e77b"
70
+ "gitHead": "826560298c428d3e57db0f06cb65306b824082b4"
71
71
  }