@expo/build-tools 1.0.86 → 1.0.88
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/dist/android/gradle.d.ts +3 -2
- package/dist/android/gradle.js +3 -3
- package/dist/android/gradle.js.map +1 -1
- package/dist/builders/android.js +14 -1
- package/dist/builders/android.js.map +1 -1
- package/dist/builders/ios.js +14 -1
- package/dist/builders/ios.js.map +1 -1
- package/dist/ios/fastlane.d.ts +3 -2
- package/dist/ios/fastlane.js +2 -2
- package/dist/ios/fastlane.js.map +1 -1
- package/dist/steps/easFunctions.js +2 -0
- package/dist/steps/easFunctions.js.map +1 -1
- package/dist/steps/functionGroups/build.js +49 -8
- package/dist/steps/functionGroups/build.js.map +1 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.d.ts +2 -0
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +46 -0
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +1 -0
- package/dist/steps/functions/configureEASUpdateIfInstalled.js +8 -1
- package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +1 -1
- package/dist/steps/functions/runFastlane.js +13 -6
- package/dist/steps/functions/runFastlane.js.map +1 -1
- package/dist/steps/functions/runGradle.js +9 -0
- package/dist/steps/functions/runGradle.js.map +1 -1
- package/dist/steps/utils/android/gradle.d.ts +2 -1
- package/dist/steps/utils/android/gradle.js +2 -2
- package/dist/steps/utils/android/gradle.js.map +1 -1
- package/dist/steps/utils/expoUpdates.d.ts +4 -3
- package/dist/steps/utils/expoUpdates.js +26 -23
- package/dist/steps/utils/expoUpdates.js.map +1 -1
- package/dist/steps/utils/ios/fastlane.d.ts +7 -5
- package/dist/steps/utils/ios/fastlane.js +4 -2
- package/dist/steps/utils/ios/fastlane.js.map +1 -1
- package/dist/utils/expoUpdates.d.ts +13 -2
- package/dist/utils/expoUpdates.js +26 -16
- package/dist/utils/expoUpdates.js.map +1 -1
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported = exports.shouldConfigureClassicUpdatesReleaseChannelAsFallback = exports.isEASUpdateConfigured = exports.getRuntimeVersionAsync = exports.getChannelAsync = exports.configureExpoUpdatesIfInstalledAsync = exports.configureEASExpoUpdatesAsync = exports.configureClassicExpoUpdatesAsync = exports.getNativelyDefinedClassicReleaseChannelAsync = exports.setClassicReleaseChannelNativelyAsync = exports.setChannelNativelyAsync = exports.setRuntimeVersionNativelyAsync = void 0;
|
|
6
|
+
exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported = exports.shouldConfigureClassicUpdatesReleaseChannelAsFallback = exports.isEASUpdateConfigured = exports.getRuntimeVersionAsync = exports.getChannelAsync = exports.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync = exports.configureExpoUpdatesIfInstalledAsync = exports.configureEASExpoUpdatesAsync = exports.configureClassicExpoUpdatesAsync = exports.getNativelyDefinedClassicReleaseChannelAsync = exports.setClassicReleaseChannelNativelyAsync = exports.setChannelNativelyAsync = exports.setRuntimeVersionNativelyAsync = void 0;
|
|
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"));
|
|
@@ -113,31 +113,25 @@ async function configureEASExpoUpdatesAsync(ctx) {
|
|
|
113
113
|
await setChannelNativelyAsync(ctx);
|
|
114
114
|
}
|
|
115
115
|
exports.configureEASExpoUpdatesAsync = configureEASExpoUpdatesAsync;
|
|
116
|
-
async function configureExpoUpdatesIfInstalledAsync(ctx) {
|
|
117
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
116
|
+
async function configureExpoUpdatesIfInstalledAsync(ctx, { resolvedRuntimeVersion }) {
|
|
117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
118
118
|
const expoUpdatesPackageVersion = await (0, getExpoUpdatesPackageVersionIfInstalledAsync_1.default)(ctx.getReactNativeProjectDirectory());
|
|
119
119
|
if (expoUpdatesPackageVersion === null) {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
const appConfigRuntimeVersion = (_b = (_a = ctx.job.version) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b :
|
|
123
|
-
|
|
124
|
-
exp: ctx.appConfig,
|
|
125
|
-
platform: ctx.job.platform,
|
|
126
|
-
logger: ctx.logger,
|
|
127
|
-
expoUpdatesPackageVersion,
|
|
128
|
-
}));
|
|
129
|
-
if (((_c = ctx.metadata) === null || _c === void 0 ? void 0 : _c.runtimeVersion) && ((_d = ctx.metadata) === null || _d === void 0 ? void 0 : _d.runtimeVersion) !== appConfigRuntimeVersion) {
|
|
122
|
+
const appConfigRuntimeVersion = (_b = (_a = ctx.job.version) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : resolvedRuntimeVersion;
|
|
123
|
+
if (((_c = ctx.metadata) === null || _c === void 0 ? void 0 : _c.runtimeVersion) && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {
|
|
130
124
|
ctx.markBuildPhaseHasWarnings();
|
|
131
125
|
ctx.logger.warn(`Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`);
|
|
132
126
|
ctx.logger.warn("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.");
|
|
133
127
|
}
|
|
134
128
|
if (isEASUpdateConfigured(ctx)) {
|
|
135
|
-
if (((
|
|
129
|
+
if (((_d = ctx.job.updates) === null || _d === void 0 ? void 0 : _d.channel) !== undefined) {
|
|
136
130
|
await configureEASExpoUpdatesAsync(ctx);
|
|
137
131
|
}
|
|
138
132
|
else {
|
|
139
133
|
const channel = await getChannelAsync(ctx);
|
|
140
|
-
const isDevelopmentClient = (
|
|
134
|
+
const isDevelopmentClient = (_e = ctx.job.developmentClient) !== null && _e !== void 0 ? _e : false;
|
|
141
135
|
if (channel !== null) {
|
|
142
136
|
const configFile = ctx.job.platform === eas_build_job_1.Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';
|
|
143
137
|
ctx.logger.info(`The channel name for EAS Update in ${configFile} is set to "${channel}"`);
|
|
@@ -150,8 +144,8 @@ async function configureExpoUpdatesIfInstalledAsync(ctx) {
|
|
|
150
144
|
ctx.logger.warn(`This build is configured with EAS Update however has a Classic Updates releaseChannel set instead of having an EAS Update channel.`);
|
|
151
145
|
}
|
|
152
146
|
else {
|
|
153
|
-
const easUpdateUrl = (
|
|
154
|
-
const jobProfile = (
|
|
147
|
+
const easUpdateUrl = (_g = (_f = ctx.appConfig.updates) === null || _f === void 0 ? void 0 : _f.url) !== null && _g !== void 0 ? _g : null;
|
|
148
|
+
const jobProfile = (_h = ctx.job.buildProfile) !== null && _h !== void 0 ? _h : null;
|
|
155
149
|
ctx.logger.warn(`This build has an invalid EAS Update configuration: update.url is set to "${easUpdateUrl}" in app config, but a channel is not specified${jobProfile ? '' : ` for the current build profile "${jobProfile}" in eas.json`}.`);
|
|
156
150
|
ctx.logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);
|
|
157
151
|
ctx.logger.warn(`- 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`);
|
|
@@ -163,12 +157,28 @@ async function configureExpoUpdatesIfInstalledAsync(ctx) {
|
|
|
163
157
|
else if (shouldConfigureClassicUpdatesReleaseChannelAsFallback(expoUpdatesPackageVersion)) {
|
|
164
158
|
await configureClassicExpoUpdatesAsync(ctx);
|
|
165
159
|
}
|
|
166
|
-
if ((
|
|
160
|
+
if ((_j = ctx.job.version) === null || _j === void 0 ? void 0 : _j.runtimeVersion) {
|
|
167
161
|
ctx.logger.info('Updating runtimeVersion in Expo.plist');
|
|
168
162
|
await setRuntimeVersionNativelyAsync(ctx, ctx.job.version.runtimeVersion);
|
|
169
163
|
}
|
|
170
164
|
}
|
|
171
165
|
exports.configureExpoUpdatesIfInstalledAsync = configureExpoUpdatesIfInstalledAsync;
|
|
166
|
+
async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({ cwd, appConfig, platform, logger, }) {
|
|
167
|
+
const expoUpdatesPackageVersion = await (0, getExpoUpdatesPackageVersionIfInstalledAsync_1.default)(cwd);
|
|
168
|
+
if (expoUpdatesPackageVersion === null) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const resolvedRuntimeVersion = await (0, resolveRuntimeVersionAsync_1.resolveRuntimeVersionAsync)({
|
|
172
|
+
projectDir: cwd,
|
|
173
|
+
exp: appConfig,
|
|
174
|
+
platform,
|
|
175
|
+
logger,
|
|
176
|
+
expoUpdatesPackageVersion,
|
|
177
|
+
});
|
|
178
|
+
logger.info(`Resolved runtime version: ${resolvedRuntimeVersion}`);
|
|
179
|
+
return resolvedRuntimeVersion;
|
|
180
|
+
}
|
|
181
|
+
exports.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync = resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync;
|
|
172
182
|
async function getChannelAsync(ctx) {
|
|
173
183
|
switch (ctx.job.platform) {
|
|
174
184
|
case eas_build_job_1.Platform.ANDROID: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;AACpD,oDAA4B;AAE5B,wDAOgC;AAChC,oDAO4B;AAG5B,kIAA0G;AAC1G,6EAA0E;AAEnE,KAAK,UAAU,8BAA8B,CAClD,GAAsB,EACtB,cAAsB;IAEtB,QAAQ,GAAG,CAAC,GAAG,CAAC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AAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2FAA2F;IAC3F,8DAA8D;IAC9D,OAAO,gBAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAVD,sHAUC;AAED,SAAgB,wDAAwD,CACtE,yBAAiC;IAEjC,IAAI,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sGAAsG;IACtG,OAAO,KAAK,CAAC;AACf,CAAC;AATD,4HASC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidSetClassicReleaseChannelNativelyAsync,\n androidGetNativelyDefinedClassicReleaseChannelAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosSetClassicReleaseChannelNativelyAsync,\n iosGetNativelyDefinedClassicReleaseChannelAsync,\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<Job>): 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\n/**\n * Used for classic Expo Updates\n */\nexport async function setClassicReleaseChannelNativelyAsync(ctx: BuildContext<Job>): Promise<void> {\n assert(ctx.job.releaseChannel, 'releaseChannel must be defined');\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`Setting the release channel in '${configFile}' to '${ctx.job.releaseChannel}'`);\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for classic Expo Updates\n */\nexport async function getNativelyDefinedClassicReleaseChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return androidGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n case Platform.IOS: {\n return iosGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureClassicExpoUpdatesAsync(ctx: BuildContext<Job>): Promise<void> {\n if (ctx.job.releaseChannel) {\n await setClassicReleaseChannelNativelyAsync(ctx);\n } else {\n /**\n * If releaseChannel is not defined:\n * 1. Try to infer it from the native value.\n * 2. If it is not set, fallback to 'default'.\n */\n const releaseChannel = await getNativelyDefinedClassicReleaseChannelAsync(ctx);\n if (releaseChannel) {\n ctx.logger.info(\n `Using the release channel pre-configured in native project (${releaseChannel})`\n );\n ctx.logger.warn('Please add the \"releaseChannel\" field to your build profile (eas.json)');\n } else {\n ctx.logger.info(`Using default release channel for 'expo-updates' (default)`);\n }\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<Job>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\nexport async function configureExpoUpdatesIfInstalledAsync(ctx: BuildContext<Job>): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (expoUpdatesPackageVersion === null) {\n return;\n }\n\n const appConfigRuntimeVersion =\n ctx.job.version?.runtimeVersion ??\n (await resolveRuntimeVersionAsync({\n projectDir: ctx.getReactNativeProjectDirectory(),\n exp: ctx.appConfig,\n platform: ctx.job.platform,\n logger: ctx.logger,\n expoUpdatesPackageVersion,\n }));\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 if (ctx.job.releaseChannel !== undefined) {\n ctx.logger.warn(\n `This build is configured with EAS Update however has a Classic Updates releaseChannel set instead of having an EAS Update channel.`\n );\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(\n `- No channel will be set and EAS Update will be disabled for the build.`\n );\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 } else if (shouldConfigureClassicUpdatesReleaseChannelAsFallback(expoUpdatesPackageVersion)) {\n await configureClassicExpoUpdatesAsync(ctx);\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 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 shouldConfigureClassicUpdatesReleaseChannelAsFallback(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return false;\n }\n\n // Anything before SDK 50 should configure classic updates as a fallback. The first version\n // of the expo-updates package published for SDK 50 was 0.19.0\n return semver.lt(expoUpdatesPackageVersion, '0.19.0');\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // TODO(wschurman): add semver check once we know the SDK51 version of expo-updates that supports this\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;AACpD,oDAA4B;AAI5B,wDAOgC;AAChC,oDAO4B;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,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,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2FAA2F;IAC3F,8DAA8D;IAC9D,OAAO,gBAAM,CAAC,EAAE,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAVD,sHAUC;AAED,SAAgB,wDAAwD,CACtE,yBAAiC;IAEjC,IAAI,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sGAAsG;IACtG,OAAO,KAAK,CAAC;AACf,CAAC;AATD,4HASC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job } from '@expo/eas-build-job';\nimport semver from 'semver';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidSetClassicReleaseChannelNativelyAsync,\n androidGetNativelyDefinedClassicReleaseChannelAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosSetClassicReleaseChannelNativelyAsync,\n iosGetNativelyDefinedClassicReleaseChannelAsync,\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<Job>): 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\n/**\n * Used for classic Expo Updates\n */\nexport async function setClassicReleaseChannelNativelyAsync(ctx: BuildContext<Job>): Promise<void> {\n assert(ctx.job.releaseChannel, 'releaseChannel must be defined');\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`Setting the release channel in '${configFile}' to '${ctx.job.releaseChannel}'`);\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for classic Expo Updates\n */\nexport async function getNativelyDefinedClassicReleaseChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return androidGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n case Platform.IOS: {\n return iosGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureClassicExpoUpdatesAsync(ctx: BuildContext<Job>): Promise<void> {\n if (ctx.job.releaseChannel) {\n await setClassicReleaseChannelNativelyAsync(ctx);\n } else {\n /**\n * If releaseChannel is not defined:\n * 1. Try to infer it from the native value.\n * 2. If it is not set, fallback to 'default'.\n */\n const releaseChannel = await getNativelyDefinedClassicReleaseChannelAsync(ctx);\n if (releaseChannel) {\n ctx.logger.info(\n `Using the release channel pre-configured in native project (${releaseChannel})`\n );\n ctx.logger.warn('Please add the \"releaseChannel\" field to your build profile (eas.json)');\n } else {\n ctx.logger.info(`Using default release channel for 'expo-updates' (default)`);\n }\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<Job>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\nexport async function configureExpoUpdatesIfInstalledAsync(\n ctx: BuildContext<Job>,\n { resolvedRuntimeVersion }: { resolvedRuntimeVersion: string | null }\n): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory()\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 if (ctx.job.releaseChannel !== undefined) {\n ctx.logger.warn(\n `This build is configured with EAS Update however has a Classic Updates releaseChannel set instead of having an EAS Update channel.`\n );\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(\n `- No channel will be set and EAS Update will be disabled for the build.`\n );\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 } else if (shouldConfigureClassicUpdatesReleaseChannelAsFallback(expoUpdatesPackageVersion)) {\n await configureClassicExpoUpdatesAsync(ctx);\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 logger,\n}: {\n cwd: string;\n appConfig: ExpoConfig;\n platform: Platform;\n logger: bunyan;\n}): Promise<string | null> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd);\n if (expoUpdatesPackageVersion === null) {\n return null;\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionAsync({\n projectDir: cwd,\n exp: appConfig,\n platform,\n logger,\n expoUpdatesPackageVersion,\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 shouldConfigureClassicUpdatesReleaseChannelAsFallback(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return false;\n }\n\n // Anything before SDK 50 should configure classic updates as a fallback. The first version\n // of the expo-updates package published for SDK 50 was 0.19.0\n return semver.lt(expoUpdatesPackageVersion, '0.19.0');\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // TODO(wschurman): add semver check once we know the SDK51 version of expo-updates that supports this\n return false;\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.88",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"@expo/config": "8.5.4",
|
|
25
25
|
"@expo/config-plugins": "7.8.4",
|
|
26
26
|
"@expo/downloader": "1.0.57",
|
|
27
|
-
"@expo/eas-build-job": "1.0.
|
|
27
|
+
"@expo/eas-build-job": "1.0.88",
|
|
28
28
|
"@expo/env": "^0.0.5",
|
|
29
29
|
"@expo/logger": "1.0.57",
|
|
30
30
|
"@expo/package-manager": "1.1.2",
|
|
31
31
|
"@expo/plist": "^0.0.20",
|
|
32
|
-
"@expo/steps": "1.0.
|
|
32
|
+
"@expo/steps": "1.0.88",
|
|
33
33
|
"@expo/template-file": "1.0.57",
|
|
34
34
|
"@expo/turtle-spawn": "1.0.57",
|
|
35
35
|
"@expo/xcpretty": "^4.3.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": "20.11.0",
|
|
70
70
|
"yarn": "1.22.21"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "6b45ac04bc89ec878ab67d3e6cbca13615798f5a"
|
|
73
73
|
}
|