@expo/build-tools 1.0.120 → 1.0.122
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/LICENSE +1 -1
- package/dist/builders/android.js +5 -3
- package/dist/builders/android.js.map +1 -1
- package/dist/builders/ios.js +9 -3
- package/dist/builders/ios.js.map +1 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +2 -2
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +1 -1
- package/dist/steps/functions/repack.js +4 -1
- package/dist/steps/functions/repack.js.map +1 -1
- package/dist/utils/expoUpdates.d.ts +10 -3
- package/dist/utils/expoUpdates.js +44 -5
- package/dist/utils/expoUpdates.js.map +1 -1
- package/dist/utils/fingerprint.d.ts +90 -0
- package/dist/utils/fingerprint.js +87 -0
- package/dist/utils/fingerprint.js.map +1 -0
- package/dist/utils/resolveRuntimeVersionAsync.d.ts +5 -1
- package/dist/utils/resolveRuntimeVersionAsync.js +9 -3
- package/dist/utils/resolveRuntimeVersionAsync.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -12,7 +12,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that you d
|
|
|
12
12
|
to access the functionality of and directly benefit from the
|
|
13
13
|
functionality of the Licensed Work.
|
|
14
14
|
|
|
15
|
-
Change Date: 2027-
|
|
15
|
+
Change Date: 2027-07-01
|
|
16
16
|
|
|
17
17
|
Change License: MIT
|
|
18
18
|
|
package/dist/builders/android.js
CHANGED
|
@@ -77,8 +77,10 @@ async function buildAsync(ctx) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {
|
|
80
|
+
var _a, _b;
|
|
80
81
|
await (0, expoUpdates_1.configureExpoUpdatesIfInstalledAsync)(ctx, {
|
|
81
|
-
resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion,
|
|
82
|
+
resolvedRuntimeVersion: (_a = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion) !== null && _a !== void 0 ? _a : null,
|
|
83
|
+
resolvedFingerprintSources: (_b = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.fingerprintSources) !== null && _b !== void 0 ? _b : null,
|
|
82
84
|
});
|
|
83
85
|
});
|
|
84
86
|
if (ctx.skipNativeBuild) {
|
|
@@ -90,10 +92,10 @@ async function buildAsync(ctx) {
|
|
|
90
92
|
logger: ctx.logger,
|
|
91
93
|
gradleCommand,
|
|
92
94
|
androidDir: path_1.default.join(ctx.getReactNativeProjectDirectory(), 'android'),
|
|
93
|
-
...(resolvedExpoUpdatesRuntimeVersion
|
|
95
|
+
...((resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion)
|
|
94
96
|
? {
|
|
95
97
|
extraEnv: {
|
|
96
|
-
EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion,
|
|
98
|
+
EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion.runtimeVersion,
|
|
97
99
|
EXPO_UPDATES_WORKFLOW_OVERRIDE: ctx.job.type,
|
|
98
100
|
},
|
|
99
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,uDAA+E;AAC/E,4DAAoC;AAEpC,wCAA2E;AAC3E,sDAG8B;AAC9B,8CAI2B;AAC3B,kDAA8D;AAC9D,0CAAwD;AACxD,wDAA4D;AAC5D,0DAA+D;AAC/D,2CAA6C;AAC7C,iDAAmD;A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CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\n\nimport { Android, BuildMode, BuildPhase, Workflow } from '@expo/eas-build-job';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext, SkipNativeBuildError } from '../context';\nimport {\n configureExpoUpdatesIfInstalledAsync,\n resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync,\n} from '../utils/expoUpdates';\nimport {\n runGradleCommand,\n ensureLFLineEndingsInGradlewScript,\n resolveGradleCommand,\n} from '../android/gradle';\nimport { uploadApplicationArchive } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { restoreCredentials } from '../android/credentials';\nimport { configureBuildGradle } from '../android/gradleConfig';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\nimport { prepareExecutableAsync } from '../utils/prepareBuildExecutable';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function androidBuilder(ctx: BuildContext<Android.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n await prepareExecutableAsync(ctx);\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n throw new Error('Not implemented');\n } else if (ctx.job.mode === BuildMode.CUSTOM || ctx.job.mode === BuildMode.REPACK) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n if (hasNativeCode) {\n await ctx.runBuildPhase(BuildPhase.FIX_GRADLEW, async () => {\n await ensureLFLineEndingsInGradlewScript(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"android\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/'\n );\n return;\n }\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const resolvedExpoUpdatesRuntimeVersion = await ctx.runBuildPhase(\n BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION,\n async () => {\n return await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n appConfig: ctx.appConfig,\n platform: ctx.job.platform,\n workflow: ctx.job.type,\n env: ctx.env,\n });\n }\n );\n\n if (\n nullthrows(ctx.job.secrets, 'Secrets must be defined for non-custom builds').buildCredentials\n ) {\n await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n await restoreCredentials(ctx);\n await configureBuildGradle(ctx);\n });\n }\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx, {\n resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion?.runtimeVersion ?? null,\n resolvedFingerprintSources: resolvedExpoUpdatesRuntimeVersion?.fingerprintSources ?? null,\n });\n });\n\n if (ctx.skipNativeBuild) {\n throw new SkipNativeBuildError('Skipping Gradle build');\n }\n await ctx.runBuildPhase(BuildPhase.RUN_GRADLEW, async () => {\n const gradleCommand = resolveGradleCommand(ctx.job);\n await runGradleCommand(ctx, {\n logger: ctx.logger,\n gradleCommand,\n androidDir: path.join(ctx.getReactNativeProjectDirectory(), 'android'),\n ...(resolvedExpoUpdatesRuntimeVersion?.runtimeVersion\n ? {\n extraEnv: {\n EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion.runtimeVersion,\n EXPO_UPDATES_WORKFLOW_OVERRIDE: ctx.job.type,\n },\n }\n : null),\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n await uploadApplicationArchive(ctx, {\n patternOrPath: ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}',\n rootDir: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n });\n });\n}\n"]}
|
package/dist/builders/ios.js
CHANGED
|
@@ -93,8 +93,10 @@ async function buildAsync(ctx) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {
|
|
96
|
+
var _a, _b;
|
|
96
97
|
await (0, expoUpdates_1.configureExpoUpdatesIfInstalledAsync)(ctx, {
|
|
97
|
-
resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion,
|
|
98
|
+
resolvedRuntimeVersion: (_a = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion) !== null && _a !== void 0 ? _a : null,
|
|
99
|
+
resolvedFingerprintSources: (_b = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.fingerprintSources) !== null && _b !== void 0 ? _b : null,
|
|
98
100
|
});
|
|
99
101
|
});
|
|
100
102
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_FASTLANE, async () => {
|
|
@@ -105,8 +107,12 @@ async function buildAsync(ctx) {
|
|
|
105
107
|
scheme,
|
|
106
108
|
buildConfiguration,
|
|
107
109
|
entitlements,
|
|
108
|
-
...(resolvedExpoUpdatesRuntimeVersion
|
|
109
|
-
? {
|
|
110
|
+
...((resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion)
|
|
111
|
+
? {
|
|
112
|
+
extraEnv: {
|
|
113
|
+
EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion,
|
|
114
|
+
},
|
|
115
|
+
}
|
|
110
116
|
: null),
|
|
111
117
|
});
|
|
112
118
|
});
|
package/dist/builders/ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAAgG;AAChG,wDAA0B;AAC1B,4DAAoC;AAGpC,sDAG8B;AAC9B,kDAA8D;AAC9D,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE;AACpE,oCAAyC;AACzC,0CAAgE;AAChE,4CAA+F;AAC/F,2CAA6C;AAC7C,iDAAmD;AACnD,4EAAyE;AACzE,kDAA4E;AAE5E,qCAAoD;AACpD,qCAA+C;AAE/C,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAClE,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAElE,MAAM,uBAAwB,SAAQ,KAAK;CAAG;AAE/B,KAAK,UAAU,UAAU,CAAC,GAA0B;IACjE,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,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MAAM,CAAC,KAAK,CACd,yMAAyM,CAC1M,CAAC;YACF,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,MAAM,IAAI,GAAG,MAAM,IAAA,kDAAsC,EAAC,IAAI,CAAC,CAAC;YAChE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,MAAA,GAAG,CAAC,WAAW,oDAAG,6CAA6C,EAAE,SAAS,EAAE;gBAC1E,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE;aAC1C,CAAC,CAAC;QACL,CAAC,EAAE,4BAA4B,CAAC,CAAC;QAEjC,MAAM,uBAAuB,CAAC;IAChC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,IAAI,uBAAuB,CAAC,uDAAuD,CAAC,CAAC;QAC7F,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { ManagedArtifactType, BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext } from '../context';\nimport {\n resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync,\n configureExpoUpdatesIfInstalledAsync,\n} from '../utils/expoUpdates';\nimport { uploadApplicationArchive } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\nimport { prepareExecutableAsync } from '../utils/prepareBuildExecutable';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nconst INSTALL_PODS_WARN_TIMEOUT_MS = 15 * 60 * 1000; // 15 minutes\nconst INSTALL_PODS_KILL_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes\n\nclass InstallPodsTimeoutError extends Error {}\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n await prepareExecutableAsync(ctx);\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM || ctx.job.mode === BuildMode.REPACK) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n options: { extraEnvs },\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await runInstallPodsAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const resolvedExpoUpdatesRuntimeVersion = await ctx.runBuildPhase(\n BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION,\n async () => {\n return await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n appConfig: ctx.appConfig,\n platform: ctx.job.platform,\n workflow: ctx.job.type,\n env: ctx.env,\n });\n }\n );\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx, {\n resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion,\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n ...(resolvedExpoUpdatesRuntimeVersion\n ? { extraEnv: { EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion } }\n : null),\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n await uploadApplicationArchive(ctx, {\n patternOrPath: resolveArtifactPath(ctx),\n rootDir: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n });\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.APPLICATION_ARCHIVE,\n paths: [applicationArchivePath],\n },\n logger: ctx.logger,\n });\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n\nasync function runInstallPodsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n let warnTimeout: NodeJS.Timeout | undefined;\n let killTimeout: NodeJS.Timeout | undefined;\n let timedOutToKill: boolean = false;\n try {\n const installPodsSpawnPromise = (\n await installPods(ctx, {\n infoCallbackFn: () => {\n warnTimeout?.refresh();\n killTimeout?.refresh();\n },\n })\n ).spawnPromise;\n warnTimeout = setTimeout(() => {\n ctx.logger.warn(\n '\"Install pods\" phase takes longer then expected and it did not produce any logs in the past 15 minutes'\n );\n }, INSTALL_PODS_WARN_TIMEOUT_MS);\n\n killTimeout = setTimeout(async () => {\n timedOutToKill = true;\n ctx.logger.error(\n '\"Install pods\" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened which caused the process to hang and it will be terminated'\n );\n const ppid = nullthrows(installPodsSpawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.('\"Install pods\" phase takes a very long time', undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, INSTALL_PODS_KILL_TIMEOUT_MS);\n\n await installPodsSpawnPromise;\n } catch (err: any) {\n if (timedOutToKill) {\n throw new InstallPodsTimeoutError('\"Install pods\" phase was inactive for over 30 minutes');\n }\n throw err;\n } finally {\n if (warnTimeout) {\n clearTimeout(warnTimeout);\n }\n if (killTimeout) {\n clearTimeout(killTimeout);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAAgG;AAChG,wDAA0B;AAC1B,4DAAoC;AAGpC,sDAG8B;AAC9B,kDAA8D;AAC9D,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE;AACpE,oCAAyC;AACzC,0CAAgE;AAChE,4CAA+F;AAC/F,2CAA6C;AAC7C,iDAAmD;AACnD,4EAAyE;AACzE,kDAA4E;AAE5E,qCAAoD;AACpD,qCAA+C;AAE/C,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAClE,MAAM,4BAA4B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAElE,MAAM,uBAAwB,SAAQ,KAAK;CAAG;AAE/B,KAAK,UAAU,UAAU,CAAC,GAA0B;IACjE,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,KAAK,EAAE,CAAC;QACrC,MAAM,IAAA,+CAAsB,EAAC,GAAG,CAAC,CAAC;QAClC,OAAO,MAAM,IAAA,iCAAwB,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,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,MAAM,IAAA,kDAAsC,EAAC,IAAI,CAAC,CAAC;YAChE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,MAAA,GAAG,CAAC,WAAW,oDAAG,6CAA6C,EAAE,SAAS,EAAE;gBAC1E,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE;aAC1C,CAAC,CAAC;QACL,CAAC,EAAE,4BAA4B,CAAC,CAAC;QAEjC,MAAM,uBAAuB,CAAC;IAChC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,IAAI,uBAAuB,CAAC,uDAAuD,CAAC,CAAC;QAC7F,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { ManagedArtifactType, BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext } from '../context';\nimport {\n resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync,\n configureExpoUpdatesIfInstalledAsync,\n} from '../utils/expoUpdates';\nimport { uploadApplicationArchive } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\nimport { prepareExecutableAsync } from '../utils/prepareBuildExecutable';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nconst INSTALL_PODS_WARN_TIMEOUT_MS = 15 * 60 * 1000; // 15 minutes\nconst INSTALL_PODS_KILL_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes\n\nclass InstallPodsTimeoutError extends Error {}\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n await prepareExecutableAsync(ctx);\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM || ctx.job.mode === BuildMode.REPACK) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n options: { extraEnvs },\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await runInstallPodsAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const resolvedExpoUpdatesRuntimeVersion = await ctx.runBuildPhase(\n BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION,\n async () => {\n return await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n appConfig: ctx.appConfig,\n platform: ctx.job.platform,\n workflow: ctx.job.type,\n env: ctx.env,\n });\n }\n );\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx, {\n resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion?.runtimeVersion ?? null,\n resolvedFingerprintSources: resolvedExpoUpdatesRuntimeVersion?.fingerprintSources ?? null,\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n ...(resolvedExpoUpdatesRuntimeVersion?.runtimeVersion\n ? {\n extraEnv: {\n EXPO_UPDATES_FINGERPRINT_OVERRIDE:\n resolvedExpoUpdatesRuntimeVersion?.runtimeVersion,\n },\n }\n : null),\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n await uploadApplicationArchive(ctx, {\n patternOrPath: resolveArtifactPath(ctx),\n rootDir: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n });\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.APPLICATION_ARCHIVE,\n paths: [applicationArchivePath],\n },\n logger: ctx.logger,\n });\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n\nasync function runInstallPodsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n let warnTimeout: NodeJS.Timeout | undefined;\n let killTimeout: NodeJS.Timeout | undefined;\n let timedOutToKill: boolean = false;\n try {\n const installPodsSpawnPromise = (\n await installPods(ctx, {\n infoCallbackFn: () => {\n warnTimeout?.refresh();\n killTimeout?.refresh();\n },\n })\n ).spawnPromise;\n warnTimeout = setTimeout(() => {\n ctx.logger.warn(\n '\"Install pods\" phase takes longer then expected and it did not produce any logs in the past 15 minutes'\n );\n }, INSTALL_PODS_WARN_TIMEOUT_MS);\n\n killTimeout = setTimeout(async () => {\n timedOutToKill = true;\n ctx.logger.error(\n '\"Install pods\" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened which caused the process to hang and it will be terminated'\n );\n const ppid = nullthrows(installPodsSpawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.('\"Install pods\" phase takes a very long time', undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, INSTALL_PODS_KILL_TIMEOUT_MS);\n\n await installPodsSpawnPromise;\n } catch (err: any) {\n if (timedOutToKill) {\n throw new InstallPodsTimeoutError('\"Install pods\" phase was inactive for over 30 minutes');\n }\n throw err;\n } finally {\n if (warnTimeout) {\n clearTimeout(warnTimeout);\n }\n if (killTimeout) {\n clearTimeout(killTimeout);\n }\n }\n}\n"]}
|
|
@@ -29,7 +29,7 @@ function calculateEASUpdateRuntimeVersionFunction() {
|
|
|
29
29
|
}),
|
|
30
30
|
],
|
|
31
31
|
fn: async (stepCtx, { env, inputs, outputs }) => {
|
|
32
|
-
var _a, _b, _c;
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
33
|
const appConfig = (0, appConfig_1.readAppConfig)({
|
|
34
34
|
projectDir: stepCtx.workingDirectory,
|
|
35
35
|
env: Object.keys(env).reduce((acc, key) => {
|
|
@@ -60,7 +60,7 @@ function calculateEASUpdateRuntimeVersionFunction() {
|
|
|
60
60
|
env,
|
|
61
61
|
});
|
|
62
62
|
if (resolvedRuntimeVersion) {
|
|
63
|
-
outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);
|
|
63
|
+
outputs.resolved_eas_update_runtime_version.set((_d = resolvedRuntimeVersion.runtimeVersion) !== null && _d !== void 0 ? _d : undefined);
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
66
|
stepCtx.logger.info('Skipped because EAS Update is not configured');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateEASUpdateRuntimeVersion.js","sourceRoot":"","sources":["../../../src/steps/functions/calculateEASUpdateRuntimeVersion.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AACzD,uCAKqB;AAErB,yDAA+F;AAC/F,qDAAsD;AAEtD,SAAgB,wCAAwC;IACtD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sCAAsC;QAC1C,IAAI,EAAE,sCAAsC;QAC5C,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,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CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzD,MAAM,IAAI,KAAK,CACb,yBAAyB,QAAQ,uBAAuB,wBAAQ,CAAC,OAAO,SAAS,wBAAQ,CAAC,GAAG,GAAG,CACjG,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,CAAC,wBAAQ,CAAC,OAAO,EAAE,wBAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC7D,IAAI,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE,CAAC;oBAClC,MAAM,IAAI,KAAK,CACb,YAAY,wBAAQ,CAAC,OAAO,gGAAgG,CAC7H,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,yBAAyB,QAAQ,uBAAuB,wBAAQ,CAAC,OAAO,SAAS,wBAAQ,CAAC,OAAO,GAAG,CACrG,CAAC;YACJ,CAAC;YAED,MAAM,sBAAsB,GAAG,MAAM,IAAA,kEAAoD,EAAC;gBACxF,GAAG,EAAE,OAAO,CAAC,gBAAgB;gBAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,QAAQ;gBACR,QAAQ;gBACR,GAAG;aACJ,CAAC,CAAC;YACH,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAC7C,MAAA,sBAAsB,CAAC,cAAc,mCAAI,SAAS,CACnD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA3ED,4FA2EC","sourcesContent":["import { Platform, Workflow } from '@expo/eas-build-job';\nimport {\n BuildFunction,\n BuildStepInput,\n BuildStepInputValueTypeName,\n BuildStepOutput,\n} from '@expo/steps';\n\nimport { resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync } from '../../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\n\nexport function calculateEASUpdateRuntimeVersionFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'calculate_eas_update_runtime_version',\n name: 'Calculate EAS Update Runtime Version',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'platform',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'workflow',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n ],\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'resolved_eas_update_runtime_version',\n required: false,\n }),\n ],\n fn: async (stepCtx, { env, inputs, outputs }) => {\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: stepCtx.global.staticContext.metadata?.sdkVersion,\n }).exp;\n\n const platform =\n (inputs.platform.value as Platform) ?? stepCtx.global.staticContext.job.platform;\n const workflow = (inputs.workflow.value as Workflow) ?? stepCtx.global.staticContext.job.type;\n\n if (![Platform.ANDROID, Platform.IOS].includes(platform)) {\n throw new Error(\n `Unsupported platform: ${platform}. Platform must be \"${Platform.ANDROID}\" or \"${Platform.IOS}\"`\n );\n }\n\n if (![Workflow.GENERIC, Workflow.MANAGED].includes(workflow)) {\n if (workflow === Workflow.UNKNOWN) {\n throw new Error(\n `Detected ${Workflow.UNKNOWN} workflow. Please make sure to run the eas/resolve_build_config step before running this step.`\n );\n }\n throw new Error(\n `Unsupported workflow: ${workflow}. Workflow must be \"${Workflow.GENERIC}\" or \"${Workflow.MANAGED}\"`\n );\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n platform,\n workflow,\n env,\n });\n if (resolvedRuntimeVersion) {\n outputs.resolved_eas_update_runtime_version.set(\n resolvedRuntimeVersion.runtimeVersion ?? undefined\n );\n } else {\n stepCtx.logger.info('Skipped because EAS Update is not configured');\n }\n },\n });\n}\n"]}
|
|
@@ -96,7 +96,10 @@ function createRepackBuildFunction() {
|
|
|
96
96
|
keyStorePath,
|
|
97
97
|
keyStorePassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keystorePassword}`,
|
|
98
98
|
keyAlias: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyAlias,
|
|
99
|
-
keyPassword:
|
|
99
|
+
keyPassword: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore
|
|
100
|
+
.keyPassword
|
|
101
|
+
? `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyPassword}`
|
|
102
|
+
: undefined,
|
|
100
103
|
};
|
|
101
104
|
}
|
|
102
105
|
await (0, repack_app_1.repackAppAndroidAsync)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repack.js","sourceRoot":"","sources":["../../../src/steps/functions/repack.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,+BAAiC;AACjC,mCAAgC;AAChC,4CAAoB;AACpB,oDAA4B;AAE5B,uCAA6D;AAC7D,wDAA0B;AAC1B,uDAA+C;AAC/C,4DAA+B;AAC/B,iDAA4E;AAC5E,+BAAoC;AAIpC,+EAAqE;AAErE,MAAM,QAAQ,GAAG,IAAA,gBAAS,EAAC,eAAM,CAAC,QAAQ,CAAC,CAAC;AAE5C,SAAgB,yBAAyB;IACvC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,yDAAyD;QAC7D,IAAI,EAAE,uDAAuD;QAC7D,eAAe,EAAE;YACf,uBAAe,CAAC,cAAc,CAAC;gBAC7B,EAAE,EAAE,uBAAuB;gBAC3B,QAAQ,EAAE,IAAI;aACf,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ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EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;QAClF,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,eAAe,EAAE,WAAW,CAAC,oCAAoC,CAAC,IAAI,CAAC,qBAAqB;KAC7F,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { promisify } from 'util';\nimport { Stream } from 'stream';\nimport os from 'os';\nimport assert from 'assert';\n\nimport { BuildFunction, BuildStepOutput } from '@expo/steps';\nimport fs from 'fs-extra';\nimport { Platform } from '@expo/eas-build-job';\nimport fetch from 'node-fetch';\nimport { repackAppAndroidAsync, repackAppIosAsync } from '@expo/repack-app';\nimport { v4 as uuidv4 } from 'uuid';\nimport { BuildCredentials } from '@expo/eas-build-job/dist/ios';\nimport { bunyan } from '@expo/logger';\n\nimport IosCredentialsManager from '../utils/ios/credentials/manager';\n\nconst pipeline = promisify(Stream.pipeline);\n\nexport function createRepackBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: '__download_and_repack_golden_development_client_archive',\n name: 'Download and repack golden development client archive',\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'repacked_archive_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { outputs, env }) => {\n const tmpDir = path.join(os.tmpdir(), `eas-build-golden-dev-client-app-${uuidv4()}`);\n await fs.mkdirs(tmpDir);\n const workingDirectory = path.join(tmpDir, 'working-directory');\n await fs.mkdirs(workingDirectory);\n stepsCtx.logger.info(`Created temporary directory: ${tmpDir}`);\n\n stepsCtx.logger.info('Downloading golden development client archive...');\n const fileName =\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'golden-dev-client-simulator-latest.ipa'\n : 'golden-dev-client-device-latest.ipa'\n : 'golden-dev-client-latest.apk';\n const goldenArchiveUrl =\n env.__EAS_GOLDEN_DEV_CLIENT_URL ??\n `https://storage.googleapis.com/turtle-v2/onboarding/${fileName}`;\n const goldenArchivePath = path.join(tmpDir, fileName);\n try {\n const response = await fetch(goldenArchiveUrl, {\n timeout: 1 * 60 * 1000, // 1 minute\n });\n if (!response.ok) {\n throw new Error(`[${response.status}] ${response.statusText}`);\n }\n await pipeline(response.body, fs.createWriteStream(goldenArchivePath));\n } catch (error: any) {\n throw new Error(`Failed to download golden development client archive: ${error.message}`);\n }\n stepsCtx.logger.info(`Downloaded golden development client archive to ${goldenArchivePath}`);\n\n stepsCtx.logger.info('Repacking and resigning the app...');\n const repackedArchivePath = path.join(\n tmpDir,\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'target.zip'\n : 'target.ipa'\n : 'target.apk'\n );\n if (stepsCtx.global.staticContext.job.platform === Platform.IOS) {\n await repackAppIosAsync({\n platform: 'ios',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n iosSigningOptions: stepsCtx.global.staticContext.job.simulator\n ? undefined\n : await resolveIosSigningOptions({\n logger: stepsCtx.logger,\n buildCredentials: stepsCtx.global.staticContext.job.secrets?.buildCredentials,\n }),\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env: {\n FASTLANE_DISABLE_COLORS: '1',\n FASTLANE_SKIP_UPDATE_CHECK: '1',\n SKIP_SLOW_FASTLANE_WARNING: 'true',\n FASTLANE_HIDE_TIMESTAMP: 'true',\n LC_ALL: 'en_US.UTF-8',\n ...env,\n },\n });\n } else if (stepsCtx.global.staticContext.job.platform === Platform.ANDROID) {\n let androidCredentials:\n | {\n keyStorePath: string;\n keyStorePassword: string;\n keyAlias: string;\n keyPassword: string | undefined;\n }\n | undefined;\n if (stepsCtx.global.staticContext.job.secrets?.buildCredentials?.keystore.dataBase64) {\n const keyStorePath = path.join(tmpDir, `keystore-${uuidv4()}`);\n await fs.writeFile(\n keyStorePath,\n Buffer.from(\n stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.dataBase64,\n 'base64'\n )\n );\n androidCredentials = {\n keyStorePath,\n keyStorePassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keystorePassword}`,\n keyAlias: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyAlias,\n keyPassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyPassword}`,\n };\n }\n\n await repackAppAndroidAsync({\n platform: 'android',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n androidSigningOptions: androidCredentials,\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env,\n });\n } else {\n throw new Error('Unsupported platform');\n }\n\n if (!(await fs.exists(repackedArchivePath))) {\n throw new Error(`Failed to repack the app. ${repackedArchivePath} does not exist`);\n }\n\n stepsCtx.logger.info(`Repacked and resigned the app to ${repackedArchivePath}`);\n outputs.repacked_archive_path.set(repackedArchivePath);\n },\n });\n}\n\nasync function resolveIosSigningOptions({\n buildCredentials,\n logger,\n}: {\n buildCredentials: BuildCredentials | undefined;\n logger: bunyan;\n}): Promise<{\n provisioningProfile: string;\n keychainPath: string;\n signingIdentity: string;\n}> {\n assert(buildCredentials, 'buildCredentials is required for repacking non-simulator iOS apps');\n\n const credentialsManager = new IosCredentialsManager(buildCredentials);\n const credentials = await credentialsManager.prepare(logger);\n\n return {\n provisioningProfile: Object.values(credentials.targetProvisioningProfiles)[0].path,\n keychainPath: credentials.keychainPath,\n signingIdentity: credentials.applicationTargetProvisioningProfile.data.certificateCommonName,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"repack.js","sourceRoot":"","sources":["../../../src/steps/functions/repack.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,+BAAiC;AACjC,mCAAgC;AAChC,4CAAoB;AACpB,oDAA4B;AAE5B,uCAA6D;AAC7D,wDAA0B;AA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E,CAAC;gBAC5C,MAAM,IAAI,KAAK,CAAC,6BAA6B,mBAAmB,iBAAiB,CAAC,CAAC;YACrF,CAAC;YAED,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,mBAAmB,EAAE,CAAC,CAAC;YAChF,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACzD,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/HD,8DA+HC;AAED,KAAK,UAAU,wBAAwB,CAAC,EACtC,gBAAgB,EAChB,MAAM,GAIP;IAKC,IAAA,gBAAM,EAAC,gBAAgB,EAAE,mEAAmE,CAAC,CAAC;IAE9F,MAAM,kBAAkB,GAAG,IAAI,iBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7D,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;QAClF,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,eAAe,EAAE,WAAW,CAAC,oCAAoC,CAAC,IAAI,CAAC,qBAAqB;KAC7F,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { promisify } from 'util';\nimport { Stream } from 'stream';\nimport os from 'os';\nimport assert from 'assert';\n\nimport { BuildFunction, BuildStepOutput } from '@expo/steps';\nimport fs from 'fs-extra';\nimport { Platform } from '@expo/eas-build-job';\nimport fetch from 'node-fetch';\nimport { repackAppAndroidAsync, repackAppIosAsync } from '@expo/repack-app';\nimport { v4 as uuidv4 } from 'uuid';\nimport { BuildCredentials } from '@expo/eas-build-job/dist/ios';\nimport { bunyan } from '@expo/logger';\n\nimport IosCredentialsManager from '../utils/ios/credentials/manager';\n\nconst pipeline = promisify(Stream.pipeline);\n\nexport function createRepackBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: '__download_and_repack_golden_development_client_archive',\n name: 'Download and repack golden development client archive',\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'repacked_archive_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { outputs, env }) => {\n const tmpDir = path.join(os.tmpdir(), `eas-build-golden-dev-client-app-${uuidv4()}`);\n await fs.mkdirs(tmpDir);\n const workingDirectory = path.join(tmpDir, 'working-directory');\n await fs.mkdirs(workingDirectory);\n stepsCtx.logger.info(`Created temporary directory: ${tmpDir}`);\n\n stepsCtx.logger.info('Downloading golden development client archive...');\n const fileName =\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'golden-dev-client-simulator-latest.ipa'\n : 'golden-dev-client-device-latest.ipa'\n : 'golden-dev-client-latest.apk';\n const goldenArchiveUrl =\n env.__EAS_GOLDEN_DEV_CLIENT_URL ??\n `https://storage.googleapis.com/turtle-v2/onboarding/${fileName}`;\n const goldenArchivePath = path.join(tmpDir, fileName);\n try {\n const response = await fetch(goldenArchiveUrl, {\n timeout: 1 * 60 * 1000, // 1 minute\n });\n if (!response.ok) {\n throw new Error(`[${response.status}] ${response.statusText}`);\n }\n await pipeline(response.body, fs.createWriteStream(goldenArchivePath));\n } catch (error: any) {\n throw new Error(`Failed to download golden development client archive: ${error.message}`);\n }\n stepsCtx.logger.info(`Downloaded golden development client archive to ${goldenArchivePath}`);\n\n stepsCtx.logger.info('Repacking and resigning the app...');\n const repackedArchivePath = path.join(\n tmpDir,\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'target.zip'\n : 'target.ipa'\n : 'target.apk'\n );\n if (stepsCtx.global.staticContext.job.platform === Platform.IOS) {\n await repackAppIosAsync({\n platform: 'ios',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n iosSigningOptions: stepsCtx.global.staticContext.job.simulator\n ? undefined\n : await resolveIosSigningOptions({\n logger: stepsCtx.logger,\n buildCredentials: stepsCtx.global.staticContext.job.secrets?.buildCredentials,\n }),\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env: {\n FASTLANE_DISABLE_COLORS: '1',\n FASTLANE_SKIP_UPDATE_CHECK: '1',\n SKIP_SLOW_FASTLANE_WARNING: 'true',\n FASTLANE_HIDE_TIMESTAMP: 'true',\n LC_ALL: 'en_US.UTF-8',\n ...env,\n },\n });\n } else if (stepsCtx.global.staticContext.job.platform === Platform.ANDROID) {\n let androidCredentials:\n | {\n keyStorePath: string;\n keyStorePassword: string;\n keyAlias: string;\n keyPassword: string | undefined;\n }\n | undefined;\n if (stepsCtx.global.staticContext.job.secrets?.buildCredentials?.keystore.dataBase64) {\n const keyStorePath = path.join(tmpDir, `keystore-${uuidv4()}`);\n await fs.writeFile(\n keyStorePath,\n Buffer.from(\n stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.dataBase64,\n 'base64'\n )\n );\n androidCredentials = {\n keyStorePath,\n keyStorePassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keystorePassword}`,\n keyAlias: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyAlias,\n keyPassword: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore\n .keyPassword\n ? `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyPassword}`\n : undefined,\n };\n }\n\n await repackAppAndroidAsync({\n platform: 'android',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n androidSigningOptions: androidCredentials,\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env,\n });\n } else {\n throw new Error('Unsupported platform');\n }\n\n if (!(await fs.exists(repackedArchivePath))) {\n throw new Error(`Failed to repack the app. ${repackedArchivePath} does not exist`);\n }\n\n stepsCtx.logger.info(`Repacked and resigned the app to ${repackedArchivePath}`);\n outputs.repacked_archive_path.set(repackedArchivePath);\n },\n });\n}\n\nasync function resolveIosSigningOptions({\n buildCredentials,\n logger,\n}: {\n buildCredentials: BuildCredentials | undefined;\n logger: bunyan;\n}): Promise<{\n provisioningProfile: string;\n keychainPath: string;\n signingIdentity: string;\n}> {\n assert(buildCredentials, 'buildCredentials is required for repacking non-simulator iOS apps');\n\n const credentialsManager = new IosCredentialsManager(buildCredentials);\n const credentials = await credentialsManager.prepare(logger);\n\n return {\n provisioningProfile: Object.values(credentials.targetProvisioningProfiles)[0].path,\n keychainPath: credentials.keychainPath,\n signingIdentity: credentials.applicationTargetProvisioningProfile.data.certificateCommonName,\n };\n}\n"]}
|
|
@@ -4,15 +4,18 @@ import { ExpoConfig } from '@expo/config';
|
|
|
4
4
|
import { bunyan } from '@expo/logger';
|
|
5
5
|
import { BuildStepEnv } from '@expo/steps';
|
|
6
6
|
import { BuildContext } from '../context';
|
|
7
|
+
import { FingerprintSource } from './fingerprint';
|
|
7
8
|
export declare function setRuntimeVersionNativelyAsync(ctx: BuildContext<Job>, runtimeVersion: string): Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* Used for when Expo Updates is pointed at an EAS server.
|
|
10
11
|
*/
|
|
11
12
|
export declare function setChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
12
13
|
export declare function configureEASExpoUpdatesAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
13
|
-
|
|
14
|
+
type ResolvedRuntime = {
|
|
14
15
|
resolvedRuntimeVersion: string | null;
|
|
15
|
-
|
|
16
|
+
resolvedFingerprintSources?: FingerprintSource[] | null;
|
|
17
|
+
};
|
|
18
|
+
export declare function configureExpoUpdatesIfInstalledAsync(ctx: BuildContext<BuildJob>, resolvedRuntime: ResolvedRuntime): Promise<void>;
|
|
16
19
|
export declare function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({ cwd, appConfig, platform, workflow, logger, env, }: {
|
|
17
20
|
cwd: string;
|
|
18
21
|
appConfig: ExpoConfig;
|
|
@@ -20,8 +23,12 @@ export declare function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({ c
|
|
|
20
23
|
workflow: Workflow;
|
|
21
24
|
logger: bunyan;
|
|
22
25
|
env: BuildStepEnv;
|
|
23
|
-
}): Promise<
|
|
26
|
+
}): Promise<{
|
|
27
|
+
runtimeVersion: string | null;
|
|
28
|
+
fingerprintSources: FingerprintSource[] | null;
|
|
29
|
+
} | null>;
|
|
24
30
|
export declare function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
25
31
|
export declare function getRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
26
32
|
export declare function isEASUpdateConfigured(ctx: BuildContext<Job>): boolean;
|
|
27
33
|
export declare function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(expoUpdatesPackageVersion: string): boolean;
|
|
34
|
+
export {};
|
|
@@ -7,10 +7,13 @@ exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported = exports.isEAS
|
|
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
9
|
const semver_1 = __importDefault(require("semver"));
|
|
10
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
11
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
12
|
const expoUpdates_1 = require("../android/expoUpdates");
|
|
11
13
|
const expoUpdates_2 = require("../ios/expoUpdates");
|
|
12
14
|
const getExpoUpdatesPackageVersionIfInstalledAsync_1 = __importDefault(require("./getExpoUpdatesPackageVersionIfInstalledAsync"));
|
|
13
15
|
const resolveRuntimeVersionAsync_1 = require("./resolveRuntimeVersionAsync");
|
|
16
|
+
const fingerprint_1 = require("./fingerprint");
|
|
14
17
|
async function setRuntimeVersionNativelyAsync(ctx, runtimeVersion) {
|
|
15
18
|
switch (ctx.job.platform) {
|
|
16
19
|
case eas_build_job_1.Platform.ANDROID: {
|
|
@@ -55,17 +58,19 @@ async function configureEASExpoUpdatesAsync(ctx) {
|
|
|
55
58
|
await setChannelNativelyAsync(ctx);
|
|
56
59
|
}
|
|
57
60
|
exports.configureEASExpoUpdatesAsync = configureEASExpoUpdatesAsync;
|
|
58
|
-
async function configureExpoUpdatesIfInstalledAsync(ctx,
|
|
61
|
+
async function configureExpoUpdatesIfInstalledAsync(ctx, resolvedRuntime) {
|
|
59
62
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
60
63
|
const expoUpdatesPackageVersion = await (0, getExpoUpdatesPackageVersionIfInstalledAsync_1.default)(ctx.getReactNativeProjectDirectory(), ctx.logger);
|
|
61
64
|
if (expoUpdatesPackageVersion === null) {
|
|
62
65
|
return;
|
|
63
66
|
}
|
|
64
|
-
const appConfigRuntimeVersion = (_b = (_a = ctx.job.version) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : resolvedRuntimeVersion;
|
|
67
|
+
const appConfigRuntimeVersion = (_b = (_a = ctx.job.version) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : resolvedRuntime.resolvedRuntimeVersion;
|
|
65
68
|
if (((_c = ctx.metadata) === null || _c === void 0 ? void 0 : _c.runtimeVersion) && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {
|
|
66
69
|
ctx.markBuildPhaseHasWarnings();
|
|
67
|
-
ctx.logger.warn(
|
|
68
|
-
ctx.logger.warn(
|
|
70
|
+
ctx.logger.warn('Runtime version mismatch');
|
|
71
|
+
ctx.logger.warn(`Runtime version on your local machine: ${ctx.metadata.runtimeVersion}`);
|
|
72
|
+
ctx.logger.warn(`Runtime version calculated on EAS: ${appConfigRuntimeVersion}`);
|
|
73
|
+
await logDiffFingerprints({ resolvedRuntime, ctx });
|
|
69
74
|
}
|
|
70
75
|
if (isEASUpdateConfigured(ctx)) {
|
|
71
76
|
if (((_d = ctx.job.updates) === null || _d === void 0 ? void 0 : _d.channel) !== undefined) {
|
|
@@ -111,7 +116,7 @@ async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({ cwd, appCo
|
|
|
111
116
|
expoUpdatesPackageVersion,
|
|
112
117
|
env,
|
|
113
118
|
});
|
|
114
|
-
logger.info(`Resolved runtime version: ${resolvedRuntimeVersion}`);
|
|
119
|
+
logger.info(`Resolved runtime version: ${resolvedRuntimeVersion === null || resolvedRuntimeVersion === void 0 ? void 0 : resolvedRuntimeVersion.runtimeVersion}`);
|
|
115
120
|
return resolvedRuntimeVersion;
|
|
116
121
|
}
|
|
117
122
|
exports.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync = resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync;
|
|
@@ -166,4 +171,38 @@ function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(expoUpdatesPac
|
|
|
166
171
|
return semver_1.default.gte(expoUpdatesPackageVersion, '0.25.4');
|
|
167
172
|
}
|
|
168
173
|
exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported = isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported;
|
|
174
|
+
async function logDiffFingerprints({ resolvedRuntime, ctx, }) {
|
|
175
|
+
var _a;
|
|
176
|
+
const { resolvedRuntimeVersion, resolvedFingerprintSources } = resolvedRuntime;
|
|
177
|
+
if (((_a = ctx.metadata) === null || _a === void 0 ? void 0 : _a.fingerprintSource) && resolvedFingerprintSources && resolvedRuntimeVersion) {
|
|
178
|
+
try {
|
|
179
|
+
const fingerprintSource = ctx.metadata.fingerprintSource;
|
|
180
|
+
let localFingerprint = null;
|
|
181
|
+
if (fingerprintSource.type === eas_build_job_1.FingerprintSourceType.URL) {
|
|
182
|
+
const result = await (0, node_fetch_1.default)(fingerprintSource.url);
|
|
183
|
+
localFingerprint = await result.json();
|
|
184
|
+
}
|
|
185
|
+
else if (fingerprintSource.type === eas_build_job_1.FingerprintSourceType.PATH) {
|
|
186
|
+
localFingerprint = await fs_extra_1.default.readJson(fingerprintSource.path);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
ctx.logger.warn(`Invalid fingerprint source type: ${fingerprintSource.type}`);
|
|
190
|
+
}
|
|
191
|
+
if (localFingerprint) {
|
|
192
|
+
const easFingerprint = {
|
|
193
|
+
hash: resolvedRuntimeVersion,
|
|
194
|
+
sources: resolvedFingerprintSources,
|
|
195
|
+
};
|
|
196
|
+
const changes = (0, fingerprint_1.diffFingerprints)(localFingerprint, easFingerprint);
|
|
197
|
+
if (changes.length) {
|
|
198
|
+
ctx.logger.warn('Difference between local and EAS fingerprints:');
|
|
199
|
+
ctx.logger.warn((0, fingerprint_1.stringifyFingerprintDiff)(changes));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
ctx.logger.warn('Failed to compare fingerprints', error);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
169
208
|
//# sourceMappingURL=expoUpdates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAwE;AACxE,oDAA4B;AAK5B,wDAKgC;AAChC,oDAK4B;AAG5B,kIAA0G;AAC1G,6EAA0E;AAEnE,KAAK,UAAU,8BAA8B,CAClD,GAAsB,EACtB,cAAsB;IAEtB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YACtB,MAAM,IAAA,mDAAqC,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YACjE,OAAO;QACT,CAAC;QACD,KAAK,wBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAClB,MAAM,IAAA,+CAAiC,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAC7D,OAAO;QACT,CAAC;QACD;YACE,M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I,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,MAAM,SAAS,CAAC,CAAC;QAC9E,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAbD,sDAaC;AAED,SAAgB,wDAAwD,CACtE,yBAAiC;IAEjC,IAAI,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uDAAuD;IACvD,OAAO,gBAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC;AATD,4HASC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job, BuildJob, Workflow } from '@expo/eas-build-job';\nimport semver from 'semver';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { BuildStepEnv } from '@expo/steps';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n iosGetNativelyDefinedChannelAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport getExpoUpdatesPackageVersionIfInstalledAsync from './getExpoUpdatesPackageVersionIfInstalledAsync';\nimport { resolveRuntimeVersionAsync } from './resolveRuntimeVersionAsync';\n\nexport async function setRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n case Platform.IOS: {\n await iosSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n */\nexport async function setChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update request headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\nexport async function configureExpoUpdatesIfInstalledAsync(\n ctx: BuildContext<BuildJob>,\n { resolvedRuntimeVersion }: { resolvedRuntimeVersion: string | null }\n): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory(),\n ctx.logger\n );\n if (expoUpdatesPackageVersion === null) {\n return;\n }\n\n const appConfigRuntimeVersion = ctx.job.version?.runtimeVersion ?? resolvedRuntimeVersion;\n if (ctx.metadata?.runtimeVersion && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.markBuildPhaseHasWarnings();\n ctx.logger.warn(\n `Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`\n );\n ctx.logger.warn(\n \"If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS Secret.\"\n );\n }\n\n if (isEASUpdateConfigured(ctx)) {\n if (ctx.job.updates?.channel !== undefined) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n const channel = await getChannelAsync(ctx);\n const isDevelopmentClient = ctx.job.developmentClient ?? false;\n\n if (channel !== null) {\n const configFile =\n ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`The channel name for EAS Update in ${configFile} is set to \"${channel}\"`);\n } else if (isDevelopmentClient) {\n // NO-OP: Development clients don't need to have a channel set\n } else {\n const easUpdateUrl = ctx.appConfig.updates?.url ?? null;\n const jobProfile = ctx.job.buildProfile ?? null;\n ctx.logger.warn(\n `This build has an invalid EAS Update configuration: update.url is set to \"${easUpdateUrl}\" in app config, but a channel is not specified${\n jobProfile ? '' : ` for the current build profile \"${jobProfile}\" in eas.json`\n }.`\n );\n ctx.logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);\n ctx.logger.warn(\n `- Run \\`eas update:configure\\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`\n );\n\n ctx.markBuildPhaseHasWarnings();\n }\n }\n }\n\n if (ctx.job.version?.runtimeVersion) {\n ctx.logger.info('Updating runtimeVersion in Expo.plist');\n await setRuntimeVersionNativelyAsync(ctx, ctx.job.version.runtimeVersion);\n }\n}\n\nexport async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd,\n appConfig,\n platform,\n workflow,\n logger,\n env,\n}: {\n cwd: string;\n appConfig: ExpoConfig;\n platform: Platform;\n workflow: Workflow;\n logger: bunyan;\n env: BuildStepEnv;\n}): Promise<string | null> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd, logger);\n if (expoUpdatesPackageVersion === null) {\n return null;\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionAsync({\n projectDir: cwd,\n exp: appConfig,\n platform,\n workflow,\n logger,\n expoUpdatesPackageVersion,\n env,\n });\n\n logger.info(`Resolved runtime version: ${resolvedRuntimeVersion}`);\n return resolvedRuntimeVersion;\n}\n\nexport async function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedChannelAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function getRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport function isEASUpdateConfigured(ctx: BuildContext<Job>): boolean {\n const rawUrl = ctx.appConfig.updates?.url;\n if (!rawUrl) {\n return false;\n }\n try {\n const url = new URL(rawUrl);\n return ['u.expo.dev', 'staging-u.expo.dev'].includes(url.hostname);\n } catch (err) {\n ctx.logger.error({ err }, `Cannot parse expo.updates.url = ${rawUrl} as URL`);\n ctx.logger.error(`Assuming EAS Update is not configured`);\n return false;\n }\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // Anything SDK 51 or greater uses the expo-updates CLI\n return semver.gte(expoUpdatesPackageVersion, '0.25.4');\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAA+F;AAC/F,oDAA4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;oBACnB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;oBAClE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,sCAAwB,EAAC,OAAO,CAAC,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job, BuildJob, Workflow, FingerprintSourceType } from '@expo/eas-build-job';\nimport semver from 'semver';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { BuildStepEnv } from '@expo/steps';\nimport fetch from 'node-fetch';\nimport fs from 'fs-extra';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n iosGetNativelyDefinedChannelAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport getExpoUpdatesPackageVersionIfInstalledAsync from './getExpoUpdatesPackageVersionIfInstalledAsync';\nimport { resolveRuntimeVersionAsync } from './resolveRuntimeVersionAsync';\nimport {\n Fingerprint,\n FingerprintSource,\n diffFingerprints,\n stringifyFingerprintDiff,\n} from './fingerprint';\n\nexport async function setRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n case Platform.IOS: {\n await iosSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n */\nexport async function setChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update request headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\ntype ResolvedRuntime = {\n resolvedRuntimeVersion: string | null;\n resolvedFingerprintSources?: FingerprintSource[] | null;\n};\n\nexport async function configureExpoUpdatesIfInstalledAsync(\n ctx: BuildContext<BuildJob>,\n resolvedRuntime: ResolvedRuntime\n): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory(),\n ctx.logger\n );\n if (expoUpdatesPackageVersion === null) {\n return;\n }\n\n const appConfigRuntimeVersion =\n ctx.job.version?.runtimeVersion ?? resolvedRuntime.resolvedRuntimeVersion;\n\n if (ctx.metadata?.runtimeVersion && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.markBuildPhaseHasWarnings();\n ctx.logger.warn('Runtime version mismatch');\n ctx.logger.warn(`Runtime version on your local machine: ${ctx.metadata.runtimeVersion}`);\n ctx.logger.warn(`Runtime version calculated on EAS: ${appConfigRuntimeVersion}`);\n\n await logDiffFingerprints({ resolvedRuntime, ctx });\n }\n\n if (isEASUpdateConfigured(ctx)) {\n if (ctx.job.updates?.channel !== undefined) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n const channel = await getChannelAsync(ctx);\n const isDevelopmentClient = ctx.job.developmentClient ?? false;\n\n if (channel !== null) {\n const configFile =\n ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`The channel name for EAS Update in ${configFile} is set to \"${channel}\"`);\n } else if (isDevelopmentClient) {\n // NO-OP: Development clients don't need to have a channel set\n } else {\n const easUpdateUrl = ctx.appConfig.updates?.url ?? null;\n const jobProfile = ctx.job.buildProfile ?? null;\n ctx.logger.warn(\n `This build has an invalid EAS Update configuration: update.url is set to \"${easUpdateUrl}\" in app config, but a channel is not specified${\n jobProfile ? '' : ` for the current build profile \"${jobProfile}\" in eas.json`\n }.`\n );\n ctx.logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);\n ctx.logger.warn(\n `- Run \\`eas update:configure\\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`\n );\n\n ctx.markBuildPhaseHasWarnings();\n }\n }\n }\n\n if (ctx.job.version?.runtimeVersion) {\n ctx.logger.info('Updating runtimeVersion in Expo.plist');\n await setRuntimeVersionNativelyAsync(ctx, ctx.job.version.runtimeVersion);\n }\n}\n\nexport async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd,\n appConfig,\n platform,\n workflow,\n logger,\n env,\n}: {\n cwd: string;\n appConfig: ExpoConfig;\n platform: Platform;\n workflow: Workflow;\n logger: bunyan;\n env: BuildStepEnv;\n}): Promise<{\n runtimeVersion: string | null;\n fingerprintSources: FingerprintSource[] | null;\n} | null> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd, logger);\n if (expoUpdatesPackageVersion === null) {\n return null;\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionAsync({\n projectDir: cwd,\n exp: appConfig,\n platform,\n workflow,\n logger,\n expoUpdatesPackageVersion,\n env,\n });\n\n logger.info(`Resolved runtime version: ${resolvedRuntimeVersion?.runtimeVersion}`);\n return resolvedRuntimeVersion;\n}\n\nexport async function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedChannelAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function getRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport function isEASUpdateConfigured(ctx: BuildContext<Job>): boolean {\n const rawUrl = ctx.appConfig.updates?.url;\n if (!rawUrl) {\n return false;\n }\n try {\n const url = new URL(rawUrl);\n return ['u.expo.dev', 'staging-u.expo.dev'].includes(url.hostname);\n } catch (err) {\n ctx.logger.error({ err }, `Cannot parse expo.updates.url = ${rawUrl} as URL`);\n ctx.logger.error(`Assuming EAS Update is not configured`);\n return false;\n }\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // Anything SDK 51 or greater uses the expo-updates CLI\n return semver.gte(expoUpdatesPackageVersion, '0.25.4');\n}\n\nasync function logDiffFingerprints({\n resolvedRuntime,\n ctx,\n}: {\n resolvedRuntime: ResolvedRuntime;\n ctx: BuildContext<BuildJob>;\n}): Promise<void> {\n const { resolvedRuntimeVersion, resolvedFingerprintSources } = resolvedRuntime;\n if (ctx.metadata?.fingerprintSource && resolvedFingerprintSources && resolvedRuntimeVersion) {\n try {\n const fingerprintSource = ctx.metadata.fingerprintSource;\n\n let localFingerprint: Fingerprint | null = null;\n\n if (fingerprintSource.type === FingerprintSourceType.URL) {\n const result = await fetch(fingerprintSource.url);\n localFingerprint = await result.json();\n } else if (fingerprintSource.type === FingerprintSourceType.PATH) {\n localFingerprint = await fs.readJson(fingerprintSource.path);\n } else {\n ctx.logger.warn(`Invalid fingerprint source type: ${fingerprintSource.type}`);\n }\n\n if (localFingerprint) {\n const easFingerprint = {\n hash: resolvedRuntimeVersion,\n sources: resolvedFingerprintSources,\n };\n const changes = diffFingerprints(localFingerprint, easFingerprint);\n if (changes.length) {\n ctx.logger.warn('Difference between local and EAS fingerprints:');\n ctx.logger.warn(stringifyFingerprintDiff(changes));\n }\n }\n } catch (error) {\n ctx.logger.warn('Failed to compare fingerprints', error);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT EDIT unless the same change is made in `@expo/fingerprint`
|
|
3
|
+
* The diffFingerprints function is a copy/paste from https://github.com/expo/expo/pull/29709
|
|
4
|
+
*/
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
export type FingerprintSource = HashSource & {
|
|
7
|
+
/**
|
|
8
|
+
* Hash value of the `source`.
|
|
9
|
+
* If the source is excluding by `Options.dirExcludes`, the value will be null.
|
|
10
|
+
*/
|
|
11
|
+
hash: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Debug info from the hashing process. Differs based on source type. Designed to be consumed by humans
|
|
14
|
+
* as opposed to programmatically.
|
|
15
|
+
*/
|
|
16
|
+
debugInfo?: DebugInfo;
|
|
17
|
+
};
|
|
18
|
+
export interface Fingerprint {
|
|
19
|
+
/**
|
|
20
|
+
* Sources and their hash values to generate a fingerprint
|
|
21
|
+
*/
|
|
22
|
+
sources: FingerprintSource[];
|
|
23
|
+
/**
|
|
24
|
+
* The final hash value of the whole fingerprint
|
|
25
|
+
*/
|
|
26
|
+
hash: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HashSourceFile {
|
|
29
|
+
type: 'file';
|
|
30
|
+
filePath: string;
|
|
31
|
+
/**
|
|
32
|
+
* Reasons of this source coming from
|
|
33
|
+
*/
|
|
34
|
+
reasons: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface HashSourceDir {
|
|
37
|
+
type: 'dir';
|
|
38
|
+
filePath: string;
|
|
39
|
+
/**
|
|
40
|
+
* Reasons of this source coming from
|
|
41
|
+
*/
|
|
42
|
+
reasons: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface HashSourceContents {
|
|
45
|
+
type: 'contents';
|
|
46
|
+
id: string;
|
|
47
|
+
contents: string | Buffer;
|
|
48
|
+
/**
|
|
49
|
+
* Reasons of this source coming from
|
|
50
|
+
*/
|
|
51
|
+
reasons: string[];
|
|
52
|
+
}
|
|
53
|
+
export type HashSource = HashSourceFile | HashSourceDir | HashSourceContents;
|
|
54
|
+
export interface DebugInfoFile {
|
|
55
|
+
path: string;
|
|
56
|
+
hash: string;
|
|
57
|
+
}
|
|
58
|
+
export interface DebugInfoDir {
|
|
59
|
+
path: string;
|
|
60
|
+
hash: string;
|
|
61
|
+
children: (DebugInfoFile | DebugInfoDir | undefined)[];
|
|
62
|
+
}
|
|
63
|
+
export interface DebugInfoContents {
|
|
64
|
+
hash: string;
|
|
65
|
+
}
|
|
66
|
+
export type DebugInfo = DebugInfoFile | DebugInfoDir | DebugInfoContents;
|
|
67
|
+
export interface FingerprintDiffItem {
|
|
68
|
+
/**
|
|
69
|
+
* The operation type of the diff item.
|
|
70
|
+
*/
|
|
71
|
+
op: 'added' | 'removed' | 'changed';
|
|
72
|
+
/**
|
|
73
|
+
* The source of the diff item.
|
|
74
|
+
* - When type is 'added', the source is the new source.
|
|
75
|
+
* - When type is 'removed', the source is the old source.
|
|
76
|
+
* - When type is 'changed', the source is the new source.
|
|
77
|
+
*/
|
|
78
|
+
source: FingerprintSource;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Comparator between two sources.
|
|
82
|
+
* This is useful for sorting sources in a consistent order.
|
|
83
|
+
* @returns:
|
|
84
|
+
* == 0 if a and b are equal,
|
|
85
|
+
* < 0 if a is less than b,
|
|
86
|
+
* > 0 if a is greater than b.
|
|
87
|
+
*/
|
|
88
|
+
export declare function compareSource(a: HashSource, b: HashSource): number;
|
|
89
|
+
export declare function diffFingerprints(fingerprint1: Fingerprint, fingerprint2: Fingerprint): FingerprintDiffItem[];
|
|
90
|
+
export declare function stringifyFingerprintDiff(fingerprintDiff: FingerprintDiffItem[]): string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DO NOT EDIT unless the same change is made in `@expo/fingerprint`
|
|
4
|
+
* The diffFingerprints function is a copy/paste from https://github.com/expo/expo/pull/29709
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.stringifyFingerprintDiff = exports.diffFingerprints = exports.compareSource = void 0;
|
|
8
|
+
const typeOrder = {
|
|
9
|
+
file: 0,
|
|
10
|
+
dir: 1,
|
|
11
|
+
contents: 2,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Comparator between two sources.
|
|
15
|
+
* This is useful for sorting sources in a consistent order.
|
|
16
|
+
* @returns:
|
|
17
|
+
* == 0 if a and b are equal,
|
|
18
|
+
* < 0 if a is less than b,
|
|
19
|
+
* > 0 if a is greater than b.
|
|
20
|
+
*/
|
|
21
|
+
function compareSource(a, b) {
|
|
22
|
+
const typeResult = typeOrder[a.type] - typeOrder[b.type];
|
|
23
|
+
if (typeResult === 0) {
|
|
24
|
+
if (a.type === 'file' && b.type === 'file') {
|
|
25
|
+
return a.filePath.localeCompare(b.filePath);
|
|
26
|
+
}
|
|
27
|
+
else if (a.type === 'dir' && b.type === 'dir') {
|
|
28
|
+
return a.filePath.localeCompare(b.filePath);
|
|
29
|
+
}
|
|
30
|
+
else if (a.type === 'contents' && b.type === 'contents') {
|
|
31
|
+
return a.id.localeCompare(b.id);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return typeResult;
|
|
35
|
+
}
|
|
36
|
+
exports.compareSource = compareSource;
|
|
37
|
+
function diffFingerprints(fingerprint1, fingerprint2) {
|
|
38
|
+
let index1 = 0;
|
|
39
|
+
let index2 = 0;
|
|
40
|
+
const diff = [];
|
|
41
|
+
while (index1 < fingerprint1.sources.length && index2 < fingerprint2.sources.length) {
|
|
42
|
+
const source1 = fingerprint1.sources[index1];
|
|
43
|
+
const source2 = fingerprint2.sources[index2];
|
|
44
|
+
const compareResult = compareSource(source1, source2);
|
|
45
|
+
if (compareResult === 0) {
|
|
46
|
+
if (source1.hash !== source2.hash) {
|
|
47
|
+
diff.push({ op: 'changed', source: source2 });
|
|
48
|
+
}
|
|
49
|
+
++index1;
|
|
50
|
+
++index2;
|
|
51
|
+
}
|
|
52
|
+
else if (compareResult < 0) {
|
|
53
|
+
diff.push({ op: 'removed', source: source1 });
|
|
54
|
+
++index1;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
diff.push({ op: 'added', source: source2 });
|
|
58
|
+
++index2;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
while (index1 < fingerprint1.sources.length) {
|
|
62
|
+
diff.push({ op: 'removed', source: fingerprint1.sources[index1] });
|
|
63
|
+
++index1;
|
|
64
|
+
}
|
|
65
|
+
while (index2 < fingerprint2.sources.length) {
|
|
66
|
+
diff.push({ op: 'added', source: fingerprint2.sources[index2] });
|
|
67
|
+
++index2;
|
|
68
|
+
}
|
|
69
|
+
return diff;
|
|
70
|
+
}
|
|
71
|
+
exports.diffFingerprints = diffFingerprints;
|
|
72
|
+
function stringifyFingerprintDiff(fingerprintDiff) {
|
|
73
|
+
return JSON.stringify(fingerprintDiff, (key, value) => {
|
|
74
|
+
if (key === 'contents') {
|
|
75
|
+
try {
|
|
76
|
+
const item = JSON.parse(value);
|
|
77
|
+
return item;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return value;
|
|
84
|
+
}, ' ');
|
|
85
|
+
}
|
|
86
|
+
exports.stringifyFingerprintDiff = stringifyFingerprintDiff;
|
|
87
|
+
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/utils/fingerprint.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4FH,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,CAAa,EAAE,CAAa;IACxD,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACzD,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3C,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YAChD,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAZD,sCAYC;A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CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnE,EAAE,MAAM,CAAC;IACX,CAAC;IACD,OAAO,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjE,EAAE,MAAM,CAAC;IACX,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAtCD,4CAsCC;AAED,SAAgB,wBAAwB,CAAC,eAAsC;IAC7E,OAAO,IAAI,CAAC,SAAS,CACnB,eAAe,EACf,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACb,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AAhBD,4DAgBC","sourcesContent":["/**\n * DO NOT EDIT unless the same change is made in `@expo/fingerprint`\n * The diffFingerprints function is a copy/paste from https://github.com/expo/expo/pull/29709\n */\n\nexport type FingerprintSource = HashSource & {\n /**\n * Hash value of the `source`.\n * If the source is excluding by `Options.dirExcludes`, the value will be null.\n */\n hash: string | null;\n /**\n * Debug info from the hashing process. Differs based on source type. Designed to be consumed by humans\n * as opposed to programmatically.\n */\n debugInfo?: DebugInfo;\n};\n\nexport interface Fingerprint {\n /**\n * Sources and their hash values to generate a fingerprint\n */\n sources: FingerprintSource[];\n\n /**\n * The final hash value of the whole fingerprint\n */\n hash: string;\n}\n\nexport interface HashSourceFile {\n type: 'file';\n filePath: string;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport interface HashSourceDir {\n type: 'dir';\n filePath: string;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport interface HashSourceContents {\n type: 'contents';\n id: string;\n contents: string | Buffer;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport type HashSource = HashSourceFile | HashSourceDir | HashSourceContents;\n\nexport interface DebugInfoFile {\n path: string;\n hash: string;\n}\n\nexport interface DebugInfoDir {\n path: string;\n hash: string;\n children: (DebugInfoFile | DebugInfoDir | undefined)[];\n}\n\nexport interface DebugInfoContents {\n hash: string;\n}\n\nexport type DebugInfo = DebugInfoFile | DebugInfoDir | DebugInfoContents;\n\nexport interface FingerprintDiffItem {\n /**\n * The operation type of the diff item.\n */\n op: 'added' | 'removed' | 'changed';\n\n /**\n * The source of the diff item.\n * - When type is 'added', the source is the new source.\n * - When type is 'removed', the source is the old source.\n * - When type is 'changed', the source is the new source.\n */\n source: FingerprintSource;\n}\n\nconst typeOrder = {\n file: 0,\n dir: 1,\n contents: 2,\n};\n\n/**\n * Comparator between two sources.\n * This is useful for sorting sources in a consistent order.\n * @returns:\n * == 0 if a and b are equal,\n * < 0 if a is less than b,\n * > 0 if a is greater than b.\n */\nexport function compareSource(a: HashSource, b: HashSource): number {\n const typeResult = typeOrder[a.type] - typeOrder[b.type];\n if (typeResult === 0) {\n if (a.type === 'file' && b.type === 'file') {\n return a.filePath.localeCompare(b.filePath);\n } else if (a.type === 'dir' && b.type === 'dir') {\n return a.filePath.localeCompare(b.filePath);\n } else if (a.type === 'contents' && b.type === 'contents') {\n return a.id.localeCompare(b.id);\n }\n }\n return typeResult;\n}\n\nexport function diffFingerprints(\n fingerprint1: Fingerprint,\n fingerprint2: Fingerprint\n): FingerprintDiffItem[] {\n let index1 = 0;\n let index2 = 0;\n const diff: FingerprintDiffItem[] = [];\n\n while (index1 < fingerprint1.sources.length && index2 < fingerprint2.sources.length) {\n const source1 = fingerprint1.sources[index1];\n const source2 = fingerprint2.sources[index2];\n\n const compareResult = compareSource(source1, source2);\n if (compareResult === 0) {\n if (source1.hash !== source2.hash) {\n diff.push({ op: 'changed', source: source2 });\n }\n ++index1;\n ++index2;\n } else if (compareResult < 0) {\n diff.push({ op: 'removed', source: source1 });\n ++index1;\n } else {\n diff.push({ op: 'added', source: source2 });\n ++index2;\n }\n }\n\n while (index1 < fingerprint1.sources.length) {\n diff.push({ op: 'removed', source: fingerprint1.sources[index1] });\n ++index1;\n }\n while (index2 < fingerprint2.sources.length) {\n diff.push({ op: 'added', source: fingerprint2.sources[index2] });\n ++index2;\n }\n\n return diff;\n}\n\nexport function stringifyFingerprintDiff(fingerprintDiff: FingerprintDiffItem[]): string {\n return JSON.stringify(\n fingerprintDiff,\n (key, value) => {\n if (key === 'contents') {\n try {\n const item = JSON.parse(value);\n return item;\n } catch {\n return value;\n }\n }\n return value;\n },\n ' '\n );\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { ExpoConfig } from '@expo/config';
|
|
|
3
3
|
import { bunyan } from '@expo/logger';
|
|
4
4
|
import { Workflow } from '@expo/eas-build-job';
|
|
5
5
|
import { BuildStepEnv } from '@expo/steps';
|
|
6
|
+
import { FingerprintSource } from './fingerprint';
|
|
6
7
|
export declare function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, logger, expoUpdatesPackageVersion, env, }: {
|
|
7
8
|
exp: ExpoConfig;
|
|
8
9
|
platform: 'ios' | 'android';
|
|
@@ -11,4 +12,7 @@ export declare function resolveRuntimeVersionAsync({ exp, platform, workflow, pr
|
|
|
11
12
|
logger: bunyan;
|
|
12
13
|
expoUpdatesPackageVersion: string;
|
|
13
14
|
env: BuildStepEnv;
|
|
14
|
-
}): Promise<
|
|
15
|
+
}): Promise<{
|
|
16
|
+
runtimeVersion: string | null;
|
|
17
|
+
fingerprintSources: FingerprintSource[] | null;
|
|
18
|
+
} | null>;
|
|
@@ -5,12 +5,15 @@ const config_plugins_1 = require("@expo/config-plugins");
|
|
|
5
5
|
const expoUpdatesCli_1 = require("./expoUpdatesCli");
|
|
6
6
|
const expoUpdates_1 = require("./expoUpdates");
|
|
7
7
|
async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, logger, expoUpdatesPackageVersion, env, }) {
|
|
8
|
-
var _a;
|
|
8
|
+
var _a, _b;
|
|
9
9
|
if (!(0, expoUpdates_1.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported)(expoUpdatesPackageVersion)) {
|
|
10
10
|
logger.debug('Using expo-updates config plugin for runtime version resolution');
|
|
11
11
|
// fall back to the previous behavior (using the @expo/config-plugins eas-cli dependency rather
|
|
12
12
|
// than the versioned @expo/config-plugins dependency in the project)
|
|
13
|
-
return
|
|
13
|
+
return {
|
|
14
|
+
runtimeVersion: await config_plugins_1.Updates.getRuntimeVersionNullableAsync(projectDir, exp, platform),
|
|
15
|
+
fingerprintSources: null,
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
try {
|
|
16
19
|
logger.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');
|
|
@@ -21,7 +24,10 @@ async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir,
|
|
|
21
24
|
const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);
|
|
22
25
|
logger.debug('runtimeversion:resolve output:');
|
|
23
26
|
logger.debug(resolvedRuntimeVersionJSONResult);
|
|
24
|
-
return
|
|
27
|
+
return {
|
|
28
|
+
runtimeVersion: (_a = runtimeVersionResult.runtimeVersion) !== null && _a !== void 0 ? _a : null,
|
|
29
|
+
fingerprintSources: (_b = runtimeVersionResult.fingerprintSources) !== null && _b !== void 0 ? _b : null,
|
|
30
|
+
};
|
|
25
31
|
}
|
|
26
32
|
catch (e) {
|
|
27
33
|
// if expo-updates is not installed, there's no need for a runtime version in the build
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRuntimeVersionAsync.js","sourceRoot":"","sources":["../../src/utils/resolveRuntimeVersionAsync.ts"],"names":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AAI,IAAI;YAC3D,kBAAkB,EAAE,MAAA,oBAAoB,CAAC,kBAAkB,mCAAI,IAAI;SACpE,CAAC;IACJ,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,uFAAuF;QACvF,IAAI,CAAC,YAAY,kDAAiC,EAAE,CAAC;YACnD,MAAM,CAAC,KAAK,CACV,uFAAuF,CAAC,CAAC,OAAO,EAAE,CACnG,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AA7DD,gEA6DC","sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { Updates } from '@expo/config-plugins';\nimport { bunyan } from '@expo/logger';\nimport { Workflow } from '@expo/eas-build-job';\nimport { BuildStepEnv } from '@expo/steps';\n\nimport { ExpoUpdatesCLIModuleNotFoundError, expoUpdatesCommandAsync } from './expoUpdatesCli';\nimport { isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported } from './expoUpdates';\nimport { FingerprintSource } from './fingerprint';\n\nexport async function resolveRuntimeVersionAsync({\n exp,\n platform,\n workflow,\n projectDir,\n logger,\n expoUpdatesPackageVersion,\n env,\n}: {\n exp: ExpoConfig;\n platform: 'ios' | 'android';\n workflow: Workflow;\n projectDir: string;\n logger: bunyan;\n expoUpdatesPackageVersion: string;\n env: BuildStepEnv;\n}): Promise<{\n runtimeVersion: string | null;\n fingerprintSources: FingerprintSource[] | null;\n} | null> {\n if (!isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(expoUpdatesPackageVersion)) {\n logger.debug('Using expo-updates config plugin for runtime version resolution');\n // fall back to the previous behavior (using the @expo/config-plugins eas-cli dependency rather\n // than the versioned @expo/config-plugins dependency in the project)\n return {\n runtimeVersion: await Updates.getRuntimeVersionNullableAsync(projectDir, exp, platform),\n fingerprintSources: null,\n };\n }\n\n try {\n logger.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');\n\n const extraArgs = logger.debug() ? ['--debug'] : [];\n\n const resolvedRuntimeVersionJSONResult = await expoUpdatesCommandAsync(\n projectDir,\n ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs],\n {\n env,\n }\n );\n const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);\n\n logger.debug('runtimeversion:resolve output:');\n logger.debug(resolvedRuntimeVersionJSONResult);\n\n return {\n runtimeVersion: runtimeVersionResult.runtimeVersion ?? null,\n fingerprintSources: runtimeVersionResult.fingerprintSources ?? null,\n };\n } catch (e: any) {\n // if expo-updates is not installed, there's no need for a runtime version in the build\n if (e instanceof ExpoUpdatesCLIModuleNotFoundError) {\n logger.error(\n `Error when resolving runtime version using expo-updates runtimeversion:resolve CLI: ${e.message}`\n );\n return null;\n }\n throw e;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.122",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"node": "20.14.0",
|
|
69
69
|
"yarn": "1.22.21"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e01b3c199659e162216300d97d09883aadc4d0f4"
|
|
72
72
|
}
|