@cemalidev/trate 1.4.4 → 1.4.6

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 (3) hide show
  1. package/dist/index.js +18 -11
  2. package/package.json +1 -1
  3. package/src/index.ts +21 -11
package/dist/index.js CHANGED
@@ -1289,9 +1289,9 @@ ${colors.bold(t("help.usage") + ":")}
1289
1289
  ${colors.cyan("trate <currency>")} ${t("dashboard.usage")} (${colors.dim("trate btc")})
1290
1290
 
1291
1291
  ${colors.bold(t("help.examples") + ":")}
1292
- ${colors.dim("$")} ${colors.yellow("trate 100 usd")} 100 USD \u2192 ${config.baseCurrency}
1293
- ${colors.dim("$")} ${colors.yellow("trate btc")} BTC \u2192 ${config.baseCurrency}
1294
- ${colors.dim("$")} ${colors.yellow("trate ceyrek_altin")} \xC7eyrek Alt\u0131n \u2192 ${config.baseCurrency}
1292
+ ${colors.dim("$")} ${colors.yellow("trate 100 usd")} 100 USD \u2192 ${config.baseCurrency}
1293
+ ${colors.dim("$")} ${colors.yellow("trate btc")} BTC \u2192 ${config.baseCurrency}
1294
+ ${colors.dim("$")} ${colors.yellow("trate ceyrek_altin")} \xC7eyrek Alt\u0131n \u2192 ${config.baseCurrency}
1295
1295
 
1296
1296
  ${colors.bold(t("help.crypto") + ":")} ${colors.dim(crypto2)}
1297
1297
 
@@ -1304,8 +1304,8 @@ ${colors.bold(t("help.config") + ":")}
1304
1304
  ${colors.yellow("set-base")} | ${colors.yellow("list")} | ${colors.yellow("add")} | ${colors.yellow("remove")} | ${colors.yellow("set-lang")} | ${colors.yellow("alias")} | ${colors.yellow("help")}
1305
1305
 
1306
1306
  ${colors.bold(t("help.alias") + ":")}
1307
- ${colors.dim("$")} ${colors.cyan("trate alias add ceyrek CEYREK_ALTIN")} ${t("help.aliasCreate")}
1308
- ${colors.dim("$")} ${colors.cyan("trate alias list")} ${t("help.aliasView")}
1307
+ ${colors.dim("$")} ${colors.cyan("trate alias add ceyrek CEYREK_ALTIN")} ${t("help.aliasCreate")}
1308
+ ${colors.dim("$")} ${colors.cyan("trate alias list")} ${t("help.aliasView")}
1309
1309
 
1310
1310
  ${divider(STATUS_WIDTH)}
1311
1311
  ${statusLine}
@@ -1313,17 +1313,24 @@ ${statusLine}
1313
1313
  };
1314
1314
  var startScreen = () => {
1315
1315
  const config = configService.getAll();
1316
+ const examples = [
1317
+ { cmd: "trate 100 usd", desc: `100 USD \u2192 ${config.baseCurrency}` },
1318
+ { cmd: "trate btc", desc: `BTC \u2192 ${config.baseCurrency}` },
1319
+ { cmd: "trate ceyrek_altin", desc: "\xC7eyrek Alt\u0131n" },
1320
+ { cmd: "trate list", desc: "Favorites" },
1321
+ { cmd: "trate alias list", desc: "View aliases" },
1322
+ { cmd: "trate help", desc: "help" }
1323
+ ];
1324
+ const maxCmdLen = Math.max(...examples.map((e) => e.cmd.length));
1325
+ const lines = examples.map(
1326
+ (e) => `${colors.dim("$")} ${colors.cyan(e.cmd.padEnd(maxCmdLen + 1))}${colors.dim("\u2192")} ${e.desc}`
1327
+ ).join("\n");
1316
1328
  return `
1317
1329
  ${getLogo()}
1318
1330
 
1319
1331
  ${colors.dim(t("app.tagline"))}
1320
1332
 
1321
- ${colors.dim("$")} ${colors.cyan("trate 100 usd")} 100 USD \u2192 ${config.baseCurrency}
1322
- ${colors.dim("$")} ${colors.cyan("trate btc")} BTC \u2192 ${config.baseCurrency}
1323
- ${colors.dim("$")} ${colors.cyan("trate ceyrek_altin")} \xC7eyrek Alt\u0131n
1324
- ${colors.dim("$")} ${colors.cyan("trate list")} ${t("dashboard.favorites")}
1325
- ${colors.dim("$")} ${colors.cyan("trate alias list")} View aliases
1326
- ${colors.dim("$")} ${colors.cyan("trate help")} ${t("commands.help")}
1333
+ ${lines}
1327
1334
  `;
1328
1335
  };
1329
1336
  var validateCurrency = (symbol) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cemalidev/trate",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "type": "module",
5
5
  "description": "Terminal-based currency tracker - convert fiat, crypto, and precious metals instantly",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -51,9 +51,9 @@ ${colors.bold(t('help.usage') + ':')}
51
51
  ${colors.cyan('trate <currency>')} ${t('dashboard.usage')} (${colors.dim('trate btc')})
52
52
 
53
53
  ${colors.bold(t('help.examples') + ':')}
54
- ${colors.dim('$')} ${colors.yellow('trate 100 usd')} 100 USD → ${config.baseCurrency}
55
- ${colors.dim('$')} ${colors.yellow('trate btc')} BTC → ${config.baseCurrency}
56
- ${colors.dim('$')} ${colors.yellow('trate ceyrek_altin')} Çeyrek Altın → ${config.baseCurrency}
54
+ ${colors.dim('$')} ${colors.yellow('trate 100 usd')} 100 USD → ${config.baseCurrency}
55
+ ${colors.dim('$')} ${colors.yellow('trate btc')} BTC → ${config.baseCurrency}
56
+ ${colors.dim('$')} ${colors.yellow('trate ceyrek_altin')} Çeyrek Altın → ${config.baseCurrency}
57
57
 
58
58
  ${colors.bold(t('help.crypto') + ':')} ${colors.dim(crypto)}
59
59
 
@@ -66,8 +66,8 @@ ${colors.bold(t('help.config') + ':')}
66
66
  ${colors.yellow('set-base')} | ${colors.yellow('list')} | ${colors.yellow('add')} | ${colors.yellow('remove')} | ${colors.yellow('set-lang')} | ${colors.yellow('alias')} | ${colors.yellow('help')}
67
67
 
68
68
  ${colors.bold(t('help.alias') + ':')}
69
- ${colors.dim('$')} ${colors.cyan('trate alias add ceyrek CEYREK_ALTIN')} ${t('help.aliasCreate')}
70
- ${colors.dim('$')} ${colors.cyan('trate alias list')} ${t('help.aliasView')}
69
+ ${colors.dim('$')} ${colors.cyan('trate alias add ceyrek CEYREK_ALTIN')} ${t('help.aliasCreate')}
70
+ ${colors.dim('$')} ${colors.cyan('trate alias list')} ${t('help.aliasView')}
71
71
 
72
72
  ${divider(STATUS_WIDTH)}
73
73
  ${statusLine}
@@ -76,17 +76,27 @@ ${statusLine}
76
76
 
77
77
  const startScreen = () => {
78
78
  const config = configService.getAll();
79
+ const examples = [
80
+ { cmd: 'trate 100 usd', desc: `100 USD → ${config.baseCurrency}` },
81
+ { cmd: 'trate btc', desc: `BTC → ${config.baseCurrency}` },
82
+ { cmd: 'trate ceyrek_altin', desc: 'Çeyrek Altın' },
83
+ { cmd: 'trate list', desc: 'Favorites' },
84
+ { cmd: 'trate alias list', desc: 'View aliases' },
85
+ { cmd: 'trate help', desc: 'help' },
86
+ ];
87
+ const maxCmdLen = Math.max(...examples.map(e => e.cmd.length));
88
+ const lines = examples
89
+ .map(
90
+ e =>
91
+ `${colors.dim('$')} ${colors.cyan(e.cmd.padEnd(maxCmdLen + 1))}${colors.dim('→')} ${e.desc}`
92
+ )
93
+ .join('\n');
79
94
  return `
80
95
  ${getLogo()}
81
96
 
82
97
  ${colors.dim(t('app.tagline'))}
83
98
 
84
- ${colors.dim('$')} ${colors.cyan('trate 100 usd')} 100 USD → ${config.baseCurrency}
85
- ${colors.dim('$')} ${colors.cyan('trate btc')} BTC → ${config.baseCurrency}
86
- ${colors.dim('$')} ${colors.cyan('trate ceyrek_altin')} Çeyrek Altın
87
- ${colors.dim('$')} ${colors.cyan('trate list')} ${t('dashboard.favorites')}
88
- ${colors.dim('$')} ${colors.cyan('trate alias list')} View aliases
89
- ${colors.dim('$')} ${colors.cyan('trate help')} ${t('commands.help')}
99
+ ${lines}
90
100
  `;
91
101
  };
92
102