issy 0.1.7 → 0.1.8

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 (3) hide show
  1. package/bin/issy +27 -2
  2. package/dist/cli.js +20 -0
  3. package/package.json +3 -3
package/bin/issy CHANGED
@@ -35,11 +35,30 @@ function findIssuesDirUpward(fromPath) {
35
35
  return null;
36
36
  }
37
37
 
38
+ /**
39
+ * Find the git repository root by walking up from the given path.
40
+ * Returns the directory containing .git, or null if not in a git repo.
41
+ */
42
+ function findGitRoot(fromPath) {
43
+ let current = resolve(fromPath);
44
+ for (let i = 0; i < 20; i++) {
45
+ const gitDir = join(current, ".git");
46
+ if (existsSync(gitDir)) {
47
+ return current;
48
+ }
49
+ const parent = dirname(current);
50
+ if (parent === current) break;
51
+ current = parent;
52
+ }
53
+ return null;
54
+ }
55
+
38
56
  /**
39
57
  * Resolve the issues directory using priority:
40
58
  * 1. ISSUES_DIR env var (explicit override)
41
59
  * 2. Walk up from ISSUES_ROOT or cwd to find existing .issues
42
- * 3. Fall back to creating .issues in ISSUES_ROOT or cwd
60
+ * 3. If in a git repo, use .issues at the repo root
61
+ * 4. Fall back to creating .issues in ISSUES_ROOT or cwd
43
62
  */
44
63
  function resolveIssuesDir() {
45
64
  // 1. Explicit override
@@ -54,7 +73,13 @@ function resolveIssuesDir() {
54
73
  return found;
55
74
  }
56
75
 
57
- // 3. Fall back to creating in start directory
76
+ // 3. If in a git repo, use .issues at the repo root
77
+ const gitRoot = findGitRoot(startDir);
78
+ if (gitRoot) {
79
+ return join(gitRoot, ".issues");
80
+ }
81
+
82
+ // 4. Fall back to creating in start directory
58
83
  return join(resolve(startDir), ".issues");
59
84
  }
60
85
 
package/dist/cli.js CHANGED
@@ -34,6 +34,20 @@ function findIssuesDirUpward(fromPath) {
34
34
  }
35
35
  return null;
36
36
  }
37
+ function findGitRoot(fromPath) {
38
+ let current = resolve(fromPath);
39
+ for (let i = 0;i < 20; i++) {
40
+ const gitDir = join(current, ".git");
41
+ if (existsSync(gitDir)) {
42
+ return current;
43
+ }
44
+ const parent = dirname(current);
45
+ if (parent === current)
46
+ break;
47
+ current = parent;
48
+ }
49
+ return null;
50
+ }
37
51
  function resolveIssuesDir() {
38
52
  if (process.env.ISSUES_DIR) {
39
53
  const dir = resolve(process.env.ISSUES_DIR);
@@ -46,6 +60,12 @@ function resolveIssuesDir() {
46
60
  setIssuesDir(found);
47
61
  return found;
48
62
  }
63
+ const gitRoot = findGitRoot(startDir);
64
+ if (gitRoot) {
65
+ const gitIssuesDir = join(gitRoot, ".issues");
66
+ setIssuesDir(gitIssuesDir);
67
+ return gitIssuesDir;
68
+ }
49
69
  const fallback = join(resolve(startDir), ".issues");
50
70
  setIssuesDir(fallback);
51
71
  return fallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "issy",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "AI-native issue tracking. Markdown files in .issues/, managed by your coding assistant.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "lint": "biome check src bin"
35
35
  },
36
36
  "dependencies": {
37
- "@miketromba/issy-app": "^0.1.7",
38
- "@miketromba/issy-core": "^0.1.7"
37
+ "@miketromba/issy-app": "^0.1.8",
38
+ "@miketromba/issy-core": "^0.1.8"
39
39
  }
40
40
  }