eas-cli 9.0.3 → 9.0.4
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/README.md +59 -59
- package/build/analytics/AnalyticsManager.js +4 -5
- package/build/api.js +1 -2
- package/build/branch/actions/SelectBranch.js +2 -3
- package/build/branch/queries.js +3 -5
- package/build/branch/utils.js +1 -1
- package/build/build/android/build.js +3 -5
- package/build/build/android/graphql.js +1 -2
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.js +1 -1
- package/build/build/android/version.js +14 -16
- package/build/build/build.js +8 -10
- package/build/build/createContext.js +7 -8
- package/build/build/ios/build.js +2 -4
- package/build/build/ios/credentials.js +1 -2
- package/build/build/ios/graphql.js +4 -6
- package/build/build/ios/prepareJob.js +5 -6
- package/build/build/ios/syncProjectConfiguration.js +1 -1
- package/build/build/ios/version.js +17 -20
- package/build/build/local.js +2 -3
- package/build/build/metadata.js +9 -10
- package/build/build/queries.js +6 -9
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +19 -13
- package/build/build/utils/appJson.js +1 -2
- package/build/build/utils/formatBuild.js +5 -8
- package/build/build/utils/printBuildInfo.js +1 -2
- package/build/build/utils/resourceClass.js +3 -4
- package/build/build/utils/url.js +1 -2
- package/build/build/validate.js +8 -11
- package/build/channel/actions/SelectChannel.js +2 -3
- package/build/channel/errors.js +1 -1
- package/build/channel/queries.js +6 -10
- package/build/channel/utils.js +1 -1
- package/build/commandUtils/EasCommand.js +7 -6
- package/build/commandUtils/builds.js +3 -3
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
- package/build/commandUtils/context/LoggedInContextField.js +1 -2
- package/build/commandUtils/context/MaybeLoggedInContextField.js +2 -3
- package/build/commandUtils/context/VcsClientContextField.js +1 -1
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +4 -6
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +2 -4
- package/build/commandUtils/gating/FeatureGateEnvOverrides.js +1 -2
- package/build/commandUtils/pagination.js +3 -4
- package/build/commands/account/view.js +1 -2
- package/build/commands/branch/delete.js +1 -2
- package/build/commands/build/configure.js +1 -2
- package/build/commands/build/index.js +1 -2
- package/build/commands/build/internal.js +1 -2
- package/build/commands/build/resign.js +7 -7
- package/build/commands/build/run.js +2 -3
- package/build/commands/build/version/get.js +3 -4
- package/build/commands/build/version/set.js +5 -6
- package/build/commands/build/version/sync.js +5 -7
- package/build/commands/channel/rollout.js +1 -2
- package/build/commands/config.js +16 -14
- package/build/commands/credentials/configure-build.js +3 -3
- package/build/commands/credentials/index.js +1 -1
- package/build/commands/device/create.js +1 -1
- package/build/commands/device/rename.js +1 -1
- package/build/commands/diagnostics.js +6 -2
- package/build/commands/project/init.js +11 -9
- package/build/commands/project/onboarding.js +192 -20
- package/build/commands/secret/delete.js +5 -5
- package/build/commands/update/index.js +5 -6
- package/build/commands/update/republish.js +1 -2
- package/build/commands/update/roll-back-to-embedded.js +3 -4
- package/build/credentials/android/AndroidCredentialsProvider.js +4 -5
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -3
- package/build/credentials/android/actions/DownloadKeystore.js +2 -3
- package/build/credentials/android/actions/RemoveFcm.js +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -5
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +3 -3
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.js +3 -3
- package/build/credentials/android/api/GraphqlClient.js +4 -8
- package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +1 -2
- package/build/credentials/android/utils/printCredentials.js +4 -4
- package/build/credentials/context.js +2 -3
- package/build/credentials/credentialsJson/update.js +14 -16
- package/build/credentials/errors.js +7 -5
- package/build/credentials/ios/IosCredentialsProvider.js +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -9
- package/build/credentials/ios/actions/AssignAscApiKey.js +2 -3
- package/build/credentials/ios/actions/AssignPushKey.js +2 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +3 -5
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -4
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -4
- package/build/credentials/ios/actions/SetUpAscApiKey.js +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -4
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +2 -3
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +2 -3
- package/build/credentials/ios/api/GraphqlClient.js +11 -15
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +2 -4
- package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +1 -2
- package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +2 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +1 -2
- package/build/credentials/ios/appstore/ascApiKey.js +6 -8
- package/build/credentials/ios/appstore/authenticate.js +2 -4
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
- package/build/credentials/ios/appstore/contractMessages.js +3 -5
- package/build/credentials/ios/appstore/distributionCertificate.js +2 -3
- package/build/credentials/ios/appstore/ensureAppExists.js +1 -2
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +5 -7
- package/build/credentials/ios/appstore/pushKey.js +2 -3
- package/build/credentials/ios/appstore/resolveCredentials.js +8 -9
- package/build/credentials/ios/errors.js +1 -1
- package/build/credentials/ios/utils/p12Certificate.js +1 -2
- package/build/credentials/ios/utils/provisioningProfile.js +1 -2
- package/build/credentials/ios/validators/validateProvisioningProfile.js +5 -7
- package/build/credentials/manager/ManageAndroid.js +2 -2
- package/build/credentials/manager/ManageIos.js +3 -4
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -2
- package/build/credentials/manager/SetDefaultAndroidKeystore.js +1 -1
- package/build/credentials/manager/SetUpAndroidBuildCredentials.js +2 -2
- package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
- package/build/credentials/utils/promptForCredentials.js +2 -3
- package/build/devices/actions/create/currentMachineMethod.js +4 -5
- package/build/devices/actions/create/developerPortalMethod.js +1 -2
- package/build/devices/actions/create/inputMethod.js +1 -1
- package/build/devices/context.js +1 -1
- package/build/devices/queries.js +3 -6
- package/build/devices/utils/errors.js +2 -2
- package/build/devices/utils/formatDevice.js +4 -6
- package/build/graphql/client.js +5 -8
- package/build/graphql/generated.d.ts +42 -0
- package/build/graphql/mutations/AppMutation.js +1 -2
- package/build/graphql/mutations/AppVersionMutation.js +1 -2
- package/build/graphql/mutations/BuildMutation.js +4 -8
- package/build/graphql/mutations/UserPreferencesMutation.js +2 -3
- package/build/graphql/queries/AppVersionQuery.js +1 -2
- package/build/graphql/queries/BranchQuery.js +1 -2
- package/build/graphql/queries/BuildQuery.js +1 -2
- package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -3
- package/build/graphql/queries/SubmissionQuery.js +1 -2
- package/build/graphql/queries/WebhookQuery.js +1 -2
- package/build/graphql/types/App.js +1 -0
- package/build/log.js +2 -2
- package/build/metadata/apple/config/reader.js +26 -32
- package/build/metadata/apple/config/writer.js +35 -39
- package/build/metadata/apple/rules/infoKeywordLength.js +2 -4
- package/build/metadata/apple/rules/infoRestrictedWords.js +2 -4
- package/build/metadata/apple/tasks/app-review-detail.js +1 -2
- package/build/metadata/apple/tasks/app-version.js +6 -8
- package/build/metadata/auth.js +1 -2
- package/build/metadata/config/resolve.js +2 -3
- package/build/metadata/config/validate.js +2 -4
- package/build/metadata/errors.js +3 -5
- package/build/metadata/upload.js +1 -2
- package/build/metadata/utils/retry.js +1 -2
- package/build/metadata/utils/telemetry.js +8 -11
- package/build/onboarding/runCommand.js +2 -2
- package/build/ora.js +1 -1
- package/build/project/android/applicationId.js +3 -4
- package/build/project/android/gradle.js +3 -4
- package/build/project/android/gradleUtils.js +4 -5
- package/build/project/expoConfig.js +3 -4
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
- package/build/project/ios/bundleIdentifier.js +7 -8
- package/build/project/ios/entitlements.js +1 -2
- package/build/project/ios/scheme.js +7 -6
- package/build/project/ios/target.js +17 -23
- package/build/project/metroConfig.js +1 -2
- package/build/project/projectUtils.js +5 -7
- package/build/project/publish.js +18 -27
- package/build/project/remoteVersionSource.js +6 -7
- package/build/project/resolveRuntimeVersionAsync.d.ts +2 -1
- package/build/project/resolveRuntimeVersionAsync.js +3 -4
- package/build/prompts.js +5 -7
- package/build/rollout/actions/CreateRollout.js +4 -5
- package/build/rollout/actions/EditRollout.js +1 -2
- package/build/rollout/actions/EndRollout.js +2 -4
- package/build/rollout/actions/ManageRollout.js +1 -2
- package/build/rollout/actions/NonInteractiveRollout.js +1 -2
- package/build/rollout/actions/SelectRuntime.js +2 -4
- package/build/rollout/utils.js +4 -5
- package/build/run/android/adb.js +4 -7
- package/build/run/ios/xcode.js +1 -2
- package/build/run/ios/xcrun.js +1 -2
- package/build/run/utils.js +2 -4
- package/build/submit/ArchiveSource.js +1 -1
- package/build/submit/android/AndroidSubmitCommand.js +3 -5
- package/build/submit/android/AndroidSubmitter.js +3 -3
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/ios/AppProduce.js +5 -4
- package/build/submit/ios/AppSpecificPasswordSource.js +2 -2
- package/build/submit/ios/AscApiKeySource.js +5 -3
- package/build/submit/ios/IosSubmitCommand.js +2 -3
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/submit/ios/utils/language.js +3 -4
- package/build/submit/submit.js +2 -3
- package/build/submit/utils/errors.js +1 -2
- package/build/submit/utils/wait.js +1 -1
- package/build/update/android/UpdatesModule.js +1 -2
- package/build/update/configure.js +11 -14
- package/build/update/ios/UpdatesModule.js +2 -4
- package/build/update/queries.js +6 -10
- package/build/update/utils.js +28 -39
- package/build/user/SessionManager.js +5 -8
- package/build/user/User.js +2 -2
- package/build/user/expoSsoLauncher.js +1 -2
- package/build/utils/code-signing.js +4 -7
- package/build/utils/expoCli.js +1 -2
- package/build/utils/expoUpdatesCli.d.ts +1 -0
- package/build/utils/expoUpdatesCli.js +3 -2
- package/build/utils/profiles.js +3 -3
- package/build/utils/progress.js +2 -2
- package/build/utils/relay.js +10 -14
- package/build/utils/timer.js +1 -2
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +24 -20
- package/build/vcs/git.d.ts +1 -1
- package/build/vcs/git.js +4 -2
- package/build/vcs/local.js +1 -2
- package/build/webhooks/input.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/build/metadata/errors.js
CHANGED
|
@@ -11,7 +11,7 @@ const log_1 = tslib_1.__importStar(require("../log"));
|
|
|
11
11
|
*/
|
|
12
12
|
class MetadataValidationError extends Error {
|
|
13
13
|
constructor(message, errors = []) {
|
|
14
|
-
super(message
|
|
14
|
+
super(message ?? 'Store configuration validation failed');
|
|
15
15
|
this.errors = errors;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -49,10 +49,9 @@ exports.MetadataDownloadError = MetadataDownloadError;
|
|
|
49
49
|
* This should help communicate any possible configuration error and help the user resolve it.
|
|
50
50
|
*/
|
|
51
51
|
function logMetadataValidationError(error) {
|
|
52
|
-
var _a;
|
|
53
52
|
log_1.default.newLine();
|
|
54
53
|
log_1.default.error(chalk_1.default.bold(error.message));
|
|
55
|
-
if (
|
|
54
|
+
if (error.errors?.length > 0) {
|
|
56
55
|
// TODO(cedric): group errors by property to make multiple errors for same property more readable
|
|
57
56
|
for (const err of error.errors) {
|
|
58
57
|
log_1.default.log(` - ${chalk_1.default.bold(`$.${err.path.join('.')}`)} ${err.message}`);
|
|
@@ -65,14 +64,13 @@ exports.logMetadataValidationError = logMetadataValidationError;
|
|
|
65
64
|
* If a normal error is thrown, this method will re-throw that error to avoid consuming it.
|
|
66
65
|
*/
|
|
67
66
|
function handleMetadataError(error) {
|
|
68
|
-
var _a;
|
|
69
67
|
if (error instanceof MetadataValidationError) {
|
|
70
68
|
return logMetadataValidationError(error);
|
|
71
69
|
}
|
|
72
70
|
if (error instanceof MetadataDownloadError || error instanceof MetadataUploadError) {
|
|
73
71
|
log_1.default.newLine();
|
|
74
72
|
log_1.default.error(chalk_1.default.bold(error.message));
|
|
75
|
-
if (
|
|
73
|
+
if (error.errors?.length > 0) {
|
|
76
74
|
log_1.default.newLine();
|
|
77
75
|
log_1.default.error(error.errors.map(err => err.message).join('\n\n'));
|
|
78
76
|
}
|
package/build/metadata/upload.js
CHANGED
|
@@ -15,7 +15,6 @@ const prompts_1 = require("../prompts");
|
|
|
15
15
|
* Note, only App Store is supported at this time.
|
|
16
16
|
*/
|
|
17
17
|
async function uploadMetadataAsync({ projectDir, profile, exp, analytics, credentialsCtx, }) {
|
|
18
|
-
var _a;
|
|
19
18
|
const storeConfig = await loadConfigWithValidationPromptAsync(projectDir, profile);
|
|
20
19
|
const { app, auth } = await (0, auth_1.getAppStoreAuthAsync)({
|
|
21
20
|
exp,
|
|
@@ -31,7 +30,7 @@ async function uploadMetadataAsync({ projectDir, profile, exp, analytics, creden
|
|
|
31
30
|
const tasks = (0, tasks_1.createAppleTasks)({
|
|
32
31
|
// We need to resolve a different version as soon as possible.
|
|
33
32
|
// This version is the parent model of all changes we are going to push.
|
|
34
|
-
version:
|
|
33
|
+
version: config.getVersion()?.versionString,
|
|
35
34
|
});
|
|
36
35
|
const taskCtx = { app };
|
|
37
36
|
for (const task of tasks) {
|
|
@@ -6,7 +6,6 @@ async function waitAsync(duration) {
|
|
|
6
6
|
}
|
|
7
7
|
exports.waitAsync = waitAsync;
|
|
8
8
|
async function retryIfNullAsync(method, options = {}) {
|
|
9
|
-
var _a;
|
|
10
9
|
let { tries = 5, delay = 1000 } = options;
|
|
11
10
|
while (tries > 0) {
|
|
12
11
|
const value = await method();
|
|
@@ -14,7 +13,7 @@ async function retryIfNullAsync(method, options = {}) {
|
|
|
14
13
|
return value;
|
|
15
14
|
}
|
|
16
15
|
tries--;
|
|
17
|
-
|
|
16
|
+
options.onRetry?.(tries);
|
|
18
17
|
await waitAsync(delay);
|
|
19
18
|
}
|
|
20
19
|
return null;
|
|
@@ -24,18 +24,17 @@ function subscribeTelemetry(analytics, event, options) {
|
|
|
24
24
|
});
|
|
25
25
|
return response;
|
|
26
26
|
}, (error) => {
|
|
27
|
-
var _a, _b, _c, _d, _e;
|
|
28
27
|
analytics.logEvent(event, {
|
|
29
28
|
executionId,
|
|
30
29
|
type: 'response',
|
|
31
30
|
phase: 'rejected',
|
|
32
31
|
method: error.request.method.toUpperCase(),
|
|
33
|
-
url: scrubber(
|
|
32
|
+
url: scrubber(error.config?.url),
|
|
34
33
|
error: scrubber(error.message),
|
|
35
|
-
status: String(
|
|
36
|
-
statusText: scrubber(
|
|
37
|
-
input: scrubber(
|
|
38
|
-
output: scrubber(
|
|
34
|
+
status: String(error.response?.status),
|
|
35
|
+
statusText: scrubber(error.response?.statusText),
|
|
36
|
+
input: scrubber(error.config?.data),
|
|
37
|
+
output: scrubber(error.response?.data),
|
|
39
38
|
});
|
|
40
39
|
throw error;
|
|
41
40
|
});
|
|
@@ -47,15 +46,14 @@ function subscribeTelemetry(analytics, event, options) {
|
|
|
47
46
|
exports.subscribeTelemetry = subscribeTelemetry;
|
|
48
47
|
/** Exposed for testing */
|
|
49
48
|
function makeDataScrubber({ app, auth }) {
|
|
50
|
-
var _a, _b;
|
|
51
49
|
const token = getAuthTokenString(auth);
|
|
52
50
|
const patterns = {
|
|
53
51
|
APPLE_APP_ID: new RegExp(app.id, 'gi'),
|
|
54
52
|
APPLE_USERNAME: auth.username ? new RegExp(auth.username, 'gi') : null,
|
|
55
53
|
APPLE_PASSWORD: auth.password ? new RegExp(auth.password, 'gi') : null,
|
|
56
54
|
APPLE_TOKEN: token ? new RegExp(token, 'gi') : null,
|
|
57
|
-
APPLE_TEAM_ID:
|
|
58
|
-
APPLE_PROVIDER_ID:
|
|
55
|
+
APPLE_TEAM_ID: auth.context?.teamId ? new RegExp(auth.context.teamId, 'gi') : null,
|
|
56
|
+
APPLE_PROVIDER_ID: auth.context?.providerId
|
|
59
57
|
? new RegExp(String(auth.context.providerId), 'gi')
|
|
60
58
|
: null,
|
|
61
59
|
};
|
|
@@ -75,8 +73,7 @@ function makeDataScrubber({ app, auth }) {
|
|
|
75
73
|
}
|
|
76
74
|
exports.makeDataScrubber = makeDataScrubber;
|
|
77
75
|
function getAuthTokenString(auth) {
|
|
78
|
-
|
|
79
|
-
if (!((_a = auth.context) === null || _a === void 0 ? void 0 : _a.token)) {
|
|
76
|
+
if (!auth.context?.token) {
|
|
80
77
|
return null;
|
|
81
78
|
}
|
|
82
79
|
if (typeof auth.context.token === 'object') {
|
|
@@ -44,7 +44,7 @@ async function runCommandAsync({ cwd, args, command, shouldShowStderrLine, shoul
|
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
46
|
if (showSpinner) {
|
|
47
|
-
spinner
|
|
47
|
+
spinner?.fail(`${chalk_1.default.bold(`${command} ${args.join(' ')}`)} failed`);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
50
|
log_1.default.error(`❌ ${chalk_1.default.bold(`${command} ${args.join(' ')}`)} failed`);
|
|
@@ -52,7 +52,7 @@ async function runCommandAsync({ cwd, args, command, shouldShowStderrLine, shoul
|
|
|
52
52
|
throw error;
|
|
53
53
|
}
|
|
54
54
|
if (showSpinner) {
|
|
55
|
-
spinner
|
|
55
|
+
spinner?.succeed(`${chalk_1.default.bold(`${command} ${args.join(' ')}`)} succeeded`);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
log_1.default.log(`✅ ${chalk_1.default.bold(`${command} ${args.join(' ')}`)} succeeded`);
|
package/build/ora.js
CHANGED
|
@@ -22,7 +22,7 @@ const isCi = (0, getenv_1.boolish)('CI', false);
|
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
24
|
function ora(options) {
|
|
25
|
-
const inputOptions = typeof options === 'string' ? { text: options } : options
|
|
25
|
+
const inputOptions = typeof options === 'string' ? { text: options } : options ?? {};
|
|
26
26
|
const disabled = log_1.default.isDebug || !process.stdin.isTTY || isCi;
|
|
27
27
|
const spinner = (0, ora_1.default)({
|
|
28
28
|
// Ensure our non-interactive mode emulates CI mode.
|
|
@@ -38,7 +38,7 @@ async function ensureApplicationIdIsDefinedForManagedProjectAsync({ graphqlClien
|
|
|
38
38
|
exports.ensureApplicationIdIsDefinedForManagedProjectAsync = ensureApplicationIdIsDefinedForManagedProjectAsync;
|
|
39
39
|
class AmbiguousApplicationIdError extends Error {
|
|
40
40
|
constructor(message) {
|
|
41
|
-
super(message
|
|
41
|
+
super(message ?? 'Could not resolve applicationId.');
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.AmbiguousApplicationIdError = AmbiguousApplicationIdError;
|
|
@@ -67,7 +67,7 @@ async function getApplicationIdFromBareAsync(projectDir, gradleContext) {
|
|
|
67
67
|
if (buildGradle.match(/productFlavors/)) {
|
|
68
68
|
throw new AmbiguousApplicationIdError('Failed to autodetect applicationId in multi-flavor project.');
|
|
69
69
|
}
|
|
70
|
-
return (0, nullthrows_1.default)(matchResult
|
|
70
|
+
return (0, nullthrows_1.default)(matchResult?.[1], errorMessage);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
exports.getApplicationIdFromBareAsync = getApplicationIdFromBareAsync;
|
|
@@ -92,7 +92,6 @@ async function getApplicationIdAsync(projectDir, exp, vcsClient, gradleContext)
|
|
|
92
92
|
}
|
|
93
93
|
exports.getApplicationIdAsync = getApplicationIdAsync;
|
|
94
94
|
async function configureApplicationIdAsync({ graphqlClient, projectDir, projectId, exp, nonInteractive, }) {
|
|
95
|
-
var _a;
|
|
96
95
|
if (nonInteractive) {
|
|
97
96
|
throw new Error(`The "android.package" is required to be set in app config when running in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/#package')}`);
|
|
98
97
|
}
|
|
@@ -115,7 +114,7 @@ async function configureApplicationIdAsync({ graphqlClient, projectDir, projectI
|
|
|
115
114
|
const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
|
|
116
115
|
rawStaticConfig.expo = {
|
|
117
116
|
...rawStaticConfig.expo,
|
|
118
|
-
android: { ...
|
|
117
|
+
android: { ...rawStaticConfig.expo?.android, package: packageName },
|
|
119
118
|
};
|
|
120
119
|
await fs_extra_1.default.writeJson(paths.staticConfigPath, rawStaticConfig, { spaces: 2 });
|
|
121
120
|
exp.android = { ...exp.android, package: packageName };
|
|
@@ -7,7 +7,6 @@ const gradleUtils = tslib_1.__importStar(require("./gradleUtils"));
|
|
|
7
7
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
8
|
const workflow_1 = require("../../project/workflow");
|
|
9
9
|
async function resolveGradleBuildContextAsync(projectDir, buildProfile, vcsClient) {
|
|
10
|
-
var _a;
|
|
11
10
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
|
|
12
11
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
13
12
|
try {
|
|
@@ -16,13 +15,13 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile, vcsClien
|
|
|
16
15
|
const parsedGradleCommand = buildProfile.gradleCommand
|
|
17
16
|
? gradleUtils.parseGradleCommand(buildProfile.gradleCommand, buildGradle)
|
|
18
17
|
: undefined;
|
|
19
|
-
if (
|
|
18
|
+
if (parsedGradleCommand?.moduleName &&
|
|
20
19
|
parsedGradleCommand.moduleName !== gradleUtils.DEFAULT_MODULE_NAME) {
|
|
21
20
|
log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior.`);
|
|
22
21
|
}
|
|
23
22
|
return {
|
|
24
|
-
moduleName:
|
|
25
|
-
flavor: parsedGradleCommand
|
|
23
|
+
moduleName: parsedGradleCommand?.moduleName ?? gradleUtils.DEFAULT_MODULE_NAME,
|
|
24
|
+
flavor: parsedGradleCommand?.flavor,
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
else {
|
|
@@ -13,8 +13,8 @@ async function getAppBuildGradleAsync(projectDir) {
|
|
|
13
13
|
}
|
|
14
14
|
exports.getAppBuildGradleAsync = getAppBuildGradleAsync;
|
|
15
15
|
function resolveConfigValue(buildGradle, field, flavor) {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return ((flavor && buildGradle?.android?.productFlavors?.[flavor]?.[field]) ??
|
|
17
|
+
buildGradle?.android?.defaultConfig?.[field]);
|
|
18
18
|
}
|
|
19
19
|
exports.resolveConfigValue = resolveConfigValue;
|
|
20
20
|
/**
|
|
@@ -30,12 +30,11 @@ exports.resolveConfigValue = resolveConfigValue;
|
|
|
30
30
|
* the flavor name
|
|
31
31
|
**/
|
|
32
32
|
function parseGradleCommand(cmd, buildGradle) {
|
|
33
|
-
|
|
34
|
-
const hasFlavorDimensions = ((_b = (_a = buildGradle.android) === null || _a === void 0 ? void 0 : _a.flavorDimensions) !== null && _b !== void 0 ? _b : '').split(',').length > 1;
|
|
33
|
+
const hasFlavorDimensions = (buildGradle.android?.flavorDimensions ?? '').split(',').length > 1;
|
|
35
34
|
if (hasFlavorDimensions) {
|
|
36
35
|
throw new Error('flavorDimensions in build.gradle are not supported yet');
|
|
37
36
|
}
|
|
38
|
-
const flavors = new Set(Object.keys(
|
|
37
|
+
const flavors = new Set(Object.keys(buildGradle?.android?.productFlavors ?? {}));
|
|
39
38
|
// remove any params specified after command name
|
|
40
39
|
const [withoutParams] = cmd.split(' ');
|
|
41
40
|
// remove leading :
|
|
@@ -61,7 +61,7 @@ function getPrivateExpoConfig(projectDir, opts = {}) {
|
|
|
61
61
|
exports.getPrivateExpoConfig = getPrivateExpoConfig;
|
|
62
62
|
function ensureExpoConfigExists(projectDir) {
|
|
63
63
|
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
64
|
-
if (!
|
|
64
|
+
if (!paths?.staticConfigPath && !paths?.dynamicConfigPath) {
|
|
65
65
|
// eslint-disable-next-line node/no-sync
|
|
66
66
|
fs_extra_1.default.writeFileSync(path_1.default.join(projectDir, 'app.json'), JSON.stringify({ expo: {} }, null, 2));
|
|
67
67
|
}
|
|
@@ -73,16 +73,15 @@ async function ensureStaticExpoConfigIsValidAsync(projectDir) {
|
|
|
73
73
|
const staticConfig = await json_file_1.default.readAsync(staticConfigPath);
|
|
74
74
|
// Add the "expo" key if it doesn't exist on app.json yet, such as in
|
|
75
75
|
// projects initialized with RNC CLI
|
|
76
|
-
if (!
|
|
76
|
+
if (!staticConfig?.expo) {
|
|
77
77
|
staticConfig.expo = {};
|
|
78
78
|
await json_file_1.default.writeAsync(staticConfigPath, staticConfig);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
function isUsingStaticExpoConfig(projectDir) {
|
|
83
|
-
var _a;
|
|
84
83
|
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
85
|
-
return !!(
|
|
84
|
+
return !!(paths.staticConfigPath?.endsWith('app.json') && !paths.dynamicConfigPath);
|
|
86
85
|
}
|
|
87
86
|
exports.isUsingStaticExpoConfig = isUsingStaticExpoConfig;
|
|
88
87
|
function getPublicExpoConfig(projectDir, opts = {}) {
|
|
@@ -17,7 +17,6 @@ const prompts_1 = require("../prompts");
|
|
|
17
17
|
* If yes, register and return that. If not, throw.
|
|
18
18
|
*/
|
|
19
19
|
async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graphqlClient, projectInfo, options, actor) {
|
|
20
|
-
var _a;
|
|
21
20
|
const { accountName, projectName } = projectInfo;
|
|
22
21
|
const projectFullName = `@${accountName}/${projectName}`;
|
|
23
22
|
if (options.nonInteractive) {
|
|
@@ -25,7 +24,7 @@ async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graph
|
|
|
25
24
|
}
|
|
26
25
|
const allAccounts = actor.accounts;
|
|
27
26
|
const accountNamesWhereUserHasSufficientPublishPermissions = new Set(allAccounts
|
|
28
|
-
.filter(a =>
|
|
27
|
+
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
29
28
|
.map(it => it.name));
|
|
30
29
|
const account = allAccounts.find(a => a.name === accountName);
|
|
31
30
|
if (!account) {
|
|
@@ -57,7 +56,7 @@ async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graph
|
|
|
57
56
|
const id = await AppMutation_1.AppMutation.createAppAsync(graphqlClient, {
|
|
58
57
|
accountId: account.id,
|
|
59
58
|
projectName,
|
|
60
|
-
privacy:
|
|
59
|
+
privacy: projectInfo.privacy ?? generated_1.AppPrivacy.Public,
|
|
61
60
|
});
|
|
62
61
|
spinner.succeed(`Created ${chalk_1.default.bold(projectLink)} on Expo`);
|
|
63
62
|
return id;
|
|
@@ -75,13 +74,12 @@ exports.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync = fetchOrCre
|
|
|
75
74
|
* @returns A promise resolving to Project ID, null if it doesn't exist
|
|
76
75
|
*/
|
|
77
76
|
async function findProjectIdByAccountNameAndSlugNullableAsync(graphqlClient, accountName, slug) {
|
|
78
|
-
var _a;
|
|
79
77
|
try {
|
|
80
78
|
const { id } = await AppQuery_1.AppQuery.byFullNameAsync(graphqlClient, `@${accountName}/${slug}`);
|
|
81
79
|
return id;
|
|
82
80
|
}
|
|
83
81
|
catch (err) {
|
|
84
|
-
if (
|
|
82
|
+
if (err.graphQLErrors?.some((it) => it.extensions?.errorCode !== 'EXPERIENCE_NOT_FOUND')) {
|
|
85
83
|
throw err;
|
|
86
84
|
}
|
|
87
85
|
return null;
|
|
@@ -33,7 +33,7 @@ async function ensureBundleIdentifierIsDefinedForManagedProjectAsync({ graphqlCl
|
|
|
33
33
|
exports.ensureBundleIdentifierIsDefinedForManagedProjectAsync = ensureBundleIdentifierIsDefinedForManagedProjectAsync;
|
|
34
34
|
class AmbiguousBundleIdentifierError extends Error {
|
|
35
35
|
constructor(message) {
|
|
36
|
-
super(message
|
|
36
|
+
super(message ?? 'Could not resolve bundle identifier.');
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.AmbiguousBundleIdentifierError = AmbiguousBundleIdentifierError;
|
|
@@ -47,8 +47,8 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
|
|
|
47
47
|
if (!xcodeContext && isMultiScheme && isMultiTarget) {
|
|
48
48
|
throw new AmbiguousBundleIdentifierError("Multiple schemes and targets found in Xcode project, bundle identifier couldn't be resolved.");
|
|
49
49
|
}
|
|
50
|
-
const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifierFromPbxproj(projectDir, xcodeContext
|
|
51
|
-
const buildConfigurationDesc =
|
|
50
|
+
const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifierFromPbxproj(projectDir, xcodeContext ?? {});
|
|
51
|
+
const buildConfigurationDesc = xcodeContext?.targetName && xcodeContext?.buildConfiguration
|
|
52
52
|
? ` (target = ${xcodeContext.targetName}, build configuration = ${xcodeContext.buildConfiguration})`
|
|
53
53
|
: '';
|
|
54
54
|
(0, assert_1.default)(bundleIdentifier, `Could not read bundle identifier from Xcode project${buildConfigurationDesc}.`);
|
|
@@ -59,9 +59,9 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
|
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
// TODO: the following asserts are only temporary until we support app extensions in managed projects
|
|
62
|
-
(0, assert_1.default)(!
|
|
63
|
-
|
|
64
|
-
(0, assert_1.default)(!
|
|
62
|
+
(0, assert_1.default)(!xcodeContext?.targetName ||
|
|
63
|
+
xcodeContext?.targetName === config_plugins_1.IOSConfig.XcodeUtils.sanitizedName(exp.name), 'targetName cannot be set to an arbitrary value for managed projects.');
|
|
64
|
+
(0, assert_1.default)(!xcodeContext?.buildConfiguration, 'buildConfiguration cannot be passed for managed projects.');
|
|
65
65
|
const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifier(exp);
|
|
66
66
|
if (!bundleIdentifier || !isBundleIdentifierValid(bundleIdentifier)) {
|
|
67
67
|
if (bundleIdentifier) {
|
|
@@ -76,7 +76,6 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
|
|
|
76
76
|
}
|
|
77
77
|
exports.getBundleIdentifierAsync = getBundleIdentifierAsync;
|
|
78
78
|
async function configureBundleIdentifierAsync({ graphqlClient, projectDir, projectId, exp, nonInteractive, }) {
|
|
79
|
-
var _a;
|
|
80
79
|
if (nonInteractive) {
|
|
81
80
|
throw new Error(`The "ios.bundleIdentifier" is required to be set in app config when running in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/#bundleidentifier')}`);
|
|
82
81
|
}
|
|
@@ -99,7 +98,7 @@ async function configureBundleIdentifierAsync({ graphqlClient, projectDir, proje
|
|
|
99
98
|
const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
|
|
100
99
|
rawStaticConfig.expo = {
|
|
101
100
|
...rawStaticConfig.expo,
|
|
102
|
-
ios: { ...
|
|
101
|
+
ios: { ...rawStaticConfig.expo?.ios, bundleIdentifier },
|
|
103
102
|
};
|
|
104
103
|
await fs_extra_1.default.writeJson(paths.staticConfigPath, rawStaticConfig, { spaces: 2 });
|
|
105
104
|
exp.ios = { ...exp.ios, bundleIdentifier };
|
|
@@ -6,7 +6,6 @@ const prebuild_config_1 = require("@expo/prebuild-config");
|
|
|
6
6
|
const plist_1 = require("../../utils/plist");
|
|
7
7
|
const workflow_1 = require("../workflow");
|
|
8
8
|
async function getManagedApplicationTargetEntitlementsAsync(projectDir, env, vcsClient) {
|
|
9
|
-
var _a;
|
|
10
9
|
const originalProcessEnv = process.env;
|
|
11
10
|
try {
|
|
12
11
|
process.env = {
|
|
@@ -20,7 +19,7 @@ async function getManagedApplicationTargetEntitlementsAsync(projectDir, env, vcs
|
|
|
20
19
|
introspect: true,
|
|
21
20
|
ignoreExistingNativeFiles: await (0, workflow_1.hasIgnoredIosProjectAsync)(projectDir, vcsClient),
|
|
22
21
|
});
|
|
23
|
-
return
|
|
22
|
+
return expWithMods.ios?.entitlements || {};
|
|
24
23
|
}
|
|
25
24
|
finally {
|
|
26
25
|
process.env = originalProcessEnv;
|
|
@@ -10,16 +10,17 @@ const prompts_1 = require("../../prompts");
|
|
|
10
10
|
const sortBy_1 = tslib_1.__importDefault(require("../../utils/expodash/sortBy"));
|
|
11
11
|
const workflow_1 = require("../workflow");
|
|
12
12
|
async function resolveXcodeBuildContextAsync({ exp, projectDir, nonInteractive, vcsClient, }, buildProfile) {
|
|
13
|
-
var _a, _b;
|
|
14
13
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
|
|
15
14
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
16
|
-
const buildScheme =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const buildScheme = buildProfile.scheme ??
|
|
16
|
+
(await selectSchemeAsync({
|
|
17
|
+
projectDir,
|
|
18
|
+
nonInteractive,
|
|
19
|
+
}));
|
|
20
20
|
return {
|
|
21
21
|
buildScheme,
|
|
22
|
-
buildConfiguration:
|
|
22
|
+
buildConfiguration: buildProfile.buildConfiguration ??
|
|
23
|
+
(await config_plugins_1.IOSConfig.BuildScheme.getArchiveBuildConfigurationForSchemeAsync(projectDir, buildScheme)),
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
@@ -16,15 +16,14 @@ const AppExtensionsConfigSchema = joi_1.default.array().items(joi_1.default.obje
|
|
|
16
16
|
entitlements: joi_1.default.object(),
|
|
17
17
|
}));
|
|
18
18
|
async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildContext, env, vcsClient, }) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f;
|
|
20
19
|
const { buildScheme, buildConfiguration } = xcodeBuildContext;
|
|
21
20
|
const applicationTargetName = buildScheme;
|
|
22
21
|
const applicationTargetBundleIdentifier = await (0, bundleIdentifier_1.getBundleIdentifierAsync)(projectDir, exp, vcsClient, {
|
|
23
22
|
targetName: applicationTargetName,
|
|
24
23
|
buildConfiguration,
|
|
25
24
|
});
|
|
26
|
-
const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env
|
|
27
|
-
const appExtensions =
|
|
25
|
+
const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env ?? {}, vcsClient);
|
|
26
|
+
const appExtensions = exp.extra?.eas?.build?.experimental?.ios?.appExtensions ?? [];
|
|
28
27
|
const { error } = AppExtensionsConfigSchema.validate(appExtensions, {
|
|
29
28
|
allowUnknown: false,
|
|
30
29
|
abortEarly: false,
|
|
@@ -32,16 +31,13 @@ async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildCo
|
|
|
32
31
|
if (error) {
|
|
33
32
|
throw new Error(`Failed to validate "extra.eas.build.experimental.ios.appExtensions" in you app config.\n${error.message}`);
|
|
34
33
|
}
|
|
35
|
-
const extensionsTargets = appExtensions.map(extension => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
entitlements: (_b = extension.entitlements) !== null && _b !== void 0 ? _b : {},
|
|
43
|
-
});
|
|
44
|
-
});
|
|
34
|
+
const extensionsTargets = appExtensions.map(extension => ({
|
|
35
|
+
targetName: extension.targetName,
|
|
36
|
+
buildConfiguration,
|
|
37
|
+
bundleIdentifier: extension.bundleIdentifier,
|
|
38
|
+
parentBundleIdentifier: extension.parentBundleIdentifier ?? applicationTargetBundleIdentifier,
|
|
39
|
+
entitlements: extension.entitlements ?? {},
|
|
40
|
+
}));
|
|
45
41
|
return [
|
|
46
42
|
{
|
|
47
43
|
targetName: applicationTargetName,
|
|
@@ -70,7 +66,7 @@ async function resolveBareProjectTargetsAsync({ exp, projectDir, xcodeBuildConte
|
|
|
70
66
|
targetName: applicationTarget.name,
|
|
71
67
|
bundleIdentifier,
|
|
72
68
|
buildConfiguration,
|
|
73
|
-
entitlements: entitlements
|
|
69
|
+
entitlements: entitlements ?? {},
|
|
74
70
|
buildSettings: resolveBareProjectBuildSettings(pbxProject, applicationTarget.name, buildConfiguration),
|
|
75
71
|
});
|
|
76
72
|
const dependencies = await resolveBareProjectDependenciesAsync({
|
|
@@ -121,7 +117,7 @@ async function resolveBareProjectDependenciesAsync({ exp, projectDir, buildConfi
|
|
|
121
117
|
buildConfiguration,
|
|
122
118
|
bundleIdentifier: dependencyBundleIdentifier,
|
|
123
119
|
parentBundleIdentifier: bundleIdentifier,
|
|
124
|
-
entitlements: entitlements
|
|
120
|
+
entitlements: entitlements ?? {},
|
|
125
121
|
buildSettings: resolveBareProjectBuildSettings(pbxProject, dependency.name, buildConfiguration),
|
|
126
122
|
});
|
|
127
123
|
const dependencyDependencies = await resolveBareProjectDependenciesAsync({
|
|
@@ -157,20 +153,20 @@ function findTargetByName(targets, name) {
|
|
|
157
153
|
}
|
|
158
154
|
exports.findTargetByName = findTargetByName;
|
|
159
155
|
function resolveBareProjectBuildSettings(project, targetName, buildConfiguration) {
|
|
160
|
-
var _a;
|
|
161
156
|
const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
|
|
162
157
|
targetName,
|
|
163
158
|
buildConfiguration,
|
|
164
159
|
});
|
|
165
|
-
return
|
|
160
|
+
return xcBuildConfiguration?.buildSettings ?? {};
|
|
166
161
|
}
|
|
167
162
|
/**
|
|
168
163
|
* Get Apple Platform from the Xcode Target where possible.
|
|
169
164
|
* @returns - Apple Platform when known, defaults to IOS when unknown
|
|
170
165
|
*/
|
|
171
166
|
function getApplePlatformFromTarget(target) {
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
return (getApplePlatformFromSdkRoot(target) ??
|
|
168
|
+
getApplePlatformFromDeviceFamily(target) ??
|
|
169
|
+
constants_1.ApplePlatform.IOS);
|
|
174
170
|
}
|
|
175
171
|
exports.getApplePlatformFromTarget = getApplePlatformFromTarget;
|
|
176
172
|
/**
|
|
@@ -178,8 +174,7 @@ exports.getApplePlatformFromTarget = getApplePlatformFromTarget;
|
|
|
178
174
|
* @returns - Apple Platform when known, defaults to null when unknown
|
|
179
175
|
*/
|
|
180
176
|
function getApplePlatformFromSdkRoot(target) {
|
|
181
|
-
|
|
182
|
-
const sdkRoot = (_a = target.buildSettings) === null || _a === void 0 ? void 0 : _a.SDKROOT;
|
|
177
|
+
const sdkRoot = target.buildSettings?.SDKROOT;
|
|
183
178
|
if (!sdkRoot) {
|
|
184
179
|
return null;
|
|
185
180
|
}
|
|
@@ -207,8 +202,7 @@ exports.getApplePlatformFromSdkRoot = getApplePlatformFromSdkRoot;
|
|
|
207
202
|
* @returns - Apple Platform when known, defaults to null when unknown
|
|
208
203
|
*/
|
|
209
204
|
function getApplePlatformFromDeviceFamily(target) {
|
|
210
|
-
|
|
211
|
-
const deviceFamily = (_a = target.buildSettings) === null || _a === void 0 ? void 0 : _a.TARGETED_DEVICE_FAMILY;
|
|
205
|
+
const deviceFamily = target.buildSettings?.TARGETED_DEVICE_FAMILY;
|
|
212
206
|
if (!deviceFamily) {
|
|
213
207
|
return null;
|
|
214
208
|
}
|
|
@@ -8,12 +8,11 @@ const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
|
|
|
8
8
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
9
9
|
const prompts_1 = require("../prompts");
|
|
10
10
|
async function validateMetroConfigForManagedWorkflowAsync(ctx) {
|
|
11
|
-
var _a, _b;
|
|
12
11
|
if (!(await configExistsAsync(ctx.projectDir))) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
14
|
const metroConfig = await loadConfigAsync(ctx.projectDir);
|
|
16
|
-
const hasHashAssetFilesPlugin =
|
|
15
|
+
const hasHashAssetFilesPlugin = metroConfig.transformer?.assetPlugins?.find((plugin) => plugin.match(/expo-asset[/|\\]tools[/|\\]hashAssetFiles/));
|
|
17
16
|
if (!hasHashAssetFilesPlugin) {
|
|
18
17
|
log_1.default.warn(`It looks like that you are using a custom ${chalk_1.default.bold('metro.config.js')} that does not extend ${chalk_1.default.bold('@expo/metro-config')}.`);
|
|
19
18
|
log_1.default.warn('This can result in unexpected and hard to debug issues, like missing assets in the production bundle.');
|
|
@@ -87,8 +87,7 @@ function isExpoUpdatesInstalledOrAvailable(projectDir, sdkVersion) {
|
|
|
87
87
|
}
|
|
88
88
|
exports.isExpoUpdatesInstalledOrAvailable = isExpoUpdatesInstalledOrAvailable;
|
|
89
89
|
function isUsingEASUpdate(exp, projectId) {
|
|
90
|
-
|
|
91
|
-
return ((_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url) === (0, api_1.getEASUpdateURL)(projectId);
|
|
90
|
+
return exp.updates?.url === (0, api_1.getEASUpdateURL)(projectId);
|
|
92
91
|
}
|
|
93
92
|
exports.isUsingEASUpdate = isUsingEASUpdate;
|
|
94
93
|
async function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir) {
|
|
@@ -97,11 +96,10 @@ async function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir) {
|
|
|
97
96
|
return null;
|
|
98
97
|
}
|
|
99
98
|
const { version } = await fs_extra_1.default.readJson(maybePackageJson);
|
|
100
|
-
return version
|
|
99
|
+
return version ?? null;
|
|
101
100
|
}
|
|
102
101
|
async function validateAppVersionRuntimePolicySupportAsync(projectDir, exp) {
|
|
103
|
-
|
|
104
|
-
if (typeof exp.runtimeVersion !== 'object' || ((_a = exp.runtimeVersion) === null || _a === void 0 ? void 0 : _a.policy) !== 'appVersion') {
|
|
102
|
+
if (typeof exp.runtimeVersion !== 'object' || exp.runtimeVersion?.policy !== 'appVersion') {
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
107
105
|
const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(projectDir);
|
|
@@ -138,10 +136,10 @@ exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync = isModern
|
|
|
138
136
|
async function installExpoUpdatesAsync(projectDir, options) {
|
|
139
137
|
log_1.default.log(chalk_1.default.gray `> npx expo install expo-updates`);
|
|
140
138
|
try {
|
|
141
|
-
await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-updates'], { silent: options
|
|
139
|
+
await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-updates'], { silent: options?.silent });
|
|
142
140
|
}
|
|
143
141
|
catch (error) {
|
|
144
|
-
if (options
|
|
142
|
+
if (options?.silent) {
|
|
145
143
|
log_1.default.error('stdout' in error ? error.stdout : error.message);
|
|
146
144
|
}
|
|
147
145
|
throw error;
|