threadlines 0.1.9 → 0.1.11

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/dist/git/repo.js +6 -22
  2. package/package.json +1 -1
package/dist/git/repo.js CHANGED
@@ -7,38 +7,22 @@ exports.getRepoName = getRepoName;
7
7
  exports.getBranchName = getBranchName;
8
8
  const simple_git_1 = __importDefault(require("simple-git"));
9
9
  /**
10
- * Gets repository name from git remote URL.
11
- * Parses common formats: github.com/user/repo, gitlab.com/user/repo, etc.
12
- * Returns null if no remote or parsing fails.
10
+ * Gets the raw git remote URL from origin.
11
+ * Returns the URL exactly as Git provides it - no parsing or normalization.
12
+ * Server-side can normalize variations if needed based on actual data.
13
13
  */
14
14
  async function getRepoName(repoRoot) {
15
15
  const git = (0, simple_git_1.default)(repoRoot);
16
16
  try {
17
17
  const remotes = await git.getRemotes(true);
18
18
  const origin = remotes.find(r => r.name === 'origin');
19
- if (!origin?.refs?.fetch) {
19
+ if (!origin || !origin.refs?.fetch) {
20
20
  return null;
21
21
  }
22
- const url = origin.refs.fetch;
23
- // Parse repo name from common URL formats:
24
- // - https://github.com/user/repo.git
25
- // - git@github.com:user/repo.git
26
- // - https://gitlab.com/user/repo.git
27
- // - git@gitlab.com:user/repo.git
28
- const patterns = [
29
- /(?:github\.com|gitlab\.com)[\/:]([^\/]+\/[^\/]+?)(?:\.git)?$/,
30
- /([^\/]+\/[^\/]+?)(?:\.git)?$/
31
- ];
32
- for (const pattern of patterns) {
33
- const match = url.match(pattern);
34
- if (match && match[1]) {
35
- return match[1];
36
- }
37
- }
38
- return null;
22
+ // Return raw URL - let server handle normalization if needed
23
+ return origin.refs.fetch;
39
24
  }
40
25
  catch (error) {
41
- // If no remote or error, return null
42
26
  return null;
43
27
  }
44
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadlines",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Threadline CLI - AI-powered linter based on your natural language documentation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {