npm package diff
Package: @forge/cli-shared
Versions: 6.8.0-next.4-experimental-479b182 - 6.8.0-next.5
File: package/out/ui/text.js
Index: package/out/ui/text.js
===================================================================
--- package/out/ui/text.js
+++ package/out/ui/text.js
@@ -1,10 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.Text = exports.capitalise = void 0;
+exports.Text = exports.capitalise = exports.itemList = void 0;
const tslib_1 = require("tslib");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
-const yaml_1 = tslib_1.__importDefault(require("yaml"));
const terminal_link_1 = tslib_1.__importDefault(require("terminal-link"));
const case_1 = require("case");
const log_symbols_1 = tslib_1.__importDefault(require("./log-symbols"));
const log_color_1 = require("./log-color");
@@ -24,8 +23,9 @@
.join(' ');
function itemList(items, indent) {
return items.map((item) => `${indent ?? ' '}- ${item}`).join(`\n${indent ?? ''}`);
}
+exports.itemList = itemList;
const fatalError = (message) => chalk_1.default.bold(chalk_1.default.red(message));
const keytarAccessErrorBase = (message) => `Keytar error detected: ${message}`;
const capitalise = (word) => word.charAt(0).toUpperCase() + word.slice(1);
exports.capitalise = capitalise;
@@ -510,9 +510,12 @@
])}`,
start: 'Comparing app versions...',
end: 'Comparing app versions...',
details: {
- banner: (envKey, envType, version1, version2) => `${log_symbols_1.default.info} Comparison between app versions [${chalk_1.default.bold(version1)} and ${chalk_1.default.bold(version2)}] in [${exports.Text.env.displayEnvironment(envKey, envType)}] is shown below:`
+ banner: (envKey, envType, version1, version2) => {
+ const envDisplay = exports.Text.env.displayEnvironment(envKey, envType);
+ return `${log_symbols_1.default.info} Comparison between app versions [${chalk_1.default.bold(version1)} and ${chalk_1.default.bold(version2)}] in [${envDisplay}] is shown below:`;
+ }
}
},
check: {
cmdName: 'details',
@@ -521,9 +524,12 @@
json: 'output results in JSON format',
outFile: 'specify a file to output the results'
},
error: {
- invalidMajorVersion: (property) => `Invalid major version number${property ? ` for ${property}` : ''}`
+ invalidMajorVersion: (property) => {
+ const version = property ? ` for ${property}` : '';
+ return `Invalid major version number${version}`;
+ }
},
desc: `returns the details of a specific version of the app. Details include:\n${itemList([
'egress',
'policies',
@@ -536,9 +542,12 @@
])}`,
start: 'Getting app version details...',
end: 'Getting app version details...',
details: {
- banner: (envKey, envType, version) => `${log_symbols_1.default.info} App [${version}] in [${exports.Text.env.displayEnvironment(envKey, envType)}] includes the following:`,
+ banner: (envKey, envType, version) => {
+ const envDisplay = exports.Text.env.displayEnvironment(envKey, envType);
+ return `${log_symbols_1.default.info} App [${version}] in [${envDisplay}] includes the following:`;
+ },
prompt: {
options: {
banner: 'Select option:',
choices: {
@@ -562,28 +571,9 @@
}
}
},
writeToFile: (file) => `Writing to file: ${file}`,
- deploymentDate: (date) => `${date.toISOString()}`,
- scopes: (scopes) => `${itemList(scopes, '')}`,
- egress: (egresses) => `${itemList(egresses.map((egress) => `[${chalk_1.default.cyan(egress.type)}]: \n ${itemList(egress.addresses, ' ')}`), '')}`,
- securityPolicies: (policies) => `${itemList(policies.map((policy) => `[${chalk_1.default.cyan(policy.type)}]: ${policy.policies.join(', ')}`))}`,
- license: (requiresLicense) => `${requiresLicense ? 'Yes' : 'No'}`,
- connectKeys: (keys) => `${itemList(keys.map((key) => `[${chalk_1.default.cyan(key.product)}]: ${key.key}`), '')}`,
- storage: (storages) => `${itemList(storages.map((storage) => `[${chalk_1.default.cyan(storage.type)}]: ${storage.store.map((store) => `${store.baseUrl} (${store.locations.join(', ')})`).join(', ')}`))}`,
- functions: (functions) => `${itemList(functions.map((func) => `[${chalk_1.default.cyan(func.key)}]: is configured with the following properties: \n ${yaml_1.default.stringify({
- runtime: `${func.runtimeName}`,
- handler: `${func.handler}`
- }, undefined, ' ').replaceAll('\n', '\n ')}`), '')}`,
- modules: (modules) => {
- return `${modules
- .map((mod) => `${chalk_1.default.bold(mod.type)}\n${itemList(mod.items.map((item) => `[${chalk_1.default.cyan(item.key)}]: is configured with the following properties:\n ${yaml_1.default.stringify(item.properties, undefined, ' ').replaceAll('\n', '\n ')}`), '')}`)
- .join('\n')}`;
- },
- remotes: (remotes) => `${itemList(remotes.map((remote) => `[${chalk_1.default.cyan(remote.key)}]: is configured with the following properties: \n ${yaml_1.default.stringify({
- baseUrl: remote.baseUrl,
- operations: remote.operations
- }, undefined, ' ').replaceAll('\n', '\n ')}`), '')}`
+ license: (requiresLicense) => `${requiresLicense ? 'Yes' : 'No'}`
}
},
list: {
cmdName: 'list',
@@ -605,18 +595,11 @@
])}`,
start: 'Getting app version list...',
end: 'Getting app version list...',
details: {
- banner: (envKey, envType, versions) => `${log_symbols_1.default.info} Details of a total of [${versions} major versions] in [${exports.Text.env.displayEnvironment(envKey, envType)}] can be seen below:`,
- deploymentDate: (date) => exports.Text.version.check.details.deploymentDate(date),
- egresses: (egresses) => {
- return egresses.map((egress) => `${egress.type}: ${egress.count}`).join('\n');
- },
- policies: (policies) => {
- return policies.map((policy) => `${policy.type}: ${policy.count}`).join('\n');
- },
- modules: (modules) => {
- return modules.map((module) => `${module.type}: ${module.count}`).join('\n');
+ banner: (envKey, envType, versions) => {
+ const envDisplay = exports.Text.env.displayEnvironment(envKey, envType);
+ return `${log_symbols_1.default.info} Details of a total of [${versions} major versions] in [${envDisplay}] can be seen below:`;
}
}
}
},