@hyperfrontend/versioning 0.1.0 → 0.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/ARCHITECTURE.md +50 -1
- package/CHANGELOG.md +23 -23
- package/README.md +12 -9
- package/changelog/index.cjs.js +23 -2
- package/changelog/index.cjs.js.map +1 -1
- package/changelog/index.esm.js +23 -2
- package/changelog/index.esm.js.map +1 -1
- package/changelog/models/entry.d.ts +5 -0
- package/changelog/models/entry.d.ts.map +1 -1
- package/changelog/models/index.cjs.js +2 -0
- package/changelog/models/index.cjs.js.map +1 -1
- package/changelog/models/index.esm.js +2 -0
- package/changelog/models/index.esm.js.map +1 -1
- package/changelog/operations/index.cjs.js.map +1 -1
- package/changelog/operations/index.esm.js.map +1 -1
- package/changelog/parse/index.cjs.js +23 -2
- package/changelog/parse/index.cjs.js.map +1 -1
- package/changelog/parse/index.esm.js +23 -2
- package/changelog/parse/index.esm.js.map +1 -1
- package/changelog/parse/line.d.ts.map +1 -1
- package/commits/classify/classifier.d.ts +73 -0
- package/commits/classify/classifier.d.ts.map +1 -0
- package/commits/classify/index.cjs.js +705 -0
- package/commits/classify/index.cjs.js.map +1 -0
- package/commits/classify/index.d.ts +8 -0
- package/commits/classify/index.d.ts.map +1 -0
- package/commits/classify/index.esm.js +678 -0
- package/commits/classify/index.esm.js.map +1 -0
- package/commits/classify/infrastructure.d.ts +205 -0
- package/commits/classify/infrastructure.d.ts.map +1 -0
- package/commits/classify/models.d.ts +108 -0
- package/commits/classify/models.d.ts.map +1 -0
- package/commits/classify/project-scopes.d.ts +59 -0
- package/commits/classify/project-scopes.d.ts.map +1 -0
- package/commits/index.cjs.js +702 -0
- package/commits/index.cjs.js.map +1 -1
- package/commits/index.d.ts +1 -0
- package/commits/index.d.ts.map +1 -1
- package/commits/index.esm.js +677 -1
- package/commits/index.esm.js.map +1 -1
- package/flow/executor/execute.d.ts +6 -0
- package/flow/executor/execute.d.ts.map +1 -1
- package/flow/executor/index.cjs.js +1604 -42
- package/flow/executor/index.cjs.js.map +1 -1
- package/flow/executor/index.esm.js +1610 -48
- package/flow/executor/index.esm.js.map +1 -1
- package/flow/index.cjs.js +6651 -2893
- package/flow/index.cjs.js.map +1 -1
- package/flow/index.esm.js +6655 -2899
- package/flow/index.esm.js.map +1 -1
- package/flow/models/index.cjs.js +125 -0
- package/flow/models/index.cjs.js.map +1 -1
- package/flow/models/index.esm.js +125 -0
- package/flow/models/index.esm.js.map +1 -1
- package/flow/models/types.d.ts +148 -3
- package/flow/models/types.d.ts.map +1 -1
- package/flow/presets/conventional.d.ts +9 -8
- package/flow/presets/conventional.d.ts.map +1 -1
- package/flow/presets/independent.d.ts.map +1 -1
- package/flow/presets/index.cjs.js +3588 -298
- package/flow/presets/index.cjs.js.map +1 -1
- package/flow/presets/index.esm.js +3588 -298
- package/flow/presets/index.esm.js.map +1 -1
- package/flow/presets/synced.d.ts.map +1 -1
- package/flow/steps/analyze-commits.d.ts +9 -6
- package/flow/steps/analyze-commits.d.ts.map +1 -1
- package/flow/steps/calculate-bump.d.ts.map +1 -1
- package/flow/steps/fetch-registry.d.ts.map +1 -1
- package/flow/steps/generate-changelog.d.ts.map +1 -1
- package/flow/steps/index.cjs.js +3604 -318
- package/flow/steps/index.cjs.js.map +1 -1
- package/flow/steps/index.d.ts +1 -0
- package/flow/steps/index.d.ts.map +1 -1
- package/flow/steps/index.esm.js +3603 -319
- package/flow/steps/index.esm.js.map +1 -1
- package/flow/steps/resolve-repository.d.ts +36 -0
- package/flow/steps/resolve-repository.d.ts.map +1 -0
- package/flow/steps/update-packages.d.ts.map +1 -1
- package/git/factory.d.ts +14 -0
- package/git/factory.d.ts.map +1 -1
- package/git/index.cjs.js +65 -0
- package/git/index.cjs.js.map +1 -1
- package/git/index.esm.js +66 -2
- package/git/index.esm.js.map +1 -1
- package/git/operations/index.cjs.js +40 -0
- package/git/operations/index.cjs.js.map +1 -1
- package/git/operations/index.d.ts +1 -1
- package/git/operations/index.d.ts.map +1 -1
- package/git/operations/index.esm.js +41 -2
- package/git/operations/index.esm.js.map +1 -1
- package/git/operations/log.d.ts +23 -0
- package/git/operations/log.d.ts.map +1 -1
- package/index.cjs.js +6962 -4413
- package/index.cjs.js.map +1 -1
- package/index.esm.js +6964 -4415
- package/index.esm.js.map +1 -1
- package/package.json +26 -1
- package/registry/index.cjs.js +3 -3
- package/registry/index.cjs.js.map +1 -1
- package/registry/index.esm.js +3 -3
- package/registry/index.esm.js.map +1 -1
- package/registry/models/index.cjs.js +2 -0
- package/registry/models/index.cjs.js.map +1 -1
- package/registry/models/index.esm.js +2 -0
- package/registry/models/index.esm.js.map +1 -1
- package/registry/models/version-info.d.ts +10 -0
- package/registry/models/version-info.d.ts.map +1 -1
- package/registry/npm/client.d.ts.map +1 -1
- package/registry/npm/index.cjs.js +1 -3
- package/registry/npm/index.cjs.js.map +1 -1
- package/registry/npm/index.esm.js +1 -3
- package/registry/npm/index.esm.js.map +1 -1
- package/repository/index.cjs.js +998 -0
- package/repository/index.cjs.js.map +1 -0
- package/repository/index.d.ts +4 -0
- package/repository/index.d.ts.map +1 -0
- package/repository/index.esm.js +981 -0
- package/repository/index.esm.js.map +1 -0
- package/repository/models/index.cjs.js +301 -0
- package/repository/models/index.cjs.js.map +1 -0
- package/repository/models/index.d.ts +7 -0
- package/repository/models/index.d.ts.map +1 -0
- package/repository/models/index.esm.js +290 -0
- package/repository/models/index.esm.js.map +1 -0
- package/repository/models/platform.d.ts +58 -0
- package/repository/models/platform.d.ts.map +1 -0
- package/repository/models/repository-config.d.ts +132 -0
- package/repository/models/repository-config.d.ts.map +1 -0
- package/repository/models/resolution.d.ts +121 -0
- package/repository/models/resolution.d.ts.map +1 -0
- package/repository/parse/index.cjs.js +755 -0
- package/repository/parse/index.cjs.js.map +1 -0
- package/repository/parse/index.d.ts +5 -0
- package/repository/parse/index.d.ts.map +1 -0
- package/repository/parse/index.esm.js +749 -0
- package/repository/parse/index.esm.js.map +1 -0
- package/repository/parse/package-json.d.ts +100 -0
- package/repository/parse/package-json.d.ts.map +1 -0
- package/repository/parse/url.d.ts +81 -0
- package/repository/parse/url.d.ts.map +1 -0
- package/repository/url/compare.d.ts +84 -0
- package/repository/url/compare.d.ts.map +1 -0
- package/repository/url/index.cjs.js +178 -0
- package/repository/url/index.cjs.js.map +1 -0
- package/repository/url/index.d.ts +3 -0
- package/repository/url/index.d.ts.map +1 -0
- package/repository/url/index.esm.js +176 -0
- package/repository/url/index.esm.js.map +1 -0
- package/workspace/discovery/index.cjs.js +324 -330
- package/workspace/discovery/index.cjs.js.map +1 -1
- package/workspace/discovery/index.esm.js +324 -330
- package/workspace/discovery/index.esm.js.map +1 -1
- package/workspace/discovery/packages.d.ts +0 -6
- package/workspace/discovery/packages.d.ts.map +1 -1
- package/workspace/index.cjs.js +0 -6
- package/workspace/index.cjs.js.map +1 -1
- package/workspace/index.esm.js +0 -6
- package/workspace/index.esm.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/math/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/url/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../../../libs/versioning/src/repository/models/platform.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../../../libs/versioning/src/repository/models/repository-config.ts","../../../../../../../../../../libs/versioning/src/repository/parse/url.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/json/index.ts","../../../../../../../../../../libs/versioning/src/repository/parse/package-json.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":"AAAA;;;;;;;AAOG;AAEH;AACA,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI;AA0F7B;;AAEG;AACI,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG;;ACvG5B;;;;;;;;AAQG;AA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IAAI,CAAC,kBAAkB,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE;AACjE,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,WAAqC;AACzC,IAAA,IAAI;AACF,QAAA,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC;IACzC;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW;IAElC,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;;AAElC,QAAA,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC/D,YAAA,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC;AAC7C,YAAA,OAAO,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI;QACxE;;AAEA,QAAA,MAAM,MAAM,GAAG,qBAAqB,CAAC,UAAU,CAAC;QAChD,OAAO,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI;IACvC;;IAGA,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,EAAE;QACpD,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC;AACjD,QAAA,OAAO,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI;IACxE;AAEA,IAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { RepositoryConfig } from '../models/repository-config';
|
|
2
|
+
/**
|
|
3
|
+
* Repository field formats from package.json.
|
|
4
|
+
*
|
|
5
|
+
* Package.json supports multiple formats for the repository field:
|
|
6
|
+
* - Shorthand: `"github:owner/repo"`
|
|
7
|
+
* - URL string: `"https://github.com/owner/repo"`
|
|
8
|
+
* - Object: `{ "type": "git", "url": "..." }`
|
|
9
|
+
*/
|
|
10
|
+
export interface PackageJsonRepository {
|
|
11
|
+
/**
|
|
12
|
+
* Repository type (typically "git").
|
|
13
|
+
*/
|
|
14
|
+
readonly type?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Repository URL.
|
|
17
|
+
*/
|
|
18
|
+
readonly url: string;
|
|
19
|
+
/**
|
|
20
|
+
* Directory within the repository (for monorepos).
|
|
21
|
+
*/
|
|
22
|
+
readonly directory?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Minimal package.json structure for repository inference.
|
|
26
|
+
*/
|
|
27
|
+
export interface PackageJsonForRepository {
|
|
28
|
+
/**
|
|
29
|
+
* Repository field - can be a string or object.
|
|
30
|
+
*/
|
|
31
|
+
readonly repository?: string | PackageJsonRepository;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Infers repository configuration from package.json content.
|
|
35
|
+
*
|
|
36
|
+
* Handles multiple formats:
|
|
37
|
+
* - Shorthand: `"github:owner/repo"`, `"gitlab:group/project"`, `"bitbucket:team/repo"`
|
|
38
|
+
* - Bare shorthand: `"owner/repo"` (defaults to GitHub)
|
|
39
|
+
* - URL string: `"https://github.com/owner/repo"`
|
|
40
|
+
* - Object with URL: `{ "type": "git", "url": "https://..." }`
|
|
41
|
+
*
|
|
42
|
+
* @param packageJsonContent - Raw JSON string content of package.json
|
|
43
|
+
* @returns RepositoryConfig or null if repository cannot be inferred
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Shorthand format
|
|
48
|
+
* inferRepositoryFromPackageJson('{"repository": "github:owner/repo"}')
|
|
49
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
50
|
+
*
|
|
51
|
+
* // URL string
|
|
52
|
+
* inferRepositoryFromPackageJson('{"repository": "https://github.com/owner/repo"}')
|
|
53
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
54
|
+
*
|
|
55
|
+
* // Object format
|
|
56
|
+
* inferRepositoryFromPackageJson('{"repository": {"type": "git", "url": "https://github.com/owner/repo"}}')
|
|
57
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
58
|
+
*
|
|
59
|
+
* // Bare shorthand (defaults to GitHub)
|
|
60
|
+
* inferRepositoryFromPackageJson('{"repository": "owner/repo"}')
|
|
61
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function inferRepositoryFromPackageJson(packageJsonContent: string): RepositoryConfig | null;
|
|
65
|
+
/**
|
|
66
|
+
* Infers repository configuration from a parsed package.json object.
|
|
67
|
+
*
|
|
68
|
+
* This is useful when you already have the parsed object.
|
|
69
|
+
*
|
|
70
|
+
* @param packageJson - Parsed package.json object
|
|
71
|
+
* @returns RepositoryConfig or null if repository cannot be inferred
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const pkg = { repository: 'github:owner/repo' }
|
|
76
|
+
* inferRepositoryFromPackageJsonObject(pkg)
|
|
77
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function inferRepositoryFromPackageJsonObject(packageJson: PackageJsonForRepository): RepositoryConfig | null;
|
|
81
|
+
/**
|
|
82
|
+
* Extracts the repository URL from package.json content.
|
|
83
|
+
*
|
|
84
|
+
* Unlike `inferRepositoryFromPackageJson`, this returns just the URL string
|
|
85
|
+
* without creating a RepositoryConfig. Useful when you need the raw URL.
|
|
86
|
+
*
|
|
87
|
+
* @param packageJsonContent - Raw JSON string content of package.json
|
|
88
|
+
* @returns Repository URL string or null if not found
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* extractRepositoryUrl('{"repository": {"url": "https://github.com/owner/repo"}}')
|
|
93
|
+
* // → 'https://github.com/owner/repo'
|
|
94
|
+
*
|
|
95
|
+
* extractRepositoryUrl('{"repository": "github:owner/repo"}')
|
|
96
|
+
* // → null (shorthand is not a URL)
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare function extractRepositoryUrl(packageJsonContent: string): string | null;
|
|
100
|
+
//# sourceMappingURL=package-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/parse/package-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKnE;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAA;CACrD;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,8BAA8B,CAAC,kBAAkB,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAalG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,wBAAwB,GAAG,gBAAgB,GAAG,IAAI,CAkBnH;AA2FD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqC9E"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { RepositoryPlatform } from '../models/platform';
|
|
2
|
+
import type { RepositoryConfig } from '../models/repository-config';
|
|
3
|
+
/**
|
|
4
|
+
* Parsed repository information extracted from a git URL.
|
|
5
|
+
*/
|
|
6
|
+
export interface ParsedRepository {
|
|
7
|
+
/**
|
|
8
|
+
* Detected platform type.
|
|
9
|
+
*/
|
|
10
|
+
readonly platform: RepositoryPlatform;
|
|
11
|
+
/**
|
|
12
|
+
* Base URL for the repository (without trailing slashes or .git suffix).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* - GitHub: `"https://github.com/owner/repo"`
|
|
16
|
+
* - GitLab: `"https://gitlab.com/group/project"`
|
|
17
|
+
* - Azure DevOps: `"https://dev.azure.com/org/project/_git/repo"`
|
|
18
|
+
*/
|
|
19
|
+
readonly baseUrl: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parses a git URL and extracts platform and base URL.
|
|
23
|
+
*
|
|
24
|
+
* Supports multiple URL formats:
|
|
25
|
+
* - `https://github.com/owner/repo`
|
|
26
|
+
* - `https://github.com/owner/repo.git`
|
|
27
|
+
* - `git+https://github.com/owner/repo.git`
|
|
28
|
+
* - `git://github.com/owner/repo.git`
|
|
29
|
+
* - `git@github.com:owner/repo.git` (SSH format)
|
|
30
|
+
*
|
|
31
|
+
* Handles self-hosted instances by detecting platform from hostname:
|
|
32
|
+
* - `github.mycompany.com` → `github`
|
|
33
|
+
* - `gitlab.internal.com` → `gitlab`
|
|
34
|
+
*
|
|
35
|
+
* Handles Azure DevOps URL formats:
|
|
36
|
+
* - `https://dev.azure.com/org/project/_git/repo`
|
|
37
|
+
* - `https://org.visualstudio.com/project/_git/repo`
|
|
38
|
+
*
|
|
39
|
+
* @param gitUrl - Git repository URL in any supported format
|
|
40
|
+
* @returns Parsed repository info with platform and base URL, or null if parsing fails
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // GitHub HTTPS
|
|
45
|
+
* parseRepositoryUrl('https://github.com/owner/repo')
|
|
46
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
47
|
+
*
|
|
48
|
+
* // SSH format
|
|
49
|
+
* parseRepositoryUrl('git@github.com:owner/repo.git')
|
|
50
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
51
|
+
*
|
|
52
|
+
* // Azure DevOps
|
|
53
|
+
* parseRepositoryUrl('https://dev.azure.com/org/proj/_git/repo')
|
|
54
|
+
* // → { platform: 'azure-devops', baseUrl: 'https://dev.azure.com/org/proj/_git/repo' }
|
|
55
|
+
*
|
|
56
|
+
* // Self-hosted GitLab
|
|
57
|
+
* parseRepositoryUrl('https://gitlab.mycompany.com/team/project')
|
|
58
|
+
* // → { platform: 'gitlab', baseUrl: 'https://gitlab.mycompany.com/team/project' }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseRepositoryUrl(gitUrl: string): ParsedRepository | null;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a RepositoryConfig from a git URL.
|
|
64
|
+
*
|
|
65
|
+
* This is a convenience function that combines `parseRepositoryUrl` with
|
|
66
|
+
* `createRepositoryConfig` to produce a ready-to-use configuration.
|
|
67
|
+
*
|
|
68
|
+
* @param gitUrl - Git repository URL in any supported format
|
|
69
|
+
* @returns RepositoryConfig or null if URL cannot be parsed
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const config = createRepositoryConfigFromUrl('https://github.com/owner/repo')
|
|
74
|
+
* // → { platform: 'github', baseUrl: 'https://github.com/owner/repo' }
|
|
75
|
+
*
|
|
76
|
+
* const config = createRepositoryConfigFromUrl('git@gitlab.com:group/project.git')
|
|
77
|
+
* // → { platform: 'gitlab', baseUrl: 'https://gitlab.com/group/project' }
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function createRepositoryConfigFromUrl(gitUrl: string): RepositoryConfig | null;
|
|
81
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/parse/url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAMnE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;IAErC;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAuB1E;AAoND;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAgBrF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { RepositoryConfig } from '../models/repository-config';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a compare URL.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateCompareUrlOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Repository configuration containing platform and base URL.
|
|
8
|
+
*/
|
|
9
|
+
readonly repository: RepositoryConfig;
|
|
10
|
+
/**
|
|
11
|
+
* Source commit hash for comparison (older version).
|
|
12
|
+
* Must be a full or abbreviated commit hash.
|
|
13
|
+
*/
|
|
14
|
+
readonly fromCommit: string;
|
|
15
|
+
/**
|
|
16
|
+
* Target commit hash for comparison (newer version).
|
|
17
|
+
* Must be a full or abbreviated commit hash.
|
|
18
|
+
*/
|
|
19
|
+
readonly toCommit: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a platform-specific compare URL for viewing changes between two commits.
|
|
23
|
+
*
|
|
24
|
+
* Each platform has a different URL format:
|
|
25
|
+
* - **GitHub**: `{baseUrl}/compare/{fromCommit}...{toCommit}` (three dots)
|
|
26
|
+
* - **GitLab**: `{baseUrl}/-/compare/{fromCommit}...{toCommit}` (three dots, `/-/` prefix)
|
|
27
|
+
* - **Bitbucket**: `{baseUrl}/compare/{toCommit}..{fromCommit}` (two dots, reversed order)
|
|
28
|
+
* - **Azure DevOps**: `{baseUrl}/compare?version=GT{toCommit}&compareVersion=GT{fromCommit}` (query params)
|
|
29
|
+
*
|
|
30
|
+
* For `custom` platforms, a `formatCompareUrl` function must be provided in the repository config.
|
|
31
|
+
* For `unknown` platforms, returns `null`.
|
|
32
|
+
*
|
|
33
|
+
* @param options - Compare URL options including repository, fromCommit, and toCommit
|
|
34
|
+
* @returns The compare URL string, or null if URL cannot be generated
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // GitHub
|
|
39
|
+
* createCompareUrl({
|
|
40
|
+
* repository: { platform: 'github', baseUrl: 'https://github.com/owner/repo' },
|
|
41
|
+
* fromCommit: 'abc1234',
|
|
42
|
+
* toCommit: 'def5678'
|
|
43
|
+
* })
|
|
44
|
+
* // → 'https://github.com/owner/repo/compare/abc1234...def5678'
|
|
45
|
+
*
|
|
46
|
+
* // GitLab
|
|
47
|
+
* createCompareUrl({
|
|
48
|
+
* repository: { platform: 'gitlab', baseUrl: 'https://gitlab.com/group/project' },
|
|
49
|
+
* fromCommit: 'abc1234',
|
|
50
|
+
* toCommit: 'def5678'
|
|
51
|
+
* })
|
|
52
|
+
* // → 'https://gitlab.com/group/project/-/compare/abc1234...def5678'
|
|
53
|
+
*
|
|
54
|
+
* // Bitbucket (reversed order)
|
|
55
|
+
* createCompareUrl({
|
|
56
|
+
* repository: { platform: 'bitbucket', baseUrl: 'https://bitbucket.org/owner/repo' },
|
|
57
|
+
* fromCommit: 'abc1234',
|
|
58
|
+
* toCommit: 'def5678'
|
|
59
|
+
* })
|
|
60
|
+
* // → 'https://bitbucket.org/owner/repo/compare/def5678..abc1234'
|
|
61
|
+
*
|
|
62
|
+
* // Azure DevOps
|
|
63
|
+
* createCompareUrl({
|
|
64
|
+
* repository: { platform: 'azure-devops', baseUrl: 'https://dev.azure.com/org/proj/_git/repo' },
|
|
65
|
+
* fromCommit: 'abc1234',
|
|
66
|
+
* toCommit: 'def5678'
|
|
67
|
+
* })
|
|
68
|
+
* // → 'https://dev.azure.com/org/proj/_git/repo/compare?version=GTdef5678&compareVersion=GTabc1234'
|
|
69
|
+
*
|
|
70
|
+
* // Custom formatter
|
|
71
|
+
* createCompareUrl({
|
|
72
|
+
* repository: {
|
|
73
|
+
* platform: 'custom',
|
|
74
|
+
* baseUrl: 'https://my-git.internal/repo',
|
|
75
|
+
* formatCompareUrl: (from, to) => `https://my-git.internal/diff/${from}/${to}`
|
|
76
|
+
* },
|
|
77
|
+
* fromCommit: 'abc1234',
|
|
78
|
+
* toCommit: 'def5678'
|
|
79
|
+
* })
|
|
80
|
+
* // → 'https://my-git.internal/diff/abc1234/def5678'
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function createCompareUrl(options: CreateCompareUrlOptions): string | null;
|
|
84
|
+
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/url/compare.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAA;IAErC;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,IAAI,CA+BhF"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe copies of Map built-in via factory function.
|
|
5
|
+
*
|
|
6
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
7
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
8
|
+
*
|
|
9
|
+
* These references are captured at module initialization time to protect against
|
|
10
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
11
|
+
*
|
|
12
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/map
|
|
13
|
+
*/
|
|
14
|
+
// Capture references at module initialization time
|
|
15
|
+
const _Map = globalThis.Map;
|
|
16
|
+
const _Reflect = globalThis.Reflect;
|
|
17
|
+
/**
|
|
18
|
+
* (Safe copy) Creates a new Map using the captured Map constructor.
|
|
19
|
+
* Use this instead of `new Map()`.
|
|
20
|
+
*
|
|
21
|
+
* @param iterable - Optional iterable of key-value pairs.
|
|
22
|
+
* @returns A new Map instance.
|
|
23
|
+
*/
|
|
24
|
+
const createMap = (iterable) => _Reflect.construct(_Map, iterable ? [iterable] : []);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a platform identifier is a known platform with built-in support.
|
|
28
|
+
*
|
|
29
|
+
* @param platform - Platform identifier to check
|
|
30
|
+
* @returns True if the platform is a known platform
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* isKnownPlatform('github') // true
|
|
35
|
+
* isKnownPlatform('gitlab') // true
|
|
36
|
+
* isKnownPlatform('custom') // false
|
|
37
|
+
* isKnownPlatform('unknown') // false
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
function isKnownPlatform(platform) {
|
|
41
|
+
return platform === 'github' || platform === 'gitlab' || platform === 'bitbucket' || platform === 'azure-devops';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Known platform hostnames mapped to their platform type.
|
|
45
|
+
* Used for automatic platform detection from repository URLs.
|
|
46
|
+
*
|
|
47
|
+
* Includes both standard SaaS domains and common patterns for self-hosted instances.
|
|
48
|
+
*/
|
|
49
|
+
createMap([
|
|
50
|
+
// GitHub
|
|
51
|
+
['github.com', 'github'],
|
|
52
|
+
// GitLab
|
|
53
|
+
['gitlab.com', 'gitlab'],
|
|
54
|
+
// Bitbucket
|
|
55
|
+
['bitbucket.org', 'bitbucket'],
|
|
56
|
+
// Azure DevOps
|
|
57
|
+
['dev.azure.com', 'azure-devops'],
|
|
58
|
+
['visualstudio.com', 'azure-devops'],
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Creates a platform-specific compare URL for viewing changes between two commits.
|
|
63
|
+
*
|
|
64
|
+
* Each platform has a different URL format:
|
|
65
|
+
* - **GitHub**: `{baseUrl}/compare/{fromCommit}...{toCommit}` (three dots)
|
|
66
|
+
* - **GitLab**: `{baseUrl}/-/compare/{fromCommit}...{toCommit}` (three dots, `/-/` prefix)
|
|
67
|
+
* - **Bitbucket**: `{baseUrl}/compare/{toCommit}..{fromCommit}` (two dots, reversed order)
|
|
68
|
+
* - **Azure DevOps**: `{baseUrl}/compare?version=GT{toCommit}&compareVersion=GT{fromCommit}` (query params)
|
|
69
|
+
*
|
|
70
|
+
* For `custom` platforms, a `formatCompareUrl` function must be provided in the repository config.
|
|
71
|
+
* For `unknown` platforms, returns `null`.
|
|
72
|
+
*
|
|
73
|
+
* @param options - Compare URL options including repository, fromCommit, and toCommit
|
|
74
|
+
* @returns The compare URL string, or null if URL cannot be generated
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // GitHub
|
|
79
|
+
* createCompareUrl({
|
|
80
|
+
* repository: { platform: 'github', baseUrl: 'https://github.com/owner/repo' },
|
|
81
|
+
* fromCommit: 'abc1234',
|
|
82
|
+
* toCommit: 'def5678'
|
|
83
|
+
* })
|
|
84
|
+
* // → 'https://github.com/owner/repo/compare/abc1234...def5678'
|
|
85
|
+
*
|
|
86
|
+
* // GitLab
|
|
87
|
+
* createCompareUrl({
|
|
88
|
+
* repository: { platform: 'gitlab', baseUrl: 'https://gitlab.com/group/project' },
|
|
89
|
+
* fromCommit: 'abc1234',
|
|
90
|
+
* toCommit: 'def5678'
|
|
91
|
+
* })
|
|
92
|
+
* // → 'https://gitlab.com/group/project/-/compare/abc1234...def5678'
|
|
93
|
+
*
|
|
94
|
+
* // Bitbucket (reversed order)
|
|
95
|
+
* createCompareUrl({
|
|
96
|
+
* repository: { platform: 'bitbucket', baseUrl: 'https://bitbucket.org/owner/repo' },
|
|
97
|
+
* fromCommit: 'abc1234',
|
|
98
|
+
* toCommit: 'def5678'
|
|
99
|
+
* })
|
|
100
|
+
* // → 'https://bitbucket.org/owner/repo/compare/def5678..abc1234'
|
|
101
|
+
*
|
|
102
|
+
* // Azure DevOps
|
|
103
|
+
* createCompareUrl({
|
|
104
|
+
* repository: { platform: 'azure-devops', baseUrl: 'https://dev.azure.com/org/proj/_git/repo' },
|
|
105
|
+
* fromCommit: 'abc1234',
|
|
106
|
+
* toCommit: 'def5678'
|
|
107
|
+
* })
|
|
108
|
+
* // → 'https://dev.azure.com/org/proj/_git/repo/compare?version=GTdef5678&compareVersion=GTabc1234'
|
|
109
|
+
*
|
|
110
|
+
* // Custom formatter
|
|
111
|
+
* createCompareUrl({
|
|
112
|
+
* repository: {
|
|
113
|
+
* platform: 'custom',
|
|
114
|
+
* baseUrl: 'https://my-git.internal/repo',
|
|
115
|
+
* formatCompareUrl: (from, to) => `https://my-git.internal/diff/${from}/${to}`
|
|
116
|
+
* },
|
|
117
|
+
* fromCommit: 'abc1234',
|
|
118
|
+
* toCommit: 'def5678'
|
|
119
|
+
* })
|
|
120
|
+
* // → 'https://my-git.internal/diff/abc1234/def5678'
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
function createCompareUrl(options) {
|
|
124
|
+
const { repository, fromCommit, toCommit } = options;
|
|
125
|
+
// Validate inputs
|
|
126
|
+
if (!repository || !fromCommit || !toCommit) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
// If custom formatter is provided, use it (works for any platform including overrides)
|
|
130
|
+
if (repository.formatCompareUrl) {
|
|
131
|
+
return repository.formatCompareUrl(fromCommit, toCommit);
|
|
132
|
+
}
|
|
133
|
+
const { platform, baseUrl } = repository;
|
|
134
|
+
// Cannot generate URL for unknown platforms without a formatter
|
|
135
|
+
if (platform === 'unknown') {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
// Custom platform requires a formatter
|
|
139
|
+
if (platform === 'custom') {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
// Generate URL for known platforms
|
|
143
|
+
if (isKnownPlatform(platform)) {
|
|
144
|
+
return formatKnownPlatformCompareUrl(platform, baseUrl, fromCommit, toCommit);
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Formats a compare URL for known platforms.
|
|
150
|
+
*
|
|
151
|
+
* @param platform - Known platform type
|
|
152
|
+
* @param baseUrl - Repository base URL
|
|
153
|
+
* @param fromCommit - Source commit hash (older version)
|
|
154
|
+
* @param toCommit - Target commit hash (newer version)
|
|
155
|
+
* @returns Formatted compare URL
|
|
156
|
+
*
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
function formatKnownPlatformCompareUrl(platform, baseUrl, fromCommit, toCommit) {
|
|
160
|
+
switch (platform) {
|
|
161
|
+
case 'github':
|
|
162
|
+
// GitHub: {baseUrl}/compare/{fromCommit}...{toCommit}
|
|
163
|
+
return `${baseUrl}/compare/${fromCommit}...${toCommit}`;
|
|
164
|
+
case 'gitlab':
|
|
165
|
+
// GitLab: {baseUrl}/-/compare/{fromCommit}...{toCommit}
|
|
166
|
+
return `${baseUrl}/-/compare/${fromCommit}...${toCommit}`;
|
|
167
|
+
case 'bitbucket':
|
|
168
|
+
// Bitbucket: {baseUrl}/compare/{toCommit}..{fromCommit} (reversed order, two dots)
|
|
169
|
+
return `${baseUrl}/compare/${toCommit}..${fromCommit}`;
|
|
170
|
+
case 'azure-devops':
|
|
171
|
+
// Azure DevOps: {baseUrl}/compare?version=GT{toCommit}&compareVersion=GT{fromCommit}
|
|
172
|
+
// Use encodeURIComponent for query parameter values
|
|
173
|
+
return `${baseUrl}/compare?version=GT${encodeURIComponent(toCommit)}&compareVersion=GT${encodeURIComponent(fromCommit)}`;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
exports.createCompareUrl = createCompareUrl;
|
|
178
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../../../libs/versioning/src/repository/models/platform.ts","../../../../../../../../../../libs/versioning/src/repository/url/compare.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":";;AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG;AAC3B,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AAGnC;;;;;;AAMG;AACI,MAAM,SAAS,GAAG,CAAO,QAA2C,KAC9D,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;;ACHjE;;;;;;;;;;;;;AAaG;AACG,SAAU,eAAe,CAAC,QAA4B,EAAA;AAC1D,IAAA,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,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