@wpmoo/toolkit 0.9.0 → 0.9.2

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 CHANGED
@@ -25,7 +25,7 @@ import { checkGitHubRepositories, createGitHubRepositories, manualCreateCommands
25
25
  import { scaffold } from './scaffold.js';
26
26
  import { confirmPrompt, introPrompt, isPromptCancel, notePrompt, outroPrompt, selectPrompt, textPrompt } from './prompts/index.js';
27
27
  import { renderBanner } from './templates.js';
28
- import { checkForUpdate, installLatestPackage, isUpdateCheckSkipped, restartCli } from './update-check.js';
28
+ import { checkForUpdate, isUpdateCheckSkipped, restartCli } from './update-check.js';
29
29
  import { packageName, packageVersion, renderVersion, renderVersionTag } from './version.js';
30
30
  import { environmentStatusJson, getEnvironmentStatus, renderEnvironmentStatusForTarget, renderEnvironmentStatusSummary, } from './status.js';
31
31
  import { getGitHubAccounts, getGitHubRepositoryStatus, githubRepositoryUrl, realGitHub, createGitHubRepository, } from './github.js';
@@ -202,7 +202,6 @@ async function showStartup(argv, skipUpdateCheck, details) {
202
202
  handleCancel(shouldUpdate, 'exit');
203
203
  if (shouldUpdate) {
204
204
  try {
205
- await installLatestPackage(packageName(), updateCheck.latestVersion);
206
205
  const code = await restartCli(packageName(), updateCheck.latestVersion, argv);
207
206
  if (code === 0) {
208
207
  process.exit(0);
@@ -881,6 +880,7 @@ export async function runCli(cliArgv = process.argv.slice(2), cwd = process.cwd(
881
880
  const status = await getEnvironmentStatus(cwd);
882
881
  clearCockpitScreen();
883
882
  console.log(renderBanner(renderCockpitStatusLines(status, lastStatus), { version: startupVersionLine() }));
883
+ console.log();
884
884
  }
885
885
  catch (error) {
886
886
  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 BANNER_DIVIDER_WIDTH = 40;
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
- renderDimInfo('Development, staging, and production workflows for Odoo projects.'),
311
- applyBannerGradient(''.repeat(BANNER_DIVIDER_WIDTH)),
325
+ renderTaglineInfo(BANNER_TAGLINE),
326
+ applyBannerGradient(''.repeat(BANNER_TAGLINE.length)),
312
327
  ].join('\n');
313
- const detailsBlock = details.length > 0 ? `\n${details.map((line) => renderDimInfo(line)).join('\n')}` : '';
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() {
@@ -85,9 +85,6 @@ export async function checkForUpdate(packageName, currentVersion, runner = realN
85
85
  export function packageSpec(packageName, version) {
86
86
  return `${packageName}@${version}`;
87
87
  }
88
- export async function installLatestPackage(packageName, version, runner = realNpm) {
89
- await runner.run(['install', '-g', packageSpec(packageName, version)]);
90
- }
91
88
  export function restartArgs(packageName, version, argv) {
92
89
  return ['exec', '--yes', '--package', packageSpec(packageName, version), '--', 'wpmoo', ...argv];
93
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpmoo/toolkit",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "WPMoo Toolkit for development, staging, and production lifecycle workflows.",
5
5
  "type": "module",
6
6
  "repository": {