@forge/cli-shared

9.2.0-next.3-experimental-fda9df69.2.0-next.6
out/ui/text.js
~out/ui/text.jsModified
+17−38
Index: package/out/ui/text.js
===================================================================
--- package/out/ui/text.js
+++ package/out/ui/text.js
@@ -32,13 +32,12 @@
 const keytarAccessErrorBase = (message) => `Keytar error detected: ${message}`;
 const capitalise = (word) => word.charAt(0).toUpperCase() + word.slice(1);
 exports.capitalise = capitalise;
 const getLintMessage = (line, column, message, level, colourFunction, reference) => `${chalk_1.default.dim(`${line}:${column}`.padEnd(7))} ${colourFunction(level.padEnd(8))} ${message}  ${chalk_1.default.dim(reference)}\n`;
-const checkLintTotalPlurals = (numErrors, numWarnings, numApprovals, numFixableErrors, numFixableWarnings) => ({
+const checkLintTotalPlurals = (numErrors, numWarnings, numFixableErrors, numFixableWarnings) => ({
     pluralCheckedErrors: `${numErrors} ${numErrors === 1 ? 'error' : 'errors'}`,
     pluralCheckedWarnings: `${numWarnings} ${numWarnings === 1 ? 'warning' : 'warnings'}`,
-    pluralCheckedApprovals: `${numApprovals} ${numApprovals === 1 ? 'approval' : 'approvals'}`,
-    pluralCheckedTotal: `${numErrors + numWarnings + numApprovals} ${numErrors + numWarnings + numApprovals === 1 ? 'issue' : 'issues'}`,
+    pluralCheckedTotal: `${numErrors + numWarnings} ${numErrors + numWarnings === 1 ? 'issue' : 'issues'}`,
     pluralCheckedFixableErrors: `${numFixableErrors} ${numFixableErrors === 1 ? 'error' : 'errors'}`,
     pluralCheckedFixableWarnings: `${numFixableWarnings} ${numFixableWarnings === 1 ? 'warning' : 'warnings'}`
 });
 const platformKeytarRecommendations = () => {
@@ -515,9 +514,8 @@
     artifact: {
         error: {
             noDeployUrl: "Couldn't find deployment URL",
             noPresignedUrls: "Couldn't find presigned URLs",
-            noManifestUrl: "Couldn't find manifest URL",
             noUploadId: "Couldn't find uploadId",
             noManifestInZip: (manifestFilename) => `Couldn't find ${manifestFilename} file in the zip archive. Add one.`,
             noManifestAtPath: (path) => `We couldn't find the artifact file ${path}.`,
             empty: 'The provided artifact file was empty.',
@@ -830,14 +828,10 @@
         },
         taskLint: {
             lintError: log_color_1.LogColor.error(`Error: The build failed due to errors in the app code. Fix the errors before rerunning ${forge('build')}, or run ${forge('build', '--no-verify')} to skip the linter.\n`),
             lintWarning: (numWarnings) => {
-                const { pluralCheckedTotal } = checkLintTotalPlurals(0, numWarnings, 0, 0, 0);
+                const { pluralCheckedTotal } = checkLintTotalPlurals(0, numWarnings, 0, 0);
                 return log_color_1.LogColor.warn(`${pluralCheckedTotal} found. Run ${forge('lint')} to review the warnings.`);
-            },
-            lintApproval: (numApprovals) => {
-                const { pluralCheckedApprovals } = checkLintTotalPlurals(0, 0, numApprovals, 0, 0);
-                return log_color_1.LogColor.approval(`The deploy failed due to ${pluralCheckedApprovals} requested. Approve the rule by running ${forge('deploy', '--approve=[ruleName]')}\n`);
             }
         },
         list: {
             cmd: {
@@ -865,31 +859,22 @@
                 const buildTagText = buildTag ? ` using build with tag ${buildTag}` : '';
                 return `Deploying ${appName}${buildTagText} to ${exports.Text.env.displayEnvironment(envKey, envType)}...`;
             },
             success: 'Deployed\n',
-            successDetails: (appName, envKey, envType, buildTag, numApprovals) => {
+            successDetails: (appName, envKey, envType, buildTag) => {
                 const buildTagText = buildTag ? ` using build with tag ${buildTag}` : '';
-                const approvalsText = numApprovals && numApprovals > 0
-                    ? ` with ${numApprovals} ${numApprovals === 1 ? 'approval' : 'approvals'} acknowledged`
-                    : '';
-                return `Deployed ${appName}${buildTagText} to the ${exports.Text.env.displayEnvironment(envKey, envType)} environment${approvalsText}.`;
+                return `Deployed ${appName}${buildTagText} to the ${exports.Text.env.displayEnvironment(envKey, envType)} environment.`;
             },
             distributePageLink: (appId) => `To install on a site that you're an admin of, run ${forge('install')}.\n` +
                 'To install on any other site, generate an installation link in the developer console and share it with the site admin: ' +
                 `https://developer.atlassian.com/console/myapps/${appId}/manage/distribution`
         },
         taskLint: {
             lintError: log_color_1.LogColor.error(`Error: The deploy failed due to errors in the app code. Fix the errors before rerunning ${forge('deploy')}, or run ${forge('deploy', '--no-verify')} to skip the linter.\n`),
             lintWarning: (numWarnings) => {
-                const { pluralCheckedTotal } = checkLintTotalPlurals(0, numWarnings, 0, 0, 0);
+                const { pluralCheckedTotal } = checkLintTotalPlurals(0, numWarnings, 0, 0);
                 return log_color_1.LogColor.warn(`${pluralCheckedTotal} found. Run ${forge('lint')} to review the warnings.`);
-            },
-            lintApproval: (numApprovals, ruleNames) => {
-                const { pluralCheckedApprovals } = checkLintTotalPlurals(0, 0, numApprovals, 0, 0);
-                const rulesArg = ruleNames && ruleNames.length > 0 ? ruleNames.join(' ') : '[ruleName]';
-                return log_color_1.LogColor.approval(`The deploy failed due to ${pluralCheckedApprovals} requested. Run ${forge('deploy', `--approve ${rulesArg}`)} to acknowledge and proceed.\n`);
-            },
-            lintErrorsWithApprovals: log_color_1.LogColor.error(`Fix the error above before approving deployment rules.\n`)
+            }
         },
         hasNoAppInstallationsForEnv: {
             hasNoAppInstallationsForEnvError: log_color_1.LogColor.error(`Error: The deployment failed due to errors while trying to determine if the app has any installations for the deployed environment.`)
         },
@@ -907,11 +892,8 @@
         },
         skipRollout: {
             description: 'Skip rolling release rollout after deployment'
         },
-        approveRule: {
-            description: 'list of validation rules to approve'
-        },
         connectKeyChange: {
             continueChange: `Do you wish to continue with changing the Connect key?`,
             continueDelete: `Do you wish to continue with deleting the Connect key?`,
             mpacAppConnectKeyChangeAnalyticsError: 'Cannot change app.connect.key for an app with an Atlassian Marketplace listing.',
@@ -926,9 +908,9 @@
         },
         taskPackage: {
             title: 'Packaging app files',
             packageBundledFiles: 'Packaging bundled files',
-            packageFile: (fileName, filePath) => `File added to archive: ${filePath}` + fileName ? `, from ${fileName}` : '',
+            packageFile: (fileName, filePath) => `File added to archive: ${fileName || '.'}${filePath ? `, from ${filePath}` : ''}`,
             archiveCreated: (archivePath) => `Archive created: ${archivePath}`
         },
         taskUpload: {
             title: 'Uploading app',
@@ -1033,9 +1015,10 @@
                 'in the developer console and share it with the site admin: ' +
                 `https://developer.atlassian.com/console/myapps/${appId}/distribution`,
             appendRequestIdToErrorMessage: (message, requestId) => `${message} For more help on this issue, please reach out to support (${buildTerminalLink('https://developer.atlassian.com/support')}) and provide them the following request ID: ${requestId}`,
             majorVersionNotFound: 'The major version you specified does not exist. Check the version number and try again.',
-            installationLimitReached: 'Installation error: The target site already has the maximum number of apps installed. To install this app there, uninstall any unused apps first.'
+            installationLimitReached: 'Installation error: The target site already has the maximum number of apps installed. To install this app there, uninstall any unused apps first.',
+            tooManyRequests: 'Too many requests'
         },
         debug: {
             ccpEntitlementQueryFailed: `Non-essential request failed. Continuing installation.`
         },
@@ -1297,34 +1280,30 @@
         blurb: "The linter checks the app code for known errors. Warnings are issues you should fix, but they won't stop the app code from building.\nPress Ctrl+C to cancel.\n",
         cmd: 'check the source files for common errors',
         running: `Running ${forge('lint')}...`,
         noProblems: 'No issues found.',
-        approvalRequired: chalk_1.default.cyan(`  Approval required, fixable with ${forge('deploy', '--approve=[ruleName]')}.`),
         noFixableProblem: chalk_1.default.red(`  Issue found is not automatically fixable with ${forge('lint')}.`),
         noFixableProblems: chalk_1.default.red(`  Issues found are not automatically fixable with ${forge('lint')}.`),
         filename: chalk_1.default.underline,
-        errorMissingManifest: `Missing manifest`,
-        errorInvalidManifest: `Invalid manifest`,
         linterFailed: (linterClass, failure) => chalk_1.default.yellow(`${chalk_1.default.bold('Warning:')} Could not perform some linting actions for ${chalk_1.default.bold(linterClass)} due to unhandled error "${failure}".\n`),
         fixed: (numFixableErrors, numFixableWarnings) => {
-            const { pluralCheckedFixableErrors, pluralCheckedFixableWarnings } = checkLintTotalPlurals(0, 0, 0, numFixableErrors, numFixableWarnings);
+            const { pluralCheckedFixableErrors, pluralCheckedFixableWarnings } = checkLintTotalPlurals(0, 0, numFixableErrors, numFixableWarnings);
             return `${greenTick} Fixed ${pluralCheckedFixableErrors} and ${pluralCheckedFixableWarnings}`;
         },
         fixFollowUp: `Run ${forge('lint')} to review outstanding errors and warnings`,
         error: (line, column, message, reference) => getLintMessage(line, column, message, 'error', log_color_1.LogColor.error, reference),
-        summary: (numErrors, numWarnings, numApprovals, numFixableErrors, numFixableWarnings) => {
-            const { pluralCheckedErrors, pluralCheckedWarnings, pluralCheckedApprovals, pluralCheckedTotal } = checkLintTotalPlurals(numErrors, numWarnings, numApprovals, numFixableErrors, numFixableWarnings);
-            const colourFunction = numErrors ? log_color_1.LogColor.error : numWarnings ? log_color_1.LogColor.warn : log_color_1.LogColor.approval;
+        summary: (numErrors, numWarnings, numFixableErrors, numFixableWarnings) => {
+            const { pluralCheckedErrors, pluralCheckedWarnings, pluralCheckedTotal } = checkLintTotalPlurals(numErrors, numWarnings, numFixableErrors, numFixableWarnings);
+            const colourFunction = numErrors ? log_color_1.LogColor.error : log_color_1.LogColor.warn;
             const warningCharacter = numErrors ? 'X' : '⚠';
-            return colourFunction(`${warningCharacter} ${pluralCheckedTotal} (${pluralCheckedErrors}, ${pluralCheckedWarnings}, ${pluralCheckedApprovals})`);
+            return colourFunction(`${warningCharacter} ${pluralCheckedTotal} (${pluralCheckedErrors}, ${pluralCheckedWarnings})`);
         },
         fixSummary: (numErrors, numFixableErrors, numFixableWarnings) => {
-            const { pluralCheckedFixableErrors, pluralCheckedFixableWarnings } = checkLintTotalPlurals(0, 0, 0, numFixableErrors, numFixableWarnings);
+            const { pluralCheckedFixableErrors, pluralCheckedFixableWarnings } = checkLintTotalPlurals(0, 0, numFixableErrors, numFixableWarnings);
             const colourFunction = numErrors ? log_color_1.LogColor.error : log_color_1.LogColor.warn;
             return colourFunction(`  Run ${forge('lint', '--fix')} to automatically fix ${pluralCheckedFixableErrors} and ${pluralCheckedFixableWarnings}.\n`);
         },
-        warning: (line, column, message, reference) => getLintMessage(line, column, message, 'warning', log_color_1.LogColor.warn, reference),
-        approval: (line, column, message, reference) => getLintMessage(line, column, message, 'approval', log_color_1.LogColor.approval, reference)
+        warning: (line, column, message, reference) => getLintMessage(line, column, message, 'warning', log_color_1.LogColor.warn, reference)
     },
     repositories: {
         cmd: {
             desc: 'view repositories and repository images'