eas-cli 9.0.3 → 9.0.5
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
|
@@ -106,9 +106,8 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
static async setExplicitIDAsync(projectId, projectDir, { force, nonInteractive }) {
|
|
109
|
-
var _c, _d;
|
|
110
109
|
const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
|
|
111
|
-
const existingProjectId =
|
|
110
|
+
const existingProjectId = exp.extra?.eas?.projectId;
|
|
112
111
|
if (projectId === existingProjectId) {
|
|
113
112
|
log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)})`);
|
|
114
113
|
return;
|
|
@@ -141,16 +140,15 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
142
|
static async initializeWithInteractiveSelectionAsync(graphqlClient, actor, projectDir) {
|
|
144
|
-
var _c, _d, _e;
|
|
145
143
|
const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
|
|
146
|
-
const existingProjectId =
|
|
144
|
+
const existingProjectId = exp.extra?.eas?.projectId;
|
|
147
145
|
if (existingProjectId) {
|
|
148
146
|
log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)}). To re-configure, remove the "extra.eas.projectId" field from your app config.`);
|
|
149
147
|
return existingProjectId;
|
|
150
148
|
}
|
|
151
149
|
const allAccounts = actor.accounts;
|
|
152
150
|
const accountNamesWhereUserHasSufficientPermissionsToCreateApp = new Set(allAccounts
|
|
153
|
-
.filter(a =>
|
|
151
|
+
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
154
152
|
.map(it => it.name));
|
|
155
153
|
// if no owner field, ask the user which account they want to use to create/link the project
|
|
156
154
|
let accountName = exp.owner;
|
|
@@ -202,7 +200,7 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
202
200
|
createdProjectId = await AppMutation_1.AppMutation.createAppAsync(graphqlClient, {
|
|
203
201
|
accountId: account.id,
|
|
204
202
|
projectName,
|
|
205
|
-
privacy: (
|
|
203
|
+
privacy: (0, projectUtils_1.toAppPrivacy)(exp.privacy) ?? generated_1.AppPrivacy.Public,
|
|
206
204
|
});
|
|
207
205
|
spinner.succeed(`Created ${chalk_1.default.bold(projectLink)}`);
|
|
208
206
|
}
|
|
@@ -219,7 +217,7 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
219
217
|
? allAccounts
|
|
220
218
|
: [...allAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.name === actor.username ? -1 : 1) : 0);
|
|
221
219
|
if (actor.__typename !== 'Robot') {
|
|
222
|
-
const personalAccount = allAccounts
|
|
220
|
+
const personalAccount = allAccounts?.find(account => account?.ownerUserActor?.id === actor.id);
|
|
223
221
|
const personalAccountChoice = personalAccount
|
|
224
222
|
? {
|
|
225
223
|
title: personalAccount.name,
|
|
@@ -229,14 +227,18 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
229
227
|
: '(Personal)',
|
|
230
228
|
}
|
|
231
229
|
: undefined;
|
|
232
|
-
const userAccounts = allAccounts
|
|
230
|
+
const userAccounts = allAccounts
|
|
231
|
+
?.filter(account => account.ownerUserActor && account.name !== actor.username)
|
|
232
|
+
.map(account => ({
|
|
233
233
|
title: account.name,
|
|
234
234
|
value: account,
|
|
235
235
|
description: !namesWithSufficientPermissions.has(account.name)
|
|
236
236
|
? '(Team) (Viewer Role)'
|
|
237
237
|
: '(Team)',
|
|
238
238
|
}));
|
|
239
|
-
const organizationAccounts = allAccounts
|
|
239
|
+
const organizationAccounts = allAccounts
|
|
240
|
+
?.filter(account => account.name !== actor.username && !account.ownerUserActor)
|
|
241
|
+
.map(account => ({
|
|
240
242
|
title: account.name,
|
|
241
243
|
value: account,
|
|
242
244
|
description: !namesWithSufficientPermissions.has(account.name)
|
|
@@ -3,8 +3,11 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
9
|
const api_1 = require("../../api");
|
|
10
|
+
const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
|
|
8
11
|
const repository_1 = require("../../build/utils/repository");
|
|
9
12
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
13
|
const getProjectIdAsync_1 = require("../../commandUtils/context/contextUtils/getProjectIdAsync");
|
|
@@ -15,8 +18,11 @@ const AppQuery_1 = require("../../graphql/queries/AppQuery");
|
|
|
15
18
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
16
19
|
const git_1 = require("../../onboarding/git");
|
|
17
20
|
const installDependencies_1 = require("../../onboarding/installDependencies");
|
|
21
|
+
const runCommand_1 = require("../../onboarding/runCommand");
|
|
22
|
+
const platform_1 = require("../../platform");
|
|
18
23
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
19
24
|
const prompts_1 = require("../../prompts");
|
|
25
|
+
const easCli_1 = require("../../utils/easCli");
|
|
20
26
|
const git_2 = tslib_1.__importDefault(require("../../vcs/clients/git"));
|
|
21
27
|
class Onboarding extends EasCommand_1.default {
|
|
22
28
|
async runAsync() {
|
|
@@ -52,7 +58,7 @@ class Onboarding extends EasCommand_1.default {
|
|
|
52
58
|
: 'expo';
|
|
53
59
|
const githubRepositoryName = app.githubRepository
|
|
54
60
|
? app.githubRepository.metadata.githubRepoName
|
|
55
|
-
: 'expo-default
|
|
61
|
+
: 'expo-template-default';
|
|
56
62
|
log_1.default.log(`👋 Welcome to Expo, ${actor.username}!`);
|
|
57
63
|
log_1.default.log();
|
|
58
64
|
log_1.default.log('✨ We will continue your onboarding process in EAS CLI');
|
|
@@ -70,8 +76,12 @@ class Onboarding extends EasCommand_1.default {
|
|
|
70
76
|
const { selectedTargetProjectDirectory } = await (0, prompts_1.promptAsync)({
|
|
71
77
|
type: 'text',
|
|
72
78
|
name: 'selectedTargetProjectDirectory',
|
|
73
|
-
message:
|
|
74
|
-
|
|
79
|
+
message: app.githubRepository
|
|
80
|
+
? '📂 Where would you like to clone the project to?'
|
|
81
|
+
: '📂 Where would you like to create your new project directory?',
|
|
82
|
+
initial: app.githubRepository
|
|
83
|
+
? path_1.default.join(process.cwd(), githubRepositoryName)
|
|
84
|
+
: path_1.default.join(process.cwd(), `${actor.username}-first-project`),
|
|
75
85
|
});
|
|
76
86
|
initialTargetProjectDirectory = selectedTargetProjectDirectory;
|
|
77
87
|
}
|
|
@@ -82,25 +92,65 @@ class Onboarding extends EasCommand_1.default {
|
|
|
82
92
|
targetProjectDir: initialTargetProjectDirectory,
|
|
83
93
|
});
|
|
84
94
|
const vcsClient = new git_2.default(finalTargetProjectDirectory);
|
|
95
|
+
if (!app.githubRepository) {
|
|
96
|
+
await fs_extra_1.default.remove(path_1.default.join(finalTargetProjectDirectory, '.git'));
|
|
97
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
98
|
+
cwd: finalTargetProjectDirectory,
|
|
99
|
+
command: 'git',
|
|
100
|
+
args: ['init'],
|
|
101
|
+
});
|
|
102
|
+
log_1.default.log();
|
|
103
|
+
await configureProjectFromBareDefaultExpoTemplateAsync({
|
|
104
|
+
app,
|
|
105
|
+
vcsClient,
|
|
106
|
+
targetDir: finalTargetProjectDirectory,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
85
109
|
await (0, installDependencies_1.installDependenciesAsync)({
|
|
86
110
|
projectDir: finalTargetProjectDirectory,
|
|
87
111
|
});
|
|
112
|
+
const exp = await getPrivateExpoConfigWithProjectIdAsync({
|
|
113
|
+
projectDir: finalTargetProjectDirectory,
|
|
114
|
+
graphqlClient,
|
|
115
|
+
actor,
|
|
116
|
+
});
|
|
117
|
+
const getDynamicProjectConfigFn = getDynamicPrivateProjectConfigGetter({
|
|
118
|
+
projectDir: finalTargetProjectDirectory,
|
|
119
|
+
graphqlClient,
|
|
120
|
+
actor,
|
|
121
|
+
});
|
|
122
|
+
if (!app.githubRepository) {
|
|
123
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
124
|
+
cwd: finalTargetProjectDirectory,
|
|
125
|
+
command: 'npx',
|
|
126
|
+
args: ['expo', 'install', 'expo-updates'],
|
|
127
|
+
});
|
|
128
|
+
log_1.default.log();
|
|
129
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
130
|
+
cwd: finalTargetProjectDirectory,
|
|
131
|
+
command: 'npx',
|
|
132
|
+
args: ['expo', 'install', 'expo-insights'],
|
|
133
|
+
});
|
|
134
|
+
log_1.default.log();
|
|
135
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
136
|
+
cwd: finalTargetProjectDirectory,
|
|
137
|
+
command: 'npx',
|
|
138
|
+
args: ['expo', 'install', 'expo-dev-client'],
|
|
139
|
+
});
|
|
140
|
+
log_1.default.log();
|
|
141
|
+
}
|
|
88
142
|
await vcsClient.trackFileAsync('package-lock.json');
|
|
89
|
-
const shouldSetupCredentials =
|
|
143
|
+
const shouldSetupCredentials = ((platform === eas_build_job_1.Platform.IOS &&
|
|
144
|
+
actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Device) ||
|
|
145
|
+
platform === eas_build_job_1.Platform.ANDROID) &&
|
|
90
146
|
actor.preferences.onboarding.environment === generated_1.OnboardingEnvironment.DevBuild;
|
|
91
147
|
if (shouldSetupCredentials) {
|
|
92
148
|
log_1.default.log('🔑 Now we need to set up build credentials for your project:');
|
|
93
|
-
await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
actor,
|
|
97
|
-
}), getDynamicPrivateProjectConfigGetter({
|
|
98
|
-
projectDir: finalTargetProjectDirectory,
|
|
99
|
-
graphqlClient,
|
|
100
|
-
actor,
|
|
101
|
-
}), platform, 'development', finalTargetProjectDirectory).runAsync();
|
|
149
|
+
await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, exp, getDynamicProjectConfigFn, platform, actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Simulator
|
|
150
|
+
? 'development-simulator'
|
|
151
|
+
: 'development', finalTargetProjectDirectory).runAsync();
|
|
102
152
|
}
|
|
103
|
-
if (await vcsClient.hasUncommittedChangesAsync()) {
|
|
153
|
+
if (app.githubRepository && (await vcsClient.hasUncommittedChangesAsync())) {
|
|
104
154
|
log_1.default.log('📦 We will now commit the changes made by the configuration process and push them to GitHub:');
|
|
105
155
|
log_1.default.log();
|
|
106
156
|
log_1.default.log('🔍 Checking for changes in the repository...');
|
|
@@ -111,17 +161,56 @@ class Onboarding extends EasCommand_1.default {
|
|
|
111
161
|
targetProjectDir: finalTargetProjectDirectory,
|
|
112
162
|
});
|
|
113
163
|
}
|
|
164
|
+
else if (!app.githubRepository) {
|
|
165
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
166
|
+
cwd: finalTargetProjectDirectory,
|
|
167
|
+
command: 'git',
|
|
168
|
+
args: ['add', '.'],
|
|
169
|
+
});
|
|
170
|
+
log_1.default.log();
|
|
171
|
+
await (0, runCommand_1.runCommandAsync)({
|
|
172
|
+
cwd: finalTargetProjectDirectory,
|
|
173
|
+
command: 'git',
|
|
174
|
+
args: ['commit', '-m', 'Initial commit'],
|
|
175
|
+
});
|
|
176
|
+
log_1.default.log();
|
|
177
|
+
}
|
|
178
|
+
log_1.default.log();
|
|
179
|
+
log_1.default.log('🎉 We finished configuring your project.');
|
|
180
|
+
log_1.default.log();
|
|
181
|
+
if (app.githubRepository ||
|
|
182
|
+
actor.preferences.onboarding.environment === generated_1.OnboardingEnvironment.ExpoGo) {
|
|
183
|
+
log_1.default.log('🚀 You can now go back to the website to continue:');
|
|
184
|
+
const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
185
|
+
log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
log_1.default.log('🚀 Now we are going to trigger your first build');
|
|
189
|
+
log_1.default.log();
|
|
190
|
+
const { buildIds } = await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(graphqlClient, analytics, vcsClient, finalTargetProjectDirectory, {
|
|
191
|
+
nonInteractive: true,
|
|
192
|
+
requestedPlatform: platform === eas_build_job_1.Platform.ANDROID ? platform_1.RequestedPlatform.Android : platform_1.RequestedPlatform.Ios,
|
|
193
|
+
profile: actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Simulator
|
|
194
|
+
? 'development-simulator'
|
|
195
|
+
: 'development',
|
|
196
|
+
wait: false,
|
|
197
|
+
clearCache: false,
|
|
198
|
+
json: false,
|
|
199
|
+
autoSubmit: false,
|
|
200
|
+
localBuildOptions: {},
|
|
201
|
+
freezeCredentials: false,
|
|
202
|
+
}, actor, getDynamicProjectConfigFn);
|
|
203
|
+
const buildId = buildIds[0];
|
|
204
|
+
log_1.default.log();
|
|
205
|
+
log_1.default.log('🚀 You can now go back to the website to continue:');
|
|
206
|
+
const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}&buildId=${buildId}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
207
|
+
log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
|
|
208
|
+
}
|
|
114
209
|
const { __typename, ...previousPreferences } = actor.preferences.onboarding;
|
|
115
210
|
await UserPreferencesMutation_1.UserPreferencesMutation.markCliDoneInOnboardingUserPreferencesAsync(graphqlClient, {
|
|
116
211
|
...previousPreferences,
|
|
117
212
|
appId: app.id,
|
|
118
213
|
});
|
|
119
|
-
log_1.default.log();
|
|
120
|
-
log_1.default.log('🎉 We finished configuring your project.');
|
|
121
|
-
log_1.default.log();
|
|
122
|
-
log_1.default.log('🚀 You can now go back to the website to continue:');
|
|
123
|
-
const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
124
|
-
log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
|
|
125
214
|
}
|
|
126
215
|
}
|
|
127
216
|
_a = Onboarding;
|
|
@@ -166,3 +255,86 @@ function getDynamicPrivateProjectConfigGetter({ projectDir, graphqlClient, actor
|
|
|
166
255
|
};
|
|
167
256
|
};
|
|
168
257
|
}
|
|
258
|
+
async function configureProjectFromBareDefaultExpoTemplateAsync({ app, vcsClient, targetDir, }) {
|
|
259
|
+
// Android package name requires each component to start with a lowercase letter.
|
|
260
|
+
const isUsernameValidSegment = /^[^a-z]/.test(app.ownerAccount.name);
|
|
261
|
+
const userPrefix = isUsernameValidSegment ? 'user' : '';
|
|
262
|
+
const isSlugValidSegment = /^[^a-z]/.test(app.slug);
|
|
263
|
+
const slugPrefix = isSlugValidSegment ? 'app' : '';
|
|
264
|
+
const bundleIdentifier = `com.${userPrefix}${stripInvalidCharactersForBundleIdentifier(app.ownerAccount.name)}.${slugPrefix}${stripInvalidCharactersForBundleIdentifier(app.slug)}`;
|
|
265
|
+
const updateUrl = (0, api_1.getEASUpdateURL)(app.id);
|
|
266
|
+
const easBuildGitHubConfig = {
|
|
267
|
+
android: {
|
|
268
|
+
image: 'latest',
|
|
269
|
+
},
|
|
270
|
+
ios: {
|
|
271
|
+
image: 'latest',
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
const easJson = {
|
|
275
|
+
cli: {
|
|
276
|
+
version: `>= ${easCli_1.easCliVersion}`,
|
|
277
|
+
},
|
|
278
|
+
build: {
|
|
279
|
+
development: {
|
|
280
|
+
developmentClient: true,
|
|
281
|
+
distribution: 'internal',
|
|
282
|
+
channel: 'development',
|
|
283
|
+
...easBuildGitHubConfig,
|
|
284
|
+
},
|
|
285
|
+
'development-simulator': {
|
|
286
|
+
extends: 'development',
|
|
287
|
+
ios: {
|
|
288
|
+
simulator: true,
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
preview: {
|
|
292
|
+
distribution: 'internal',
|
|
293
|
+
channel: 'preview',
|
|
294
|
+
...easBuildGitHubConfig,
|
|
295
|
+
},
|
|
296
|
+
production: {
|
|
297
|
+
channel: 'production',
|
|
298
|
+
...easBuildGitHubConfig,
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
submit: {
|
|
302
|
+
production: {},
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
const easJsonPath = path_1.default.join(targetDir, 'eas.json');
|
|
306
|
+
await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
|
|
307
|
+
await vcsClient.trackFileAsync(easJsonPath);
|
|
308
|
+
log_1.default.log(`✅ Generated ${chalk_1.default.bold('eas.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/eas-json/')}`);
|
|
309
|
+
log_1.default.log();
|
|
310
|
+
const expoConfig = {
|
|
311
|
+
name: app.name ?? app.slug,
|
|
312
|
+
slug: app.slug,
|
|
313
|
+
extra: {
|
|
314
|
+
eas: {
|
|
315
|
+
projectId: app.id,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
owner: app.ownerAccount.name,
|
|
319
|
+
updates: {
|
|
320
|
+
url: updateUrl,
|
|
321
|
+
},
|
|
322
|
+
runtimeVersion: {
|
|
323
|
+
policy: 'appVersion',
|
|
324
|
+
},
|
|
325
|
+
ios: {
|
|
326
|
+
bundleIdentifier,
|
|
327
|
+
},
|
|
328
|
+
android: {
|
|
329
|
+
package: bundleIdentifier,
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
const appJsonPath = path_1.default.join(targetDir, 'app.json');
|
|
333
|
+
await fs_extra_1.default.writeFile(appJsonPath, `${JSON.stringify({ expo: expoConfig }, null, 2)}\n`);
|
|
334
|
+
await vcsClient.trackFileAsync(appJsonPath);
|
|
335
|
+
log_1.default.log(`✅ Generated ${chalk_1.default.bold('app.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/')}`);
|
|
336
|
+
log_1.default.log();
|
|
337
|
+
}
|
|
338
|
+
function stripInvalidCharactersForBundleIdentifier(string) {
|
|
339
|
+
return string.replaceAll(/[^A-Za-z0-9]/g, '');
|
|
340
|
+
}
|
|
@@ -31,27 +31,27 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
|
|
|
31
31
|
value: secret,
|
|
32
32
|
})),
|
|
33
33
|
}));
|
|
34
|
-
id = secret
|
|
34
|
+
id = secret?.id;
|
|
35
35
|
if (!id) {
|
|
36
36
|
throw new Error(validationMessage);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (!nonInteractive) {
|
|
40
40
|
log_1.default.addNewLineIfNone();
|
|
41
|
-
log_1.default.warn(`You are about to permanently delete secret${
|
|
41
|
+
log_1.default.warn(`You are about to permanently delete secret${secret?.name ? ` "${secret?.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
|
|
42
42
|
log_1.default.newLine();
|
|
43
43
|
const confirmed = await (0, prompts_1.toggleConfirmAsync)({
|
|
44
|
-
message: `Are you sure you wish to proceed?${
|
|
44
|
+
message: `Are you sure you wish to proceed?${secret?.scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
|
|
45
45
|
? ' This secret is applied across your whole account and may affect multiple apps.'
|
|
46
46
|
: ''}`,
|
|
47
47
|
});
|
|
48
48
|
if (!confirmed) {
|
|
49
|
-
log_1.default.error(`Canceled deletion of secret${
|
|
49
|
+
log_1.default.error(`Canceled deletion of secret${secret?.name ? ` "${secret?.name}"` : ''} with id: "${id}".`);
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(graphqlClient, id);
|
|
54
|
-
log_1.default.withTick(`️Deleted secret${
|
|
54
|
+
log_1.default.withTick(`️Deleted secret${secret?.name ? ` "${secret?.name}"` : ''} with id "${id}".`);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
_a = EnvironmentSecretDelete;
|
|
@@ -133,7 +133,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
133
133
|
cancelationToken.isCanceledOrFinished = true;
|
|
134
134
|
const timedOutAssets = lastAssetUploadResults
|
|
135
135
|
.filter(r => !r.finished)
|
|
136
|
-
.map(r =>
|
|
136
|
+
.map(r => `\n- ${r.asset.originalPath ?? r.asset.path}`);
|
|
137
137
|
throw new Error(`Asset processing timed out for assets: ${timedOutAssets}`);
|
|
138
138
|
})(),
|
|
139
139
|
]);
|
|
@@ -277,7 +277,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
277
277
|
? [{ label: 'Android update ID', value: newAndroidUpdate.id }]
|
|
278
278
|
: []),
|
|
279
279
|
...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
|
|
280
|
-
{ label: 'Message', value: updateMessage
|
|
280
|
+
{ label: 'Message', value: updateMessage ?? '' },
|
|
281
281
|
...(gitCommitHash
|
|
282
282
|
? [
|
|
283
283
|
{
|
|
@@ -301,8 +301,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
sanitizeFlags(flags) {
|
|
304
|
-
|
|
305
|
-
const nonInteractive = (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false;
|
|
304
|
+
const nonInteractive = flags['non-interactive'] ?? false;
|
|
306
305
|
const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
|
|
307
306
|
if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
|
|
308
307
|
core_1.Errors.error('--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified', { exit: 1 });
|
|
@@ -315,7 +314,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
315
314
|
].filter(([_, value]) => value)[0];
|
|
316
315
|
log_1.default.newLine();
|
|
317
316
|
log_1.default.warn('The --group and --republish flags are deprecated, use the republish command instead:');
|
|
318
|
-
log_1.default.warn(` ${chalk_1.default.bold([`eas update:republish`, ...(args
|
|
317
|
+
log_1.default.warn(` ${chalk_1.default.bold([`eas update:republish`, ...(args ?? [])].join(' '))}`);
|
|
319
318
|
log_1.default.newLine();
|
|
320
319
|
core_1.Errors.error('--group and --republish flags are deprecated', { exit: 1 });
|
|
321
320
|
}
|
|
@@ -330,7 +329,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
330
329
|
platform: flags.platform,
|
|
331
330
|
privateKeyPath: flags['private-key-path'],
|
|
332
331
|
nonInteractive,
|
|
333
|
-
json:
|
|
332
|
+
json: flags.json ?? false,
|
|
334
333
|
};
|
|
335
334
|
}
|
|
336
335
|
}
|
|
@@ -60,7 +60,6 @@ class UpdateRepublish extends EasCommand_1.default {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
sanitizeFlags(rawFlags) {
|
|
63
|
-
var _b;
|
|
64
63
|
const branchName = rawFlags.branch;
|
|
65
64
|
const channelName = rawFlags.channel;
|
|
66
65
|
const groupId = rawFlags.group;
|
|
@@ -77,7 +76,7 @@ class UpdateRepublish extends EasCommand_1.default {
|
|
|
77
76
|
platform,
|
|
78
77
|
updateMessage: rawFlags.message,
|
|
79
78
|
privateKeyPath,
|
|
80
|
-
json:
|
|
79
|
+
json: rawFlags.json ?? false,
|
|
81
80
|
nonInteractive,
|
|
82
81
|
};
|
|
83
82
|
}
|
|
@@ -135,7 +135,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
|
|
|
135
135
|
? [{ label: 'Android update ID', value: newAndroidUpdate.id }]
|
|
136
136
|
: []),
|
|
137
137
|
...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
|
|
138
|
-
{ label: 'Message', value: updateMessage
|
|
138
|
+
{ label: 'Message', value: updateMessage ?? '' },
|
|
139
139
|
...(gitCommitHash
|
|
140
140
|
? [
|
|
141
141
|
{
|
|
@@ -197,8 +197,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
|
|
|
197
197
|
return newUpdates;
|
|
198
198
|
}
|
|
199
199
|
sanitizeFlags(flags) {
|
|
200
|
-
|
|
201
|
-
const nonInteractive = (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false;
|
|
200
|
+
const nonInteractive = flags['non-interactive'] ?? false;
|
|
202
201
|
const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
|
|
203
202
|
if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
|
|
204
203
|
core_1.Errors.error('--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified', { exit: 1 });
|
|
@@ -211,7 +210,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
|
|
|
211
210
|
platform: flags.platform,
|
|
212
211
|
privateKeyPath: flags['private-key-path'],
|
|
213
212
|
nonInteractive,
|
|
214
|
-
json:
|
|
213
|
+
json: flags.json ?? false,
|
|
215
214
|
};
|
|
216
215
|
}
|
|
217
216
|
}
|
|
@@ -26,13 +26,12 @@ class AndroidCredentialsProvider {
|
|
|
26
26
|
return this.toAndroidCredentials(buildCredentials);
|
|
27
27
|
}
|
|
28
28
|
toAndroidCredentials(androidBuildCredentials) {
|
|
29
|
-
var _a, _b, _c, _d, _e;
|
|
30
29
|
return {
|
|
31
30
|
keystore: {
|
|
32
|
-
keystore: (0, nullthrows_1.default)(
|
|
33
|
-
keystorePassword: (0, nullthrows_1.default)(
|
|
34
|
-
keyAlias: (0, nullthrows_1.default)(
|
|
35
|
-
keyPassword:
|
|
31
|
+
keystore: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keystore),
|
|
32
|
+
keystorePassword: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keystorePassword),
|
|
33
|
+
keyAlias: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keyAlias),
|
|
34
|
+
keyPassword: androidBuildCredentials.androidKeystore?.keyPassword ?? undefined,
|
|
36
35
|
},
|
|
37
36
|
};
|
|
38
37
|
}
|
|
@@ -23,7 +23,6 @@ async function canCopyLegacyCredentialsAsync(ctx, app) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.canCopyLegacyCredentialsAsync = canCopyLegacyCredentialsAsync;
|
|
25
25
|
async function promptUserAndCopyLegacyCredentialsAsync(ctx, app) {
|
|
26
|
-
var _a, _b;
|
|
27
26
|
(0, assert_1.default)(await canCopyLegacyCredentialsAsync(ctx, app), 'User not eligible to copy classic build credentials to EAS');
|
|
28
27
|
const spinner = (0, ora_1.ora)('Classic credentials detected, copying to EAS...').start();
|
|
29
28
|
try {
|
|
@@ -40,13 +39,13 @@ async function promptUserAndCopyLegacyCredentialsAsync(ctx, app) {
|
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
const legacyBuildCredentials = await ctx.android.getLegacyAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
|
|
43
|
-
const legacyKeystore =
|
|
42
|
+
const legacyKeystore = legacyBuildCredentials?.androidKeystore ?? null;
|
|
44
43
|
if (legacyKeystore) {
|
|
45
44
|
const clonedKeystore = await ctx.android.createKeystoreAsync(ctx.graphqlClient, app.account, {
|
|
46
45
|
keystore: legacyKeystore.keystore,
|
|
47
46
|
keystorePassword: legacyKeystore.keystorePassword,
|
|
48
47
|
keyAlias: legacyKeystore.keyAlias,
|
|
49
|
-
keyPassword:
|
|
48
|
+
keyPassword: legacyKeystore.keyPassword ?? undefined,
|
|
50
49
|
type: legacyKeystore.type,
|
|
51
50
|
});
|
|
52
51
|
await createOrUpdateDefaultAndroidAppBuildCredentialsAsync(ctx, app, {
|
|
@@ -14,20 +14,19 @@ class DownloadKeystore {
|
|
|
14
14
|
this.options = options;
|
|
15
15
|
}
|
|
16
16
|
async runAsync(ctx, buildCredentials) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
17
|
const keystore = buildCredentials.androidKeystore;
|
|
19
18
|
if (!keystore) {
|
|
20
19
|
log_1.default.warn(`There is no valid Keystore defined for build credentials: ${buildCredentials.name}`);
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
let displaySensitiveInformation =
|
|
22
|
+
let displaySensitiveInformation = this.options?.displaySensitiveInformation;
|
|
24
23
|
if (displaySensitiveInformation === undefined && !ctx.nonInteractive) {
|
|
25
24
|
displaySensitiveInformation = await (0, prompts_1.confirmAsync)({
|
|
26
25
|
message: 'Do you want to display the sensitive information of the Android Keystore?',
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
28
|
const projectFullName = (0, GraphqlClient_1.formatProjectFullName)(this.options.app);
|
|
30
|
-
const keystorePath =
|
|
29
|
+
const keystorePath = this.options?.outputPath ?? `${projectFullName.replace('/', '__')}.jks`;
|
|
31
30
|
await (0, files_1.maybeRenameExistingFileAsync)(ctx.projectDir, keystorePath);
|
|
32
31
|
log_1.default.log(`Saving Keystore to ${keystorePath}`);
|
|
33
32
|
await fs_extra_1.default.writeFile(keystorePath, keystore.keystore, 'base64');
|
|
@@ -14,7 +14,7 @@ class RemoveFcm {
|
|
|
14
14
|
throw new Error("Deleting an FCM API Key is a destructive operation. Start the CLI without the '--non-interactive' flag to delete the credentials.");
|
|
15
15
|
}
|
|
16
16
|
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
|
|
17
|
-
const fcm = appCredentials
|
|
17
|
+
const fcm = appCredentials?.androidFcm;
|
|
18
18
|
if (!fcm) {
|
|
19
19
|
log_1.default.warn(`There is no valid FCM API Key defined for ${(0, GraphqlClient_1.formatProjectFullName)(this.app)}, ${this.app.androidApplicationIdentifier}`);
|
|
20
20
|
return;
|
|
@@ -49,12 +49,11 @@ class SetUpBuildCredentials {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
async getFullySetupBuildCredentialsAsync({ ctx, app, name, }) {
|
|
52
|
-
var _a;
|
|
53
52
|
if (name) {
|
|
54
53
|
return await this.getFullySetupBuildCredentialsByNameAsync({ ctx, app, name });
|
|
55
54
|
}
|
|
56
55
|
const defaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
|
|
57
|
-
const defaultKeystore =
|
|
56
|
+
const defaultKeystore = defaultBuildCredentials?.androidKeystore ?? null;
|
|
58
57
|
if (defaultKeystore) {
|
|
59
58
|
(0, ora_1.ora)(`Using Keystore from configuration: ${(0, nullthrows_1.default)(defaultBuildCredentials).name} (default)`).succeed();
|
|
60
59
|
return defaultBuildCredentials;
|
|
@@ -62,15 +61,14 @@ class SetUpBuildCredentials {
|
|
|
62
61
|
return null;
|
|
63
62
|
}
|
|
64
63
|
async getFullySetupBuildCredentialsByNameAsync({ ctx, app, name, }) {
|
|
65
|
-
var _a;
|
|
66
64
|
const maybeBuildCredentials = await ctx.android.getAndroidAppBuildCredentialsByNameAsync(ctx.graphqlClient, app, name);
|
|
67
|
-
const keystore =
|
|
65
|
+
const keystore = maybeBuildCredentials?.androidKeystore ?? null;
|
|
68
66
|
if (keystore) {
|
|
69
67
|
const buildCredentials = (0, nullthrows_1.default)(maybeBuildCredentials);
|
|
70
68
|
(0, ora_1.ora)(`Using Keystore from configuration: ${buildCredentials.name}${buildCredentials.isDefault ? ' (default)' : ''}`).succeed();
|
|
71
69
|
return buildCredentials;
|
|
72
70
|
}
|
|
73
|
-
log_1.default.log(`No Keystore found for configuration: ${name}${
|
|
71
|
+
log_1.default.log(`No Keystore found for configuration: ${name}${maybeBuildCredentials?.isDefault ? ' (default)' : ''}`);
|
|
74
72
|
return null;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
@@ -34,10 +34,9 @@ class SetUpGoogleServiceAccountKeyForFcmV1 {
|
|
|
34
34
|
}
|
|
35
35
|
async isGoogleServiceAccountKeySetupAsync(ctx) {
|
|
36
36
|
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
|
|
37
|
-
return !!
|
|
37
|
+
return !!appCredentials?.googleServiceAccountKeyForFcmV1;
|
|
38
38
|
}
|
|
39
39
|
async createOrUseExistingKeyAsync(ctx) {
|
|
40
|
-
var _a;
|
|
41
40
|
const { action } = await (0, prompts_1.promptAsync)({
|
|
42
41
|
type: 'select',
|
|
43
42
|
name: 'action',
|
|
@@ -53,7 +52,8 @@ class SetUpGoogleServiceAccountKeyForFcmV1 {
|
|
|
53
52
|
if (action === 'GENERATE') {
|
|
54
53
|
return await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
|
|
55
54
|
}
|
|
56
|
-
return ((
|
|
55
|
+
return ((await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx)) ??
|
|
56
|
+
(await this.createOrUseExistingKeyAsync(ctx)));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
exports.SetUpGoogleServiceAccountKeyForFcmV1 = SetUpGoogleServiceAccountKeyForFcmV1;
|
|
@@ -34,10 +34,9 @@ class SetUpGoogleServiceAccountKeyForSubmissions {
|
|
|
34
34
|
}
|
|
35
35
|
async isGoogleServiceAccountKeySetupAsync(ctx) {
|
|
36
36
|
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
|
|
37
|
-
return !!
|
|
37
|
+
return !!appCredentials?.googleServiceAccountKeyForSubmissions;
|
|
38
38
|
}
|
|
39
39
|
async createOrUseExistingKeyAsync(ctx) {
|
|
40
|
-
var _a;
|
|
41
40
|
const { action } = await (0, prompts_1.promptAsync)({
|
|
42
41
|
type: 'select',
|
|
43
42
|
name: 'action',
|
|
@@ -53,7 +52,8 @@ class SetUpGoogleServiceAccountKeyForSubmissions {
|
|
|
53
52
|
if (action === 'GENERATE') {
|
|
54
53
|
return await new CreateGoogleServiceAccountKey_1.CreateGoogleServiceAccountKey(this.app.account).runAsync(ctx);
|
|
55
54
|
}
|
|
56
|
-
return ((
|
|
55
|
+
return ((await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx)) ??
|
|
56
|
+
(await this.createOrUseExistingKeyAsync(ctx)));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
exports.SetUpGoogleServiceAccountKeyForSubmissions = SetUpGoogleServiceAccountKeyForSubmissions;
|