@varlock/bumpy 1.6.0 → 1.7.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/{add-u3h5BH8e.mjs → add-Dr1vFn9b.mjs} +9 -10
- package/dist/{ai-C66IfTzs.mjs → ai-BHoKuvHn.mjs} +2 -2
- package/dist/{apply-release-plan-DNpoi7cS.mjs → apply-release-plan-BRN29C3D.mjs} +3 -3
- package/dist/{bump-file-CoaSxqne.mjs → bump-file-4cnuDyfW.mjs} +110 -6
- package/dist/{changelog-_gBjowzN.mjs → changelog-C9JXdwaj.mjs} +3 -3
- package/dist/{changelog-github-B_e9JWku.mjs → changelog-github-CZcW184H.mjs} +2 -2
- package/dist/{check-B3M2S2wx.mjs → check-Dqm9ZU8T.mjs} +9 -6
- package/dist/{ci-h8s-soA6.mjs → ci-E1QXDnB_.mjs} +102 -16
- package/dist/{ci-setup-DWxrdSK6.mjs → ci-setup-Bbf96usW.mjs} +4 -4
- package/dist/{clack-CJT1JFFa.mjs → clack-CehaQZU6.mjs} +1 -1
- package/dist/cli.mjs +20 -16
- package/dist/{config-D13G4-R8.mjs → config-BcmlSJJd.mjs} +2 -2
- package/dist/{fs-DnDogVn-.mjs → fs-CBXKZhoU.mjs} +1 -1
- package/dist/{generate-CxKXOBNP.mjs → generate-0a_KR7tn.mjs} +7 -8
- package/dist/{git-ukq7VTuZ.mjs → git-DE46Je5V.mjs} +1 -1
- package/dist/index.mjs +6 -8
- package/dist/{init-CUIw0jg8.mjs → init-CY7OVZCX.mjs} +5 -5
- package/dist/{logger-C2dEe5Su.mjs → logger-BgksGFuf.mjs} +3 -1
- package/dist/{package-manager-CClZtIHP.mjs → package-manager-BQPwXwu5.mjs} +1 -1
- package/dist/{publish-CXJ0Ggkq.mjs → publish-D5OcYhC_.mjs} +74 -12
- package/dist/{publish-pipeline-C1slMaJV.mjs → publish-pipeline-ChiL1eRQ.mjs} +6 -6
- package/dist/{semver-DfQyVLM_.mjs → release-plan-M9TGZn2W.mjs} +249 -2
- package/dist/{shell-u3bYGxNy.mjs → shell-C8KgKnMQ.mjs} +1 -1
- package/dist/{status-lS56U6F_.mjs → status-CapkBv6n.mjs} +8 -9
- package/dist/{version-BjjnO2ii.mjs → version-Cz-p96lm.mjs} +8 -9
- package/package.json +1 -1
- package/dist/release-plan-C1Lz9rl_.mjs +0 -249
- package/dist/workspace-Yt7qwsML.mjs +0 -109
- /package/dist/{commit-message-3e4KhzFV.mjs → commit-message-BA1w19wq.mjs} +0 -0
- /package/dist/{names-CBy7d8K_.mjs → names-C-TuOPbd.mjs} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { n as log,
|
|
2
|
-
import { n as exists, t as ensureDir } from "./fs-
|
|
3
|
-
import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir, s as matchGlob } from "./config-
|
|
4
|
-
import {
|
|
1
|
+
import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGFuf.mjs";
|
|
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
5
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { r as
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { findChangedPackages, t as require_picomatch } from "./check-B3M2S2wx.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";
|
|
11
10
|
import { relative, resolve } from "node:path";
|
|
12
11
|
import * as readline from "node:readline";
|
|
13
12
|
//#region src/prompts/bump-select.ts
|
|
@@ -186,7 +185,7 @@ async function addCommand(rootDir, opts) {
|
|
|
186
185
|
if (opts.empty) {
|
|
187
186
|
const filename = opts.name ? slugify(opts.name) : randomName();
|
|
188
187
|
const filePath = resolve(bumpyDir, `${filename}.md`);
|
|
189
|
-
const { writeText } = await import("./fs-
|
|
188
|
+
const { writeText } = await import("./fs-CBXKZhoU.mjs").then((n) => n.r);
|
|
190
189
|
await writeText(filePath, "---\n---\n");
|
|
191
190
|
log.success(`🐸 Created empty bump file: .bumpy/${filename}.md`);
|
|
192
191
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as log } from "./logger-
|
|
2
|
-
import { f as writeText, n as exists, t as ensureDir } from "./fs-
|
|
1
|
+
import { n as log } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { f as writeText, n as exists, t as ensureDir } from "./fs-CBXKZhoU.mjs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
import { r as getBumpyDir } from "./config-
|
|
3
|
-
import { a as prependToChangelog, i as loadFormatter, n as generateChangelogEntry } from "./changelog-
|
|
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";
|
|
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,9 +1,113 @@
|
|
|
1
|
-
import { f as writeText, i as listFiles, s as readText } from "./fs-
|
|
2
|
-
import { r as getBumpyDir } from "./config-
|
|
3
|
-
import { i as jsYaml } from "./package-manager-
|
|
4
|
-
import { s as tryRunArgs } from "./shell-
|
|
5
|
-
import { resolve } from "node:path";
|
|
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";
|
|
3
|
+
import { i as jsYaml, n as detectWorkspaces } from "./package-manager-BQPwXwu5.mjs";
|
|
4
|
+
import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
|
|
5
|
+
import { relative, resolve } from "node:path";
|
|
6
|
+
import { readdir, stat } from "node:fs/promises";
|
|
6
7
|
import { existsSync } from "node:fs";
|
|
8
|
+
//#region src/core/workspace.ts
|
|
9
|
+
/** Discover all workspace packages and catalogs in a monorepo or single-package repo */
|
|
10
|
+
async function discoverWorkspace(rootDir, config) {
|
|
11
|
+
const { globs, catalogs } = await detectWorkspaces(rootDir);
|
|
12
|
+
const packages = /* @__PURE__ */ new Map();
|
|
13
|
+
if (globs.length === 0) {
|
|
14
|
+
const pkg = await loadWorkspacePackage(rootDir, rootDir, config);
|
|
15
|
+
if (pkg && isPackageManaged(pkg.name, pkg.private, config, pkg.bumpy)) packages.set(pkg.name, pkg);
|
|
16
|
+
} else for (const glob of globs) {
|
|
17
|
+
const dirs = await resolveGlob(rootDir, glob);
|
|
18
|
+
for (const dir of dirs) {
|
|
19
|
+
const pkg = await loadWorkspacePackage(dir, rootDir, config);
|
|
20
|
+
if (pkg) {
|
|
21
|
+
if (!isPackageManaged(pkg.name, pkg.private, config, pkg.bumpy)) continue;
|
|
22
|
+
packages.set(pkg.name, pkg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
packages,
|
|
28
|
+
catalogs
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Convenience wrapper that returns just packages (backwards compat) */
|
|
32
|
+
async function discoverPackages(rootDir, config) {
|
|
33
|
+
const { packages } = await discoverWorkspace(rootDir, config);
|
|
34
|
+
return packages;
|
|
35
|
+
}
|
|
36
|
+
/** Resolve a workspace glob pattern to directories containing package.json */
|
|
37
|
+
async function resolveGlob(rootDir, pattern) {
|
|
38
|
+
return expandGlob(rootDir, pattern.split("/"));
|
|
39
|
+
}
|
|
40
|
+
async function expandGlob(baseDir, parts) {
|
|
41
|
+
if (parts.length === 0) {
|
|
42
|
+
if (await exists(resolve(baseDir, "package.json"))) return [baseDir];
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
const [current, ...rest] = parts;
|
|
46
|
+
if (current === "*") {
|
|
47
|
+
const entries = await safeReaddir(baseDir);
|
|
48
|
+
const results = [];
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const entryPath = resolve(baseDir, entry);
|
|
51
|
+
if (await isDirectory(entryPath)) results.push(...await expandGlob(entryPath, rest));
|
|
52
|
+
}
|
|
53
|
+
return results;
|
|
54
|
+
} else if (current === "**") {
|
|
55
|
+
const results = [];
|
|
56
|
+
results.push(...await expandGlob(baseDir, rest));
|
|
57
|
+
const entries = await safeReaddir(baseDir);
|
|
58
|
+
for (const entry of entries) {
|
|
59
|
+
if (entry.startsWith(".") || entry === "node_modules") continue;
|
|
60
|
+
const entryPath = resolve(baseDir, entry);
|
|
61
|
+
if (await isDirectory(entryPath)) results.push(...await expandGlob(entryPath, parts));
|
|
62
|
+
}
|
|
63
|
+
return results;
|
|
64
|
+
} else {
|
|
65
|
+
const next = resolve(baseDir, current);
|
|
66
|
+
if (await isDirectory(next)) return expandGlob(next, rest);
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function safeReaddir(dir) {
|
|
71
|
+
try {
|
|
72
|
+
return await readdir(dir);
|
|
73
|
+
} catch {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function isDirectory(path) {
|
|
78
|
+
try {
|
|
79
|
+
return (await stat(path)).isDirectory();
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async function loadWorkspacePackage(dir, rootDir, config) {
|
|
85
|
+
const pkgPath = resolve(dir, "package.json");
|
|
86
|
+
if (!await exists(pkgPath)) return null;
|
|
87
|
+
let pkg;
|
|
88
|
+
try {
|
|
89
|
+
pkg = await readJson(pkgPath);
|
|
90
|
+
} catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const name = pkg.name;
|
|
94
|
+
if (!name) return null;
|
|
95
|
+
const bumpy = await loadPackageConfig(dir, config, name);
|
|
96
|
+
return {
|
|
97
|
+
name,
|
|
98
|
+
version: pkg.version || "0.0.0",
|
|
99
|
+
dir: resolve(dir),
|
|
100
|
+
relativeDir: relative(rootDir, dir) || ".",
|
|
101
|
+
packageJson: pkg,
|
|
102
|
+
private: !!pkg.private,
|
|
103
|
+
dependencies: pkg.dependencies || {},
|
|
104
|
+
devDependencies: pkg.devDependencies || {},
|
|
105
|
+
peerDependencies: pkg.peerDependencies || {},
|
|
106
|
+
optionalDependencies: pkg.optionalDependencies || {},
|
|
107
|
+
bumpy
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
7
111
|
//#region src/core/bump-file.ts
|
|
8
112
|
const VALID_BUMP_TYPES = new Set([
|
|
9
113
|
"major",
|
|
@@ -205,4 +309,4 @@ function filterBranchBumpFiles(allBumpFiles, changedFiles, rootDir, parseErrors
|
|
|
205
309
|
};
|
|
206
310
|
}
|
|
207
311
|
//#endregion
|
|
208
|
-
export { writeBumpFile as i, parseBumpFile as n, readBumpFiles as r, filterBranchBumpFiles as t };
|
|
312
|
+
export { discoverPackages as a, writeBumpFile as i, parseBumpFile as n, discoverWorkspace as o, readBumpFiles as r, filterBranchBumpFiles as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as log } from "./logger-
|
|
1
|
+
import { n as log } from "./logger-BgksGFuf.mjs";
|
|
2
2
|
import { c as maxBump, t as BUMP_LEVELS } from "./types-BX4pfmKh.mjs";
|
|
3
3
|
import { relative, resolve } from "node:path";
|
|
4
4
|
import { realpathSync } from "node:fs";
|
|
@@ -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-
|
|
48
|
+
const { createGithubFormatter } = await import("./changelog-github-CZcW184H.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-
|
|
59
|
+
const { createGithubFormatter } = await import("./changelog-github-CZcW184H.mjs");
|
|
60
60
|
return createGithubFormatter(options);
|
|
61
61
|
}
|
|
62
62
|
if (typeof name === "string" && BUILTIN_FORMATTERS[name]) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as maxBump } from "./types-BX4pfmKh.mjs";
|
|
2
|
-
import { s as tryRunArgs } from "./shell-
|
|
3
|
-
import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-
|
|
2
|
+
import { s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
|
|
3
|
+
import { o as sortBumpFilesByType, r as getBumpTypeForPackage } from "./changelog-C9JXdwaj.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,8 +1,7 @@
|
|
|
1
|
-
import { i as __commonJSMin, n as log,
|
|
2
|
-
import { a as loadConfig, o as loadPackageConfig, r as getBumpyDir } from "./config-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as getFileStatuses, r as getChangedFiles } from "./git-ukq7VTuZ.mjs";
|
|
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";
|
|
6
5
|
import { relative } from "node:path";
|
|
7
6
|
//#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
8
7
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -1873,6 +1872,10 @@ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1873
1872
|
}));
|
|
1874
1873
|
//#endregion
|
|
1875
1874
|
//#region src/commands/check.ts
|
|
1875
|
+
var check_exports = /* @__PURE__ */ __exportAll({
|
|
1876
|
+
checkCommand: () => checkCommand,
|
|
1877
|
+
findChangedPackages: () => findChangedPackages
|
|
1878
|
+
});
|
|
1876
1879
|
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
1877
1880
|
/**
|
|
1878
1881
|
* Local check: detect which packages have changed on this branch
|
|
@@ -1996,4 +1999,4 @@ async function findChangedPackages(changedFiles, packages, rootDir, config) {
|
|
|
1996
1999
|
return [...changed];
|
|
1997
2000
|
}
|
|
1998
2001
|
//#endregion
|
|
1999
|
-
export {
|
|
2002
|
+
export { findChangedPackages as n, require_picomatch as r, check_exports as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { n as log, t as colorize } from "./logger-
|
|
2
|
-
import { a as loadConfig } from "./config-
|
|
3
|
-
import { t as detectPackageManager } from "./package-manager-
|
|
4
|
-
import {
|
|
1
|
+
import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { a as loadConfig } from "./config-BcmlSJJd.mjs";
|
|
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
5
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
6
|
-
import { n as runArgs, r as runArgsAsync, s as tryRunArgs } from "./shell-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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";
|
|
12
|
+
import { appendFileSync, mkdirSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
14
14
|
//#region src/commands/ci.ts
|
|
15
15
|
/**
|
|
@@ -124,6 +124,92 @@ async function ciCheckCommand(rootDir, opts) {
|
|
|
124
124
|
if (willFail) process.exit(1);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
+
/** Path (relative to rootDir) where ci plan caches its output for ci release to reuse */
|
|
128
|
+
const CI_PLAN_CACHE_PATH = "node_modules/.cache/bumpy/ci-plan.json";
|
|
129
|
+
/**
|
|
130
|
+
* CI plan: report what `ci release` would do, without acting.
|
|
131
|
+
* Outputs JSON to stdout and sets GitHub Actions outputs when detected.
|
|
132
|
+
*/
|
|
133
|
+
async function ciPlanCommand(rootDir) {
|
|
134
|
+
const config = await loadConfig(rootDir);
|
|
135
|
+
const { packages } = await discoverWorkspace(rootDir, config);
|
|
136
|
+
const depGraph = new DependencyGraph(packages);
|
|
137
|
+
const { bumpFiles, errors: parseErrors } = await readBumpFiles(rootDir);
|
|
138
|
+
if (parseErrors.length > 0) {
|
|
139
|
+
for (const err of parseErrors) log.error(err);
|
|
140
|
+
throw new Error("Bump file parse errors must be fixed before planning.");
|
|
141
|
+
}
|
|
142
|
+
let output;
|
|
143
|
+
if (bumpFiles.length > 0) {
|
|
144
|
+
const plan = assembleReleasePlan(bumpFiles, packages, depGraph, config);
|
|
145
|
+
output = {
|
|
146
|
+
mode: "version-pr",
|
|
147
|
+
bumpFiles: plan.bumpFiles.map((bf) => ({
|
|
148
|
+
id: bf.id,
|
|
149
|
+
summary: bf.summary,
|
|
150
|
+
releases: bf.releases.map((r) => ({
|
|
151
|
+
name: r.name,
|
|
152
|
+
type: r.type
|
|
153
|
+
}))
|
|
154
|
+
})),
|
|
155
|
+
releases: plan.releases.map((r) => formatPlanRelease(r, packages, config)),
|
|
156
|
+
packageNames: plan.releases.map((r) => r.name)
|
|
157
|
+
};
|
|
158
|
+
} else {
|
|
159
|
+
const { findUnpublishedPackages } = await import("./publish-D5OcYhC_.mjs");
|
|
160
|
+
const unpublished = await findUnpublishedPackages(packages, config);
|
|
161
|
+
if (unpublished.length > 0) output = {
|
|
162
|
+
mode: "publish",
|
|
163
|
+
bumpFiles: [],
|
|
164
|
+
releases: unpublished.map((r) => formatPlanRelease(r, packages, config)),
|
|
165
|
+
packageNames: unpublished.map((r) => r.name)
|
|
166
|
+
};
|
|
167
|
+
else output = {
|
|
168
|
+
mode: "nothing",
|
|
169
|
+
bumpFiles: [],
|
|
170
|
+
releases: [],
|
|
171
|
+
packageNames: []
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const json = JSON.stringify(output, null, 2);
|
|
175
|
+
console.log(json);
|
|
176
|
+
const cachePath = `${rootDir}/${CI_PLAN_CACHE_PATH}`;
|
|
177
|
+
mkdirSync(cachePath.slice(0, cachePath.lastIndexOf("/")), { recursive: true });
|
|
178
|
+
writeFileSync(cachePath, json, "utf-8");
|
|
179
|
+
writeGitHubOutput("mode", output.mode);
|
|
180
|
+
writeGitHubOutput("packages", output.packageNames.join(","));
|
|
181
|
+
writeGitHubOutput("json", JSON.stringify(output));
|
|
182
|
+
}
|
|
183
|
+
function formatPlanRelease(r, packages, config) {
|
|
184
|
+
const pkg = packages.get(r.name);
|
|
185
|
+
return {
|
|
186
|
+
name: r.name,
|
|
187
|
+
type: r.type,
|
|
188
|
+
oldVersion: r.oldVersion,
|
|
189
|
+
newVersion: r.newVersion,
|
|
190
|
+
dir: pkg?.relativeDir,
|
|
191
|
+
bumpFiles: r.bumpFiles,
|
|
192
|
+
isDependencyBump: r.isDependencyBump,
|
|
193
|
+
isCascadeBump: r.isCascadeBump,
|
|
194
|
+
publishTargets: getPublishTargets(pkg, config)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function getPublishTargets(pkg, _config) {
|
|
198
|
+
if (!pkg) return [];
|
|
199
|
+
const pkgConfig = pkg.bumpy || {};
|
|
200
|
+
if (pkg.private && !pkgConfig.publishCommand) return [];
|
|
201
|
+
const targets = [];
|
|
202
|
+
if (pkgConfig.publishCommand) targets.push({ type: "custom" });
|
|
203
|
+
if (!pkgConfig.publishCommand && !pkgConfig.skipNpmPublish) targets.push({ type: "npm" });
|
|
204
|
+
return targets;
|
|
205
|
+
}
|
|
206
|
+
/** Write a key=value pair to $GITHUB_OUTPUT if available */
|
|
207
|
+
function writeGitHubOutput(key, value) {
|
|
208
|
+
const outputFile = process.env.GITHUB_OUTPUT;
|
|
209
|
+
if (!outputFile) return;
|
|
210
|
+
const delimiter = `ghadelimiter_${Date.now()}`;
|
|
211
|
+
appendFileSync(outputFile, `${key}<<${delimiter}\n${value}\n${delimiter}\n`);
|
|
212
|
+
}
|
|
127
213
|
/**
|
|
128
214
|
* CI release: either auto-publish or create a version PR.
|
|
129
215
|
* Designed for merge-to-main workflows.
|
|
@@ -140,7 +226,7 @@ async function ciReleaseCommand(rootDir, opts) {
|
|
|
140
226
|
}
|
|
141
227
|
if (bumpFiles.length === 0) {
|
|
142
228
|
log.info("No pending bump files — checking for unpublished packages...");
|
|
143
|
-
const { publishCommand } = await import("./publish-
|
|
229
|
+
const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
|
|
144
230
|
await publishCommand(rootDir, { tag: opts.tag });
|
|
145
231
|
return;
|
|
146
232
|
}
|
|
@@ -154,7 +240,7 @@ async function ciReleaseCommand(rootDir, opts) {
|
|
|
154
240
|
}
|
|
155
241
|
async function autoPublish(rootDir, config, plan, tag) {
|
|
156
242
|
log.step("Running bumpy version...");
|
|
157
|
-
const { versionCommand } = await import("./version-
|
|
243
|
+
const { versionCommand } = await import("./version-Cz-p96lm.mjs");
|
|
158
244
|
await versionCommand(rootDir);
|
|
159
245
|
log.step("Committing version changes...");
|
|
160
246
|
runArgs([
|
|
@@ -183,7 +269,7 @@ async function autoPublish(rootDir, config, plan, tag) {
|
|
|
183
269
|
], { cwd: rootDir });
|
|
184
270
|
}
|
|
185
271
|
log.step("Running bumpy publish...");
|
|
186
|
-
const { publishCommand } = await import("./publish-
|
|
272
|
+
const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
|
|
187
273
|
await publishCommand(rootDir, { tag });
|
|
188
274
|
}
|
|
189
275
|
/**
|
|
@@ -349,7 +435,7 @@ async function createVersionPr(rootDir, plan, config, packageDirs, branchName) {
|
|
|
349
435
|
branch
|
|
350
436
|
], { cwd: rootDir });
|
|
351
437
|
log.step("Running bumpy version...");
|
|
352
|
-
const { versionCommand } = await import("./version-
|
|
438
|
+
const { versionCommand } = await import("./version-Cz-p96lm.mjs");
|
|
353
439
|
await versionCommand(rootDir);
|
|
354
440
|
runArgs([
|
|
355
441
|
"git",
|
|
@@ -736,4 +822,4 @@ function detectPrNumber() {
|
|
|
736
822
|
return envPr;
|
|
737
823
|
}
|
|
738
824
|
//#endregion
|
|
739
|
-
export { ciCheckCommand, ciReleaseCommand };
|
|
825
|
+
export { CI_PLAN_CACHE_PATH, ciCheckCommand, ciPlanCommand, ciReleaseCommand };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as log,
|
|
2
|
-
import { t as detectPackageManager } from "./package-manager-
|
|
3
|
-
import { s as tryRunArgs } from "./shell-
|
|
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-
|
|
1
|
+
import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { t as detectPackageManager } from "./package-manager-BQPwXwu5.mjs";
|
|
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";
|
|
5
5
|
//#region src/commands/ci-setup.ts
|
|
6
6
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
7
7
|
const PAT_PERMISSIONS = [
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as log, t as colorize } from "./logger-
|
|
3
|
-
import { n as findRoot } from "./config-
|
|
2
|
+
import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
|
|
3
|
+
import { n as findRoot } from "./config-BcmlSJJd.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-
|
|
28
|
+
const { initCommand } = await import("./init-CY7OVZCX.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-
|
|
34
|
+
const { addCommand } = await import("./add-Dr1vFn9b.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-
|
|
46
|
+
const { statusCommand } = await import("./status-CapkBv6n.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-
|
|
58
|
+
const { versionCommand } = await import("./version-Cz-p96lm.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-
|
|
64
|
+
const { generateCommand } = await import("./generate-0a_KR7tn.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-
|
|
74
|
+
const { checkCommand } = await import("./check-Dqm9ZU8T.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,31 +89,34 @@ 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-E1QXDnB_.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
|
+
} else if (subcommand === "plan") {
|
|
99
|
+
const { ciPlanCommand } = await import("./ci-E1QXDnB_.mjs");
|
|
100
|
+
await ciPlanCommand(rootDir);
|
|
98
101
|
} else if (subcommand === "release") {
|
|
99
|
-
const { ciReleaseCommand } = await import("./ci-
|
|
102
|
+
const { ciReleaseCommand } = await import("./ci-E1QXDnB_.mjs");
|
|
100
103
|
await ciReleaseCommand(rootDir, {
|
|
101
104
|
mode: ciFlags["auto-publish"] === true ? "auto-publish" : "version-pr",
|
|
102
105
|
tag: ciFlags.tag,
|
|
103
106
|
branch: ciFlags.branch
|
|
104
107
|
});
|
|
105
108
|
} else if (subcommand === "setup") {
|
|
106
|
-
const { ciSetupCommand } = await import("./ci-setup-
|
|
109
|
+
const { ciSetupCommand } = await import("./ci-setup-Bbf96usW.mjs");
|
|
107
110
|
await ciSetupCommand(rootDir);
|
|
108
111
|
} else {
|
|
109
|
-
log.error(`Unknown ci subcommand: ${subcommand}. Use "ci check", "ci release", or "ci setup".`);
|
|
112
|
+
log.error(`Unknown ci subcommand: ${subcommand}. Use "ci check", "ci plan", "ci release", or "ci setup".`);
|
|
110
113
|
process.exit(1);
|
|
111
114
|
}
|
|
112
115
|
break;
|
|
113
116
|
}
|
|
114
117
|
case "publish": {
|
|
115
118
|
const rootDir = await findRoot();
|
|
116
|
-
const { publishCommand } = await import("./publish-
|
|
119
|
+
const { publishCommand } = await import("./publish-D5OcYhC_.mjs");
|
|
117
120
|
await publishCommand(rootDir, {
|
|
118
121
|
dryRun: flags["dry-run"] === true,
|
|
119
122
|
tag: flags.tag,
|
|
@@ -127,7 +130,7 @@ async function main() {
|
|
|
127
130
|
const subcommand = args[1];
|
|
128
131
|
const aiFlags = parseFlags(args.slice(2));
|
|
129
132
|
if (subcommand === "setup") {
|
|
130
|
-
const { aiSetupCommand } = await import("./ai-
|
|
133
|
+
const { aiSetupCommand } = await import("./ai-BHoKuvHn.mjs");
|
|
131
134
|
await aiSetupCommand(rootDir, { target: aiFlags.target });
|
|
132
135
|
} else {
|
|
133
136
|
log.error(`Unknown ai subcommand: ${subcommand}. Use "ai setup".`);
|
|
@@ -137,7 +140,7 @@ async function main() {
|
|
|
137
140
|
}
|
|
138
141
|
case "--version":
|
|
139
142
|
case "-v":
|
|
140
|
-
console.log(`bumpy 1.
|
|
143
|
+
console.log(`bumpy 1.7.0`);
|
|
141
144
|
break;
|
|
142
145
|
case "help":
|
|
143
146
|
case "--help":
|
|
@@ -157,7 +160,7 @@ async function main() {
|
|
|
157
160
|
}
|
|
158
161
|
function printHelp() {
|
|
159
162
|
console.log(`
|
|
160
|
-
${colorize(`🐸 bumpy v1.
|
|
163
|
+
${colorize(`🐸 bumpy v1.7.0`, "bold")} - Modern monorepo versioning
|
|
161
164
|
|
|
162
165
|
Usage: bumpy <command> [options]
|
|
163
166
|
|
|
@@ -175,6 +178,7 @@ function printHelp() {
|
|
|
175
178
|
version [--commit] Apply bump files and bump versions
|
|
176
179
|
publish Publish versioned packages
|
|
177
180
|
ci check PR check — report pending releases, comment on PR
|
|
181
|
+
ci plan Report what ci release would do (JSON + GitHub Actions outputs)
|
|
178
182
|
ci release Release — create version PR or auto-publish
|
|
179
183
|
ci setup Set up a token for triggering CI on version PRs
|
|
180
184
|
ai setup Install AI skill for creating bump files
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as __exportAll } from "./logger-
|
|
2
|
-
import { a as readJson, n as exists, o as readJsonc } from "./fs-
|
|
1
|
+
import { a as __exportAll } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { a as readJson, n as exists, o as readJsonc } from "./fs-CBXKZhoU.mjs";
|
|
3
3
|
import { r as DEFAULT_CONFIG } from "./types-BX4pfmKh.mjs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
//#region src/core/config.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __exportAll } from "./logger-
|
|
1
|
+
import { a as __exportAll } from "./logger-BgksGFuf.mjs";
|
|
2
2
|
import { access, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
3
3
|
//#region src/utils/jsonc.ts
|
|
4
4
|
const stringOrCommentRe = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { n as log, t as colorize } from "./logger-
|
|
2
|
-
import { t as ensureDir } from "./fs-
|
|
3
|
-
import { a as loadConfig, r as getBumpyDir } from "./config-
|
|
4
|
-
import {
|
|
5
|
-
import { s as tryRunArgs } from "./shell-
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as slugify, t as randomName } from "./names-CBy7d8K_.mjs";
|
|
1
|
+
import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
|
|
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";
|
|
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";
|
|
9
8
|
import { relative } from "node:path";
|
|
10
9
|
//#region src/commands/generate.ts
|
|
11
10
|
const BUMP_MAP = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
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-
|
|
3
|
-
import {
|
|
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
4
|
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { t as applyReleasePlan } from "./apply-release-plan-DNpoi7cS.mjs";
|
|
10
|
-
import { t as publishPackages } from "./publish-pipeline-C1slMaJV.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";
|
|
11
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,8 +1,8 @@
|
|
|
1
|
-
import { n as log,
|
|
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-
|
|
3
|
-
import { t as detectPackageManager } from "./package-manager-
|
|
4
|
-
import { t as run } from "./shell-
|
|
5
|
-
import { c as ot, o as gt, s as mt, t as unwrap } from "./clack-
|
|
1
|
+
import { n as log, r as require_picocolors, s as __toESM } from "./logger-BgksGFuf.mjs";
|
|
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
|
+
import { t as detectPackageManager } from "./package-manager-BQPwXwu5.mjs";
|
|
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";
|
|
6
6
|
import { resolve } from "node:path";
|
|
7
7
|
import { readdir, rename, rm } from "node:fs/promises";
|
|
8
8
|
//#region ../../.bumpy/README.md
|