@hyperfrontend/versioning 0.1.0 → 0.3.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 +37 -23
- package/README.md +19 -14
- package/changelog/index.cjs.js +38 -6
- package/changelog/index.cjs.js.map +1 -1
- package/changelog/index.esm.js +38 -6
- 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 +85 -6
- package/changelog/parse/index.cjs.js.map +1 -1
- package/changelog/parse/index.esm.js +85 -6
- package/changelog/parse/index.esm.js.map +1 -1
- package/changelog/parse/line.d.ts.map +1 -1
- package/changelog/parse/parser.d.ts +0 -6
- package/changelog/parse/parser.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 +707 -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 +679 -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 +69 -0
- package/commits/classify/project-scopes.d.ts.map +1 -0
- package/commits/index.cjs.js +704 -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 +678 -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 +1617 -43
- package/flow/executor/index.cjs.js.map +1 -1
- package/flow/executor/index.esm.js +1623 -49
- package/flow/executor/index.esm.js.map +1 -1
- package/flow/index.cjs.js +6749 -2938
- package/flow/index.cjs.js.map +1 -1
- package/flow/index.esm.js +6751 -2944
- package/flow/index.esm.js.map +1 -1
- package/flow/models/index.cjs.js +138 -0
- package/flow/models/index.cjs.js.map +1 -1
- package/flow/models/index.d.ts +1 -1
- package/flow/models/index.d.ts.map +1 -1
- package/flow/models/index.esm.js +138 -1
- package/flow/models/index.esm.js.map +1 -1
- package/flow/models/types.d.ts +180 -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 +3641 -303
- package/flow/presets/index.cjs.js.map +1 -1
- package/flow/presets/index.esm.js +3641 -303
- 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 +5 -0
- package/flow/steps/generate-changelog.d.ts.map +1 -1
- package/flow/steps/index.cjs.js +3663 -328
- package/flow/steps/index.cjs.js.map +1 -1
- package/flow/steps/index.d.ts +2 -1
- package/flow/steps/index.d.ts.map +1 -1
- package/flow/steps/index.esm.js +3661 -329
- 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 +7547 -4947
- package/index.cjs.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.esm.js +7550 -4954
- package/index.esm.js.map +1 -1
- package/package.json +39 -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/changelog-path.d.ts +3 -7
- package/workspace/discovery/changelog-path.d.ts.map +1 -1
- package/workspace/discovery/index.cjs.js +408 -335
- package/workspace/discovery/index.cjs.js.map +1 -1
- package/workspace/discovery/index.esm.js +408 -335
- 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 +84 -11
- package/workspace/index.cjs.js.map +1 -1
- package/workspace/index.esm.js +84 -11
- package/workspace/index.esm.js.map +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known git hosting platforms with built-in compare URL support.
|
|
3
|
+
*
|
|
4
|
+
* Each platform has a specific URL format for compare links:
|
|
5
|
+
* - `github`: `{baseUrl}/compare/{fromCommit}...{toCommit}`
|
|
6
|
+
* - `gitlab`: `{baseUrl}/-/compare/{fromCommit}...{toCommit}`
|
|
7
|
+
* - `bitbucket`: `{baseUrl}/compare/{toCommit}..{fromCommit}` (reversed order)
|
|
8
|
+
* - `azure-devops`: `{baseUrl}/compare?version=GT{toCommit}&compareVersion=GT{fromCommit}`
|
|
9
|
+
*/
|
|
10
|
+
export type KnownPlatform = 'github' | 'gitlab' | 'bitbucket' | 'azure-devops';
|
|
11
|
+
/**
|
|
12
|
+
* Platform identifier.
|
|
13
|
+
*
|
|
14
|
+
* - Known platforms have built-in compare URL formatters
|
|
15
|
+
* - `custom` requires a custom `formatCompareUrl` function
|
|
16
|
+
* - `unknown` indicates platform could not be determined (no URL generation)
|
|
17
|
+
*/
|
|
18
|
+
export type RepositoryPlatform = KnownPlatform | 'custom' | 'unknown';
|
|
19
|
+
/**
|
|
20
|
+
* Checks if a platform identifier is a known platform with built-in support.
|
|
21
|
+
*
|
|
22
|
+
* @param platform - Platform identifier to check
|
|
23
|
+
* @returns True if the platform is a known platform
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* isKnownPlatform('github') // true
|
|
28
|
+
* isKnownPlatform('gitlab') // true
|
|
29
|
+
* isKnownPlatform('custom') // false
|
|
30
|
+
* isKnownPlatform('unknown') // false
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function isKnownPlatform(platform: RepositoryPlatform): platform is KnownPlatform;
|
|
34
|
+
/**
|
|
35
|
+
* Known platform hostnames mapped to their platform type.
|
|
36
|
+
* Used for automatic platform detection from repository URLs.
|
|
37
|
+
*
|
|
38
|
+
* Includes both standard SaaS domains and common patterns for self-hosted instances.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PLATFORM_HOSTNAMES: ReadonlyMap<string, KnownPlatform>;
|
|
41
|
+
/**
|
|
42
|
+
* Detects platform from a hostname.
|
|
43
|
+
*
|
|
44
|
+
* First checks for exact match in known platforms, then applies heuristics
|
|
45
|
+
* for self-hosted instances (e.g., `github.company.com` → `github`).
|
|
46
|
+
*
|
|
47
|
+
* @param hostname - Hostname to detect platform from (e.g., "github.com")
|
|
48
|
+
* @returns Detected platform or 'unknown' if not recognized
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* detectPlatformFromHostname('github.com') // 'github'
|
|
53
|
+
* detectPlatformFromHostname('gitlab.mycompany.com') // 'gitlab'
|
|
54
|
+
* detectPlatformFromHostname('custom-git.internal') // 'unknown'
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function detectPlatformFromHostname(hostname: string): RepositoryPlatform;
|
|
58
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/models/platform.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAA;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAA;AAErE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,IAAI,aAAa,CAEvF;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAahE,CAAA;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAoC/E"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { RepositoryPlatform } from './platform';
|
|
2
|
+
/**
|
|
3
|
+
* Custom compare URL formatter function.
|
|
4
|
+
*
|
|
5
|
+
* @param fromCommit - The source commit hash for comparison (older version)
|
|
6
|
+
* @param toCommit - The target commit hash for comparison (newer version)
|
|
7
|
+
* @returns Full compare URL string
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const formatter: CompareUrlFormatter = (from, to) =>
|
|
12
|
+
* `https://my-git.internal/diff/${from}/${to}`
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type CompareUrlFormatter = (fromCommit: string, toCommit: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Repository configuration for compare URL generation.
|
|
18
|
+
*
|
|
19
|
+
* Supports both standard platforms and self-hosted instances.
|
|
20
|
+
* When using a known platform, compare URLs are generated automatically.
|
|
21
|
+
* For custom or unknown platforms, provide a `formatCompareUrl` function.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // GitHub repository
|
|
26
|
+
* const github: RepositoryConfig = {
|
|
27
|
+
* platform: 'github',
|
|
28
|
+
* baseUrl: 'https://github.com/owner/repo'
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* // Self-hosted GitLab
|
|
32
|
+
* const gitlabSelfHosted: RepositoryConfig = {
|
|
33
|
+
* platform: 'gitlab',
|
|
34
|
+
* baseUrl: 'https://gitlab.mycompany.com/team/project'
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* // Custom platform with formatter
|
|
38
|
+
* const custom: RepositoryConfig = {
|
|
39
|
+
* platform: 'custom',
|
|
40
|
+
* baseUrl: 'https://custom-git.internal/repo',
|
|
41
|
+
* formatCompareUrl: (from, to) => `https://custom-git.internal/diff/${from}/${to}`
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export interface RepositoryConfig {
|
|
46
|
+
/**
|
|
47
|
+
* Platform type - determines URL format for known platforms.
|
|
48
|
+
*/
|
|
49
|
+
readonly platform: RepositoryPlatform;
|
|
50
|
+
/**
|
|
51
|
+
* Base URL for the repository.
|
|
52
|
+
*
|
|
53
|
+
* This is the URL without any trailing slashes or paths like `/compare`.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* - GitHub: `"https://github.com/owner/repo"`
|
|
57
|
+
* - GitLab: `"https://gitlab.com/group/project"`
|
|
58
|
+
* - Azure DevOps: `"https://dev.azure.com/org/project/_git/repo"`
|
|
59
|
+
*/
|
|
60
|
+
readonly baseUrl: string;
|
|
61
|
+
/**
|
|
62
|
+
* Custom compare URL formatter.
|
|
63
|
+
*
|
|
64
|
+
* Required when `platform` is `'custom'`.
|
|
65
|
+
* Optional for known platforms (overrides built-in formatter).
|
|
66
|
+
*
|
|
67
|
+
* Receives the from and to tags, returns the full compare URL.
|
|
68
|
+
*/
|
|
69
|
+
readonly formatCompareUrl?: CompareUrlFormatter;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Options for creating a repository config.
|
|
73
|
+
*/
|
|
74
|
+
export interface CreateRepositoryConfigOptions {
|
|
75
|
+
/**
|
|
76
|
+
* Platform type - determines URL format for known platforms.
|
|
77
|
+
*/
|
|
78
|
+
readonly platform: RepositoryPlatform;
|
|
79
|
+
/**
|
|
80
|
+
* Base URL for the repository.
|
|
81
|
+
* Trailing slashes will be automatically stripped.
|
|
82
|
+
*/
|
|
83
|
+
readonly baseUrl: string;
|
|
84
|
+
/**
|
|
85
|
+
* Custom compare URL formatter.
|
|
86
|
+
* Required when platform is 'custom'.
|
|
87
|
+
*/
|
|
88
|
+
readonly formatCompareUrl?: CompareUrlFormatter;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new RepositoryConfig.
|
|
92
|
+
*
|
|
93
|
+
* Normalizes the base URL by stripping trailing slashes and validating
|
|
94
|
+
* that custom platforms have a formatter function.
|
|
95
|
+
*
|
|
96
|
+
* @param options - Repository configuration options
|
|
97
|
+
* @returns A new RepositoryConfig object
|
|
98
|
+
* @throws {Error} if platform is 'custom' but no formatCompareUrl is provided
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // GitHub repository
|
|
103
|
+
* const config = createRepositoryConfig({
|
|
104
|
+
* platform: 'github',
|
|
105
|
+
* baseUrl: 'https://github.com/owner/repo'
|
|
106
|
+
* })
|
|
107
|
+
*
|
|
108
|
+
* // Custom platform
|
|
109
|
+
* const customConfig = createRepositoryConfig({
|
|
110
|
+
* platform: 'custom',
|
|
111
|
+
* baseUrl: 'https://my-git.internal/repo',
|
|
112
|
+
* formatCompareUrl: (from, to) => `https://my-git.internal/diff/${from}/${to}`
|
|
113
|
+
* })
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare function createRepositoryConfig(options: CreateRepositoryConfigOptions): RepositoryConfig;
|
|
117
|
+
/**
|
|
118
|
+
* Checks if a value is a RepositoryConfig object.
|
|
119
|
+
*
|
|
120
|
+
* @param value - Value to check
|
|
121
|
+
* @returns True if the value is a RepositoryConfig
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const config = { platform: 'github', baseUrl: 'https://...' }
|
|
126
|
+
* if (isRepositoryConfig(config)) {
|
|
127
|
+
* // config is typed as RepositoryConfig
|
|
128
|
+
* }
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare function isRepositoryConfig(value: unknown): value is RepositoryConfig;
|
|
132
|
+
//# sourceMappingURL=repository-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-config.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/models/repository-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;IAErC;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB;;;;;;;OAOG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;IAErC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,gBAAgB,CAgB/F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAY5E"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { RepositoryConfig } from './repository-config';
|
|
2
|
+
/**
|
|
3
|
+
* How to resolve repository information for compare URLs.
|
|
4
|
+
*
|
|
5
|
+
* - `explicit`: Use only the provided `RepositoryConfig`; error if missing
|
|
6
|
+
* - `inferred`: Auto-detect from package.json repository field or git remote
|
|
7
|
+
* - `disabled`: Do not generate compare URLs (default for backward compatibility)
|
|
8
|
+
*/
|
|
9
|
+
export type RepositoryResolutionMode = 'explicit' | 'inferred' | 'disabled';
|
|
10
|
+
/**
|
|
11
|
+
* Sources for repository inference, in order of preference.
|
|
12
|
+
*
|
|
13
|
+
* - `package-json`: Read from `repository` field in package.json
|
|
14
|
+
* - `git-remote`: Read from `git remote get-url origin`
|
|
15
|
+
*/
|
|
16
|
+
export type RepositoryInferenceSource = 'package-json' | 'git-remote';
|
|
17
|
+
/**
|
|
18
|
+
* Full repository resolution configuration.
|
|
19
|
+
*
|
|
20
|
+
* Provides fine-grained control over repository resolution behavior.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Explicit configuration - must provide repository
|
|
25
|
+
* const explicit: RepositoryResolution = {
|
|
26
|
+
* mode: 'explicit',
|
|
27
|
+
* repository: {
|
|
28
|
+
* platform: 'github',
|
|
29
|
+
* baseUrl: 'https://github.com/owner/repo'
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* // Auto-detection with custom order
|
|
34
|
+
* const inferred: RepositoryResolution = {
|
|
35
|
+
* mode: 'inferred',
|
|
36
|
+
* inferenceOrder: ['git-remote', 'package-json'] // Try git first
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* // Disabled
|
|
40
|
+
* const disabled: RepositoryResolution = {
|
|
41
|
+
* mode: 'disabled'
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export interface RepositoryResolution {
|
|
46
|
+
/**
|
|
47
|
+
* Resolution mode.
|
|
48
|
+
*/
|
|
49
|
+
readonly mode: RepositoryResolutionMode;
|
|
50
|
+
/**
|
|
51
|
+
* Explicit repository config.
|
|
52
|
+
*
|
|
53
|
+
* Required when `mode` is `'explicit'`.
|
|
54
|
+
* Ignored when `mode` is `'inferred'` or `'disabled'`.
|
|
55
|
+
*/
|
|
56
|
+
readonly repository?: RepositoryConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Inference source order when `mode` is `'inferred'`.
|
|
59
|
+
*
|
|
60
|
+
* Sources are tried in order until one succeeds.
|
|
61
|
+
* Default: `['package-json', 'git-remote']`
|
|
62
|
+
*/
|
|
63
|
+
readonly inferenceOrder?: readonly RepositoryInferenceSource[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates a disabled repository resolution configuration.
|
|
67
|
+
*
|
|
68
|
+
* No compare URLs will be generated.
|
|
69
|
+
*
|
|
70
|
+
* @returns A RepositoryResolution with mode 'disabled'
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const config = createDisabledResolution()
|
|
75
|
+
* // { mode: 'disabled' }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function createDisabledResolution(): RepositoryResolution;
|
|
79
|
+
/**
|
|
80
|
+
* Creates an explicit repository resolution configuration.
|
|
81
|
+
*
|
|
82
|
+
* @param repository - The repository config to use
|
|
83
|
+
* @returns A RepositoryResolution with mode 'explicit'
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const config = createExplicitResolution({
|
|
88
|
+
* platform: 'github',
|
|
89
|
+
* baseUrl: 'https://github.com/owner/repo'
|
|
90
|
+
* })
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function createExplicitResolution(repository: RepositoryConfig): RepositoryResolution;
|
|
94
|
+
/**
|
|
95
|
+
* Creates an inferred repository resolution configuration.
|
|
96
|
+
*
|
|
97
|
+
* @param inferenceOrder - Order to try inference sources (default: package-json first)
|
|
98
|
+
* @returns A RepositoryResolution with mode 'inferred'
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // Default order: package.json → git remote
|
|
103
|
+
* const config = createInferredResolution()
|
|
104
|
+
*
|
|
105
|
+
* // Custom order: git remote → package.json
|
|
106
|
+
* const customOrder = createInferredResolution(['git-remote', 'package-json'])
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare function createInferredResolution(inferenceOrder?: readonly RepositoryInferenceSource[]): RepositoryResolution;
|
|
110
|
+
/**
|
|
111
|
+
* Checks if a value is a RepositoryResolution object.
|
|
112
|
+
*
|
|
113
|
+
* @param value - Value to check
|
|
114
|
+
* @returns True if the value is a RepositoryResolution
|
|
115
|
+
*/
|
|
116
|
+
export declare function isRepositoryResolution(value: unknown): value is RepositoryResolution;
|
|
117
|
+
/**
|
|
118
|
+
* Default inference order when mode is 'inferred'.
|
|
119
|
+
*/
|
|
120
|
+
export declare const DEFAULT_INFERENCE_ORDER: readonly RepositoryInferenceSource[];
|
|
121
|
+
//# sourceMappingURL=resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/repository/models/resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG,YAAY,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAA;IAEvC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAEtC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAA;CAC/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,IAAI,oBAAoB,CAE/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,oBAAoB,CAK3F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,GAAE,SAAS,yBAAyB,EAAmC,GACpF,oBAAoB,CAKtB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CASpF;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,yBAAyB,EAAmC,CAAA"}
|