From 44cd3b2669e6e09d9b385dcff68e15feb79f43ed Mon Sep 17 00:00:00 2001 From: Quinlan Jung Date: Fri, 19 Apr 2024 10:41:18 -0700 Subject: [PATCH] [eas-cli] amend credential removal wording (#2334) * Temporary Commit at 4/18/2024, 8:40:55 PM * update CHANGELOG.md --- CHANGELOG.md | 2 ++ .../ios/actions/DistributionCertificateUtils.ts | 9 +++++++-- .../src/credentials/ios/actions/PushKeyUtils.ts | 9 +++++++-- .../ios/actions/RemoveDistributionCertificate.ts | 12 +++++++++--- .../src/credentials/ios/actions/RemovePushKey.ts | 9 +++++++-- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee05df3af2..98bd19a9e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿงน Chores +- Amend credential removal wording. ([#2334](https://github.com/expo/eas-cli/pull/2334) by [@quinlanj](https://github.com/quinlanj)) + ## [7.8.2](https://github.com/expo/eas-cli/releases/tag/v7.8.2) - 2024-04-15 ### ๐Ÿ› Bug fixes diff --git a/packages/eas-cli/src/credentials/ios/actions/DistributionCertificateUtils.ts b/packages/eas-cli/src/credentials/ios/actions/DistributionCertificateUtils.ts index 7b5e40dc0d..e275611955 100644 --- a/packages/eas-cli/src/credentials/ios/actions/DistributionCertificateUtils.ts +++ b/packages/eas-cli/src/credentials/ios/actions/DistributionCertificateUtils.ts @@ -48,8 +48,13 @@ export function formatDistributionCertificate( buildCredentials => buildCredentials.iosAppCredentials.app ); if (apps.length) { - const appFullNames = apps.map(app => app.fullName).join(','); - line += chalk.gray(`\n ๐Ÿ“ฒ Used by: ${appFullNames}`); + // iosAppBuildCredentialsList is capped at 20 on www + const appFullNames = apps + .map(app => app.fullName) + .slice(0, 19) + .join(','); + const andMaybeMore = apps.length > 19 ? ' (and more)' : ''; + line += chalk.gray(`\n ๐Ÿ“ฒ Used by: ${appFullNames}${andMaybeMore}`); } if (validSerialNumbers?.includes(serialNumber)) { diff --git a/packages/eas-cli/src/credentials/ios/actions/PushKeyUtils.ts b/packages/eas-cli/src/credentials/ios/actions/PushKeyUtils.ts index 3e3f61ebd1..7f3ae23aec 100644 --- a/packages/eas-cli/src/credentials/ios/actions/PushKeyUtils.ts +++ b/packages/eas-cli/src/credentials/ios/actions/PushKeyUtils.ts @@ -185,8 +185,13 @@ export function formatPushKey( const apps = pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app); if (apps.length) { - const appFullNames = apps.map(app => app.fullName).join(','); - line += chalk.gray(`\n ๐Ÿ“ฒ Used by: ${appFullNames}`); + // iosAppCredentialsList is capped at 20 on www + const appFullNames = apps + .map(app => app.fullName) + .slice(0, 19) + .join(','); + const andMaybeMore = apps.length > 19 ? ' (and more)' : ''; + line += chalk.gray(`\n ๐Ÿ“ฒ Used by: ${appFullNames}${andMaybeMore}`); } if (validPushKeyIdentifiers?.includes(keyIdentifier)) { diff --git a/packages/eas-cli/src/credentials/ios/actions/RemoveDistributionCertificate.ts b/packages/eas-cli/src/credentials/ios/actions/RemoveDistributionCertificate.ts index bb9f5addc9..d2ad5582f1 100644 --- a/packages/eas-cli/src/credentials/ios/actions/RemoveDistributionCertificate.ts +++ b/packages/eas-cli/src/credentials/ios/actions/RemoveDistributionCertificate.ts @@ -34,14 +34,20 @@ export class RemoveDistributionCertificate { buildCredentials => buildCredentials.iosAppCredentials.app ); if (apps.length !== 0) { - const appFullNames = apps.map(app => app.fullName).join(','); + // iosAppBuildCredentialsList is capped at 20 on www + const appFullNames = apps + .map(app => app.fullName) + .slice(0, 19) + .join(','); + const andMaybeMore = apps.length > 19 ? ' (and more)' : ''; + if (ctx.nonInteractive) { throw new Error( - `Certificate is currently used by ${appFullNames} and cannot be deleted in non-interactive mode.` + `Certificate is currently used by ${appFullNames}${andMaybeMore} and cannot be deleted in non-interactive mode.` ); } const confirm = await confirmAsync({ - message: `You are removing certificate used by ${appFullNames}. Do you want to continue?`, + message: `You are removing certificate used by ${appFullNames}${andMaybeMore}. Do you want to continue?`, }); if (!confirm) { Log.log('Aborting'); diff --git a/packages/eas-cli/src/credentials/ios/actions/RemovePushKey.ts b/packages/eas-cli/src/credentials/ios/actions/RemovePushKey.ts index 74586aa003..147bcf319c 100644 --- a/packages/eas-cli/src/credentials/ios/actions/RemovePushKey.ts +++ b/packages/eas-cli/src/credentials/ios/actions/RemovePushKey.ts @@ -27,9 +27,14 @@ export class RemovePushKey { const apps = this.pushKey.iosAppCredentialsList.map(appCredentials => appCredentials.app); if (apps.length !== 0) { - const appFullNames = apps.map(app => app.fullName).join(','); + // iosAppCredentialsList is capped at 20 on www + const appFullNames = apps + .map(app => app.fullName) + .slice(0, 19) + .join(','); + const andMaybeMore = apps.length > 19 ? ' (and more)' : ''; const confirm = await confirmAsync({ - message: `Removing this push key will disable push notifications for ${appFullNames}. Do you want to continue?`, + message: `Removing this push key will disable push notifications for ${appFullNames}${andMaybeMore}. Do you want to continue?`, }); if (!confirm) { Log.log('Aborting');