honeytree 1.0.4 → 1.0.5

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/package.json +1 -1
  2. package/src/init.js +17 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honeytree",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Grow a forest in your terminal every time you use Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -37,11 +37,26 @@ export async function init() {
37
37
  const honeydewDir = getHoneydewDir();
38
38
  fs.mkdirSync(honeydewDir, { recursive: true });
39
39
 
40
- if (!readForest()) {
40
+ const existing = readForest();
41
+ if (!existing) {
41
42
  writeForest(createEmptyForest());
42
43
  console.log(`Created ${path.join(honeydewDir, "forest.json")}`);
43
44
  } else {
44
- console.log(`Forest already exists at ${path.join(honeydewDir, "forest.json")}`);
45
+ let migrated = false;
46
+ if (existing.lastActiveDate === undefined) {
47
+ existing.lastActiveDate = new Date().toISOString().slice(0, 10);
48
+ migrated = true;
49
+ }
50
+ if (existing.streak === undefined) {
51
+ existing.streak = 0;
52
+ migrated = true;
53
+ }
54
+ if (migrated) {
55
+ writeForest(existing);
56
+ console.log(`Updated forest with streak tracking (${existing.trees.length} trees kept)`);
57
+ } else {
58
+ console.log(`Forest already up to date at ${path.join(honeydewDir, "forest.json")}`);
59
+ }
45
60
  }
46
61
 
47
62
  const settingsPath = getClaudeSettingsPath();