versionary 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/README.md +39 -6
- package/dist/cli/index.js +43 -2
- package/dist/config/load-config.js +6 -0
- package/dist/config/schema.d.ts +24 -85
- package/dist/config/schema.js +19 -81
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -1
- package/dist/plugins/capabilities.d.ts +3 -0
- package/dist/plugins/capabilities.js +10 -0
- package/dist/plugins/runtime.d.ts +2 -0
- package/dist/plugins/runtime.js +24 -0
- package/dist/scm/github-plugin.d.ts +2 -0
- package/dist/scm/github-plugin.js +114 -0
- package/dist/simple/changelog.js +16 -2
- package/dist/simple/git.d.ts +4 -1
- package/dist/simple/git.js +59 -6
- package/dist/simple/plan.d.ts +8 -0
- package/dist/simple/plan.js +73 -13
- package/dist/simple/pr.d.ts +10 -0
- package/dist/simple/pr.js +155 -6
- package/dist/simple/release.d.ts +1 -0
- package/dist/simple/release.js +77 -0
- package/dist/simple/repo-url.d.ts +1 -0
- package/dist/simple/repo-url.js +27 -0
- package/dist/simple/state.d.ts +3 -0
- package/dist/simple/state.js +47 -0
- package/dist/types/config.d.ts +19 -66
- package/dist/types/plugins.d.ts +36 -0
- package/dist/types/plugins.js +2 -0
- package/dist/verify/verify-project.js +11 -13
- package/package.json +15 -14
package/dist/types/config.d.ts
CHANGED
|
@@ -1,77 +1,30 @@
|
|
|
1
1
|
export type ConfigFileFormat = "jsonc" | "json" | "toml" | "js";
|
|
2
|
-
export interface VersionaryBootstrap {
|
|
3
|
-
sha?: string;
|
|
4
|
-
tag?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface VersionaryHistory {
|
|
7
|
-
bootstrap?: VersionaryBootstrap;
|
|
8
|
-
}
|
|
9
|
-
export interface VersionaryMonorepo {
|
|
10
|
-
mode: "independent" | "fixed";
|
|
11
|
-
}
|
|
12
|
-
export interface VersionaryVersioningDefaults {
|
|
13
|
-
bumpMinorPreMajor?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface VersionaryChangelogDefaults {
|
|
16
|
-
includeAuthors?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface VersionaryCommitConventions {
|
|
19
|
-
preset: "conventional" | "angular" | "custom";
|
|
20
|
-
}
|
|
21
|
-
export interface VersionaryDefaults {
|
|
22
|
-
strategy?: string;
|
|
23
|
-
versioning?: VersionaryVersioningDefaults;
|
|
24
|
-
changelog?: VersionaryChangelogDefaults;
|
|
25
|
-
commitConventions?: VersionaryCommitConventions;
|
|
26
|
-
}
|
|
27
2
|
export interface VersionaryArtifactRule {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
3
|
+
type: "json" | "toml" | "yaml" | "regex";
|
|
4
|
+
path: string;
|
|
5
|
+
jsonpath?: string;
|
|
31
6
|
pattern?: string;
|
|
32
7
|
}
|
|
33
8
|
export interface VersionaryPackage {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
artifacts?: VersionaryArtifactRule[];
|
|
39
|
-
}
|
|
40
|
-
export interface VersionaryPluginRef {
|
|
41
|
-
name: string;
|
|
42
|
-
options?: Record<string, unknown>;
|
|
43
|
-
}
|
|
44
|
-
export type VersionaryLifecycle = "plan" | "pr" | "release";
|
|
45
|
-
export type VersionaryPluginStep = "verifyConditions" | "analyzeCommits" | "resolveReverts" | "verifyRelease" | "generateNotes" | "updateArtifacts" | "preparePr" | "publish" | "postRelease" | "success" | "fail";
|
|
46
|
-
export type VersionaryPluginMergeStrategy = "highest" | "concat" | "override" | "reduce";
|
|
47
|
-
export interface VersionaryPluginExecution {
|
|
48
|
-
step: VersionaryPluginStep;
|
|
49
|
-
lifecycle?: VersionaryLifecycle[];
|
|
50
|
-
merge?: VersionaryPluginMergeStrategy;
|
|
51
|
-
}
|
|
52
|
-
export interface VersionaryPluginPresetRef {
|
|
53
|
-
name: string;
|
|
54
|
-
}
|
|
55
|
-
export interface VersionaryPluginConfig {
|
|
56
|
-
extends?: VersionaryPluginPresetRef[];
|
|
57
|
-
globalOptions?: Record<string, unknown>;
|
|
58
|
-
execution?: VersionaryPluginExecution[];
|
|
59
|
-
plugins?: VersionaryPluginRef[];
|
|
9
|
+
"release-type"?: string;
|
|
10
|
+
"package-name"?: string;
|
|
11
|
+
"exclude-paths"?: string[];
|
|
12
|
+
"extra-files"?: VersionaryArtifactRule[];
|
|
60
13
|
}
|
|
61
14
|
export interface VersionaryConfig {
|
|
62
15
|
version: 1;
|
|
63
|
-
mode?: "
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
16
|
+
"review-mode"?: "direct" | "review";
|
|
17
|
+
"version-file"?: string;
|
|
18
|
+
"changelog-file"?: string;
|
|
19
|
+
"release-branch"?: string;
|
|
20
|
+
"baseline-file"?: string;
|
|
21
|
+
"bootstrap-sha"?: string;
|
|
22
|
+
"monorepo-mode"?: "independent" | "fixed";
|
|
23
|
+
"bump-minor-pre-major"?: boolean;
|
|
24
|
+
"include-commit-authors"?: boolean;
|
|
25
|
+
"release-type"?: string;
|
|
26
|
+
packages?: Record<string, VersionaryPackage>;
|
|
27
|
+
plugins?: string[];
|
|
75
28
|
}
|
|
76
29
|
export interface LoadedConfig {
|
|
77
30
|
path: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type VersionaryPluginCapability = "scm.reviewRequest" | "scm.releaseMetadata";
|
|
2
|
+
export interface VersionaryScmReviewRequestInput {
|
|
3
|
+
baseBranch: string;
|
|
4
|
+
headBranch: string;
|
|
5
|
+
title: string;
|
|
6
|
+
body: string;
|
|
7
|
+
labels?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface VersionaryScmReviewRequestResult {
|
|
10
|
+
id: string;
|
|
11
|
+
number?: number;
|
|
12
|
+
url: string;
|
|
13
|
+
state: "open" | "closed" | "merged";
|
|
14
|
+
}
|
|
15
|
+
export interface VersionaryScmReleaseMetadataInput {
|
|
16
|
+
tag: string;
|
|
17
|
+
version: string;
|
|
18
|
+
notes: string;
|
|
19
|
+
}
|
|
20
|
+
export interface VersionaryScmReleaseMetadataResult {
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
export interface VersionaryPluginContext {
|
|
24
|
+
cwd: string;
|
|
25
|
+
logger?: {
|
|
26
|
+
info: (message: string) => void;
|
|
27
|
+
warn: (message: string) => void;
|
|
28
|
+
error: (message: string) => void;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface VersionaryPluginRuntime {
|
|
32
|
+
name: string;
|
|
33
|
+
capabilities: VersionaryPluginCapability[];
|
|
34
|
+
createOrUpdateReviewRequest?: (input: VersionaryScmReviewRequestInput, context: VersionaryPluginContext) => Promise<VersionaryScmReviewRequestResult>;
|
|
35
|
+
createReleaseMetadata?: (input: VersionaryScmReleaseMetadataInput, context: VersionaryPluginContext) => Promise<VersionaryScmReleaseMetadataResult>;
|
|
36
|
+
}
|
|
@@ -15,23 +15,21 @@ function verifyProject(cwd = process.cwd()) {
|
|
|
15
15
|
ok: true,
|
|
16
16
|
details: `Loaded ${node_path_1.default.basename(config.path)} (${config.format})`,
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
}
|
|
18
|
+
const versionFile = config.config["version-file"] ?? "version.txt";
|
|
19
|
+
const exists = node_fs_1.default.existsSync(node_path_1.default.join(cwd, versionFile));
|
|
20
|
+
checks.push({
|
|
21
|
+
name: `version-file:${versionFile}`,
|
|
22
|
+
ok: exists,
|
|
23
|
+
details: exists ? "Version file exists" : `Missing ${versionFile}`,
|
|
24
|
+
});
|
|
27
25
|
if (config.config.packages) {
|
|
28
|
-
for (const
|
|
29
|
-
const pkgPath = node_path_1.default.join(cwd,
|
|
26
|
+
for (const pkgPathRaw of Object.keys(config.config.packages)) {
|
|
27
|
+
const pkgPath = node_path_1.default.join(cwd, pkgPathRaw);
|
|
30
28
|
const exists = node_fs_1.default.existsSync(pkgPath);
|
|
31
29
|
checks.push({
|
|
32
|
-
name: `package-path:${
|
|
30
|
+
name: `package-path:${pkgPathRaw}`,
|
|
33
31
|
ok: exists,
|
|
34
|
-
details: exists ? "Path exists" : `Missing path: ${
|
|
32
|
+
details: exists ? "Path exists" : `Missing path: ${pkgPathRaw}`,
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "versionary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Automatic release framework based on conventional commits and semantic versioning",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"releasing",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Johan Larsson",
|
|
20
20
|
"type": "commonjs",
|
|
21
|
-
"packageManager": "pnpm@10.33.0",
|
|
22
21
|
"bin": {
|
|
23
22
|
"versionary": "dist/cli/index.js"
|
|
24
23
|
},
|
|
@@ -27,17 +26,8 @@
|
|
|
27
26
|
],
|
|
28
27
|
"main": "dist/index.js",
|
|
29
28
|
"types": "dist/index.d.ts",
|
|
30
|
-
"scripts": {
|
|
31
|
-
"prepare": "pnpm run build",
|
|
32
|
-
"build": "tsc -p tsconfig.json",
|
|
33
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"verify": "tsx src/cli/index.ts verify",
|
|
36
|
-
"plan": "tsx src/cli/index.ts plan",
|
|
37
|
-
"changelog": "tsx src/cli/index.ts changelog",
|
|
38
|
-
"pr": "tsx src/cli/index.ts pr"
|
|
39
|
-
},
|
|
40
29
|
"dependencies": {
|
|
30
|
+
"@octokit/rest": "^22.0.0",
|
|
41
31
|
"@iarna/toml": "^2.2.5",
|
|
42
32
|
"jsonc-parser": "^3.3.1",
|
|
43
33
|
"zod": "^4.1.12"
|
|
@@ -46,6 +36,17 @@
|
|
|
46
36
|
"@types/node": "^24.7.2",
|
|
47
37
|
"tsx": "^4.20.6",
|
|
48
38
|
"typescript": "^5.9.3",
|
|
49
|
-
"vitest": "^
|
|
39
|
+
"vitest": "^4.1.4"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"verify": "tsx src/cli/index.ts verify",
|
|
46
|
+
"run": "tsx src/cli/index.ts run",
|
|
47
|
+
"plan": "tsx src/cli/index.ts plan",
|
|
48
|
+
"changelog": "tsx src/cli/index.ts changelog",
|
|
49
|
+
"pr": "tsx src/cli/index.ts pr",
|
|
50
|
+
"release": "tsx src/cli/index.ts release"
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
}
|