versionary 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.
Files changed (70) hide show
  1. package/README.md +217 -8
  2. package/dist/app/release/pr.d.ts +18 -0
  3. package/dist/app/release/pr.js +209 -0
  4. package/dist/app/release/recovery.d.ts +17 -0
  5. package/dist/app/release/recovery.js +101 -0
  6. package/dist/app/release/release.d.ts +1 -0
  7. package/dist/app/release/release.js +90 -0
  8. package/dist/app/release/state.d.ts +10 -0
  9. package/dist/app/release/state.js +59 -0
  10. package/dist/app/release/verify.d.ts +2 -0
  11. package/dist/app/release/verify.js +5 -0
  12. package/dist/cli/index.js +51 -8
  13. package/dist/config/load-config.js +8 -12
  14. package/dist/config/schema.d.ts +25 -85
  15. package/dist/config/schema.js +20 -81
  16. package/dist/domain/release/changelog.d.ts +12 -0
  17. package/dist/domain/release/changelog.js +123 -0
  18. package/dist/domain/release/plan.d.ts +21 -0
  19. package/dist/domain/release/plan.js +114 -0
  20. package/dist/domain/release/semver.d.ts +15 -0
  21. package/dist/domain/release/semver.js +111 -0
  22. package/dist/domain/strategy/node.d.ts +2 -0
  23. package/dist/domain/strategy/node.js +37 -0
  24. package/dist/domain/strategy/resolve.d.ts +3 -0
  25. package/dist/domain/strategy/resolve.js +11 -0
  26. package/dist/domain/strategy/simple.d.ts +2 -0
  27. package/dist/domain/strategy/simple.js +28 -0
  28. package/dist/domain/strategy/types.d.ts +7 -0
  29. package/dist/domain/strategy/types.js +2 -0
  30. package/dist/index.d.ts +6 -1
  31. package/dist/index.js +10 -1
  32. package/dist/infra/git/commits.d.ts +65 -0
  33. package/dist/infra/git/commits.js +436 -0
  34. package/dist/infra/git/repo-url.d.ts +1 -0
  35. package/dist/infra/git/repo-url.js +27 -0
  36. package/dist/infra/scm/github/plugin.d.ts +1 -0
  37. package/dist/infra/scm/github/plugin.js +5 -0
  38. package/dist/infra/scm/runtime.d.ts +2 -0
  39. package/dist/infra/scm/runtime.js +24 -0
  40. package/dist/infra/scm/types.d.ts +1 -0
  41. package/dist/infra/scm/types.js +2 -0
  42. package/dist/plugins/capabilities.d.ts +3 -0
  43. package/dist/plugins/capabilities.js +10 -0
  44. package/dist/plugins/runtime.d.ts +1 -0
  45. package/dist/plugins/runtime.js +5 -0
  46. package/dist/scm/github-plugin.d.ts +2 -0
  47. package/dist/scm/github-plugin.js +207 -0
  48. package/dist/strategies/node.d.ts +1 -0
  49. package/dist/strategies/node.js +5 -0
  50. package/dist/strategies/resolve.d.ts +1 -0
  51. package/dist/strategies/resolve.js +5 -0
  52. package/dist/strategies/simple.d.ts +1 -0
  53. package/dist/strategies/simple.js +5 -0
  54. package/dist/strategies/types.d.ts +1 -0
  55. package/dist/strategies/types.js +2 -0
  56. package/dist/types/config.d.ts +20 -66
  57. package/dist/types/plugins.d.ts +37 -0
  58. package/dist/types/plugins.js +2 -0
  59. package/dist/verify/verify-project.js +13 -13
  60. package/package.json +15 -14
  61. package/dist/simple/changelog.d.ts +0 -3
  62. package/dist/simple/changelog.js +0 -32
  63. package/dist/simple/git.d.ts +0 -7
  64. package/dist/simple/git.js +0 -61
  65. package/dist/simple/plan.d.ts +0 -12
  66. package/dist/simple/plan.js +0 -37
  67. package/dist/simple/pr.d.ts +0 -5
  68. package/dist/simple/pr.js +0 -45
  69. package/dist/simple/semver.d.ts +0 -8
  70. package/dist/simple/semver.js +0 -25
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createSimplePlan = createSimplePlan;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const state_js_1 = require("../../app/release/state.js");
10
+ const load_config_js_1 = require("../../config/load-config.js");
11
+ const commits_js_1 = require("../../infra/git/commits.js");
12
+ const resolve_js_1 = require("../strategy/resolve.js");
13
+ const semver_js_1 = require("./semver.js");
14
+ function getMode(configMode) {
15
+ return configMode ?? "independent";
16
+ }
17
+ function createSimplePlan(cwd = process.cwd()) {
18
+ const loaded = (0, load_config_js_1.loadConfig)(cwd);
19
+ const strategy = (0, resolve_js_1.resolveVersionStrategy)(loaded.config);
20
+ const versionFile = strategy.getVersionFile(loaded.config);
21
+ const changelogFile = loaded.config["changelog-file"] ?? "CHANGELOG.md";
22
+ const releaseBranchPrefix = loaded.config["release-branch"] ?? "versionary/release";
23
+ const baselineSha = (0, state_js_1.readBaselineSha)(cwd) ?? loaded.config["bootstrap-sha"] ?? null;
24
+ const versionPath = node_path_1.default.join(cwd, versionFile);
25
+ if (!node_fs_1.default.existsSync(versionPath)) {
26
+ throw new Error(`Versionary requires ${versionFile} to exist.`);
27
+ }
28
+ const currentVersion = strategy.readVersion(cwd, loaded.config);
29
+ const allowStableMajor = loaded.config["allow-stable-major"] ?? false;
30
+ const configuredPackages = Object.entries(loaded.config.packages ?? {}).map(([pkgPath, cfg]) => ({
31
+ path: pkgPath,
32
+ ...cfg,
33
+ }));
34
+ const monorepoMode = getMode(loaded.config["monorepo-mode"]);
35
+ const hasPackages = configuredPackages.length > 0;
36
+ if (!hasPackages) {
37
+ const parsedCommits = (0, commits_js_1.getParsedCommitsSinceLastTag)(cwd, baselineSha);
38
+ const effectiveCommits = (0, commits_js_1.applyRevertSuppression)(parsedCommits);
39
+ const commits = effectiveCommits;
40
+ const releaseType = (0, commits_js_1.analyzeParsedCommits)(parsedCommits);
41
+ const nextVersion = releaseType
42
+ ? (0, semver_js_1.bumpVersion)(currentVersion, releaseType, { allowStableMajor })
43
+ : null;
44
+ return {
45
+ mode: "simple",
46
+ releaseType,
47
+ currentVersion,
48
+ nextVersion,
49
+ versionFile,
50
+ changelogFile,
51
+ releaseBranchPrefix,
52
+ baselineSha,
53
+ commits,
54
+ };
55
+ }
56
+ const packagePlans = configuredPackages
57
+ .map((pkg) => {
58
+ const parsedCommits = (0, commits_js_1.getParsedCommitsForPath)(cwd, baselineSha, pkg.path, pkg["exclude-paths"] ?? []);
59
+ const effectiveCommits = (0, commits_js_1.applyRevertSuppression)(parsedCommits);
60
+ const commits = effectiveCommits;
61
+ const releaseType = (0, commits_js_1.analyzeParsedCommits)(parsedCommits);
62
+ const nextVersion = releaseType
63
+ ? (0, semver_js_1.bumpVersion)(currentVersion, releaseType, { allowStableMajor })
64
+ : null;
65
+ return {
66
+ path: pkg.path,
67
+ releaseType,
68
+ currentVersion,
69
+ nextVersion,
70
+ commits,
71
+ parsedCommits,
72
+ };
73
+ })
74
+ .sort((a, b) => a.path.localeCompare(b.path));
75
+ if (monorepoMode === "fixed") {
76
+ const fixedType = (0, commits_js_1.analyzeParsedCommits)(packagePlans.flatMap((pkgPlan) => pkgPlan.parsedCommits));
77
+ const fixedNextVersion = fixedType
78
+ ? (0, semver_js_1.bumpVersion)(currentVersion, fixedType, { allowStableMajor })
79
+ : null;
80
+ const adjusted = packagePlans.map((pkgPlan) => ({
81
+ ...pkgPlan,
82
+ releaseType: fixedType,
83
+ nextVersion: fixedNextVersion,
84
+ }));
85
+ return {
86
+ mode: "simple",
87
+ releaseType: fixedType,
88
+ currentVersion,
89
+ nextVersion: fixedNextVersion,
90
+ versionFile,
91
+ changelogFile,
92
+ releaseBranchPrefix,
93
+ baselineSha,
94
+ commits: adjusted.flatMap((pkgPlan) => pkgPlan.commits),
95
+ packages: adjusted,
96
+ };
97
+ }
98
+ const overallType = (0, commits_js_1.analyzeParsedCommits)(packagePlans.flatMap((pkgPlan) => pkgPlan.parsedCommits));
99
+ const overallNextVersion = overallType
100
+ ? (0, semver_js_1.bumpVersion)(currentVersion, overallType, { allowStableMajor })
101
+ : null;
102
+ return {
103
+ mode: "simple",
104
+ releaseType: overallType,
105
+ currentVersion,
106
+ nextVersion: overallNextVersion,
107
+ versionFile,
108
+ changelogFile,
109
+ releaseBranchPrefix,
110
+ baselineSha,
111
+ commits: packagePlans.flatMap((pkgPlan) => pkgPlan.commits),
112
+ packages: packagePlans,
113
+ };
114
+ }
@@ -0,0 +1,15 @@
1
+ export type ReleaseType = "major" | "minor" | "patch" | null;
2
+ export interface ParsedVersion {
3
+ major: number;
4
+ minor: number;
5
+ patch: number;
6
+ prerelease: string[];
7
+ build: string[];
8
+ }
9
+ export interface BumpVersionOptions {
10
+ allowStableMajor?: boolean;
11
+ }
12
+ export declare function parseVersion(version: string): ParsedVersion;
13
+ export declare function isValidVersion(version: string): boolean;
14
+ export declare function compareVersions(leftRaw: string, rightRaw: string): number;
15
+ export declare function bumpVersion(current: string, releaseType: Exclude<ReleaseType, null>, options?: BumpVersionOptions): string;
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseVersion = parseVersion;
4
+ exports.isValidVersion = isValidVersion;
5
+ exports.compareVersions = compareVersions;
6
+ exports.bumpVersion = bumpVersion;
7
+ const SEMVER_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/u;
8
+ function parseVersion(version) {
9
+ const match = version.trim().match(SEMVER_PATTERN);
10
+ if (!match) {
11
+ throw new Error(`Invalid version in version file: "${version}". Expected SemVer 2.0.0 format.`);
12
+ }
13
+ return {
14
+ major: Number(match[1]),
15
+ minor: Number(match[2]),
16
+ patch: Number(match[3]),
17
+ prerelease: match[4] ? match[4].split(".") : [],
18
+ build: match[5] ? match[5].split(".") : [],
19
+ };
20
+ }
21
+ function isValidVersion(version) {
22
+ return SEMVER_PATTERN.test(version.trim());
23
+ }
24
+ function isNumericIdentifier(identifier) {
25
+ return /^(0|[1-9]\d*)$/u.test(identifier);
26
+ }
27
+ function comparePreReleaseIdentifiers(left, right) {
28
+ const leftNumeric = isNumericIdentifier(left);
29
+ const rightNumeric = isNumericIdentifier(right);
30
+ if (leftNumeric && rightNumeric) {
31
+ const leftNumber = Number(left);
32
+ const rightNumber = Number(right);
33
+ if (leftNumber < rightNumber) {
34
+ return -1;
35
+ }
36
+ if (leftNumber > rightNumber) {
37
+ return 1;
38
+ }
39
+ return 0;
40
+ }
41
+ if (leftNumeric && !rightNumeric) {
42
+ return -1;
43
+ }
44
+ if (!leftNumeric && rightNumeric) {
45
+ return 1;
46
+ }
47
+ if (left < right) {
48
+ return -1;
49
+ }
50
+ if (left > right) {
51
+ return 1;
52
+ }
53
+ return 0;
54
+ }
55
+ function compareVersions(leftRaw, rightRaw) {
56
+ const left = parseVersion(leftRaw);
57
+ const right = parseVersion(rightRaw);
58
+ if (left.major !== right.major) {
59
+ return left.major < right.major ? -1 : 1;
60
+ }
61
+ if (left.minor !== right.minor) {
62
+ return left.minor < right.minor ? -1 : 1;
63
+ }
64
+ if (left.patch !== right.patch) {
65
+ return left.patch < right.patch ? -1 : 1;
66
+ }
67
+ const leftPre = left.prerelease;
68
+ const rightPre = right.prerelease;
69
+ if (leftPre.length === 0 && rightPre.length === 0) {
70
+ return 0;
71
+ }
72
+ if (leftPre.length === 0) {
73
+ return 1;
74
+ }
75
+ if (rightPre.length === 0) {
76
+ return -1;
77
+ }
78
+ const maxLength = Math.max(leftPre.length, rightPre.length);
79
+ for (let index = 0; index < maxLength; index += 1) {
80
+ const leftIdentifier = leftPre[index];
81
+ const rightIdentifier = rightPre[index];
82
+ if (leftIdentifier === undefined) {
83
+ return -1;
84
+ }
85
+ if (rightIdentifier === undefined) {
86
+ return 1;
87
+ }
88
+ const comparison = comparePreReleaseIdentifiers(leftIdentifier, rightIdentifier);
89
+ if (comparison !== 0) {
90
+ return comparison;
91
+ }
92
+ }
93
+ return 0;
94
+ }
95
+ function bumpVersion(current, releaseType, options = {}) {
96
+ const parsed = parseVersion(current);
97
+ const allowStableMajor = options.allowStableMajor ?? false;
98
+ if (releaseType === "major") {
99
+ if (parsed.major === 0 && !allowStableMajor) {
100
+ return `0.${parsed.minor + 1}.0`;
101
+ }
102
+ if (parsed.major === 0 && allowStableMajor) {
103
+ return "1.0.0";
104
+ }
105
+ return `${parsed.major + 1}.0.0`;
106
+ }
107
+ if (releaseType === "minor") {
108
+ return `${parsed.major}.${parsed.minor + 1}.0`;
109
+ }
110
+ return `${parsed.major}.${parsed.minor}.${parsed.patch + 1}`;
111
+ }
@@ -0,0 +1,2 @@
1
+ import type { VersionStrategy } from "./types.js";
2
+ export declare const nodeVersionStrategy: VersionStrategy;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.nodeVersionStrategy = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ exports.nodeVersionStrategy = {
10
+ name: "node",
11
+ getVersionFile(config) {
12
+ return config["version-file"] ?? "version.txt";
13
+ },
14
+ readVersion(cwd, config) {
15
+ const versionFile = this.getVersionFile(config);
16
+ const versionPath = node_path_1.default.join(cwd, versionFile);
17
+ if (!node_fs_1.default.existsSync(versionPath)) {
18
+ throw new Error(`Versionary requires ${versionFile} to exist.`);
19
+ }
20
+ return node_fs_1.default.readFileSync(versionPath, "utf8").trim();
21
+ },
22
+ writeVersion(cwd, config, version) {
23
+ const versionFile = this.getVersionFile(config);
24
+ const versionPath = node_path_1.default.join(cwd, versionFile);
25
+ node_fs_1.default.writeFileSync(versionPath, `${version}\n`, "utf8");
26
+ const updatedFiles = [versionFile];
27
+ const packageJsonPath = node_path_1.default.join(cwd, "package.json");
28
+ if (node_fs_1.default.existsSync(packageJsonPath)) {
29
+ const packageJsonRaw = node_fs_1.default.readFileSync(packageJsonPath, "utf8");
30
+ const packageJson = JSON.parse(packageJsonRaw);
31
+ packageJson.version = version;
32
+ node_fs_1.default.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, "utf8");
33
+ updatedFiles.push("package.json");
34
+ }
35
+ return updatedFiles;
36
+ },
37
+ };
@@ -0,0 +1,3 @@
1
+ import type { VersionaryConfig } from "../../types/config.js";
2
+ import type { VersionStrategy } from "./types.js";
3
+ export declare function resolveVersionStrategy(config: VersionaryConfig): VersionStrategy;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveVersionStrategy = resolveVersionStrategy;
4
+ const node_js_1 = require("./node.js");
5
+ const simple_js_1 = require("./simple.js");
6
+ function resolveVersionStrategy(config) {
7
+ if (config["release-type"] === "node") {
8
+ return node_js_1.nodeVersionStrategy;
9
+ }
10
+ return simple_js_1.simpleVersionStrategy;
11
+ }
@@ -0,0 +1,2 @@
1
+ import type { VersionStrategy } from "./types.js";
2
+ export declare const simpleVersionStrategy: VersionStrategy;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.simpleVersionStrategy = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ exports.simpleVersionStrategy = {
10
+ name: "simple",
11
+ getVersionFile(config) {
12
+ return config["version-file"] ?? "version.txt";
13
+ },
14
+ readVersion(cwd, config) {
15
+ const versionFile = this.getVersionFile(config);
16
+ const versionPath = node_path_1.default.join(cwd, versionFile);
17
+ if (!node_fs_1.default.existsSync(versionPath)) {
18
+ throw new Error(`Versionary requires ${versionFile} to exist.`);
19
+ }
20
+ return node_fs_1.default.readFileSync(versionPath, "utf8").trim();
21
+ },
22
+ writeVersion(cwd, config, version) {
23
+ const versionFile = this.getVersionFile(config);
24
+ const versionPath = node_path_1.default.join(cwd, versionFile);
25
+ node_fs_1.default.writeFileSync(versionPath, `${version}\n`, "utf8");
26
+ return [versionFile];
27
+ },
28
+ };
@@ -0,0 +1,7 @@
1
+ import type { VersionaryConfig } from "../../types/config.js";
2
+ export interface VersionStrategy {
3
+ name: string;
4
+ getVersionFile(config: VersionaryConfig): string;
5
+ readVersion(cwd: string, config: VersionaryConfig): string;
6
+ writeVersion(cwd: string, config: VersionaryConfig, version: string): string[];
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
- export type { VersionaryConfig, VersionaryPackage, VersionaryPluginRef, VersionaryArtifactRule, } from "./types/config.js";
2
1
  export { loadConfig } from "./config/load-config.js";
2
+ export { resolveVersionStrategy } from "./domain/strategy/resolve.js";
3
+ export { createGitHubPlugin } from "./infra/scm/github/plugin.js";
4
+ export { findPluginsByCapability, pluginHasCapability, } from "./plugins/capabilities.js";
5
+ export { loadRuntimePlugins } from "./plugins/runtime.js";
6
+ export type { VersionaryArtifactRule, VersionaryConfig, VersionaryPackage, } from "./types/config.js";
7
+ export type { VersionaryPluginCapability, VersionaryPluginContext, VersionaryPluginRuntime, VersionaryScmReleaseMetadataInput, VersionaryScmReleaseMetadataResult, VersionaryScmReviewRequestInput, VersionaryScmReviewRequestResult, } from "./types/plugins.js";
3
8
  export { verifyProject } from "./verify/verify-project.js";
package/dist/index.js CHANGED
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyProject = exports.loadConfig = void 0;
3
+ exports.verifyProject = exports.loadRuntimePlugins = exports.pluginHasCapability = exports.findPluginsByCapability = exports.createGitHubPlugin = exports.resolveVersionStrategy = exports.loadConfig = void 0;
4
4
  var load_config_js_1 = require("./config/load-config.js");
5
5
  Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return load_config_js_1.loadConfig; } });
6
+ var resolve_js_1 = require("./domain/strategy/resolve.js");
7
+ Object.defineProperty(exports, "resolveVersionStrategy", { enumerable: true, get: function () { return resolve_js_1.resolveVersionStrategy; } });
8
+ var plugin_js_1 = require("./infra/scm/github/plugin.js");
9
+ Object.defineProperty(exports, "createGitHubPlugin", { enumerable: true, get: function () { return plugin_js_1.createGitHubPlugin; } });
10
+ var capabilities_js_1 = require("./plugins/capabilities.js");
11
+ Object.defineProperty(exports, "findPluginsByCapability", { enumerable: true, get: function () { return capabilities_js_1.findPluginsByCapability; } });
12
+ Object.defineProperty(exports, "pluginHasCapability", { enumerable: true, get: function () { return capabilities_js_1.pluginHasCapability; } });
13
+ var runtime_js_1 = require("./plugins/runtime.js");
14
+ Object.defineProperty(exports, "loadRuntimePlugins", { enumerable: true, get: function () { return runtime_js_1.loadRuntimePlugins; } });
6
15
  var verify_project_js_1 = require("./verify/verify-project.js");
7
16
  Object.defineProperty(exports, "verifyProject", { enumerable: true, get: function () { return verify_project_js_1.verifyProject; } });
@@ -0,0 +1,65 @@
1
+ import type { ReleaseType } from "../../domain/release/semver.js";
2
+ export interface CommitInfo {
3
+ hash: string;
4
+ subject: string;
5
+ }
6
+ export interface ParsedCommit {
7
+ hash: string;
8
+ subject: string;
9
+ body: string;
10
+ fullMessage: string;
11
+ type: string | null;
12
+ scope: string | null;
13
+ description: string;
14
+ isBreaking: boolean;
15
+ isRevert: boolean;
16
+ footers: Array<{
17
+ token: string;
18
+ value: string;
19
+ }>;
20
+ revertedShas: string[];
21
+ header?: string;
22
+ merge?: string | null;
23
+ footer?: string | null;
24
+ notes?: CommitNote[];
25
+ references?: CommitReference[];
26
+ mentions?: string[];
27
+ revert?: RevertInfo | null;
28
+ isConventional?: boolean;
29
+ diagnostics?: ParseDiagnostic[];
30
+ }
31
+ export type CommitParseDiagnosticCode = "invalid-header" | "malformed-breaking-footer" | "malformed-reference" | "ambiguous-revert";
32
+ export interface ParseDiagnostic {
33
+ code: CommitParseDiagnosticCode;
34
+ message: string;
35
+ }
36
+ export interface CommitNote {
37
+ title: string;
38
+ text: string;
39
+ }
40
+ export interface CommitReference {
41
+ action: string | null;
42
+ owner: string | null;
43
+ repository: string | null;
44
+ issue: string | null;
45
+ raw: string;
46
+ prefix: "#" | "GH-";
47
+ }
48
+ export interface RevertInfo {
49
+ header: string;
50
+ hashes: string[];
51
+ }
52
+ export declare function parseConventionalCommitMessage(subject: string, body?: string): ParsedCommit;
53
+ export declare function parseConventionalCommitMessageDetailed(header: string, body?: string): ParsedCommit;
54
+ export declare function getCommitsSinceLastTag(cwd?: string, baselineSha?: string | null): CommitInfo[];
55
+ export declare function getCommitsForPath(cwd?: string, baselineSha?: string | null, packagePath?: string, excludePaths?: string[]): CommitInfo[];
56
+ export declare function getParsedCommitsSinceLastTag(cwd?: string, baselineSha?: string | null): ParsedCommit[];
57
+ export declare function getParsedCommitsForPath(cwd?: string, baselineSha?: string | null, packagePath?: string, excludePaths?: string[]): ParsedCommit[];
58
+ export declare function inferReleaseTypeFromParsedCommit(commit: ParsedCommit): ReleaseType;
59
+ export declare function inferReleaseTypeFromSubject(subject: string): ReleaseType;
60
+ export declare function isReleasableCommit(subject: string): boolean;
61
+ export declare function getCommitParseDiagnostics(commit: ParsedCommit): ParseDiagnostic[];
62
+ export declare function analyzeCommits(commits: CommitInfo[]): ReleaseType;
63
+ export declare function applyRevertSuppression(commits: ParsedCommit[]): ParsedCommit[];
64
+ export declare function analyzeParsedCommits(commits: ParsedCommit[]): ReleaseType;
65
+ export declare function isReleasableParsedCommit(commit: ParsedCommit): boolean;