@forge/cli-shared
9.2.0-next.3-experimental-c6a39169.2.0-next.5
out/ui/text.js~
out/ui/text.jsModified+13−35
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,15 +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, ruleNames) => {
- const { pluralCheckedApprovals } = checkLintTotalPlurals(0, 0, numApprovals, 0, 0);
- const approveValue = ruleNames && ruleNames.length > 0 ? ruleNames.join(',') : 'ruleName';
- return log_color_1.LogColor.approval(`The deploy failed due to ${pluralCheckedApprovals} requested. Approve the rule by running ${forge('deploy', `--approve=${approveValue}`)}\n`);
}
},
list: {
cmd: {
@@ -866,29 +859,21 @@
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 approveValue = ruleNames && ruleNames.length > 0 ? ruleNames.join(',') : 'ruleName';
- return log_color_1.LogColor.approval(`The deploy failed due to ${pluralCheckedApprovals} requested. Approve the rule by running ${forge('deploy', `--approve=${approveValue}`)}\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.`)
@@ -1294,37 +1279,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: (ruleNames) => {
- const approveValue = ruleNames && ruleNames.length > 0 ? ruleNames.join(',') : 'ruleName';
- return log_color_1.LogColor.approval(`Approval required, fixable with ${forge('deploy', `--approve=${approveValue}`)}\n`);
- },
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'