@wpmoo/toolkit 0.9.0 → 0.9.1
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/dist/cli.js +1 -0
- package/dist/templates.js +19 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -881,6 +881,7 @@ export async function runCli(cliArgv = process.argv.slice(2), cwd = process.cwd(
|
|
|
881
881
|
const status = await getEnvironmentStatus(cwd);
|
|
882
882
|
clearCockpitScreen();
|
|
883
883
|
console.log(renderBanner(renderCockpitStatusLines(status, lastStatus), { version: startupVersionLine() }));
|
|
884
|
+
console.log();
|
|
884
885
|
}
|
|
885
886
|
catch (error) {
|
|
886
887
|
if (isMenuBackSignal(error)) {
|
package/dist/templates.js
CHANGED
|
@@ -277,8 +277,10 @@ const BANNER_GRADIENT_END = [209, 95, 127];
|
|
|
277
277
|
const ANSI_BOLD = '\u001B[1m';
|
|
278
278
|
const ANSI_DIM = '\u001B[2m';
|
|
279
279
|
const ANSI_INFO = '\u001B[38;2;139;166;190m';
|
|
280
|
+
const ANSI_TAGLINE = '\u001B[38;2;120;157;181m';
|
|
281
|
+
const ANSI_META = '\u001B[38;2;218;236;246m';
|
|
280
282
|
const ANSI_RESET = '\u001B[0m';
|
|
281
|
-
const
|
|
283
|
+
const BANNER_TAGLINE = 'Development, staging and production workflows for Odoo projects.';
|
|
282
284
|
function gradientColor(column, width) {
|
|
283
285
|
const ratio = width <= 1 ? 0 : column / (width - 1);
|
|
284
286
|
const [startR, startG, startB] = BANNER_GRADIENT_START;
|
|
@@ -302,15 +304,28 @@ function applyBannerGradient(banner) {
|
|
|
302
304
|
function renderDimInfo(value) {
|
|
303
305
|
return `${ANSI_DIM}${ANSI_INFO}${value}${ANSI_RESET}`;
|
|
304
306
|
}
|
|
307
|
+
function renderMetaInfo(value) {
|
|
308
|
+
return `${ANSI_META}${value}${ANSI_RESET}`;
|
|
309
|
+
}
|
|
310
|
+
function renderTaglineInfo(value) {
|
|
311
|
+
return `${ANSI_TAGLINE}${value}${ANSI_RESET}`;
|
|
312
|
+
}
|
|
313
|
+
function renderBannerDetail(value) {
|
|
314
|
+
const match = /^(Environment|Last):(.*)$/u.exec(value);
|
|
315
|
+
if (!match) {
|
|
316
|
+
return renderDimInfo(value);
|
|
317
|
+
}
|
|
318
|
+
return `${renderMetaInfo(`${match[1]}:`)}${renderDimInfo(match[2] ?? '')}`;
|
|
319
|
+
}
|
|
305
320
|
export function renderBanner(details = [], options = {}) {
|
|
306
321
|
const title = `${applyBannerGradient('WPMoo Toolkit')}${options.version ? ` ${renderDimInfo(options.version)}` : ''}`;
|
|
307
322
|
const header = [
|
|
308
323
|
title,
|
|
309
324
|
applyBannerGradient('Workflow Platform · Micro Object Oriented'),
|
|
310
|
-
|
|
311
|
-
applyBannerGradient('
|
|
325
|
+
renderTaglineInfo(BANNER_TAGLINE),
|
|
326
|
+
applyBannerGradient('━'.repeat(BANNER_TAGLINE.length)),
|
|
312
327
|
].join('\n');
|
|
313
|
-
const detailsBlock = details.length > 0 ? `\n${details.map((line) =>
|
|
328
|
+
const detailsBlock = details.length > 0 ? `\n${details.map((line) => renderBannerDetail(line)).join('\n')}` : '';
|
|
314
329
|
return `\n${ANSI_BOLD}${header}${ANSI_RESET}${detailsBlock}`;
|
|
315
330
|
}
|
|
316
331
|
export function renderGitignore() {
|