@varlock/bumpy 1.7.0 → 1.8.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 (28) hide show
  1. package/config-schema.json +33 -17
  2. package/dist/{add-Dr1vFn9b.mjs → add-Ci3vfJCF.mjs} +41 -81
  3. package/dist/{apply-release-plan-BRN29C3D.mjs → apply-release-plan-DncfboRW.mjs} +2 -2
  4. package/dist/{bump-file-4cnuDyfW.mjs → bump-file-BZT3KCns.mjs} +1 -1
  5. package/dist/{changelog-C9JXdwaj.mjs → changelog-CFWf9s2q.mjs} +3 -3
  6. package/dist/{changelog-github-CZcW184H.mjs → changelog-github-T5LqaTwV.mjs} +2 -2
  7. package/dist/{check-Dqm9ZU8T.mjs → check-C-l4yr0C.mjs} +3 -3
  8. package/dist/{ci-E1QXDnB_.mjs → ci-Ukh4gbGo.mjs} +13 -14
  9. package/dist/{ci-setup-Bbf96usW.mjs → ci-setup-DKjyiF2-.mjs} +1 -1
  10. package/dist/{clack-CehaQZU6.mjs → clack-W95rXis0.mjs} +5 -126
  11. package/dist/cli.mjs +15 -15
  12. package/dist/{config-BcmlSJJd.mjs → config-gMu1z0bz.mjs} +7 -3
  13. package/dist/{generate-0a_KR7tn.mjs → generate-BuH9DEZO.mjs} +4 -4
  14. package/dist/index.d.mts +13 -2
  15. package/dist/index.mjs +8 -9
  16. package/dist/{init-CY7OVZCX.mjs → init-Cs6amsw5.mjs} +10 -2
  17. package/dist/{publish-D5OcYhC_.mjs → publish-X8IGj3AF.mjs} +8 -8
  18. package/dist/{publish-pipeline-ChiL1eRQ.mjs → publish-pipeline-DHSCchtX.mjs} +2 -2
  19. package/dist/{release-plan-M9TGZn2W.mjs → release-plan-7ApKPR6T.mjs} +109 -19
  20. package/dist/{status-CapkBv6n.mjs → status-Cgr3Opiw.mjs} +5 -6
  21. package/dist/{types-BX4pfmKh.mjs → types-CAwBhUsn.mjs} +14 -1
  22. package/dist/{version-Cz-p96lm.mjs → version-DvjKjAsp.mjs} +5 -6
  23. package/package.json +1 -1
  24. package/dist/dep-graph-E-9-eQ2J.mjs +0 -64
  25. /package/dist/{ai-BHoKuvHn.mjs → ai-Bbe56gBt.mjs} +0 -0
  26. /package/dist/{commit-message-BA1w19wq.mjs → commit-message-CSWVKPJ-.mjs} +0 -0
  27. /package/dist/{git-DE46Je5V.mjs → git-nTR-JccX.mjs} +0 -0
  28. /package/dist/{names-C-TuOPbd.mjs → names-COooXAFg.mjs} +0 -0
@@ -222,6 +222,33 @@
222
222
  "type": "string",
223
223
  "enum": ["major", "minor", "patch"]
224
224
  },
225
+ "cascadeConfig": {
226
+ "oneOf": [
227
+ {
228
+ "type": "array",
229
+ "description": "List of package names/glob patterns (defaults: trigger \"patch\", bumpAs \"match\")",
230
+ "items": { "type": "string" }
231
+ },
232
+ {
233
+ "type": "object",
234
+ "description": "Package name/glob patterns mapped to cascade rules",
235
+ "additionalProperties": {
236
+ "type": "object",
237
+ "properties": {
238
+ "trigger": {
239
+ "$ref": "#/$defs/bumpType",
240
+ "description": "Minimum bump level that triggers the cascade (default: \"patch\")"
241
+ },
242
+ "bumpAs": {
243
+ "description": "What level to bump the target (default: \"match\")",
244
+ "oneOf": [{ "$ref": "#/$defs/bumpType" }, { "type": "string", "const": "match" }]
245
+ }
246
+ },
247
+ "additionalProperties": false
248
+ }
249
+ }
250
+ ]
251
+ },
225
252
  "dependencyBumpRule": {
226
253
  "oneOf": [
227
254
  {
@@ -302,23 +329,12 @@
302
329
  "additionalProperties": false
303
330
  },
304
331
  "cascadeTo": {
305
- "type": "object",
306
- "description": "Explicit cascade targets — glob pattern mapped to { trigger, bumpAs }",
307
- "additionalProperties": {
308
- "type": "object",
309
- "properties": {
310
- "trigger": {
311
- "$ref": "#/$defs/bumpType",
312
- "description": "Minimum bump level that triggers the cascade"
313
- },
314
- "bumpAs": {
315
- "description": "What level to bump the target",
316
- "oneOf": [{ "$ref": "#/$defs/bumpType" }, { "type": "string", "const": "match" }]
317
- }
318
- },
319
- "required": ["trigger", "bumpAs"],
320
- "additionalProperties": false
321
- }
332
+ "description": "Explicit cascade targets — when this package is bumped, cascade to matching packages.",
333
+ "$ref": "#/$defs/cascadeConfig"
334
+ },
335
+ "cascadeFrom": {
336
+ "description": "Explicit cascade sources — when a matching package is bumped, cascade the bump to this package.",
337
+ "$ref": "#/$defs/cascadeConfig"
322
338
  }
323
339
  },
324
340
  "additionalProperties": false
@@ -1,18 +1,18 @@
1
1
  import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGFuf.mjs";
2
2
  import { n as exists, t as ensureDir } from "./fs-CBXKZhoU.mjs";
3
- import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir, s as matchGlob } from "./config-BcmlSJJd.mjs";
4
- import { a as discoverPackages, i as writeBumpFile, o as discoverWorkspace } from "./bump-file-4cnuDyfW.mjs";
5
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
6
- import { r as getChangedFiles } from "./git-DE46Je5V.mjs";
7
- import { c as ot, d as yt, i as _t, l as pt, o as gt, r as Ot, s as mt, t as unwrap, u as wt } from "./clack-CehaQZU6.mjs";
8
- import { n as slugify, t as randomName } from "./names-C-TuOPbd.mjs";
9
- import { n as findChangedPackages, r as require_picomatch } from "./check-Dqm9ZU8T.mjs";
3
+ import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir } from "./config-gMu1z0bz.mjs";
4
+ import { a as discoverPackages, i as writeBumpFile, o as discoverWorkspace, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-BZT3KCns.mjs";
5
+ import { r as getChangedFiles } from "./git-nTR-JccX.mjs";
6
+ import { l as pt, o as gt, r as Ot, s as mt, t as unwrap, u as wt } from "./clack-W95rXis0.mjs";
7
+ import { n as slugify, t as randomName } from "./names-COooXAFg.mjs";
8
+ import { n as findChangedPackages, r as require_picomatch } from "./check-C-l4yr0C.mjs";
10
9
  import { relative, resolve } from "node:path";
11
10
  import * as readline from "node:readline";
12
11
  //#region src/prompts/bump-select.ts
13
12
  var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
14
13
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
15
14
  const LEVELS = [
15
+ "skip",
16
16
  "none",
17
17
  "patch",
18
18
  "minor",
@@ -37,7 +37,7 @@ async function bumpSelectPrompt(items) {
37
37
  })).filter(({ item }) => !item.changed);
38
38
  const displayOrder = [...changedEntries, ...unchangedEntries];
39
39
  let cursor = 0;
40
- const levels = items.map((item) => item.changed ? "patch" : "none");
40
+ const levels = items.map((item) => item.initialLevel !== void 0 ? item.initialLevel : item.changed ? "patch" : "skip");
41
41
  return new Promise((resolve) => {
42
42
  const { stdin, stdout } = process;
43
43
  const rl = readline.createInterface({
@@ -54,14 +54,14 @@ async function bumpSelectPrompt(items) {
54
54
  const lines = [];
55
55
  if (final) {
56
56
  lines.push(`${import_picocolors.default.green("◇")} Bump levels selected`);
57
- const selected = displayOrder.filter(({ idx }) => levels[idx] !== "none");
58
- if (selected.length === 0) lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim("(none)")}`);
57
+ const selected = displayOrder.filter(({ idx }) => levels[idx] !== "skip");
58
+ if (selected.length === 0) lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim("(none selected)")}`);
59
59
  else for (const { item, idx } of selected) lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.cyan(item.name)} ${import_picocolors.default.dim("→")} ${import_picocolors.default.bold(levels[idx])}`);
60
60
  lines.push(import_picocolors.default.dim("│"));
61
61
  } else {
62
62
  lines.push(`${import_picocolors.default.cyan("◆")} Select bump levels`);
63
63
  lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim("↑/↓ navigate · ←/→ change level · enter to confirm")}`);
64
- lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim("0 clear current · x clear all · r reset all to defaults")}`);
64
+ lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim("0 skip current · x skip all · r reset all to defaults")}`);
65
65
  lines.push(import_picocolors.default.dim("│"));
66
66
  let displayIdx = 0;
67
67
  if (changedEntries.length > 0) {
@@ -80,7 +80,7 @@ async function bumpSelectPrompt(items) {
80
80
  }
81
81
  }
82
82
  lines.push(import_picocolors.default.dim("│"));
83
- const selectedCount = levels.filter((l) => l !== "none").length;
83
+ const selectedCount = levels.filter((l) => l !== "skip").length;
84
84
  lines.push(`${import_picocolors.default.dim("│")} ${import_picocolors.default.dim(`${selectedCount} package${selectedCount !== 1 ? "s" : ""} selected`)}`);
85
85
  lines.push(`${import_picocolors.default.dim("└")}`);
86
86
  }
@@ -89,6 +89,7 @@ async function bumpSelectPrompt(items) {
89
89
  renderedLines = lines.length;
90
90
  }
91
91
  function cleanup() {
92
+ stdin.removeListener("keypress", onKeypress);
92
93
  rl.close();
93
94
  stdout.write("\x1B[?25h");
94
95
  if (stdin.isTTY) stdin.setRawMode(false);
@@ -98,10 +99,11 @@ async function bumpSelectPrompt(items) {
98
99
  cleanup();
99
100
  resolve(result);
100
101
  }
102
+ readline.emitKeypressEvents(stdin, rl);
101
103
  if (stdin.isTTY) stdin.setRawMode(true);
102
104
  stdin.resume();
103
105
  render();
104
- stdin.on("keypress", (_str, key) => {
106
+ function onKeypress(_str, key) {
105
107
  if (!key) return;
106
108
  if (key.name === "escape" || key.ctrl && key.name === "c") {
107
109
  cleanup();
@@ -115,7 +117,7 @@ async function bumpSelectPrompt(items) {
115
117
  }
116
118
  if (key.name === "return") {
117
119
  const results = [];
118
- for (let i = 0; i < items.length; i++) if (levels[i] !== "none") results.push({
120
+ for (let i = 0; i < items.length; i++) if (levels[i] !== "skip") results.push({
119
121
  name: items[i].name,
120
122
  type: levels[i]
121
123
  });
@@ -134,12 +136,12 @@ async function bumpSelectPrompt(items) {
134
136
  if (currentLevel > 0) levels[entry.idx] = LEVELS[currentLevel - 1];
135
137
  } else if (_str === "0" || key.name === "backspace") {
136
138
  const entry = displayOrder[cursor];
137
- levels[entry.idx] = "none";
138
- } else if (_str === "r") for (let i = 0; i < items.length; i++) levels[i] = items[i].changed ? "patch" : "none";
139
- else if (_str === "x") for (let i = 0; i < items.length; i++) levels[i] = "none";
139
+ levels[entry.idx] = "skip";
140
+ } else if (_str === "r") for (let i = 0; i < items.length; i++) levels[i] = items[i].initialLevel !== void 0 ? items[i].initialLevel : items[i].changed ? "patch" : "skip";
141
+ else if (_str === "x") for (let i = 0; i < items.length; i++) levels[i] = "skip";
140
142
  render();
141
- });
142
- readline.emitKeypressEvents(stdin, rl);
143
+ }
144
+ stdin.on("keypress", onKeypress);
143
145
  });
144
146
  }
145
147
  function formatRow(item, level, focused) {
@@ -147,13 +149,15 @@ function formatRow(item, level, focused) {
147
149
  }
148
150
  function formatLevel(level, focused) {
149
151
  if (!focused) {
150
- if (level === "none") return import_picocolors.default.dim("·");
152
+ if (level === "skip") return import_picocolors.default.dim("·");
153
+ if (level === "none") return import_picocolors.default.dim("none");
151
154
  if (level === "major") return import_picocolors.default.red(level);
152
155
  if (level === "minor") return import_picocolors.default.yellow(level);
153
156
  return import_picocolors.default.green(level);
154
157
  }
155
158
  return `◄ ${LEVELS.map((l) => {
156
159
  if (l === level) {
160
+ if (l === "skip") return import_picocolors.default.bold(import_picocolors.default.dim("[skip]"));
157
161
  if (l === "none") return import_picocolors.default.bold(import_picocolors.default.dim("[none]"));
158
162
  if (l === "major") return import_picocolors.default.bold(import_picocolors.default.red(`[${l}]`));
159
163
  if (l === "minor") return import_picocolors.default.bold(import_picocolors.default.yellow(`[${l}]`));
@@ -164,20 +168,6 @@ function formatLevel(level, focused) {
164
168
  }
165
169
  //#endregion
166
170
  //#region src/commands/add.ts
167
- const CASCADE_CHOICES = [
168
- {
169
- label: "patch",
170
- value: "patch"
171
- },
172
- {
173
- label: "minor",
174
- value: "minor"
175
- },
176
- {
177
- label: "major",
178
- value: "major"
179
- }
180
- ];
181
171
  async function addCommand(rootDir, opts) {
182
172
  const config = await loadConfig(rootDir);
183
173
  const bumpyDir = getBumpyDir(rootDir);
@@ -219,7 +209,6 @@ async function addCommand(rootDir, opts) {
219
209
  } else {
220
210
  mt(import_picocolors.default.bgCyan(import_picocolors.default.black(" bumpy add ")));
221
211
  const pkgs = await discoverPackages(rootDir, config);
222
- const depGraph = new DependencyGraph(pkgs);
223
212
  if (pkgs.size === 0) {
224
213
  pt("No managed packages found in this workspace.");
225
214
  process.exit(1);
@@ -239,11 +228,19 @@ async function addCommand(rootDir, opts) {
239
228
  if (matchers.get(name)(relToPackage)) changedPackageNames.add(name);
240
229
  }
241
230
  }
242
- const bumpSelectResult = await bumpSelectPrompt([...pkgs.values()].map((pkg) => ({
243
- name: pkg.name,
244
- version: pkg.version,
245
- changed: changedPackageNames.has(pkg.name)
246
- })));
231
+ const { bumpFiles: allBumpFiles } = await readBumpFiles(rootDir);
232
+ const { branchBumpFiles } = filterBranchBumpFiles(allBumpFiles, changedFiles, rootDir);
233
+ const alreadyCoveredPackages = /* @__PURE__ */ new Map();
234
+ for (const bf of branchBumpFiles) for (const release of bf.releases) alreadyCoveredPackages.set(release.name, release.type === "none" ? "none" : release.type);
235
+ const bumpSelectResult = await bumpSelectPrompt([...pkgs.values()].map((pkg) => {
236
+ const item = {
237
+ name: pkg.name,
238
+ version: pkg.version,
239
+ changed: changedPackageNames.has(pkg.name)
240
+ };
241
+ if (alreadyCoveredPackages.has(pkg.name)) item.initialLevel = "skip";
242
+ return item;
243
+ }));
247
244
  if (typeof bumpSelectResult === "symbol") {
248
245
  pt("Aborted");
249
246
  process.exit(0);
@@ -253,47 +250,10 @@ async function addCommand(rootDir, opts) {
253
250
  pt("No packages selected.");
254
251
  process.exit(0);
255
252
  }
256
- releases = [];
257
- for (const { name, type: bumpType } of bumpSelections) {
258
- const release = {
259
- name,
260
- type: bumpType
261
- };
262
- {
263
- const dependents = depGraph.getDependents(name);
264
- const cascadeTargets = pkgs.get(name).bumpy?.cascadeTo;
265
- if (dependents.length > 0 || cascadeTargets) {
266
- if (unwrap(await ot({
267
- message: `${import_picocolors.default.cyan(name)} has ${import_picocolors.default.bold(String(dependents.length))} dependents. Specify explicit cascades?`,
268
- initialValue: false
269
- }))) {
270
- const allTargets = /* @__PURE__ */ new Set();
271
- for (const d of dependents) allTargets.add(d.name);
272
- if (cascadeTargets) {
273
- for (const pattern of Object.keys(cascadeTargets)) for (const [pName] of pkgs) if (matchGlob(pName, pattern)) allTargets.add(pName);
274
- }
275
- const cascadeSelected = unwrap(await yt({
276
- message: "Which packages should cascade?",
277
- options: [...allTargets].map((n) => ({
278
- label: n,
279
- value: n
280
- })),
281
- required: false
282
- }));
283
- if (cascadeSelected.length > 0) {
284
- const cascadeBump = unwrap(await _t({
285
- message: "Cascade bump type",
286
- options: CASCADE_CHOICES
287
- }));
288
- const cascade = {};
289
- for (const target of cascadeSelected) cascade[target] = cascadeBump;
290
- release.cascade = cascade;
291
- }
292
- }
293
- }
294
- }
295
- releases.push(release);
296
- }
253
+ releases = bumpSelections.map(({ name, type }) => ({
254
+ name,
255
+ type
256
+ }));
297
257
  summary = unwrap(await Ot({
298
258
  message: "Summary (what changed and why)",
299
259
  placeholder: "A short description of the change",
@@ -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-CBXKZhoU.mjs";
2
- import { r as getBumpyDir } from "./config-BcmlSJJd.mjs";
3
- import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry } from "./changelog-C9JXdwaj.mjs";
2
+ import { r as getBumpyDir } from "./config-gMu1z0bz.mjs";
3
+ import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry } from "./changelog-CFWf9s2q.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 */
@@ -1,5 +1,5 @@
1
1
  import { a as readJson, f as writeText, i as listFiles, n as exists, s as readText } from "./fs-CBXKZhoU.mjs";
2
- import { i as isPackageManaged, o as loadPackageConfig, r as getBumpyDir } from "./config-BcmlSJJd.mjs";
2
+ import { i as isPackageManaged, o as loadPackageConfig, r as getBumpyDir } from "./config-gMu1z0bz.mjs";
3
3
  import { i as jsYaml, n as detectWorkspaces } from "./package-manager-BQPwXwu5.mjs";
4
4
  import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
5
5
  import { relative, resolve } from "node:path";
@@ -1,5 +1,5 @@
1
1
  import { n as log } from "./logger-BgksGFuf.mjs";
2
- import { c as maxBump, t as BUMP_LEVELS } from "./types-BX4pfmKh.mjs";
2
+ import { c as maxBump, t as BUMP_LEVELS } from "./types-CAwBhUsn.mjs";
3
3
  import { relative, resolve } from "node:path";
4
4
  import { realpathSync } from "node:fs";
5
5
  //#region src/core/changelog.ts
@@ -45,7 +45,7 @@ const defaultFormatter = (ctx) => {
45
45
  const BUILTIN_FORMATTERS = {
46
46
  default: defaultFormatter,
47
47
  github: async () => {
48
- const { createGithubFormatter } = await import("./changelog-github-CZcW184H.mjs");
48
+ const { createGithubFormatter } = await import("./changelog-github-T5LqaTwV.mjs");
49
49
  return createGithubFormatter();
50
50
  }
51
51
  };
@@ -56,7 +56,7 @@ const BUILTIN_FORMATTERS = {
56
56
  async function loadFormatter(changelog, rootDir) {
57
57
  const [name, options] = Array.isArray(changelog) ? changelog : [changelog, {}];
58
58
  if (name === "github") {
59
- const { createGithubFormatter } = await import("./changelog-github-CZcW184H.mjs");
59
+ const { createGithubFormatter } = await import("./changelog-github-T5LqaTwV.mjs");
60
60
  return createGithubFormatter(options);
61
61
  }
62
62
  if (typeof name === "string" && BUILTIN_FORMATTERS[name]) {
@@ -1,6 +1,6 @@
1
- import { c as maxBump } from "./types-BX4pfmKh.mjs";
1
+ import { c as maxBump } from "./types-CAwBhUsn.mjs";
2
2
  import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
3
- import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-C9JXdwaj.mjs";
3
+ import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-CFWf9s2q.mjs";
4
4
  //#region src/core/changelog-github.ts
5
5
  /** Authors filtered from "Thanks" attribution by default (e.g. bots) */
6
6
  /** Authors filtered from "Thanks" attribution by default (e.g. AI/automation bots) */
@@ -1,7 +1,7 @@
1
1
  import { a as __exportAll, i as __commonJSMin, n as log, s as __toESM, t as colorize } from "./logger-BgksGFuf.mjs";
2
- import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir } from "./config-BcmlSJJd.mjs";
3
- import { o as discoverWorkspace, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-4cnuDyfW.mjs";
4
- import { a as getFileStatuses, r as getChangedFiles } from "./git-DE46Je5V.mjs";
2
+ import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir } from "./config-gMu1z0bz.mjs";
3
+ import { o as discoverWorkspace, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-BZT3KCns.mjs";
4
+ import { a as getFileStatuses, r as getChangedFiles } from "./git-nTR-JccX.mjs";
5
5
  import { relative } from "node:path";
6
6
  //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
7
7
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -1,14 +1,13 @@
1
1
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
2
- import { a as loadConfig } from "./config-BcmlSJJd.mjs";
2
+ import { a as loadConfig } from "./config-gMu1z0bz.mjs";
3
3
  import { t as detectPackageManager } from "./package-manager-BQPwXwu5.mjs";
4
- import { o as discoverWorkspace, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-4cnuDyfW.mjs";
5
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
4
+ import { o as discoverWorkspace, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-BZT3KCns.mjs";
5
+ import { a as DependencyGraph, t as assembleReleasePlan } from "./release-plan-7ApKPR6T.mjs";
6
6
  import { n as runArgs, r as runArgsAsync, s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
7
- import { t as assembleReleasePlan } from "./release-plan-M9TGZn2W.mjs";
8
- import { r as getChangedFiles } from "./git-DE46Je5V.mjs";
9
- import { t as randomName } from "./names-C-TuOPbd.mjs";
10
- import { n as findChangedPackages } from "./check-Dqm9ZU8T.mjs";
11
- import { t as resolveCommitMessage } from "./commit-message-BA1w19wq.mjs";
7
+ import { r as getChangedFiles } from "./git-nTR-JccX.mjs";
8
+ import { t as randomName } from "./names-COooXAFg.mjs";
9
+ import { n as findChangedPackages } from "./check-C-l4yr0C.mjs";
10
+ import { t as resolveCommitMessage } from "./commit-message-CSWVKPJ-.mjs";
12
11
  import { appendFileSync, mkdirSync, writeFileSync } from "node:fs";
13
12
  import { createHash } from "node:crypto";
14
13
  //#region src/commands/ci.ts
@@ -156,7 +155,7 @@ async function ciPlanCommand(rootDir) {
156
155
  packageNames: plan.releases.map((r) => r.name)
157
156
  };
158
157
  } else {
159
- const { findUnpublishedPackages } = await import("./publish-D5OcYhC_.mjs");
158
+ const { findUnpublishedPackages } = await import("./publish-X8IGj3AF.mjs");
160
159
  const unpublished = await findUnpublishedPackages(packages, config);
161
160
  if (unpublished.length > 0) output = {
162
161
  mode: "publish",
@@ -177,7 +176,7 @@ async function ciPlanCommand(rootDir) {
177
176
  mkdirSync(cachePath.slice(0, cachePath.lastIndexOf("/")), { recursive: true });
178
177
  writeFileSync(cachePath, json, "utf-8");
179
178
  writeGitHubOutput("mode", output.mode);
180
- writeGitHubOutput("packages", output.packageNames.join(","));
179
+ writeGitHubOutput("packages", JSON.stringify(output.packageNames));
181
180
  writeGitHubOutput("json", JSON.stringify(output));
182
181
  }
183
182
  function formatPlanRelease(r, packages, config) {
@@ -226,7 +225,7 @@ async function ciReleaseCommand(rootDir, opts) {
226
225
  }
227
226
  if (bumpFiles.length === 0) {
228
227
  log.info("No pending bump files — checking for unpublished packages...");
229
- const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
228
+ const { publishCommand } = await import("./publish-X8IGj3AF.mjs");
230
229
  await publishCommand(rootDir, { tag: opts.tag });
231
230
  return;
232
231
  }
@@ -240,7 +239,7 @@ async function ciReleaseCommand(rootDir, opts) {
240
239
  }
241
240
  async function autoPublish(rootDir, config, plan, tag) {
242
241
  log.step("Running bumpy version...");
243
- const { versionCommand } = await import("./version-Cz-p96lm.mjs");
242
+ const { versionCommand } = await import("./version-DvjKjAsp.mjs");
244
243
  await versionCommand(rootDir);
245
244
  log.step("Committing version changes...");
246
245
  runArgs([
@@ -269,7 +268,7 @@ async function autoPublish(rootDir, config, plan, tag) {
269
268
  ], { cwd: rootDir });
270
269
  }
271
270
  log.step("Running bumpy publish...");
272
- const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
271
+ const { publishCommand } = await import("./publish-X8IGj3AF.mjs");
273
272
  await publishCommand(rootDir, { tag });
274
273
  }
275
274
  /**
@@ -435,7 +434,7 @@ async function createVersionPr(rootDir, plan, config, packageDirs, branchName) {
435
434
  branch
436
435
  ], { cwd: rootDir });
437
436
  log.step("Running bumpy version...");
438
- const { versionCommand } = await import("./version-Cz-p96lm.mjs");
437
+ const { versionCommand } = await import("./version-DvjKjAsp.mjs");
439
438
  await versionCommand(rootDir);
440
439
  runArgs([
441
440
  "git",
@@ -1,7 +1,7 @@
1
1
  import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGFuf.mjs";
2
2
  import { t as detectPackageManager } from "./package-manager-BQPwXwu5.mjs";
3
3
  import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
4
- import { a as fe, c as ot, i as _t, n as O, o as gt, r as Ot, s as mt, t as unwrap, u as wt } from "./clack-CehaQZU6.mjs";
4
+ import { a as fe, c as ot, i as _t, n as O, o as gt, r as Ot, s as mt, t as unwrap, u as wt } from "./clack-W95rXis0.mjs";
5
5
  //#region src/commands/ci-setup.ts
6
6
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
7
7
  const PAT_PERMISSIONS = [
@@ -659,50 +659,6 @@ var Q$1 = class extends p {
659
659
  });
660
660
  }
661
661
  };
662
- let it$1 = class extends p {
663
- options;
664
- cursor = 0;
665
- get _value() {
666
- return this.options[this.cursor].value;
667
- }
668
- get _enabledOptions() {
669
- return this.options.filter((t) => t.disabled !== !0);
670
- }
671
- toggleAll() {
672
- const t = this._enabledOptions;
673
- this.value = this.value !== void 0 && this.value.length === t.length ? [] : t.map((s) => s.value);
674
- }
675
- toggleInvert() {
676
- const t = this.value;
677
- if (!t) return;
678
- this.value = this._enabledOptions.filter((s) => !t.includes(s.value)).map((s) => s.value);
679
- }
680
- toggleValue() {
681
- this.value === void 0 && (this.value = []);
682
- this.value = this.value.includes(this._value) ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
683
- }
684
- constructor(t) {
685
- super(t, !1), this.options = t.options, this.value = [...t.initialValues ?? []];
686
- const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
687
- this.cursor = this.options[e].disabled ? d$1(e, 1, this.options) : e, this.on("key", (s) => {
688
- s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
689
- }), this.on("cursor", (s) => {
690
- switch (s) {
691
- case "left":
692
- case "up":
693
- this.cursor = d$1(this.cursor, -1, this.options);
694
- break;
695
- case "down":
696
- case "right":
697
- this.cursor = d$1(this.cursor, 1, this.options);
698
- break;
699
- case "space":
700
- this.toggleValue();
701
- break;
702
- }
703
- });
704
- }
705
- };
706
662
  var nt$1 = class extends p {
707
663
  options;
708
664
  cursor = 0;
@@ -760,7 +716,10 @@ function Ze() {
760
716
  const ee = Ze(), ae = () => process.env.CI === "true", w = (e, i) => ee ? e : i, _e = w("◆", "*"), oe = w("■", "x"), ue = w("▲", "x"), F = w("◇", "o"), le = w("┌", "T"), d = w("│", "|"), E = w("└", "—");
761
717
  w("┐", "T");
762
718
  w("┘", "—");
763
- const z = w("●", ">"), H = w("○", " "), te = w("◻", "[•]"), U = w("◼", "[+]"), J = w("◻", "[ ]");
719
+ const z = w("●", ">"), H = w("○", " ");
720
+ w("◻", "[•]");
721
+ w("◼", "[+]");
722
+ w("◻", "[ ]");
764
723
  w("▪", "•");
765
724
  const se = w("─", "-"), ce = w("╮", "+"), Ge = w("├", "+"), $e = w("╯", "+"), de = w("╰", "+");
766
725
  w("╭", "+");
@@ -908,86 +867,6 @@ ${styleText("gray", E)} ` : "";
908
867
  s.write(`${r}${e}
909
868
 
910
869
  `);
911
- }, Q = (e, i) => e.split(`
912
- `).map((s) => i(s)).join(`
913
- `), yt = (e) => {
914
- const i = (r, u) => {
915
- const n = r.label ?? String(r.value);
916
- return u === "disabled" ? `${styleText("gray", J)} ${Q(n, (o) => styleText(["strikethrough", "gray"], o))}${r.hint ? ` ${styleText("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${styleText("cyan", te)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${styleText("green", U)} ${Q(n, (o) => styleText("dim", o))}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q(n, (o) => styleText(["strikethrough", "dim"], o))}` : u === "active-selected" ? `${styleText("green", U)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q(n, (o) => styleText("dim", o))}` : `${styleText("dim", J)} ${Q(n, (o) => styleText("dim", o))}`;
917
- }, s = e.required ?? !0;
918
- return new it$1({
919
- options: e.options,
920
- signal: e.signal,
921
- input: e.input,
922
- output: e.output,
923
- initialValues: e.initialValues,
924
- required: s,
925
- cursorAt: e.cursorAt,
926
- validate(r) {
927
- if (s && (r === void 0 || r.length === 0)) return `Please select at least one option.
928
- ${styleText("reset", styleText("dim", `Press ${styleText([
929
- "gray",
930
- "bgWhite",
931
- "inverse"
932
- ], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
933
- },
934
- render() {
935
- const r = e.withGuide ?? u.withGuide, u$8 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V(this.state)} `), n = `${r ? `${styleText("gray", d)}
936
- ` : ""}${u$8}
937
- `, o = this.value ?? [], c = (a, l) => {
938
- if (a.disabled) return i(a, "disabled");
939
- const $ = o.includes(a.value);
940
- return l && $ ? i(a, "active-selected") : $ ? i(a, "selected") : i(a, l ? "active" : "inactive");
941
- };
942
- switch (this.state) {
943
- case "submit": {
944
- const a = this.options.filter(({ value: $ }) => o.includes($)).map(($) => i($, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none");
945
- return `${n}${R(e.output, a, r ? `${styleText("gray", d)} ` : "")}`;
946
- }
947
- case "cancel": {
948
- const a = this.options.filter(({ value: $ }) => o.includes($)).map(($) => i($, "cancelled")).join(styleText("dim", ", "));
949
- if (a.trim() === "") return `${n}${styleText("gray", d)}`;
950
- return `${n}${R(e.output, a, r ? `${styleText("gray", d)} ` : "")}${r ? `
951
- ${styleText("gray", d)}` : ""}`;
952
- }
953
- case "error": {
954
- const a = r ? `${styleText("yellow", d)} ` : "", l = this.error.split(`
955
- `).map((p, m) => m === 0 ? `${r ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
956
- `), $ = n.split(`
957
- `).length, y = l.split(`
958
- `).length + 1;
959
- return `${n}${a}${Y({
960
- output: e.output,
961
- options: this.options,
962
- cursor: this.cursor,
963
- maxItems: e.maxItems,
964
- columnPadding: a.length,
965
- rowPadding: $ + y,
966
- style: c
967
- }).join(`
968
- ${a}`)}
969
- ${l}
970
- `;
971
- }
972
- default: {
973
- const a = r ? `${styleText("cyan", d)} ` : "", l = n.split(`
974
- `).length, $ = r ? 2 : 1;
975
- return `${n}${a}${Y({
976
- output: e.output,
977
- options: this.options,
978
- cursor: this.cursor,
979
- maxItems: e.maxItems,
980
- columnPadding: a.length,
981
- rowPadding: l + $,
982
- style: c
983
- }).join(`
984
- ${a}`)}
985
- ${r ? styleText("cyan", E) : ""}
986
- `;
987
- }
988
- }
989
- }
990
- }).prompt();
991
870
  }, ft = (e) => styleText("dim", e), vt = (e, i, s) => {
992
871
  const r = {
993
872
  hard: !0,
@@ -1213,4 +1092,4 @@ function unwrap(value) {
1213
1092
  return value;
1214
1093
  }
1215
1094
  //#endregion
1216
- export { fe as a, ot as c, yt as d, _t as i, pt as l, O as n, gt as o, Ot as r, mt as s, unwrap as t, wt as u };
1095
+ export { fe as a, ot as c, _t as i, pt as l, O as n, gt as o, Ot as r, mt as s, unwrap as t, wt as u };
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
3
- import { n as findRoot } from "./config-BcmlSJJd.mjs";
3
+ import { n as findRoot } from "./config-gMu1z0bz.mjs";
4
4
  //#region src/cli.ts
5
5
  const args = process.argv.slice(2);
6
6
  const command = args[0];
@@ -25,13 +25,13 @@ async function main() {
25
25
  switch (command) {
26
26
  case "init": {
27
27
  const rootDir = await findRoot();
28
- const { initCommand } = await import("./init-CY7OVZCX.mjs");
28
+ const { initCommand } = await import("./init-Cs6amsw5.mjs");
29
29
  await initCommand(rootDir, { force: flags.force === true });
30
30
  break;
31
31
  }
32
32
  case "add": {
33
33
  const rootDir = await findRoot();
34
- const { addCommand } = await import("./add-Dr1vFn9b.mjs");
34
+ const { addCommand } = await import("./add-Ci3vfJCF.mjs");
35
35
  await addCommand(rootDir, {
36
36
  packages: flags.packages,
37
37
  message: flags.message,
@@ -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-CapkBv6n.mjs");
46
+ const { statusCommand } = await import("./status-Cgr3Opiw.mjs");
47
47
  await statusCommand(rootDir, {
48
48
  json: flags.json === true,
49
49
  packagesOnly: flags.packages === true,
@@ -55,13 +55,13 @@ async function main() {
55
55
  }
56
56
  case "version": {
57
57
  const rootDir = await findRoot();
58
- const { versionCommand } = await import("./version-Cz-p96lm.mjs");
58
+ const { versionCommand } = await import("./version-DvjKjAsp.mjs");
59
59
  await versionCommand(rootDir, { commit: flags.commit === true });
60
60
  break;
61
61
  }
62
62
  case "generate": {
63
63
  const rootDir = await findRoot();
64
- const { generateCommand } = await import("./generate-0a_KR7tn.mjs");
64
+ const { generateCommand } = await import("./generate-BuH9DEZO.mjs");
65
65
  await generateCommand(rootDir, {
66
66
  from: flags.from,
67
67
  dryRun: flags["dry-run"] === true,
@@ -71,7 +71,7 @@ async function main() {
71
71
  }
72
72
  case "check": {
73
73
  const rootDir = await findRoot();
74
- const { checkCommand } = await import("./check-Dqm9ZU8T.mjs").then((n) => n.t);
74
+ const { checkCommand } = await import("./check-C-l4yr0C.mjs").then((n) => n.t);
75
75
  const hookValue = flags.hook;
76
76
  if (hookValue && hookValue !== "pre-commit" && hookValue !== "pre-push") {
77
77
  log.error(`Invalid --hook value "${hookValue}". Expected "pre-commit" or "pre-push".`);
@@ -89,24 +89,24 @@ 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-E1QXDnB_.mjs");
92
+ const { ciCheckCommand } = await import("./ci-Ukh4gbGo.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 === "plan") {
99
- const { ciPlanCommand } = await import("./ci-E1QXDnB_.mjs");
99
+ const { ciPlanCommand } = await import("./ci-Ukh4gbGo.mjs");
100
100
  await ciPlanCommand(rootDir);
101
101
  } else if (subcommand === "release") {
102
- const { ciReleaseCommand } = await import("./ci-E1QXDnB_.mjs");
102
+ const { ciReleaseCommand } = await import("./ci-Ukh4gbGo.mjs");
103
103
  await ciReleaseCommand(rootDir, {
104
104
  mode: ciFlags["auto-publish"] === true ? "auto-publish" : "version-pr",
105
105
  tag: ciFlags.tag,
106
106
  branch: ciFlags.branch
107
107
  });
108
108
  } else if (subcommand === "setup") {
109
- const { ciSetupCommand } = await import("./ci-setup-Bbf96usW.mjs");
109
+ const { ciSetupCommand } = await import("./ci-setup-DKjyiF2-.mjs");
110
110
  await ciSetupCommand(rootDir);
111
111
  } else {
112
112
  log.error(`Unknown ci subcommand: ${subcommand}. Use "ci check", "ci plan", "ci release", or "ci setup".`);
@@ -116,7 +116,7 @@ async function main() {
116
116
  }
117
117
  case "publish": {
118
118
  const rootDir = await findRoot();
119
- const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
119
+ const { publishCommand } = await import("./publish-X8IGj3AF.mjs");
120
120
  await publishCommand(rootDir, {
121
121
  dryRun: flags["dry-run"] === true,
122
122
  tag: flags.tag,
@@ -130,7 +130,7 @@ async function main() {
130
130
  const subcommand = args[1];
131
131
  const aiFlags = parseFlags(args.slice(2));
132
132
  if (subcommand === "setup") {
133
- const { aiSetupCommand } = await import("./ai-BHoKuvHn.mjs");
133
+ const { aiSetupCommand } = await import("./ai-Bbe56gBt.mjs");
134
134
  await aiSetupCommand(rootDir, { target: aiFlags.target });
135
135
  } else {
136
136
  log.error(`Unknown ai subcommand: ${subcommand}. Use "ai setup".`);
@@ -140,7 +140,7 @@ async function main() {
140
140
  }
141
141
  case "--version":
142
142
  case "-v":
143
- console.log(`bumpy 1.7.0`);
143
+ console.log(`bumpy 1.8.0`);
144
144
  break;
145
145
  case "help":
146
146
  case "--help":
@@ -160,7 +160,7 @@ async function main() {
160
160
  }
161
161
  function printHelp() {
162
162
  console.log(`
163
- ${colorize(`🐸 bumpy v1.7.0`, "bold")} - Modern monorepo versioning
163
+ ${colorize(`🐸 bumpy v1.8.0`, "bold")} - Modern monorepo versioning
164
164
 
165
165
  Usage: bumpy <command> [options]
166
166
 
@@ -1,6 +1,6 @@
1
1
  import { a as __exportAll } from "./logger-BgksGFuf.mjs";
2
2
  import { a as readJson, n as exists, o as readJsonc } from "./fs-CBXKZhoU.mjs";
3
- import { r as DEFAULT_CONFIG } from "./types-BX4pfmKh.mjs";
3
+ import { l as normalizeCascadeConfig, r as DEFAULT_CONFIG } from "./types-CAwBhUsn.mjs";
4
4
  import { resolve } from "node:path";
5
5
  //#region src/core/config.ts
6
6
  var config_exports = /* @__PURE__ */ __exportAll({
@@ -101,8 +101,12 @@ function mergePackageConfig(...configs) {
101
101
  ...cfg.dependencyBumpRules
102
102
  };
103
103
  if (cfg.cascadeTo) result.cascadeTo = {
104
- ...result.cascadeTo,
105
- ...cfg.cascadeTo
104
+ ...result.cascadeTo ? normalizeCascadeConfig(result.cascadeTo) : {},
105
+ ...normalizeCascadeConfig(cfg.cascadeTo)
106
+ };
107
+ if (cfg.cascadeFrom) result.cascadeFrom = {
108
+ ...result.cascadeFrom ? normalizeCascadeConfig(result.cascadeFrom) : {},
109
+ ...normalizeCascadeConfig(cfg.cascadeFrom)
106
110
  };
107
111
  }
108
112
  return result;
@@ -1,10 +1,10 @@
1
1
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
2
2
  import { t as ensureDir } from "./fs-CBXKZhoU.mjs";
3
- import { a as loadConfig, r as getBumpyDir } from "./config-BcmlSJJd.mjs";
4
- import { a as discoverPackages, i as writeBumpFile } from "./bump-file-4cnuDyfW.mjs";
3
+ import { a as loadConfig, r as getBumpyDir } from "./config-gMu1z0bz.mjs";
4
+ import { a as discoverPackages, i as writeBumpFile } from "./bump-file-BZT3KCns.mjs";
5
5
  import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
6
- import { n as getBranchCommits, o as getFilesChangedInCommit } from "./git-DE46Je5V.mjs";
7
- import { n as slugify, t as randomName } from "./names-C-TuOPbd.mjs";
6
+ import { n as getBranchCommits, o as getFilesChangedInCommit } from "./git-nTR-JccX.mjs";
7
+ import { n as slugify, t as randomName } from "./names-COooXAFg.mjs";
8
8
  import { relative } from "node:path";
9
9
  //#region src/commands/generate.ts
10
10
  const BUMP_MAP = {
package/dist/index.d.mts CHANGED
@@ -10,6 +10,16 @@ interface DependencyBumpRule {
10
10
  /** What bump to apply to the dependent */
11
11
  bumpAs: BumpType | 'match';
12
12
  }
13
+ interface CascadeRule {
14
+ /** What bump level in the source triggers the cascade. Default: "patch" (any bump) */
15
+ trigger?: BumpType;
16
+ /** What bump to apply to the target. Default: "match" (same as the source bump level) */
17
+ bumpAs?: BumpType | 'match';
18
+ }
19
+ /** Input type for cascadeTo/cascadeFrom — array of names/globs, or object with per-entry rules */
20
+ type CascadeConfig = string[] | Record<string, CascadeRule>;
21
+ /** Normalize CascadeConfig into a consistent Record form with defaults applied */
22
+ declare function normalizeCascadeConfig(config: CascadeConfig): Record<string, Required<CascadeRule>>;
13
23
  declare const DEFAULT_BUMP_RULES: Record<string, DependencyBumpRule | false>;
14
24
  type DepType = 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies';
15
25
  declare const DEP_TYPES: DepType[];
@@ -102,7 +112,8 @@ interface PackageConfig {
102
112
  /** Glob patterns to filter which changed files count toward marking this package as changed */
103
113
  changedFilePatterns?: string[];
104
114
  dependencyBumpRules?: Partial<Record<DepType, DependencyBumpRule | false>>;
105
- cascadeTo?: Record<string, DependencyBumpRule>;
115
+ cascadeTo?: CascadeConfig;
116
+ cascadeFrom?: CascadeConfig;
106
117
  }
107
118
  declare const DEFAULT_PUBLISH_CONFIG: PublishConfig;
108
119
  declare const DEFAULT_CONFIG: BumpyConfig;
@@ -307,4 +318,4 @@ interface PublishResult {
307
318
  */
308
319
  declare function publishPackages(releasePlan: ReleasePlan, packages: Map<string, WorkspacePackage>, depGraph: DependencyGraph, config: BumpyConfig, rootDir: string, opts?: PublishOptions, catalogs?: CatalogMap, detectedPm?: PackageManager): Promise<PublishResult>;
309
320
  //#endregion
310
- export { BUMP_LEVELS, BumpFile, type BumpFileParseResult, BumpFileRelease, BumpFileReleaseCascade, BumpFileReleaseSimple, BumpType, BumpTypeWithNone, BumpyConfig, type ChangelogContext, type ChangelogFormatter, DEFAULT_BUMP_RULES, DEFAULT_CONFIG, DEFAULT_PUBLISH_CONFIG, DEP_TYPES, DepType, DependencyBumpRule, DependencyGraph, DependentInfo, type GithubChangelogOptions, PackageConfig, PackageManager, PlannedRelease, PublishConfig, type ReadBumpFilesResult, ReleasePlan, WorkspacePackage, applyReleasePlan, assembleReleasePlan, bumpLevel, bumpVersion, defaultFormatter, discoverPackages, findRoot, generateChangelogEntry, getBumpyDir, hasCascade, loadConfig, loadFormatter, matchGlob, maxBump, parseBumpFile, prependToChangelog, publishPackages, readBumpFiles, satisfies, stripProtocol, writeBumpFile };
321
+ export { BUMP_LEVELS, BumpFile, type BumpFileParseResult, BumpFileRelease, BumpFileReleaseCascade, BumpFileReleaseSimple, BumpType, BumpTypeWithNone, BumpyConfig, CascadeConfig, CascadeRule, type ChangelogContext, type ChangelogFormatter, DEFAULT_BUMP_RULES, DEFAULT_CONFIG, DEFAULT_PUBLISH_CONFIG, DEP_TYPES, DepType, DependencyBumpRule, DependencyGraph, DependentInfo, type GithubChangelogOptions, PackageConfig, PackageManager, PlannedRelease, PublishConfig, type ReadBumpFilesResult, ReleasePlan, WorkspacePackage, applyReleasePlan, assembleReleasePlan, bumpLevel, bumpVersion, defaultFormatter, discoverPackages, findRoot, generateChangelogEntry, getBumpyDir, hasCascade, loadConfig, loadFormatter, matchGlob, maxBump, normalizeCascadeConfig, parseBumpFile, prependToChangelog, publishPackages, readBumpFiles, satisfies, stripProtocol, writeBumpFile };
package/dist/index.mjs CHANGED
@@ -1,9 +1,8 @@
1
- import { a as DEP_TYPES, c as maxBump, i as DEFAULT_PUBLISH_CONFIG, n as DEFAULT_BUMP_RULES, o as bumpLevel, r as DEFAULT_CONFIG, s as hasCascade, t as BUMP_LEVELS } from "./types-BX4pfmKh.mjs";
2
- import { a as loadConfig, n as findRoot, r as getBumpyDir, s as matchGlob } from "./config-BcmlSJJd.mjs";
3
- import { a as discoverPackages, i as writeBumpFile, n as parseBumpFile, r as readBumpFiles } from "./bump-file-4cnuDyfW.mjs";
4
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
5
- import { i as stripProtocol, n as bumpVersion, r as satisfies, t as assembleReleasePlan } from "./release-plan-M9TGZn2W.mjs";
6
- import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry, t as defaultFormatter } from "./changelog-C9JXdwaj.mjs";
7
- import { t as applyReleasePlan } from "./apply-release-plan-BRN29C3D.mjs";
8
- import { t as publishPackages } from "./publish-pipeline-ChiL1eRQ.mjs";
9
- 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 };
1
+ import { a as DEP_TYPES, c as maxBump, i as DEFAULT_PUBLISH_CONFIG, l as normalizeCascadeConfig, n as DEFAULT_BUMP_RULES, o as bumpLevel, r as DEFAULT_CONFIG, s as hasCascade, t as BUMP_LEVELS } from "./types-CAwBhUsn.mjs";
2
+ import { a as loadConfig, n as findRoot, r as getBumpyDir, s as matchGlob } from "./config-gMu1z0bz.mjs";
3
+ import { a as discoverPackages, i as writeBumpFile, n as parseBumpFile, r as readBumpFiles } from "./bump-file-BZT3KCns.mjs";
4
+ import { a as DependencyGraph, i as stripProtocol, n as bumpVersion, r as satisfies, t as assembleReleasePlan } from "./release-plan-7ApKPR6T.mjs";
5
+ import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry, t as defaultFormatter } from "./changelog-CFWf9s2q.mjs";
6
+ import { t as applyReleasePlan } from "./apply-release-plan-DncfboRW.mjs";
7
+ import { t as publishPackages } from "./publish-pipeline-DHSCchtX.mjs";
8
+ 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, normalizeCascadeConfig, parseBumpFile, prependToChangelog, publishPackages, readBumpFiles, satisfies, stripProtocol, writeBumpFile };
@@ -2,7 +2,7 @@ import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGF
2
2
  import { a as readJson, d as writeJson, f as writeText, i as listFiles, n as exists, s as readText, t as ensureDir } from "./fs-CBXKZhoU.mjs";
3
3
  import { t as detectPackageManager } from "./package-manager-BQPwXwu5.mjs";
4
4
  import { t as run } from "./shell-C8KgKnMQ.mjs";
5
- import { c as ot, o as gt, s as mt, t as unwrap } from "./clack-CehaQZU6.mjs";
5
+ import { c as ot, o as gt, s as mt, t as unwrap } from "./clack-W95rXis0.mjs";
6
6
  import { resolve } from "node:path";
7
7
  import { readdir, rename, rm } from "node:fs/promises";
8
8
  //#region ../../.bumpy/README.md
@@ -100,7 +100,15 @@ function migrateChangesetConfig(csConfig) {
100
100
  "ignore",
101
101
  "updateInternalDependencies",
102
102
  "privatePackages"
103
- ]) if (csConfig[field] !== void 0) bumpyConfig[field] = csConfig[field];
103
+ ]) {
104
+ const value = csConfig[field];
105
+ if (value === void 0) continue;
106
+ if (Array.isArray(value) && value.length === 0) continue;
107
+ if (field === "baseBranch" && value === "main") continue;
108
+ if (field === "access" && value === "public") continue;
109
+ if (field === "updateInternalDependencies" && value === "out-of-range") continue;
110
+ bumpyConfig[field] = value;
111
+ }
104
112
  return bumpyConfig;
105
113
  }
106
114
  async function isPackageInstalled(rootDir, pkgName) {
@@ -1,13 +1,13 @@
1
1
  import { n as log, o as __require, t as colorize } from "./logger-BgksGFuf.mjs";
2
- import { a as loadConfig } from "./config-BcmlSJJd.mjs";
2
+ import { a as loadConfig } from "./config-gMu1z0bz.mjs";
3
3
  import { n as detectWorkspaces } from "./package-manager-BQPwXwu5.mjs";
4
- import { o as discoverWorkspace } from "./bump-file-4cnuDyfW.mjs";
5
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
4
+ import { o as discoverWorkspace } from "./bump-file-BZT3KCns.mjs";
5
+ import { a as DependencyGraph } from "./release-plan-7ApKPR6T.mjs";
6
6
  import { r as runArgsAsync, s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
7
- import { i as loadFormatter, n as generateChangelogEntry } from "./changelog-C9JXdwaj.mjs";
8
- import { c as listTags, l as pushWithTags, s as hasUncommittedChanges } from "./git-DE46Je5V.mjs";
9
- import { t as publishPackages } from "./publish-pipeline-ChiL1eRQ.mjs";
10
- import { CI_PLAN_CACHE_PATH } from "./ci-E1QXDnB_.mjs";
7
+ import { i as loadFormatter, n as generateChangelogEntry } from "./changelog-CFWf9s2q.mjs";
8
+ import { c as listTags, l as pushWithTags, s as hasUncommittedChanges } from "./git-nTR-JccX.mjs";
9
+ import { t as publishPackages } from "./publish-pipeline-DHSCchtX.mjs";
10
+ import { CI_PLAN_CACHE_PATH } from "./ci-Ukh4gbGo.mjs";
11
11
  //#region src/core/github-release.ts
12
12
  /** Get the current HEAD commit SHA */
13
13
  function getHeadSha(rootDir) {
@@ -197,7 +197,7 @@ async function publishCommand(rootDir, opts) {
197
197
  }
198
198
  let toPublish = await findUnpublishedWithCache(rootDir, packages, config);
199
199
  if (opts.filter) {
200
- const { matchGlob } = await import("./config-BcmlSJJd.mjs").then((n) => n.t);
200
+ const { matchGlob } = await import("./config-gMu1z0bz.mjs").then((n) => n.t);
201
201
  const patterns = opts.filter.split(",").map((p) => p.trim());
202
202
  toPublish = toPublish.filter((r) => patterns.some((p) => matchGlob(r.name, p)));
203
203
  }
@@ -1,9 +1,9 @@
1
1
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
2
2
  import { a as readJson, u as updateJsonNestedField } from "./fs-CBXKZhoU.mjs";
3
3
  import { r as resolveCatalogDep } from "./package-manager-BQPwXwu5.mjs";
4
+ import { i as stripProtocol } from "./release-plan-7ApKPR6T.mjs";
4
5
  import { i as runAsync, o as sq, r as runArgsAsync, s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
5
- import { i as stripProtocol } from "./release-plan-M9TGZn2W.mjs";
6
- import { t as createTag, u as tagExists } from "./git-DE46Je5V.mjs";
6
+ import { t as createTag, u as tagExists } from "./git-nTR-JccX.mjs";
7
7
  import { resolve } from "node:path";
8
8
  import { unlink } from "node:fs/promises";
9
9
  import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
@@ -1,6 +1,69 @@
1
1
  import { i as __commonJSMin, s as __toESM } from "./logger-BgksGFuf.mjs";
2
- import { c as maxBump, n as DEFAULT_BUMP_RULES, o as bumpLevel, s as hasCascade } from "./types-BX4pfmKh.mjs";
3
- import { s as matchGlob } from "./config-BcmlSJJd.mjs";
2
+ import { c as maxBump, l as normalizeCascadeConfig, n as DEFAULT_BUMP_RULES, o as bumpLevel, s as hasCascade } from "./types-CAwBhUsn.mjs";
3
+ import { s as matchGlob } from "./config-gMu1z0bz.mjs";
4
+ //#region src/core/dep-graph.ts
5
+ var DependencyGraph = class {
6
+ /** Map from package name → packages that depend on it */
7
+ dependents = /* @__PURE__ */ new Map();
8
+ /** Set of all internal package names */
9
+ internalPackages;
10
+ constructor(packages) {
11
+ this.internalPackages = new Set(packages.keys());
12
+ this.build(packages);
13
+ }
14
+ build(packages) {
15
+ for (const [name, pkg] of packages) {
16
+ const depTypes = [
17
+ ["dependencies", pkg.dependencies],
18
+ ["devDependencies", pkg.devDependencies],
19
+ ["peerDependencies", pkg.peerDependencies],
20
+ ["optionalDependencies", pkg.optionalDependencies]
21
+ ];
22
+ for (const [depType, deps] of depTypes) for (const [depName, versionRange] of Object.entries(deps)) {
23
+ if (!this.internalPackages.has(depName)) continue;
24
+ if (!this.dependents.has(depName)) this.dependents.set(depName, []);
25
+ this.dependents.get(depName).push({
26
+ name,
27
+ depType,
28
+ versionRange
29
+ });
30
+ }
31
+ }
32
+ }
33
+ /** Get all packages that depend on the given package */
34
+ getDependents(pkgName) {
35
+ return this.dependents.get(pkgName) || [];
36
+ }
37
+ /** Check if a package is an internal workspace package */
38
+ isInternal(pkgName) {
39
+ return this.internalPackages.has(pkgName);
40
+ }
41
+ /** Get all internal package names */
42
+ allPackages() {
43
+ return [...this.internalPackages];
44
+ }
45
+ /** Topological sort — returns packages in dependency order (deps first) */
46
+ topologicalSort(packages) {
47
+ const visited = /* @__PURE__ */ new Set();
48
+ const result = [];
49
+ const visit = (name) => {
50
+ if (visited.has(name)) return;
51
+ visited.add(name);
52
+ const pkg = packages.get(name);
53
+ if (!pkg) return;
54
+ for (const deps of [
55
+ pkg.dependencies,
56
+ pkg.devDependencies,
57
+ pkg.peerDependencies,
58
+ pkg.optionalDependencies
59
+ ]) for (const depName of Object.keys(deps)) if (this.internalPackages.has(depName)) visit(depName);
60
+ result.push(name);
61
+ };
62
+ for (const name of this.internalPackages) visit(name);
63
+ return result;
64
+ }
65
+ };
66
+ //#endregion
4
67
  //#region ../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/constants.js
5
68
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6
69
  const SEMVER_SPEC_VERSION = "2.0.0";
@@ -1504,15 +1567,11 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
1504
1567
  if (!matchGlob(targetName, pattern)) continue;
1505
1568
  if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
1506
1569
  }
1507
- const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
1508
- if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
1509
- if (!shouldTrigger(bump.type, rule.trigger)) continue;
1510
- const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
1511
- for (const [targetName] of packages) {
1512
- if (!matchGlob(targetName, pattern)) continue;
1513
- if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
1514
- }
1570
+ const pkg = packages.get(pkgName);
1571
+ if (pkg?.bumpy?.cascadeTo) {
1572
+ if (applyCascadeRules(normalizeCascadeConfig(pkg.bumpy.cascadeTo), pkgName, bump.type, packages, planned)) changed = true;
1515
1573
  }
1574
+ if (applyCascadeFrom(pkgName, bump.type, packages, planned)) changed = true;
1516
1575
  const dependents = depGraph.getDependents(pkgName);
1517
1576
  for (const dep of dependents) {
1518
1577
  const rule = resolveRule(dep.name, dep.depType, packages, config);
@@ -1528,15 +1587,11 @@ function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
1528
1587
  if (!matchGlob(targetName, pattern)) continue;
1529
1588
  if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
1530
1589
  }
1531
- const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
1532
- if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
1533
- if (!shouldTrigger(bump.type, rule.trigger)) continue;
1534
- const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
1535
- for (const [targetName] of packages) {
1536
- if (!matchGlob(targetName, pattern)) continue;
1537
- if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
1538
- }
1590
+ const pkg = packages.get(pkgName);
1591
+ if (pkg?.bumpy?.cascadeTo) {
1592
+ if (applyCascadeRules(normalizeCascadeConfig(pkg.bumpy.cascadeTo), pkgName, bump.type, packages, planned)) changed = true;
1539
1593
  }
1594
+ if (applyCascadeFrom(pkgName, bump.type, packages, planned)) changed = true;
1540
1595
  }
1541
1596
  }
1542
1597
  const releases = [];
@@ -1594,6 +1649,41 @@ function applyBump(planned, name, type, isDependencyBump, isCascadeBump, sourceP
1594
1649
  });
1595
1650
  return true;
1596
1651
  }
1652
+ /**
1653
+ * Apply normalized cascade rules (used for both cascadeTo and cascadeFrom).
1654
+ * Keys in `rules` are target package name/glob patterns.
1655
+ * Returns true if any bump was applied.
1656
+ */
1657
+ function applyCascadeRules(rules, sourceName, sourceType, packages, planned) {
1658
+ let changed = false;
1659
+ for (const [pattern, rule] of Object.entries(rules)) {
1660
+ if (!shouldTrigger(sourceType, rule.trigger)) continue;
1661
+ const cascadeBump = rule.bumpAs === "match" ? sourceType : rule.bumpAs;
1662
+ for (const [targetName] of packages) {
1663
+ if (!matchGlob(targetName, pattern)) continue;
1664
+ if (applyBump(planned, targetName, cascadeBump, false, true, sourceName)) changed = true;
1665
+ }
1666
+ }
1667
+ return changed;
1668
+ }
1669
+ /**
1670
+ * Apply consumer-side cascadeFrom rules.
1671
+ * Scans all packages for cascadeFrom entries where the pattern matches the bumped source.
1672
+ * Returns true if any bump was applied.
1673
+ */
1674
+ function applyCascadeFrom(sourceName, sourceType, packages, planned) {
1675
+ let changed = false;
1676
+ for (const [targetName, targetPkg] of packages) {
1677
+ if (!targetPkg.bumpy?.cascadeFrom) continue;
1678
+ const rules = normalizeCascadeConfig(targetPkg.bumpy.cascadeFrom);
1679
+ for (const [pattern, rule] of Object.entries(rules)) {
1680
+ if (!matchGlob(sourceName, pattern)) continue;
1681
+ if (!shouldTrigger(sourceType, rule.trigger)) continue;
1682
+ if (applyBump(planned, targetName, rule.bumpAs === "match" ? sourceType : rule.bumpAs, false, true, sourceName)) changed = true;
1683
+ }
1684
+ }
1685
+ return changed;
1686
+ }
1597
1687
  /** Check if a bump level meets the trigger threshold */
1598
1688
  function shouldTrigger(bumpType, trigger) {
1599
1689
  return bumpLevel(bumpType) >= bumpLevel(trigger);
@@ -1614,4 +1704,4 @@ function resolveRule(dependentName, depType, packages, config) {
1614
1704
  };
1615
1705
  }
1616
1706
  //#endregion
1617
- export { stripProtocol as i, bumpVersion as n, satisfies as r, assembleReleasePlan as t };
1707
+ export { DependencyGraph as a, stripProtocol as i, bumpVersion as n, satisfies as r, assembleReleasePlan as t };
@@ -1,9 +1,8 @@
1
1
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
2
- import { a as loadConfig } from "./config-BcmlSJJd.mjs";
3
- import { a as discoverPackages, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-4cnuDyfW.mjs";
4
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
5
- import { t as assembleReleasePlan } from "./release-plan-M9TGZn2W.mjs";
6
- import { i as getCurrentBranch, r as getChangedFiles } from "./git-DE46Je5V.mjs";
2
+ import { a as loadConfig } from "./config-gMu1z0bz.mjs";
3
+ import { a as discoverPackages, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-BZT3KCns.mjs";
4
+ import { a as DependencyGraph, t as assembleReleasePlan } from "./release-plan-7ApKPR6T.mjs";
5
+ import { i as getCurrentBranch, r as getChangedFiles } from "./git-nTR-JccX.mjs";
7
6
  //#region src/commands/status.ts
8
7
  async function statusCommand(rootDir, opts) {
9
8
  const config = await loadConfig(rootDir);
@@ -30,7 +29,7 @@ async function statusCommand(rootDir, opts) {
30
29
  releases = releases.filter((r) => types.includes(r.type));
31
30
  }
32
31
  if (opts.filter) {
33
- const { matchGlob } = await import("./config-BcmlSJJd.mjs").then((n) => n.t);
32
+ const { matchGlob } = await import("./config-gMu1z0bz.mjs").then((n) => n.t);
34
33
  const patterns = opts.filter.split(",").map((p) => p.trim());
35
34
  releases = releases.filter((r) => patterns.some((p) => matchGlob(r.name, p)));
36
35
  }
@@ -11,6 +11,19 @@ function maxBump(a, b) {
11
11
  if (!a) return b;
12
12
  return bumpLevel(a) >= bumpLevel(b) ? a : b;
13
13
  }
14
+ /** Normalize CascadeConfig into a consistent Record form with defaults applied */
15
+ function normalizeCascadeConfig(config) {
16
+ const result = {};
17
+ if (Array.isArray(config)) for (const name of config) result[name] = {
18
+ trigger: "patch",
19
+ bumpAs: "match"
20
+ };
21
+ else for (const [name, rule] of Object.entries(config)) result[name] = {
22
+ trigger: rule.trigger ?? "patch",
23
+ bumpAs: rule.bumpAs ?? "match"
24
+ };
25
+ return result;
26
+ }
14
27
  const DEFAULT_BUMP_RULES = {
15
28
  dependencies: {
16
29
  trigger: "patch",
@@ -77,4 +90,4 @@ function hasCascade(r) {
77
90
  return "cascade" in r && Object.keys(r.cascade).length > 0;
78
91
  }
79
92
  //#endregion
80
- export { DEP_TYPES as a, maxBump as c, DEFAULT_PUBLISH_CONFIG as i, DEFAULT_BUMP_RULES as n, bumpLevel as o, DEFAULT_CONFIG as r, hasCascade as s, BUMP_LEVELS as t };
93
+ export { DEP_TYPES as a, maxBump as c, DEFAULT_PUBLISH_CONFIG as i, normalizeCascadeConfig as l, DEFAULT_BUMP_RULES as n, bumpLevel as o, DEFAULT_CONFIG as r, hasCascade as s, BUMP_LEVELS as t };
@@ -1,12 +1,11 @@
1
1
  import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
2
- import { a as loadConfig } from "./config-BcmlSJJd.mjs";
2
+ import { a as loadConfig } from "./config-gMu1z0bz.mjs";
3
3
  import { n as detectWorkspaces } from "./package-manager-BQPwXwu5.mjs";
4
- import { a as discoverPackages, r as readBumpFiles } from "./bump-file-4cnuDyfW.mjs";
5
- import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
4
+ import { a as discoverPackages, r as readBumpFiles } from "./bump-file-BZT3KCns.mjs";
5
+ import { a as DependencyGraph, t as assembleReleasePlan } from "./release-plan-7ApKPR6T.mjs";
6
6
  import { n as runArgs, s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
7
- import { t as assembleReleasePlan } from "./release-plan-M9TGZn2W.mjs";
8
- import { t as applyReleasePlan } from "./apply-release-plan-BRN29C3D.mjs";
9
- import { t as resolveCommitMessage } from "./commit-message-BA1w19wq.mjs";
7
+ import { t as applyReleasePlan } from "./apply-release-plan-DncfboRW.mjs";
8
+ import { t as resolveCommitMessage } from "./commit-message-CSWVKPJ-.mjs";
10
9
  //#region src/commands/version.ts
11
10
  async function versionCommand(rootDir, opts = {}) {
12
11
  const config = await loadConfig(rootDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlock/bumpy",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Modern monorepo versioning and changelog tool",
5
5
  "keywords": [
6
6
  "bump",
@@ -1,64 +0,0 @@
1
- //#region src/core/dep-graph.ts
2
- var DependencyGraph = class {
3
- /** Map from package name → packages that depend on it */
4
- dependents = /* @__PURE__ */ new Map();
5
- /** Set of all internal package names */
6
- internalPackages;
7
- constructor(packages) {
8
- this.internalPackages = new Set(packages.keys());
9
- this.build(packages);
10
- }
11
- build(packages) {
12
- for (const [name, pkg] of packages) {
13
- const depTypes = [
14
- ["dependencies", pkg.dependencies],
15
- ["devDependencies", pkg.devDependencies],
16
- ["peerDependencies", pkg.peerDependencies],
17
- ["optionalDependencies", pkg.optionalDependencies]
18
- ];
19
- for (const [depType, deps] of depTypes) for (const [depName, versionRange] of Object.entries(deps)) {
20
- if (!this.internalPackages.has(depName)) continue;
21
- if (!this.dependents.has(depName)) this.dependents.set(depName, []);
22
- this.dependents.get(depName).push({
23
- name,
24
- depType,
25
- versionRange
26
- });
27
- }
28
- }
29
- }
30
- /** Get all packages that depend on the given package */
31
- getDependents(pkgName) {
32
- return this.dependents.get(pkgName) || [];
33
- }
34
- /** Check if a package is an internal workspace package */
35
- isInternal(pkgName) {
36
- return this.internalPackages.has(pkgName);
37
- }
38
- /** Get all internal package names */
39
- allPackages() {
40
- return [...this.internalPackages];
41
- }
42
- /** Topological sort — returns packages in dependency order (deps first) */
43
- topologicalSort(packages) {
44
- const visited = /* @__PURE__ */ new Set();
45
- const result = [];
46
- const visit = (name) => {
47
- if (visited.has(name)) return;
48
- visited.add(name);
49
- const pkg = packages.get(name);
50
- if (!pkg) return;
51
- for (const deps of [
52
- pkg.dependencies,
53
- pkg.devDependencies,
54
- pkg.peerDependencies,
55
- pkg.optionalDependencies
56
- ]) for (const depName of Object.keys(deps)) if (this.internalPackages.has(depName)) visit(depName);
57
- result.push(name);
58
- };
59
- for (const name of this.internalPackages) visit(name);
60
- return result;
61
- }
62
- };
63
- //#endregion
64
- export { DependencyGraph as t };
File without changes
File without changes
File without changes