ccgather 2.0.16 → 2.0.17

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/dist/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -243,7 +243,7 @@ async function printAnimatedHeader() {
243
243
  }
244
244
  console.log();
245
245
  }
246
- async function slotMachineRank(finalRank, label, medal, iterations = 12) {
246
+ async function slotMachineRank(finalRank, label, medal, iterations = 12, previousRank) {
247
247
  const maxRank = Math.max(finalRank * 3, 100);
248
248
  for (let i = 0; i < iterations; i++) {
249
249
  const fakeRank = Math.floor(Math.random() * maxRank) + 1;
@@ -253,8 +253,17 @@ async function slotMachineRank(finalRank, label, medal, iterations = 12) {
253
253
  );
254
254
  await sleep(speed);
255
255
  }
256
+ let changeText = "";
257
+ if (previousRank && previousRank !== finalRank) {
258
+ const change = previousRank - finalRank;
259
+ if (change > 0) {
260
+ changeText = ` ${colors.success(`\u2191${change}`)}`;
261
+ } else if (change < 0) {
262
+ changeText = ` ${colors.error(`\u2193${Math.abs(change)}`)}`;
263
+ }
264
+ }
256
265
  process.stdout.write(
257
- `\r ${medal} ${colors.muted(label)} ${colors.primary.bold(`#${finalRank}`)}
266
+ `\r ${medal} ${colors.muted(label)} ${colors.primary.bold(`#${finalRank}`)}${changeText}
258
267
  `
259
268
  );
260
269
  }
@@ -307,7 +316,7 @@ var init_ui = __esm({
307
316
  "use strict";
308
317
  import_chalk = __toESM(require("chalk"));
309
318
  import_string_width = __toESM(require("string-width"));
310
- VERSION = true ? "2.0.16" : "0.0.0";
319
+ VERSION = true ? "2.0.17" : "0.0.0";
311
320
  colors = {
312
321
  primary: import_chalk.default.hex("#DA7756"),
313
322
  // Claude coral
@@ -1455,13 +1464,15 @@ async function submit(options) {
1455
1464
  console.log();
1456
1465
  console.log(sectionHeader("\u{1F4CA}", "Your Ranking"));
1457
1466
  console.log();
1467
+ const prevGlobalRank = result.previous?.previousGlobalRank;
1468
+ const prevCountryRank = result.previous?.previousCountryRank;
1458
1469
  if (result.rank) {
1459
1470
  const medal = result.rank === 1 ? "\u{1F947}" : result.rank === 2 ? "\u{1F948}" : result.rank === 3 ? "\u{1F949}" : result.rank <= 10 ? "\u{1F3C5}" : "\u{1F30D}";
1460
- await slotMachineRank(result.rank, "Global:", medal);
1471
+ await slotMachineRank(result.rank, "Global:", medal, 12, prevGlobalRank);
1461
1472
  }
1462
1473
  if (result.countryRank) {
1463
1474
  const countryMedal = result.countryRank === 1 ? "\u{1F947}" : result.countryRank <= 3 ? "\u{1F3C6}" : "\u{1F3E0}";
1464
- await slotMachineRank(result.countryRank, "Country:", countryMedal, 10);
1475
+ await slotMachineRank(result.countryRank, "Country:", countryMedal, 10, prevCountryRank);
1465
1476
  }
1466
1477
  }
1467
1478
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgather",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "CLI tool for syncing Claude Code usage data to CCgather leaderboard",
5
5
  "bin": {
6
6
  "ccgather": "dist/index.js",