aicp-tracker 1.1.8 → 1.2.0

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/bin/setup.js CHANGED
@@ -10,11 +10,15 @@ const path = require('path');
10
10
  const isPostinstall = process.env.npm_lifecycle_event === 'postinstall';
11
11
  if (isPostinstall) {
12
12
  // Always record which project this package was installed into.
13
- // process.cwd() during postinstall is the project root the only reliable moment we know it.
13
+ // INIT_CWD = the directory where `npm install` was run (the project root).
14
+ // process.cwd() in postinstall is the package's own directory — do NOT use it.
14
15
  try {
15
- const config = require('../src/config');
16
- const existing = config.load() || {};
17
- config.save({ ...existing, projectPath: process.cwd() });
16
+ const projectPath = process.env.INIT_CWD;
17
+ if (projectPath) {
18
+ const config = require('../src/config');
19
+ const existing = config.load() || {};
20
+ config.save({ ...existing, projectPath });
21
+ }
18
22
  } catch {}
19
23
 
20
24
  let existing = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicp-tracker",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "AI Code Pulse — Claude Code usage tracker for JIRA cost attribution",
5
5
  "main": "src/daemon.js",
6
6
  "bin": {
@@ -17,9 +17,10 @@ function pathToProjectFolder(p) {
17
17
  return p
18
18
  .replace(/\\/g, '/')
19
19
  .replace(/^([A-Za-z]):\//, (_, d) => d.toLowerCase() + '--')
20
- .replace(/\//g, '-');
20
+ .replace(/\//g, '-')
21
+ .replace(/_/g, '-');
21
22
  }
22
- return p.replace(/\//g, '-');
23
+ return p.replace(/\//g, '-').replace(/_/g, '-');
23
24
  }
24
25
 
25
26
  function findJsonlFiles(projectPath) {