@varlock/bumpy 1.4.2 → 1.5.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/dist/{apply-release-plan-60VfCLF8.mjs → apply-release-plan-CIlB1M6e.mjs} +1 -1
- package/dist/{changelog-DP3OrTqQ.mjs → changelog-CXX-Cviy.mjs} +7 -6
- package/dist/{changelog-github-Da5KekQd.mjs → changelog-github-BOs4cEhS.mjs} +6 -5
- package/dist/{ci-S7H1RK-6.mjs → ci-DjrgGbYj.mjs} +5 -5
- package/dist/cli.mjs +7 -7
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +3 -3
- package/dist/{publish-DWdN3o9u.mjs → publish-Kf5bq4Ph.mjs} +26 -7
- package/dist/{release-plan-ClHMgUMl.mjs → release-plan-DGDgSWZo.mjs} +47 -14
- package/dist/{status-DsHn_xdJ.mjs → status-CqefyAEI.mjs} +1 -1
- package/dist/{version-sDrbp6HI.mjs → version-Cj-Lkhbh.mjs} +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as readJson, c as removeFile, f as writeText, i as listFiles, l as updateJsonFields, n as exists, s as readText, u as updateJsonNestedField } from "./fs-DnDogVn-.mjs";
|
|
2
2
|
import { r as getBumpyDir } from "./config-D13G4-R8.mjs";
|
|
3
|
-
import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry } from "./changelog-
|
|
3
|
+
import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry } from "./changelog-CXX-Cviy.mjs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
//#region src/core/apply-release-plan.ts
|
|
6
6
|
/** Apply the release plan: bump versions, update changelogs, delete bump files */
|
|
@@ -22,8 +22,7 @@ const defaultFormatter = (ctx) => {
|
|
|
22
22
|
lines.push(`## ${release.newVersion}`);
|
|
23
23
|
lines.push(`<sub>${date}</sub>`);
|
|
24
24
|
lines.push("");
|
|
25
|
-
const
|
|
26
|
-
const sorted = sortBumpFilesByType(relevantBumpFiles, release.name);
|
|
25
|
+
const sorted = sortBumpFilesByType(bumpFiles.filter((bf) => release.bumpFiles.includes(bf.id)), release.name);
|
|
27
26
|
for (const bf of sorted) {
|
|
28
27
|
if (!bf.summary) continue;
|
|
29
28
|
const type = getBumpTypeForPackage(bf, release.name);
|
|
@@ -32,18 +31,20 @@ const defaultFormatter = (ctx) => {
|
|
|
32
31
|
lines.push(`- ${tag}${summaryLines[0]}`);
|
|
33
32
|
for (let i = 1; i < summaryLines.length; i++) if (summaryLines[i].trim()) lines.push(` ${summaryLines[i]}`);
|
|
34
33
|
}
|
|
34
|
+
const sourceList = release.bumpSources.length > 0 ? release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ") : "";
|
|
35
35
|
if (release.isDependencyBump) {
|
|
36
36
|
const tag = release.type !== "patch" ? `*(patch)* ` : "";
|
|
37
|
-
lines.push(`- ${tag}Updated
|
|
37
|
+
lines.push(`- ${tag}Updated dependency ${sourceList || "(internal)"}`);
|
|
38
38
|
}
|
|
39
|
-
if (release.
|
|
39
|
+
if (release.isGroupBump) lines.push(sourceList ? `- Version bump from group with ${sourceList}` : "- Version bump from group");
|
|
40
|
+
if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) lines.push(sourceList ? `- Version bump from ${sourceList}` : "- Version bump via cascade rule");
|
|
40
41
|
lines.push("");
|
|
41
42
|
return lines.join("\n");
|
|
42
43
|
};
|
|
43
44
|
const BUILTIN_FORMATTERS = {
|
|
44
45
|
default: defaultFormatter,
|
|
45
46
|
github: async () => {
|
|
46
|
-
const { createGithubFormatter } = await import("./changelog-github-
|
|
47
|
+
const { createGithubFormatter } = await import("./changelog-github-BOs4cEhS.mjs");
|
|
47
48
|
return createGithubFormatter();
|
|
48
49
|
}
|
|
49
50
|
};
|
|
@@ -54,7 +55,7 @@ const BUILTIN_FORMATTERS = {
|
|
|
54
55
|
async function loadFormatter(changelog, rootDir) {
|
|
55
56
|
const [name, options] = Array.isArray(changelog) ? changelog : [changelog, {}];
|
|
56
57
|
if (name === "github") {
|
|
57
|
-
const { createGithubFormatter } = await import("./changelog-github-
|
|
58
|
+
const { createGithubFormatter } = await import("./changelog-github-BOs4cEhS.mjs");
|
|
58
59
|
return createGithubFormatter(options);
|
|
59
60
|
}
|
|
60
61
|
if (typeof name === "string" && BUILTIN_FORMATTERS[name]) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as tryRunArgs } from "./shell-u3bYGxNy.mjs";
|
|
2
|
-
import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-
|
|
2
|
+
import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-CXX-Cviy.mjs";
|
|
3
3
|
//#region src/core/changelog-github.ts
|
|
4
4
|
/** Authors filtered from "Thanks" attribution by default (e.g. bots) */
|
|
5
5
|
/** Authors filtered from "Thanks" attribution by default (e.g. AI/automation bots) */
|
|
@@ -37,8 +37,7 @@ function createGithubFormatter(options = {}) {
|
|
|
37
37
|
lines.push(`## ${release.newVersion}`);
|
|
38
38
|
lines.push(`<sub>${date}</sub>`);
|
|
39
39
|
lines.push("");
|
|
40
|
-
const
|
|
41
|
-
const sorted = sortBumpFilesByType(relevantBumpFiles, release.name);
|
|
40
|
+
const sorted = sortBumpFilesByType(bumpFiles.filter((bf) => release.bumpFiles.includes(bf.id)), release.name);
|
|
42
41
|
for (const bf of sorted) {
|
|
43
42
|
if (!bf.summary) continue;
|
|
44
43
|
const type = getBumpTypeForPackage(bf, release.name);
|
|
@@ -57,11 +56,13 @@ function createGithubFormatter(options = {}) {
|
|
|
57
56
|
lines.push(`- ${parts.join(" ")}${hasMeta ? " - " : ""}${firstLine}`);
|
|
58
57
|
for (let i = 1; i < summaryLines.length; i++) if (summaryLines[i].trim()) lines.push(` ${linkifyIssueRefs(summaryLines[i], serverUrl, repoSlug)}`);
|
|
59
58
|
}
|
|
59
|
+
const sourceList = release.bumpSources.length > 0 ? release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ") : "";
|
|
60
60
|
if (release.isDependencyBump) {
|
|
61
61
|
const depTag = release.type !== "patch" ? ` *(patch)* -` : "";
|
|
62
|
-
lines.push(`-${depTag} Updated
|
|
62
|
+
lines.push(`-${depTag} Updated dependency ${sourceList || "(internal)"}`);
|
|
63
63
|
}
|
|
64
|
-
if (release.
|
|
64
|
+
if (release.isGroupBump) lines.push(sourceList ? `- Version bump from group with ${sourceList}` : "- Version bump from group");
|
|
65
|
+
if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) lines.push(sourceList ? `- Version bump from ${sourceList}` : "- Version bump via cascade rule");
|
|
65
66
|
lines.push("");
|
|
66
67
|
return lines.join("\n");
|
|
67
68
|
};
|
|
@@ -5,7 +5,7 @@ import { n as discoverWorkspace } from "./workspace-BKOAMeki.mjs";
|
|
|
5
5
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
6
6
|
import { n as runArgs, r as runArgsAsync, s as tryRunArgs } from "./shell-u3bYGxNy.mjs";
|
|
7
7
|
import { r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-CoaSxqne.mjs";
|
|
8
|
-
import { t as assembleReleasePlan } from "./release-plan-
|
|
8
|
+
import { t as assembleReleasePlan } from "./release-plan-DGDgSWZo.mjs";
|
|
9
9
|
import { r as getChangedFiles } from "./git-ukq7VTuZ.mjs";
|
|
10
10
|
import { t as randomName } from "./names-CBy7d8K_.mjs";
|
|
11
11
|
import { findChangedPackages } from "./check-CS8WIGZA.mjs";
|
|
@@ -140,7 +140,7 @@ async function ciReleaseCommand(rootDir, opts) {
|
|
|
140
140
|
}
|
|
141
141
|
if (bumpFiles.length === 0) {
|
|
142
142
|
log.info("No pending bump files — checking for unpublished packages...");
|
|
143
|
-
const { publishCommand } = await import("./publish-
|
|
143
|
+
const { publishCommand } = await import("./publish-Kf5bq4Ph.mjs");
|
|
144
144
|
await publishCommand(rootDir, { tag: opts.tag });
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
@@ -154,7 +154,7 @@ async function ciReleaseCommand(rootDir, opts) {
|
|
|
154
154
|
}
|
|
155
155
|
async function autoPublish(rootDir, config, plan, tag) {
|
|
156
156
|
log.step("Running bumpy version...");
|
|
157
|
-
const { versionCommand } = await import("./version-
|
|
157
|
+
const { versionCommand } = await import("./version-Cj-Lkhbh.mjs");
|
|
158
158
|
await versionCommand(rootDir);
|
|
159
159
|
log.step("Committing version changes...");
|
|
160
160
|
runArgs([
|
|
@@ -183,7 +183,7 @@ async function autoPublish(rootDir, config, plan, tag) {
|
|
|
183
183
|
], { cwd: rootDir });
|
|
184
184
|
}
|
|
185
185
|
log.step("Running bumpy publish...");
|
|
186
|
-
const { publishCommand } = await import("./publish-
|
|
186
|
+
const { publishCommand } = await import("./publish-Kf5bq4Ph.mjs");
|
|
187
187
|
await publishCommand(rootDir, { tag });
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
@@ -349,7 +349,7 @@ async function createVersionPr(rootDir, plan, config, packageDirs, branchName) {
|
|
|
349
349
|
branch
|
|
350
350
|
], { cwd: rootDir });
|
|
351
351
|
log.step("Running bumpy version...");
|
|
352
|
-
const { versionCommand } = await import("./version-
|
|
352
|
+
const { versionCommand } = await import("./version-Cj-Lkhbh.mjs");
|
|
353
353
|
await versionCommand(rootDir);
|
|
354
354
|
runArgs([
|
|
355
355
|
"git",
|
package/dist/cli.mjs
CHANGED
|
@@ -43,7 +43,7 @@ async function main() {
|
|
|
43
43
|
}
|
|
44
44
|
case "status": {
|
|
45
45
|
const rootDir = await findRoot();
|
|
46
|
-
const { statusCommand } = await import("./status-
|
|
46
|
+
const { statusCommand } = await import("./status-CqefyAEI.mjs");
|
|
47
47
|
await statusCommand(rootDir, {
|
|
48
48
|
json: flags.json === true,
|
|
49
49
|
packagesOnly: flags.packages === true,
|
|
@@ -55,7 +55,7 @@ async function main() {
|
|
|
55
55
|
}
|
|
56
56
|
case "version": {
|
|
57
57
|
const rootDir = await findRoot();
|
|
58
|
-
const { versionCommand } = await import("./version-
|
|
58
|
+
const { versionCommand } = await import("./version-Cj-Lkhbh.mjs");
|
|
59
59
|
await versionCommand(rootDir, { commit: flags.commit === true });
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
@@ -89,14 +89,14 @@ async function main() {
|
|
|
89
89
|
const subcommand = args[1];
|
|
90
90
|
const ciFlags = parseFlags(args.slice(2));
|
|
91
91
|
if (subcommand === "check") {
|
|
92
|
-
const { ciCheckCommand } = await import("./ci-
|
|
92
|
+
const { ciCheckCommand } = await import("./ci-DjrgGbYj.mjs");
|
|
93
93
|
await ciCheckCommand(rootDir, {
|
|
94
94
|
comment: ciFlags.comment !== void 0 ? ciFlags.comment === true : void 0,
|
|
95
95
|
strict: ciFlags.strict === true,
|
|
96
96
|
noFail: ciFlags["no-fail"] === true
|
|
97
97
|
});
|
|
98
98
|
} else if (subcommand === "release") {
|
|
99
|
-
const { ciReleaseCommand } = await import("./ci-
|
|
99
|
+
const { ciReleaseCommand } = await import("./ci-DjrgGbYj.mjs");
|
|
100
100
|
await ciReleaseCommand(rootDir, {
|
|
101
101
|
mode: ciFlags["auto-publish"] === true ? "auto-publish" : "version-pr",
|
|
102
102
|
tag: ciFlags.tag,
|
|
@@ -113,7 +113,7 @@ async function main() {
|
|
|
113
113
|
}
|
|
114
114
|
case "publish": {
|
|
115
115
|
const rootDir = await findRoot();
|
|
116
|
-
const { publishCommand } = await import("./publish-
|
|
116
|
+
const { publishCommand } = await import("./publish-Kf5bq4Ph.mjs");
|
|
117
117
|
await publishCommand(rootDir, {
|
|
118
118
|
dryRun: flags["dry-run"] === true,
|
|
119
119
|
tag: flags.tag,
|
|
@@ -137,7 +137,7 @@ async function main() {
|
|
|
137
137
|
}
|
|
138
138
|
case "--version":
|
|
139
139
|
case "-v":
|
|
140
|
-
console.log(`bumpy 1.
|
|
140
|
+
console.log(`bumpy 1.5.0`);
|
|
141
141
|
break;
|
|
142
142
|
case "help":
|
|
143
143
|
case "--help":
|
|
@@ -157,7 +157,7 @@ async function main() {
|
|
|
157
157
|
}
|
|
158
158
|
function printHelp() {
|
|
159
159
|
console.log(`
|
|
160
|
-
${colorize(`🐸 bumpy v1.
|
|
160
|
+
${colorize(`🐸 bumpy v1.5.0`, "bold")} - Modern monorepo versioning
|
|
161
161
|
|
|
162
162
|
Usage: bumpy <command> [options]
|
|
163
163
|
|
package/dist/index.d.mts
CHANGED
|
@@ -150,6 +150,12 @@ interface PlannedRelease {
|
|
|
150
150
|
bumpFiles: string[];
|
|
151
151
|
isDependencyBump: boolean;
|
|
152
152
|
isCascadeBump: boolean;
|
|
153
|
+
isGroupBump: boolean;
|
|
154
|
+
/** Packages whose bumps caused this dependency/cascade/group bump, with their new versions */
|
|
155
|
+
bumpSources: Array<{
|
|
156
|
+
name: string;
|
|
157
|
+
newVersion: string;
|
|
158
|
+
}>;
|
|
153
159
|
}
|
|
154
160
|
interface ReleasePlan {
|
|
155
161
|
bumpFiles: BumpFile[];
|
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { t as discoverPackages } from "./workspace-BKOAMeki.mjs";
|
|
|
4
4
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
5
5
|
import { i as writeBumpFile, n as parseBumpFile, r as readBumpFiles } from "./bump-file-CoaSxqne.mjs";
|
|
6
6
|
import { n as satisfies, r as stripProtocol, t as bumpVersion } from "./semver-DfQyVLM_.mjs";
|
|
7
|
-
import { t as assembleReleasePlan } from "./release-plan-
|
|
8
|
-
import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry, t as defaultFormatter } from "./changelog-
|
|
9
|
-
import { t as applyReleasePlan } from "./apply-release-plan-
|
|
7
|
+
import { t as assembleReleasePlan } from "./release-plan-DGDgSWZo.mjs";
|
|
8
|
+
import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry, t as defaultFormatter } from "./changelog-CXX-Cviy.mjs";
|
|
9
|
+
import { t as applyReleasePlan } from "./apply-release-plan-CIlB1M6e.mjs";
|
|
10
10
|
import { t as publishPackages } from "./publish-pipeline-C1slMaJV.mjs";
|
|
11
11
|
export { BUMP_LEVELS, DEFAULT_BUMP_RULES, DEFAULT_CONFIG, DEFAULT_PUBLISH_CONFIG, DEP_TYPES, DependencyGraph, applyReleasePlan, assembleReleasePlan, bumpLevel, bumpVersion, defaultFormatter, discoverPackages, findRoot, generateChangelogEntry, getBumpyDir, hasCascade, loadConfig, loadFormatter, matchGlob, maxBump, parseBumpFile, prependToChangelog, publishPackages, readBumpFiles, satisfies, stripProtocol, writeBumpFile };
|
|
@@ -4,7 +4,7 @@ import { n as detectWorkspaces } from "./package-manager-CClZtIHP.mjs";
|
|
|
4
4
|
import { n as discoverWorkspace } from "./workspace-BKOAMeki.mjs";
|
|
5
5
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
6
6
|
import { r as runArgsAsync, s as tryRunArgs } from "./shell-u3bYGxNy.mjs";
|
|
7
|
-
import { i as loadFormatter, n as generateChangelogEntry } from "./changelog-
|
|
7
|
+
import { i as loadFormatter, n as generateChangelogEntry } from "./changelog-CXX-Cviy.mjs";
|
|
8
8
|
import { c as listTags, l as pushWithTags, s as hasUncommittedChanges } from "./git-ukq7VTuZ.mjs";
|
|
9
9
|
import { t as publishPackages } from "./publish-pipeline-C1slMaJV.mjs";
|
|
10
10
|
//#region src/core/github-release.ts
|
|
@@ -108,8 +108,16 @@ async function generateAggregateBody(releases, bumpFiles, formatter) {
|
|
|
108
108
|
lines.push(`### ${release.name} v${release.newVersion}\n`);
|
|
109
109
|
const body = stripVersionHeading(await generateChangelogEntry(release, bumpFiles, formatter, void 0, "github-release")).trim();
|
|
110
110
|
if (body) lines.push(body);
|
|
111
|
-
else if (release.isDependencyBump)
|
|
112
|
-
|
|
111
|
+
else if (release.isDependencyBump) {
|
|
112
|
+
const sourceList = release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ");
|
|
113
|
+
lines.push(sourceList ? `- Updated dependency ${sourceList}` : "- Updated dependencies");
|
|
114
|
+
} else if (release.isGroupBump) {
|
|
115
|
+
const sourceList = release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ");
|
|
116
|
+
lines.push(sourceList ? `- Version bump from group with ${sourceList}` : "- Version bump from group");
|
|
117
|
+
} else if (release.isCascadeBump) {
|
|
118
|
+
const sourceList = release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ");
|
|
119
|
+
lines.push(sourceList ? `- Version bump from ${sourceList}` : "- Version bump via cascade rule");
|
|
120
|
+
}
|
|
113
121
|
lines.push("");
|
|
114
122
|
}
|
|
115
123
|
}
|
|
@@ -125,7 +133,12 @@ function buildReleaseBody(release, bumpFiles) {
|
|
|
125
133
|
if (relevant.length > 0) {
|
|
126
134
|
for (const bf of relevant) if (bf.summary) lines.push(`- ${bf.summary.split("\n")[0]}`);
|
|
127
135
|
}
|
|
128
|
-
if (
|
|
136
|
+
if (relevant.length === 0) {
|
|
137
|
+
const sourceList = release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ");
|
|
138
|
+
if (release.isDependencyBump) lines.push(sourceList ? `- Updated dependency ${sourceList}` : "- Updated dependencies");
|
|
139
|
+
else if (release.isGroupBump) lines.push(sourceList ? `- Version bump from group with ${sourceList}` : "- Version bump from group");
|
|
140
|
+
else if (release.isCascadeBump) lines.push(sourceList ? `- Version bump from ${sourceList}` : "- Version bump via cascade rule");
|
|
141
|
+
}
|
|
129
142
|
return lines.join("\n") || "No changelog entries.";
|
|
130
143
|
}
|
|
131
144
|
function buildAggregateBody(releases, bumpFiles) {
|
|
@@ -143,8 +156,12 @@ function buildAggregateBody(releases, bumpFiles) {
|
|
|
143
156
|
const relevant = bumpFiles.filter((bf) => release.bumpFiles.includes(bf.id));
|
|
144
157
|
if (relevant.length > 0) {
|
|
145
158
|
for (const bf of relevant) if (bf.summary) lines.push(`- ${bf.summary.split("\n")[0]}`);
|
|
146
|
-
} else
|
|
147
|
-
|
|
159
|
+
} else {
|
|
160
|
+
const sourceList = release.bumpSources.map((s) => `\`${s.name}\` v${s.newVersion}`).join(", ");
|
|
161
|
+
if (release.isDependencyBump) lines.push(sourceList ? `- Updated dependency ${sourceList}` : "- Updated dependencies");
|
|
162
|
+
else if (release.isGroupBump) lines.push(sourceList ? `- Version bump from group with ${sourceList}` : "- Version bump from group");
|
|
163
|
+
else if (release.isCascadeBump) lines.push(sourceList ? `- Version bump from ${sourceList}` : "- Version bump via cascade rule");
|
|
164
|
+
}
|
|
148
165
|
lines.push("");
|
|
149
166
|
}
|
|
150
167
|
}
|
|
@@ -250,7 +267,9 @@ async function findUnpublishedPackages(packages, _config) {
|
|
|
250
267
|
newVersion: pkg.version,
|
|
251
268
|
bumpFiles: [],
|
|
252
269
|
isDependencyBump: false,
|
|
253
|
-
isCascadeBump: false
|
|
270
|
+
isCascadeBump: false,
|
|
271
|
+
isGroupBump: false,
|
|
272
|
+
bumpSources: []
|
|
254
273
|
});
|
|
255
274
|
}
|
|
256
275
|
return unpublished;
|
|
@@ -32,7 +32,9 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
32
32
|
type: bump,
|
|
33
33
|
isDependencyBump: false,
|
|
34
34
|
isCascadeBump: false,
|
|
35
|
-
|
|
35
|
+
isGroupBump: false,
|
|
36
|
+
bumpFiles: new Set([bf.id]),
|
|
37
|
+
bumpSources: /* @__PURE__ */ new Set()
|
|
36
38
|
});
|
|
37
39
|
if (hasCascade(release)) {
|
|
38
40
|
if (!cascadeOverrides.has(release.name)) cascadeOverrides.set(release.name, /* @__PURE__ */ new Map());
|
|
@@ -65,12 +67,19 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
65
67
|
if (resolvedRange === "^" || resolvedRange === "~") resolvedRange = `${resolvedRange}${pkg.version}`;
|
|
66
68
|
if (/^\^0(\.|$)/.test(resolvedRange)) warnings.push(`${dep.name} gets a ${depBump} bump because ${pkgName}@${newVersion} is out of range for its peer dep "${dep.versionRange}" (resolves to ${resolvedRange}). npm treats ^ on 0.x as minor-breaking. Consider using >=0.x ranges for pre-1.0 peer deps.`);
|
|
67
69
|
}
|
|
68
|
-
if (applyBump(planned, dep.name, depBump, true, false,
|
|
70
|
+
if (applyBump(planned, dep.name, depBump, true, false, pkgName)) changed = true;
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
for (const group of config.fixed) {
|
|
72
74
|
let groupBump;
|
|
73
|
-
|
|
75
|
+
const groupSources = [];
|
|
76
|
+
for (const nameOrGlob of group) for (const [name, bump] of planned) if (matchGlob(name, nameOrGlob)) {
|
|
77
|
+
if (!groupBump || bumpLevel(bump.type) > bumpLevel(groupBump)) {
|
|
78
|
+
groupBump = bump.type;
|
|
79
|
+
groupSources.length = 0;
|
|
80
|
+
groupSources.push(name);
|
|
81
|
+
} else if (bump.type === groupBump) groupSources.push(name);
|
|
82
|
+
}
|
|
74
83
|
if (!groupBump) continue;
|
|
75
84
|
for (const nameOrGlob of group) for (const [name] of packages) {
|
|
76
85
|
if (!matchGlob(name, nameOrGlob)) continue;
|
|
@@ -79,6 +88,8 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
79
88
|
const newType = maxBump(existing.type, groupBump);
|
|
80
89
|
if (newType !== existing.type) {
|
|
81
90
|
existing.type = newType;
|
|
91
|
+
existing.isGroupBump = true;
|
|
92
|
+
for (const src of groupSources) if (src !== name) existing.bumpSources.add(src);
|
|
82
93
|
changed = true;
|
|
83
94
|
}
|
|
84
95
|
} else {
|
|
@@ -86,7 +97,9 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
86
97
|
type: groupBump,
|
|
87
98
|
isDependencyBump: false,
|
|
88
99
|
isCascadeBump: false,
|
|
89
|
-
|
|
100
|
+
isGroupBump: true,
|
|
101
|
+
bumpFiles: /* @__PURE__ */ new Set(),
|
|
102
|
+
bumpSources: new Set(groupSources.filter((s) => s !== name))
|
|
90
103
|
});
|
|
91
104
|
changed = true;
|
|
92
105
|
}
|
|
@@ -94,7 +107,14 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
94
107
|
}
|
|
95
108
|
for (const group of config.linked) {
|
|
96
109
|
let groupBump;
|
|
97
|
-
|
|
110
|
+
const groupSources = [];
|
|
111
|
+
for (const nameOrGlob of group) for (const [name, bump] of planned) if (matchGlob(name, nameOrGlob)) {
|
|
112
|
+
if (!groupBump || bumpLevel(bump.type) > bumpLevel(groupBump)) {
|
|
113
|
+
groupBump = bump.type;
|
|
114
|
+
groupSources.length = 0;
|
|
115
|
+
groupSources.push(name);
|
|
116
|
+
} else if (bump.type === groupBump) groupSources.push(name);
|
|
117
|
+
}
|
|
98
118
|
if (!groupBump) continue;
|
|
99
119
|
for (const nameOrGlob of group) for (const [name] of packages) {
|
|
100
120
|
if (!matchGlob(name, nameOrGlob)) continue;
|
|
@@ -103,6 +123,8 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
103
123
|
const newType = maxBump(existing.type, groupBump);
|
|
104
124
|
if (newType !== existing.type) {
|
|
105
125
|
existing.type = newType;
|
|
126
|
+
existing.isGroupBump = true;
|
|
127
|
+
for (const src of groupSources) if (src !== name) existing.bumpSources.add(src);
|
|
106
128
|
changed = true;
|
|
107
129
|
}
|
|
108
130
|
}
|
|
@@ -112,7 +134,7 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
112
134
|
const bfOverrides = cascadeOverrides.get(pkgName);
|
|
113
135
|
if (bfOverrides) for (const [pattern, cascadeBumpType] of bfOverrides) for (const [targetName] of packages) {
|
|
114
136
|
if (!matchGlob(targetName, pattern)) continue;
|
|
115
|
-
if (applyBump(planned, targetName, cascadeBumpType, false, true,
|
|
137
|
+
if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
|
|
116
138
|
}
|
|
117
139
|
const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
|
|
118
140
|
if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
|
|
@@ -120,7 +142,7 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
120
142
|
const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
121
143
|
for (const [targetName] of packages) {
|
|
122
144
|
if (!matchGlob(targetName, pattern)) continue;
|
|
123
|
-
if (applyBump(planned, targetName, cascadeBump, false, true,
|
|
145
|
+
if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
|
|
124
146
|
}
|
|
125
147
|
}
|
|
126
148
|
const dependents = depGraph.getDependents(pkgName);
|
|
@@ -129,14 +151,14 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
129
151
|
if (!rule) continue;
|
|
130
152
|
if (!shouldTrigger(bump.type, rule.trigger)) continue;
|
|
131
153
|
const depBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
132
|
-
if (applyBump(planned, dep.name, depBump, true, false,
|
|
154
|
+
if (applyBump(planned, dep.name, depBump, true, false, pkgName)) changed = true;
|
|
133
155
|
}
|
|
134
156
|
}
|
|
135
157
|
else for (const [pkgName, bump] of planned) {
|
|
136
158
|
const bfOverrides = cascadeOverrides.get(pkgName);
|
|
137
159
|
if (bfOverrides) for (const [pattern, cascadeBumpType] of bfOverrides) for (const [targetName] of packages) {
|
|
138
160
|
if (!matchGlob(targetName, pattern)) continue;
|
|
139
|
-
if (applyBump(planned, targetName, cascadeBumpType, false, true,
|
|
161
|
+
if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
|
|
140
162
|
}
|
|
141
163
|
const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
|
|
142
164
|
if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
|
|
@@ -144,7 +166,7 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
144
166
|
const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
145
167
|
for (const [targetName] of packages) {
|
|
146
168
|
if (!matchGlob(targetName, pattern)) continue;
|
|
147
|
-
if (applyBump(planned, targetName, cascadeBump, false, true,
|
|
169
|
+
if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
|
|
148
170
|
}
|
|
149
171
|
}
|
|
150
172
|
}
|
|
@@ -161,7 +183,16 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
161
183
|
newVersion,
|
|
162
184
|
bumpFiles: [...bump.bumpFiles],
|
|
163
185
|
isDependencyBump: bump.isDependencyBump,
|
|
164
|
-
isCascadeBump: bump.isCascadeBump
|
|
186
|
+
isCascadeBump: bump.isCascadeBump,
|
|
187
|
+
isGroupBump: bump.isGroupBump,
|
|
188
|
+
bumpSources: [...bump.bumpSources].map((srcName) => {
|
|
189
|
+
const srcBump = planned.get(srcName);
|
|
190
|
+
const srcPkg = packages.get(srcName);
|
|
191
|
+
return {
|
|
192
|
+
name: srcName,
|
|
193
|
+
newVersion: srcPkg && srcBump ? bumpVersion(srcPkg.version, srcBump.type) : "unknown"
|
|
194
|
+
};
|
|
195
|
+
})
|
|
165
196
|
});
|
|
166
197
|
}
|
|
167
198
|
releases.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -173,7 +204,7 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
|
173
204
|
};
|
|
174
205
|
}
|
|
175
206
|
/** Apply a bump to a package, upgrading if already planned. Returns true if anything changed. */
|
|
176
|
-
function applyBump(planned, name, type, isDependencyBump, isCascadeBump,
|
|
207
|
+
function applyBump(planned, name, type, isDependencyBump, isCascadeBump, sourcePackageName) {
|
|
177
208
|
const existing = planned.get(name);
|
|
178
209
|
if (existing) {
|
|
179
210
|
const newType = maxBump(existing.type, type);
|
|
@@ -181,14 +212,16 @@ function applyBump(planned, name, type, isDependencyBump, isCascadeBump, sourceB
|
|
|
181
212
|
existing.type = newType;
|
|
182
213
|
if (isDependencyBump) existing.isDependencyBump = true;
|
|
183
214
|
if (isCascadeBump) existing.isCascadeBump = true;
|
|
184
|
-
|
|
215
|
+
existing.bumpSources.add(sourcePackageName);
|
|
185
216
|
return true;
|
|
186
217
|
}
|
|
187
218
|
planned.set(name, {
|
|
188
219
|
type,
|
|
189
220
|
isDependencyBump,
|
|
190
221
|
isCascadeBump,
|
|
191
|
-
|
|
222
|
+
isGroupBump: false,
|
|
223
|
+
bumpFiles: /* @__PURE__ */ new Set(),
|
|
224
|
+
bumpSources: new Set([sourcePackageName])
|
|
192
225
|
});
|
|
193
226
|
return true;
|
|
194
227
|
}
|
|
@@ -3,7 +3,7 @@ import { a as loadConfig } from "./config-D13G4-R8.mjs";
|
|
|
3
3
|
import { t as discoverPackages } from "./workspace-BKOAMeki.mjs";
|
|
4
4
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
5
5
|
import { r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-CoaSxqne.mjs";
|
|
6
|
-
import { t as assembleReleasePlan } from "./release-plan-
|
|
6
|
+
import { t as assembleReleasePlan } from "./release-plan-DGDgSWZo.mjs";
|
|
7
7
|
import { i as getCurrentBranch, r as getChangedFiles } from "./git-ukq7VTuZ.mjs";
|
|
8
8
|
//#region src/commands/status.ts
|
|
9
9
|
async function statusCommand(rootDir, opts) {
|
|
@@ -5,8 +5,8 @@ import { t as discoverPackages } from "./workspace-BKOAMeki.mjs";
|
|
|
5
5
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
6
6
|
import { n as runArgs, s as tryRunArgs } from "./shell-u3bYGxNy.mjs";
|
|
7
7
|
import { r as readBumpFiles } from "./bump-file-CoaSxqne.mjs";
|
|
8
|
-
import { t as assembleReleasePlan } from "./release-plan-
|
|
9
|
-
import { t as applyReleasePlan } from "./apply-release-plan-
|
|
8
|
+
import { t as assembleReleasePlan } from "./release-plan-DGDgSWZo.mjs";
|
|
9
|
+
import { t as applyReleasePlan } from "./apply-release-plan-CIlB1M6e.mjs";
|
|
10
10
|
import { t as resolveCommitMessage } from "./commit-message-3e4KhzFV.mjs";
|
|
11
11
|
//#region src/commands/version.ts
|
|
12
12
|
async function versionCommand(rootDir, opts = {}) {
|