ai-heatmap 1.17.1 → 1.17.3

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/README.md CHANGED
@@ -207,6 +207,12 @@ To use the latest version of ai-heatmap:
207
207
  npx --yes ai-heatmap@latest update
208
208
  ```
209
209
 
210
+ > **Still running an old version?** npx caches packages locally. If the update command behaves unexpectedly after a release, clear the cache:
211
+ > ```bash
212
+ > npx clear-npx-cache
213
+ > npx --yes ai-heatmap@latest update
214
+ > ```
215
+
210
216
  ## Deployment
211
217
 
212
218
  ```bash
package/bin/cli.mjs CHANGED
@@ -136,7 +136,12 @@ switch (command) {
136
136
  for (const file of files) {
137
137
  // 현재 컴퓨터 파일은 generate에서 새로 생성하므로 건너뜀
138
138
  if (file.name === `data-${machineName}.json`) continue;
139
- const decoded = Buffer.from(file.content.replace(/\n/g, ""), "base64").toString("utf-8");
139
+ // 디렉토리 목록 API는 content 포함하지 않으므로 파일별로 개별 fetch
140
+ const content = execSync(
141
+ `gh api repos/${repo}/contents/${file.path} --jq .content`,
142
+ { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] },
143
+ ).trim();
144
+ const decoded = Buffer.from(content.replace(/\n/g, ""), "base64").toString("utf-8");
140
145
  writeFileSync(resolve(outDir, file.name), decoded);
141
146
  console.log(` Fetched ${file.name}`);
142
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-heatmap",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "description": "AI usage cost heatmap powered by ccusage + react-activity-calendar",
5
5
  "type": "module",
6
6
  "bin": {
@@ -74,7 +74,7 @@ if (!mergeOnly) {
74
74
  for (let i = 364; i >= 0; i--) {
75
75
  const d = new Date(today);
76
76
  d.setDate(d.getDate() - i);
77
- const date = d.toISOString().slice(0, 10);
77
+ const date = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
78
78
  const entry = dataMap.get(date);
79
79
  if (entry) {
80
80
  const cacheReadTokens = entry.cacheReadTokens ?? 0;