fabrica-e-commerce 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ui.js +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fabrica-e-commerce",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Orange themed CMD launcher for deploying Fabrica e-commerce stores with Supabase and Vercel.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/ui.js CHANGED
@@ -16,7 +16,17 @@ export function banner() {
16
16
  }
17
17
  export function section(title) { console.log('\n' + orange(`◆ ${title}`)); }
18
18
  export function kv(key, value) { console.log(`${dimOrange('>')} ${bold(key)} ${dimOrange('→')} ${value}`); }
19
- export function spinner(text) { process.stdout.write(dimOrange('> ') + text); return { succeed(msg) { process.stdout.write(`\r${orange('✓')} ${msg}\n`); }, fail(msg) { process.stdout.write(`\r${orange('✗')} ${msg}\n`); } }; }
19
+ // Clear the rest of the line (\x1b[K) before writing the final message so a
20
+ // shorter success/fail message never leaves leftover characters from the
21
+ // longer spinner text trailing after it (e.g. "✓ Git foundGit").
22
+ const CLEAR_LINE = '\x1b[K';
23
+ export function spinner(text) {
24
+ process.stdout.write(dimOrange('> ') + text);
25
+ return {
26
+ succeed(msg) { process.stdout.write(`\r${CLEAR_LINE}${orange('✓')} ${msg}\n`); },
27
+ fail(msg) { process.stdout.write(`\r${CLEAR_LINE}${orange('✗')} ${msg}\n`); }
28
+ };
29
+ }
20
30
  export function help() {
21
31
  banner();
22
32
  console.log(`