claude-code-wakatime 3.1.0 → 3.1.1

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.
@@ -11,7 +11,7 @@
11
11
  "name": "claude-code-wakatime",
12
12
  "source": "./",
13
13
  "description": "WakaTime plugin for Claude Code - Track your AI usage, lines of code generated, and time spent prompting AI",
14
- "version": "3.1.0",
14
+ "version": "3.1.1",
15
15
  "homepage": "https://github.com/wakatime/claude-code-wakatime",
16
16
  "repository": "https://github.com/wakatime/claude-code-wakatime",
17
17
  "license": "BSD-3-Clause",
@@ -22,7 +22,10 @@
22
22
  "metrics"
23
23
  ],
24
24
  "category": "productivity",
25
- "tags": ["productivity", "metrics"]
25
+ "tags": [
26
+ "productivity",
27
+ "metrics"
28
+ ]
26
29
  }
27
30
  ]
28
- }
31
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "claude-code-wakatime",
3
3
  "description": "WakaTime plugin for Claude Code - Track your AI usage, lines of code generated, and time spent prompting AI",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "author": {
6
6
  "name": "WakaTime"
7
7
  },
@@ -14,4 +14,4 @@
14
14
  "productivity",
15
15
  "metrics"
16
16
  ]
17
- }
17
+ }
package/dist/index.js CHANGED
@@ -41134,7 +41134,7 @@ var Options = class {
41134
41134
  };
41135
41135
 
41136
41136
  // src/version.ts
41137
- var VERSION = "3.1.0";
41137
+ var VERSION = "3.1.1";
41138
41138
 
41139
41139
  // src/dependencies.ts
41140
41140
  var import_adm_zip = __toESM(require_adm_zip());
package/hooks/hooks.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
9
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
10
10
  }
11
11
  ]
12
12
  }
@@ -17,7 +17,7 @@
17
17
  "hooks": [
18
18
  {
19
19
  "type": "command",
20
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
20
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
21
21
  }
22
22
  ]
23
23
  }
@@ -28,7 +28,7 @@
28
28
  "hooks": [
29
29
  {
30
30
  "type": "command",
31
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
31
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
32
32
  }
33
33
  ]
34
34
  }
@@ -39,7 +39,7 @@
39
39
  "hooks": [
40
40
  {
41
41
  "type": "command",
42
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
42
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
43
43
  }
44
44
  ]
45
45
  }
@@ -50,7 +50,7 @@
50
50
  "hooks": [
51
51
  {
52
52
  "type": "command",
53
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
53
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
54
54
  }
55
55
  ]
56
56
  }
@@ -61,7 +61,7 @@
61
61
  "hooks": [
62
62
  {
63
63
  "type": "command",
64
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
64
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
65
65
  }
66
66
  ]
67
67
  }
@@ -72,10 +72,10 @@
72
72
  "hooks": [
73
73
  {
74
74
  "type": "command",
75
- "command": "node ${CLAUDE_PLUGIN_ROOT}/dist/index.js"
75
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/run"
76
76
  }
77
77
  ]
78
78
  }
79
79
  ]
80
80
  }
81
- }
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-wakatime",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "WakaTime plugin for Claude Code",
5
5
  "bin": {
6
6
  "claude-code-wakatime": "dist/index.js"
@@ -11,9 +11,9 @@
11
11
  "build:legacy": "esbuild src/install-hooks.ts --bundle --platform=node --outfile=dist/install-hooks.js",
12
12
  "build": "npm run build:legacy && esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
13
13
  "watch": "npm run prebuild && tsc --watch",
14
- "release:major": "npm version major && npm run build && npm publish && git push && git push --tags",
15
- "release:minor": "npm version minor && npm run build && npm publish && git push && git push --tags",
16
- "release:patch": "npm version patch && npm run build && npm publish && git push && git push --tags"
14
+ "release:major": "npm version major && npm run build && npm publish && git commit -am \"build release\" && git push && git push --tags",
15
+ "release:minor": "npm version minor && npm run build && npm publish && git commit -am \"build release\" && git push && git push --tags",
16
+ "release:patch": "npm version patch && npm run build && npm publish && git commit -am \"build release\" && git push && git push --tags"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
@@ -5,18 +5,30 @@ const path = require('path');
5
5
 
6
6
  const packagePath = path.join(__dirname, '..', 'package.json');
7
7
  const versionFilePath = path.join(__dirname, '..', 'src', 'version.ts');
8
+ const marketplaceFilePath = path.join(__dirname, '..', '.claude-plugin', 'marketplace.json');
9
+ const pluginFilePath = path.join(__dirname, '..', '.claude-plugin', 'plugin.json');
8
10
 
9
11
  try {
10
12
  const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
11
13
  const version = packageJson.version;
12
-
14
+
13
15
  const versionFileContent = `// This file is auto-generated during build. Do not edit manually.
14
16
  export const VERSION = '${version}';
15
17
  `;
16
-
18
+
17
19
  fs.writeFileSync(versionFilePath, versionFileContent);
18
20
  console.log(`Generated version.ts with version ${version}`);
21
+
22
+ const marketplace = JSON.parse(fs.readFileSync(marketplaceFilePath, 'utf8'));
23
+ marketplace.plugins[0].version = version;
24
+ fs.writeFileSync(marketplaceFilePath, JSON.stringify(marketplace, null, 2));
25
+ console.log(`Generated marketplace.json with version ${version}`);
26
+
27
+ const plugin = JSON.parse(fs.readFileSync(pluginFilePath, 'utf8'));
28
+ plugin.version = version;
29
+ fs.writeFileSync(pluginFilePath, JSON.stringify(plugin, null, 2));
30
+ console.log(`Generated plugin.json with version ${version}`);
19
31
  } catch (error) {
20
32
  console.error('Error generating version file:', error);
21
33
  process.exit(1);
22
- }
34
+ }
package/scripts/run ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ ROOT="${CLAUDE_PLUGIN_ROOT:-$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)}"
5
+
6
+ # If user provides an explicit node path, use it
7
+ if [ -n "${NODE_BIN:-}" ] && [ -x "${NODE_BIN}" ]; then
8
+ exec "${NODE_BIN}" "$ROOT/dist/index.js" "$@"
9
+ fi
10
+
11
+ # If node exists anyway, use it
12
+ if command -v node >/dev/null 2>&1; then
13
+ exec node "$ROOT/dist/index.js" "$@"
14
+ fi
15
+
16
+ # NixOS bootstrap: run node from nixpkgs (flakes)
17
+ if command -v nix >/dev/null 2>&1; then
18
+ exec nix run nixpkgs#nodejs -- node "$ROOT/dist/index.js" "$@"
19
+ fi
20
+
21
+ echo "Error: Node.js not found. On NixOS either:
22
+ - set NODE_BIN=/absolute/path/to/node, or
23
+ - ensure 'nix' is available and flakes are enabled." >&2
24
+ exit 127