ccgather 1.3.58 → 1.3.59

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 +28 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -380,7 +380,7 @@ var init_ui = __esm({
380
380
  "use strict";
381
381
  import_chalk = __toESM(require("chalk"));
382
382
  import_string_width = __toESM(require("string-width"));
383
- VERSION = true ? "1.3.58" : "0.0.0";
383
+ VERSION = true ? "1.3.59" : "0.0.0";
384
384
  colors = {
385
385
  primary: import_chalk.default.hex("#DA7756"),
386
386
  // Claude coral
@@ -859,26 +859,50 @@ function encodePathLikeClaude(inputPath) {
859
859
  function getCurrentProjectDir() {
860
860
  const projectsDirs = getClaudeProjectsDirs();
861
861
  if (projectsDirs.length === 0) {
862
+ debugLog("No project directories found");
862
863
  return null;
863
864
  }
864
865
  const cwd = process.cwd();
866
+ const projectName = path2.basename(cwd);
865
867
  const encodedCwd = encodePathLikeClaude(cwd);
868
+ debugLog("Looking for project:", projectName);
869
+ debugLog("Encoded CWD:", encodedCwd);
866
870
  for (const projectsDir of projectsDirs) {
867
871
  try {
868
872
  const entries = fs2.readdirSync(projectsDir, { withFileTypes: true });
873
+ debugLog(`Scanning ${projectsDir}: ${entries.length} entries`);
869
874
  for (const entry of entries) {
870
875
  if (!entry.isDirectory()) continue;
871
- if (entry.name === encodedCwd) {
876
+ const folderName = entry.name;
877
+ const folderNameLower = folderName.toLowerCase();
878
+ const projectNameLower = projectName.toLowerCase();
879
+ const encodedCwdLower = encodedCwd.toLowerCase();
880
+ if (folderName === encodedCwd || folderNameLower === encodedCwdLower) {
881
+ debugLog("Match found (exact):", folderName);
872
882
  return path2.join(projectsDir, entry.name);
873
883
  }
874
- if (entry.name.toLowerCase() === encodedCwd.toLowerCase()) {
884
+ if (folderNameLower.includes(projectNameLower)) {
885
+ debugLog("Match found (contains project name):", folderName);
886
+ return path2.join(projectsDir, entry.name);
887
+ }
888
+ const projectNameHyphenated = projectNameLower.replace(/_/g, "-");
889
+ if (folderNameLower.includes(projectNameHyphenated)) {
890
+ debugLog("Match found (hyphenated project name):", folderName);
891
+ return path2.join(projectsDir, entry.name);
892
+ }
893
+ const projectNamePattern = projectNameLower.replace(/[^a-z0-9]/g, "");
894
+ const folderNamePattern = folderNameLower.replace(/[^a-z0-9]/g, "");
895
+ if (folderNamePattern.endsWith(projectNamePattern) && projectNamePattern.length > 3) {
896
+ debugLog("Match found (ends with pattern):", folderName);
875
897
  return path2.join(projectsDir, entry.name);
876
898
  }
877
899
  }
878
- } catch {
900
+ } catch (err) {
901
+ debugLog("Error scanning directory:", err);
879
902
  continue;
880
903
  }
881
904
  }
905
+ debugLog("No matching project directory found");
882
906
  return null;
883
907
  }
884
908
  function findJsonlFiles(dir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgather",
3
- "version": "1.3.58",
3
+ "version": "1.3.59",
4
4
  "description": "CLI tool for syncing Claude Code usage data to CCgather leaderboard",
5
5
  "bin": {
6
6
  "ccgather": "dist/index.js",