@tallyrelease/core 0.3.2-beta.4 → 0.4.0-beta.2
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/CHANGELOG.md +7 -0
- package/dist/branches.d.ts +16 -0
- package/dist/branches.js +43 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.2](https://github.com/abinnovision/tallyrelease/compare/core-v0.3.1...core-v0.3.2) (2026-10-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **core:** Synchronize tallyrelease versions
|
|
9
|
+
|
|
3
10
|
## [0.3.1](https://github.com/abinnovision/tallyrelease/compare/core-v0.3.0...core-v0.3.1) (2026-10-16)
|
|
4
11
|
|
|
5
12
|
|
package/dist/branches.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { Plan } from "./plan.js";
|
|
1
2
|
import type { BumpLevel } from "./plugin.js";
|
|
3
|
+
import type { ReleaseItem as PrItem } from "./release-items.js";
|
|
2
4
|
import type { BranchRule } from "./release.js";
|
|
5
|
+
import type { Workspace } from "./workspace.js";
|
|
3
6
|
/** The branch rule matching the planned branch. */
|
|
4
7
|
export interface Line {
|
|
5
8
|
rule: string;
|
|
@@ -68,3 +71,16 @@ export declare const checkLimits: (line: Line | null, items: readonly LimitItem[
|
|
|
68
71
|
branch: string;
|
|
69
72
|
implicit: boolean;
|
|
70
73
|
}) => void;
|
|
74
|
+
/** A maintenance branch to cut at the last release of the previous major. */
|
|
75
|
+
export interface MaintenanceCut {
|
|
76
|
+
branch: string;
|
|
77
|
+
tag: string;
|
|
78
|
+
/** `2.x`, or `2.3.x` for a `{minor}` rule. */
|
|
79
|
+
line: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The cut for `item` when a default-line plan releases a new major: the first
|
|
83
|
+
* maintenance rule with `{major}` and no `*` that targets the item or nothing,
|
|
84
|
+
* rendered from `from`, at the item's base tag; else undefined.
|
|
85
|
+
*/
|
|
86
|
+
export declare const maintenanceCut: (workspace: Workspace, plan: Plan, item: PrItem) => MaintenanceCut | undefined;
|
package/dist/branches.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TallyError } from "./errors.js";
|
|
2
|
+
import { schemeRegistry } from "./schemes.js";
|
|
2
3
|
import { maxLevel } from "./util.js";
|
|
3
4
|
const SPECIAL = /[\\^$.*+?()[\]{}|/]/gu;
|
|
4
5
|
const PART = /\{(major|minor)\}|\*/gu;
|
|
@@ -166,3 +167,45 @@ export const checkLimits = (line, items, { branch, implicit }) => {
|
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* The cut for `item` when a default-line plan releases a new major: the first
|
|
172
|
+
* maintenance rule with `{major}` and no `*` that targets the item or nothing,
|
|
173
|
+
* rendered from `from`, at the item's base tag; else undefined.
|
|
174
|
+
*/
|
|
175
|
+
export const maintenanceCut = (workspace, plan, item) => {
|
|
176
|
+
const base = item.kind === "group"
|
|
177
|
+
? plan.groups.find((g) => g.name === item.name)
|
|
178
|
+
: plan.units.find((u) => u.id === item.name);
|
|
179
|
+
const unit = workspace.units.find((u) => u.id === item.units[0]);
|
|
180
|
+
const scheme = unit && schemeRegistry(workspace.schemes).get(unit.scheme);
|
|
181
|
+
if (plan.line?.kind !== "default" ||
|
|
182
|
+
!scheme ||
|
|
183
|
+
!base?.from ||
|
|
184
|
+
!base.baseTag) {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
const from = scheme.parse(base.from);
|
|
188
|
+
const next = scheme.parse(item.version);
|
|
189
|
+
if (from === undefined || next === undefined) {
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
const { major, minor } = scheme.core(from);
|
|
193
|
+
const rule = workspace.release.branches.find((r) => r.line === "maintenance" &&
|
|
194
|
+
r.name.includes("{major}") &&
|
|
195
|
+
!r.name.includes("*") &&
|
|
196
|
+
((r.unit === null && r.group === null) ||
|
|
197
|
+
(item.kind === "group" ? r.group : r.unit) === item.name));
|
|
198
|
+
if (!rule || scheme.core(next).major <= major) {
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
const withMinor = rule.name.includes("{minor}");
|
|
202
|
+
return {
|
|
203
|
+
branch: rule.name
|
|
204
|
+
.replace("{major}", String(major))
|
|
205
|
+
.replace("{minor}", String(minor)),
|
|
206
|
+
tag: base.baseTag,
|
|
207
|
+
line: withMinor
|
|
208
|
+
? `${String(major)}.${String(minor)}.x`
|
|
209
|
+
: `${String(major)}.x`,
|
|
210
|
+
};
|
|
211
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type { SchemeEntry } from "./schemes.js";
|
|
|
17
17
|
export type { SemVer } from "./semver.js";
|
|
18
18
|
export type { IntentEntry, Workspace, WorkspaceInput } from "./workspace.js";
|
|
19
19
|
export { computeAffected } from "./affected.js";
|
|
20
|
+
export { maintenanceCut } from "./branches.js";
|
|
20
21
|
export { changelogSection, releaseNotes, renderChangelogSection, updateChangelog, } from "./changelog.js";
|
|
21
22
|
export { CONFIG_FILE } from "./config.js";
|
|
22
23
|
export { conventionalCommits, parseCommit } from "./conventional.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const version = "0.0.0";
|
|
2
2
|
export { computeAffected } from "./affected.js";
|
|
3
|
+
export { maintenanceCut } from "./branches.js";
|
|
3
4
|
export { changelogSection, releaseNotes, renderChangelogSection, updateChangelog, } from "./changelog.js";
|
|
4
5
|
export { CONFIG_FILE } from "./config.js";
|
|
5
6
|
export { conventionalCommits, parseCommit } from "./conventional.js";
|