@releasekit/version 0.3.0-next.3 → 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/README.md +5 -3
- package/dist/cli.js +0 -105
- package/docs/CI_CD_INTEGRATION.md +13 -13
- package/docs/versioning.md +14 -14
- package/package.json +14 -12
- package/version.schema.json +1 -1
- package/dist/baseError-ZCZHF6A2.js +0 -7
- package/dist/chunk-GQLJ7JQY.js +0 -18
- package/dist/chunk-LMPZV35Z.js +0 -20
- package/dist/chunk-ZEXPJ53Z.js +0 -2061
- package/dist/cli.cjs +0 -2230
- package/dist/cli.d.cts +0 -4
- package/dist/cli.d.ts +0 -4
- package/dist/commandExecutor-E44ID5U4.js +0 -8
- package/dist/index.cjs +0 -2150
- package/dist/index.d.cts +0 -208
- package/dist/index.d.ts +0 -208
- package/dist/index.js +0 -31
package/dist/index.d.cts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { LoadOptions } from '@releasekit/config';
|
|
2
|
-
import { ReleaseType } from 'semver';
|
|
3
|
-
import { Packages, Package } from '@manypkg/get-packages';
|
|
4
|
-
import { ReleaseKitError, VersionPackageChangelog } from '@releasekit/core';
|
|
5
|
-
|
|
6
|
-
interface VersionConfigBase {
|
|
7
|
-
versionPrefix: string;
|
|
8
|
-
type?: ReleaseType;
|
|
9
|
-
prereleaseIdentifier?: string;
|
|
10
|
-
branchPattern?: string[];
|
|
11
|
-
baseBranch?: string;
|
|
12
|
-
path?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
strictReachable?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface Config extends VersionConfigBase {
|
|
17
|
-
tagTemplate: string;
|
|
18
|
-
packageSpecificTags?: boolean;
|
|
19
|
-
preset: string;
|
|
20
|
-
sync: boolean;
|
|
21
|
-
packages: string[];
|
|
22
|
-
mainPackage?: string;
|
|
23
|
-
updateInternalDependencies: 'major' | 'minor' | 'patch' | 'no-internal-update';
|
|
24
|
-
skip?: string[];
|
|
25
|
-
commitMessage?: string;
|
|
26
|
-
versionStrategy?: 'branchPattern' | 'commitMessage';
|
|
27
|
-
branchPatterns?: BranchPattern[];
|
|
28
|
-
defaultReleaseType?: ReleaseType;
|
|
29
|
-
dryRun?: boolean;
|
|
30
|
-
latestTag?: string;
|
|
31
|
-
isPrerelease?: boolean;
|
|
32
|
-
mismatchStrategy?: 'error' | 'warn' | 'ignore' | 'prefer-package' | 'prefer-git';
|
|
33
|
-
strictReachable?: boolean;
|
|
34
|
-
cargo?: {
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
paths?: string[];
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
interface BranchPattern {
|
|
40
|
-
pattern: string;
|
|
41
|
-
releaseType: ReleaseType;
|
|
42
|
-
}
|
|
43
|
-
interface VersionOptions extends VersionConfigBase {
|
|
44
|
-
latestTag: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare function loadConfig(options?: LoadOptions): Config;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Version calculation logic
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Calculates the next version number based on the current version and options
|
|
55
|
-
*/
|
|
56
|
-
declare function calculateVersion(config: Config, options: VersionOptions): Promise<string>;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Strategy functions for versioning using the higher-order function pattern
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Available strategy types
|
|
64
|
-
*/
|
|
65
|
-
type StrategyType = 'sync' | 'single' | 'async';
|
|
66
|
-
/**
|
|
67
|
-
* Strategy function type
|
|
68
|
-
*/
|
|
69
|
-
type StrategyFunction = (packages: PackagesWithRoot, targets?: string[]) => Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Create a sync versioning strategy function
|
|
72
|
-
*/
|
|
73
|
-
declare function createSyncStrategy(config: Config): StrategyFunction;
|
|
74
|
-
/**
|
|
75
|
-
* Create a single package versioning strategy function
|
|
76
|
-
*/
|
|
77
|
-
declare function createSingleStrategy(config: Config): StrategyFunction;
|
|
78
|
-
/**
|
|
79
|
-
* Create an async package versioning strategy function
|
|
80
|
-
*/
|
|
81
|
-
declare function createAsyncStrategy(config: Config): StrategyFunction;
|
|
82
|
-
|
|
83
|
-
interface PackagesWithRoot extends Packages {
|
|
84
|
-
root: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Main versioning engine that uses functional strategies
|
|
88
|
-
*/
|
|
89
|
-
declare class VersionEngine {
|
|
90
|
-
private config;
|
|
91
|
-
private workspaceCache;
|
|
92
|
-
private strategies;
|
|
93
|
-
private currentStrategy;
|
|
94
|
-
constructor(config: Config, _jsonMode?: boolean);
|
|
95
|
-
/**
|
|
96
|
-
* Get workspace packages information - with caching for performance
|
|
97
|
-
*/
|
|
98
|
-
getWorkspacePackages(): Promise<PackagesWithRoot>;
|
|
99
|
-
/**
|
|
100
|
-
* Run the current strategy
|
|
101
|
-
* @param packages Workspace packages to process
|
|
102
|
-
* @param targets Optional package targets to process (only used by async strategy)
|
|
103
|
-
*/
|
|
104
|
-
run(packages: PackagesWithRoot, targets?: string[]): Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* Change the current strategy
|
|
107
|
-
* @param strategyType The strategy type to use: 'sync', 'single', or 'async'
|
|
108
|
-
*/
|
|
109
|
-
setStrategy(strategyType: StrategyType): void;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Version-specific base error that bridges the factory pattern
|
|
114
|
-
* used by @releasekit/version with the abstract ReleaseKitError base.
|
|
115
|
-
*/
|
|
116
|
-
declare class BaseVersionError extends ReleaseKitError {
|
|
117
|
-
readonly code: string;
|
|
118
|
-
readonly suggestions: string[];
|
|
119
|
-
constructor(message: string, code: string, suggestions?: string[]);
|
|
120
|
-
static isVersionError(error: unknown): error is BaseVersionError;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Custom error class for versioning operations
|
|
125
|
-
*/
|
|
126
|
-
declare class VersionError extends BaseVersionError {
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Error codes for versioning operations
|
|
130
|
-
*/
|
|
131
|
-
declare enum VersionErrorCode {
|
|
132
|
-
CONFIG_REQUIRED = "CONFIG_REQUIRED",
|
|
133
|
-
PACKAGES_NOT_FOUND = "PACKAGES_NOT_FOUND",
|
|
134
|
-
WORKSPACE_ERROR = "WORKSPACE_ERROR",
|
|
135
|
-
INVALID_CONFIG = "INVALID_CONFIG",
|
|
136
|
-
PACKAGE_NOT_FOUND = "PACKAGE_NOT_FOUND",
|
|
137
|
-
VERSION_CALCULATION_ERROR = "VERSION_CALCULATION_ERROR"
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Creates a VersionError with standard error message for common failure scenarios
|
|
141
|
-
* @param code Error code
|
|
142
|
-
* @param details Additional error details
|
|
143
|
-
* @returns VersionError instance
|
|
144
|
-
*/
|
|
145
|
-
declare function createVersionError(code: VersionErrorCode, details?: string): VersionError;
|
|
146
|
-
|
|
147
|
-
interface PackageProcessorOptions {
|
|
148
|
-
skip?: string[];
|
|
149
|
-
versionPrefix?: string;
|
|
150
|
-
tagTemplate?: string;
|
|
151
|
-
commitMessageTemplate?: string;
|
|
152
|
-
dryRun?: boolean;
|
|
153
|
-
getLatestTag: () => Promise<string | null>;
|
|
154
|
-
config: Omit<VersionConfigBase, 'versionPrefix' | 'path' | 'name'>;
|
|
155
|
-
fullConfig: Config;
|
|
156
|
-
}
|
|
157
|
-
interface ProcessResult {
|
|
158
|
-
updatedPackages: Array<{
|
|
159
|
-
name: string;
|
|
160
|
-
version: string;
|
|
161
|
-
path: string;
|
|
162
|
-
}>;
|
|
163
|
-
commitMessage?: string;
|
|
164
|
-
tags: string[];
|
|
165
|
-
}
|
|
166
|
-
declare class PackageProcessor {
|
|
167
|
-
private skip;
|
|
168
|
-
private versionPrefix;
|
|
169
|
-
private tagTemplate?;
|
|
170
|
-
private commitMessageTemplate;
|
|
171
|
-
private dryRun;
|
|
172
|
-
private getLatestTag;
|
|
173
|
-
private config;
|
|
174
|
-
private fullConfig;
|
|
175
|
-
constructor(options: PackageProcessorOptions);
|
|
176
|
-
/**
|
|
177
|
-
* Process packages based on skip list only (targeting handled at discovery time)
|
|
178
|
-
*/
|
|
179
|
-
processPackages(packages: Package[]): Promise<ProcessResult>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* JSON Output service for releasekit-version
|
|
184
|
-
* Centralizes all JSON output handling
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
interface JsonOutputData {
|
|
188
|
-
dryRun: boolean;
|
|
189
|
-
updates: Array<{
|
|
190
|
-
packageName: string;
|
|
191
|
-
newVersion: string;
|
|
192
|
-
filePath: string;
|
|
193
|
-
}>;
|
|
194
|
-
changelogs: VersionPackageChangelog[];
|
|
195
|
-
commitMessage?: string;
|
|
196
|
-
tags: string[];
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Enable JSON output mode
|
|
200
|
-
* @param dryRun Whether this is a dry run
|
|
201
|
-
*/
|
|
202
|
-
declare function enableJsonOutput(dryRun?: boolean): void;
|
|
203
|
-
/**
|
|
204
|
-
* Get the current JSON output data (for testing)
|
|
205
|
-
*/
|
|
206
|
-
declare function getJsonData(): JsonOutputData;
|
|
207
|
-
|
|
208
|
-
export { BaseVersionError, type Config, type JsonOutputData, PackageProcessor, type VersionConfigBase, VersionEngine, VersionErrorCode, calculateVersion, createAsyncStrategy, createSingleStrategy, createSyncStrategy, createVersionError, enableJsonOutput, getJsonData, loadConfig };
|
package/dist/index.d.ts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { LoadOptions } from '@releasekit/config';
|
|
2
|
-
import { ReleaseType } from 'semver';
|
|
3
|
-
import { Packages, Package } from '@manypkg/get-packages';
|
|
4
|
-
import { ReleaseKitError, VersionPackageChangelog } from '@releasekit/core';
|
|
5
|
-
|
|
6
|
-
interface VersionConfigBase {
|
|
7
|
-
versionPrefix: string;
|
|
8
|
-
type?: ReleaseType;
|
|
9
|
-
prereleaseIdentifier?: string;
|
|
10
|
-
branchPattern?: string[];
|
|
11
|
-
baseBranch?: string;
|
|
12
|
-
path?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
strictReachable?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface Config extends VersionConfigBase {
|
|
17
|
-
tagTemplate: string;
|
|
18
|
-
packageSpecificTags?: boolean;
|
|
19
|
-
preset: string;
|
|
20
|
-
sync: boolean;
|
|
21
|
-
packages: string[];
|
|
22
|
-
mainPackage?: string;
|
|
23
|
-
updateInternalDependencies: 'major' | 'minor' | 'patch' | 'no-internal-update';
|
|
24
|
-
skip?: string[];
|
|
25
|
-
commitMessage?: string;
|
|
26
|
-
versionStrategy?: 'branchPattern' | 'commitMessage';
|
|
27
|
-
branchPatterns?: BranchPattern[];
|
|
28
|
-
defaultReleaseType?: ReleaseType;
|
|
29
|
-
dryRun?: boolean;
|
|
30
|
-
latestTag?: string;
|
|
31
|
-
isPrerelease?: boolean;
|
|
32
|
-
mismatchStrategy?: 'error' | 'warn' | 'ignore' | 'prefer-package' | 'prefer-git';
|
|
33
|
-
strictReachable?: boolean;
|
|
34
|
-
cargo?: {
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
paths?: string[];
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
interface BranchPattern {
|
|
40
|
-
pattern: string;
|
|
41
|
-
releaseType: ReleaseType;
|
|
42
|
-
}
|
|
43
|
-
interface VersionOptions extends VersionConfigBase {
|
|
44
|
-
latestTag: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare function loadConfig(options?: LoadOptions): Config;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Version calculation logic
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Calculates the next version number based on the current version and options
|
|
55
|
-
*/
|
|
56
|
-
declare function calculateVersion(config: Config, options: VersionOptions): Promise<string>;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Strategy functions for versioning using the higher-order function pattern
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Available strategy types
|
|
64
|
-
*/
|
|
65
|
-
type StrategyType = 'sync' | 'single' | 'async';
|
|
66
|
-
/**
|
|
67
|
-
* Strategy function type
|
|
68
|
-
*/
|
|
69
|
-
type StrategyFunction = (packages: PackagesWithRoot, targets?: string[]) => Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Create a sync versioning strategy function
|
|
72
|
-
*/
|
|
73
|
-
declare function createSyncStrategy(config: Config): StrategyFunction;
|
|
74
|
-
/**
|
|
75
|
-
* Create a single package versioning strategy function
|
|
76
|
-
*/
|
|
77
|
-
declare function createSingleStrategy(config: Config): StrategyFunction;
|
|
78
|
-
/**
|
|
79
|
-
* Create an async package versioning strategy function
|
|
80
|
-
*/
|
|
81
|
-
declare function createAsyncStrategy(config: Config): StrategyFunction;
|
|
82
|
-
|
|
83
|
-
interface PackagesWithRoot extends Packages {
|
|
84
|
-
root: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Main versioning engine that uses functional strategies
|
|
88
|
-
*/
|
|
89
|
-
declare class VersionEngine {
|
|
90
|
-
private config;
|
|
91
|
-
private workspaceCache;
|
|
92
|
-
private strategies;
|
|
93
|
-
private currentStrategy;
|
|
94
|
-
constructor(config: Config, _jsonMode?: boolean);
|
|
95
|
-
/**
|
|
96
|
-
* Get workspace packages information - with caching for performance
|
|
97
|
-
*/
|
|
98
|
-
getWorkspacePackages(): Promise<PackagesWithRoot>;
|
|
99
|
-
/**
|
|
100
|
-
* Run the current strategy
|
|
101
|
-
* @param packages Workspace packages to process
|
|
102
|
-
* @param targets Optional package targets to process (only used by async strategy)
|
|
103
|
-
*/
|
|
104
|
-
run(packages: PackagesWithRoot, targets?: string[]): Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* Change the current strategy
|
|
107
|
-
* @param strategyType The strategy type to use: 'sync', 'single', or 'async'
|
|
108
|
-
*/
|
|
109
|
-
setStrategy(strategyType: StrategyType): void;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Version-specific base error that bridges the factory pattern
|
|
114
|
-
* used by @releasekit/version with the abstract ReleaseKitError base.
|
|
115
|
-
*/
|
|
116
|
-
declare class BaseVersionError extends ReleaseKitError {
|
|
117
|
-
readonly code: string;
|
|
118
|
-
readonly suggestions: string[];
|
|
119
|
-
constructor(message: string, code: string, suggestions?: string[]);
|
|
120
|
-
static isVersionError(error: unknown): error is BaseVersionError;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Custom error class for versioning operations
|
|
125
|
-
*/
|
|
126
|
-
declare class VersionError extends BaseVersionError {
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Error codes for versioning operations
|
|
130
|
-
*/
|
|
131
|
-
declare enum VersionErrorCode {
|
|
132
|
-
CONFIG_REQUIRED = "CONFIG_REQUIRED",
|
|
133
|
-
PACKAGES_NOT_FOUND = "PACKAGES_NOT_FOUND",
|
|
134
|
-
WORKSPACE_ERROR = "WORKSPACE_ERROR",
|
|
135
|
-
INVALID_CONFIG = "INVALID_CONFIG",
|
|
136
|
-
PACKAGE_NOT_FOUND = "PACKAGE_NOT_FOUND",
|
|
137
|
-
VERSION_CALCULATION_ERROR = "VERSION_CALCULATION_ERROR"
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Creates a VersionError with standard error message for common failure scenarios
|
|
141
|
-
* @param code Error code
|
|
142
|
-
* @param details Additional error details
|
|
143
|
-
* @returns VersionError instance
|
|
144
|
-
*/
|
|
145
|
-
declare function createVersionError(code: VersionErrorCode, details?: string): VersionError;
|
|
146
|
-
|
|
147
|
-
interface PackageProcessorOptions {
|
|
148
|
-
skip?: string[];
|
|
149
|
-
versionPrefix?: string;
|
|
150
|
-
tagTemplate?: string;
|
|
151
|
-
commitMessageTemplate?: string;
|
|
152
|
-
dryRun?: boolean;
|
|
153
|
-
getLatestTag: () => Promise<string | null>;
|
|
154
|
-
config: Omit<VersionConfigBase, 'versionPrefix' | 'path' | 'name'>;
|
|
155
|
-
fullConfig: Config;
|
|
156
|
-
}
|
|
157
|
-
interface ProcessResult {
|
|
158
|
-
updatedPackages: Array<{
|
|
159
|
-
name: string;
|
|
160
|
-
version: string;
|
|
161
|
-
path: string;
|
|
162
|
-
}>;
|
|
163
|
-
commitMessage?: string;
|
|
164
|
-
tags: string[];
|
|
165
|
-
}
|
|
166
|
-
declare class PackageProcessor {
|
|
167
|
-
private skip;
|
|
168
|
-
private versionPrefix;
|
|
169
|
-
private tagTemplate?;
|
|
170
|
-
private commitMessageTemplate;
|
|
171
|
-
private dryRun;
|
|
172
|
-
private getLatestTag;
|
|
173
|
-
private config;
|
|
174
|
-
private fullConfig;
|
|
175
|
-
constructor(options: PackageProcessorOptions);
|
|
176
|
-
/**
|
|
177
|
-
* Process packages based on skip list only (targeting handled at discovery time)
|
|
178
|
-
*/
|
|
179
|
-
processPackages(packages: Package[]): Promise<ProcessResult>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* JSON Output service for releasekit-version
|
|
184
|
-
* Centralizes all JSON output handling
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
interface JsonOutputData {
|
|
188
|
-
dryRun: boolean;
|
|
189
|
-
updates: Array<{
|
|
190
|
-
packageName: string;
|
|
191
|
-
newVersion: string;
|
|
192
|
-
filePath: string;
|
|
193
|
-
}>;
|
|
194
|
-
changelogs: VersionPackageChangelog[];
|
|
195
|
-
commitMessage?: string;
|
|
196
|
-
tags: string[];
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Enable JSON output mode
|
|
200
|
-
* @param dryRun Whether this is a dry run
|
|
201
|
-
*/
|
|
202
|
-
declare function enableJsonOutput(dryRun?: boolean): void;
|
|
203
|
-
/**
|
|
204
|
-
* Get the current JSON output data (for testing)
|
|
205
|
-
*/
|
|
206
|
-
declare function getJsonData(): JsonOutputData;
|
|
207
|
-
|
|
208
|
-
export { BaseVersionError, type Config, type JsonOutputData, PackageProcessor, type VersionConfigBase, VersionEngine, VersionErrorCode, calculateVersion, createAsyncStrategy, createSingleStrategy, createSyncStrategy, createVersionError, enableJsonOutput, getJsonData, loadConfig };
|
package/dist/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PackageProcessor,
|
|
3
|
-
VersionEngine,
|
|
4
|
-
VersionErrorCode,
|
|
5
|
-
calculateVersion,
|
|
6
|
-
createAsyncStrategy,
|
|
7
|
-
createSingleStrategy,
|
|
8
|
-
createSyncStrategy,
|
|
9
|
-
createVersionError,
|
|
10
|
-
enableJsonOutput,
|
|
11
|
-
getJsonData,
|
|
12
|
-
loadConfig
|
|
13
|
-
} from "./chunk-ZEXPJ53Z.js";
|
|
14
|
-
import {
|
|
15
|
-
BaseVersionError
|
|
16
|
-
} from "./chunk-GQLJ7JQY.js";
|
|
17
|
-
import "./chunk-LMPZV35Z.js";
|
|
18
|
-
export {
|
|
19
|
-
BaseVersionError,
|
|
20
|
-
PackageProcessor,
|
|
21
|
-
VersionEngine,
|
|
22
|
-
VersionErrorCode,
|
|
23
|
-
calculateVersion,
|
|
24
|
-
createAsyncStrategy,
|
|
25
|
-
createSingleStrategy,
|
|
26
|
-
createSyncStrategy,
|
|
27
|
-
createVersionError,
|
|
28
|
-
enableJsonOutput,
|
|
29
|
-
getJsonData,
|
|
30
|
-
loadConfig
|
|
31
|
-
};
|