ccclub 0.2.7 → 0.2.9
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/index.js +5 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -326,7 +326,7 @@ function aggregateToBlocks(entries, humanTurns = []) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// src/commands/sync.ts
|
|
329
|
-
var SYNC_FORMAT_VERSION = "
|
|
329
|
+
var SYNC_FORMAT_VERSION = "4";
|
|
330
330
|
function getSyncVersionPath() {
|
|
331
331
|
return join4(homedir4(), CCCLUB_CONFIG_DIR, "sync-version");
|
|
332
332
|
}
|
|
@@ -565,7 +565,9 @@ import Table from "cli-table3";
|
|
|
565
565
|
import ora4 from "ora";
|
|
566
566
|
async function rankCommand(options) {
|
|
567
567
|
const config = await requireConfig();
|
|
568
|
-
|
|
568
|
+
if (needsFullSync()) {
|
|
569
|
+
await doSync(true, true);
|
|
570
|
+
}
|
|
569
571
|
const isGlobal = options.global === true;
|
|
570
572
|
const period = options.period || "daily";
|
|
571
573
|
let codes;
|
|
@@ -789,31 +791,9 @@ async function hookCommand() {
|
|
|
789
791
|
}
|
|
790
792
|
}
|
|
791
793
|
|
|
792
|
-
// src/global-install.ts
|
|
793
|
-
import { exec } from "child_process";
|
|
794
|
-
import chalk9 from "chalk";
|
|
795
|
-
function run(cmd) {
|
|
796
|
-
return new Promise((resolve) => {
|
|
797
|
-
exec(cmd, (err, stdout4) => resolve(err ? "" : stdout4.trim()));
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
async function ensureGlobalInstall() {
|
|
801
|
-
const globalList = await run("npm list -g ccclub --depth=0");
|
|
802
|
-
if (globalList.includes("ccclub@")) return;
|
|
803
|
-
console.log(chalk9.dim("\n Installing ccclub globally so you can run it directly..."));
|
|
804
|
-
const result = await run("npm install -g ccclub");
|
|
805
|
-
if (result) {
|
|
806
|
-
console.log(chalk9.green(" Done!") + chalk9.dim(" You can now use ") + chalk9.white("ccclub") + chalk9.dim(" directly."));
|
|
807
|
-
} else {
|
|
808
|
-
console.log(chalk9.dim(" Could not auto-install. Run manually:"));
|
|
809
|
-
console.log(chalk9.white(" npm install -g ccclub"));
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
794
|
// src/index.ts
|
|
814
795
|
var program = new Command();
|
|
815
|
-
program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.2.
|
|
816
|
-
program.hook("postAction", () => ensureGlobalInstall());
|
|
796
|
+
program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.2.9");
|
|
817
797
|
program.command("init").description("Initialize CCClub (one-time setup)").action(initCommand);
|
|
818
798
|
program.command("join").description("Join a friend's group").argument("<invite-code>", "6-character invite code").action(joinCommand);
|
|
819
799
|
program.command("sync").description("Sync local usage data to server").option("-s, --silent", "No output (used by auto-sync hook)").option("-f, --full", "Force full re-sync of all data").action(syncCommand);
|