@varlock/bumpy 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-BjyVIUlr.mjs +175 -0
- package/dist/{ai-B8ZL2x8z.mjs → ai-CQhUyHAG.mjs} +2 -2
- package/dist/{apply-release-plan-DtU3rVyL.mjs → apply-release-plan-D6TSrcwX.mjs} +11 -6
- package/dist/changelog-github-Du62krXi.mjs +193 -0
- package/dist/{changeset-ClCYsChu.mjs → changeset-UCZdSRDv.mjs} +36 -3
- package/dist/{check-CkRubvuk.mjs → check-jIwike9F.mjs} +5 -11
- package/dist/ci-D6LQbR38.mjs +585 -0
- package/dist/ci-setup-C6FlOfW5.mjs +211 -0
- package/dist/clack-CDRCHrC-.mjs +1216 -0
- package/dist/cli.mjs +20 -16
- package/dist/{config-CJ2orhTL.mjs → config-BkwIEaQg.mjs} +2 -2
- package/dist/{fs-DbNNEyzq.mjs → fs-0AtnPUUe.mjs} +1 -1
- package/dist/{generate-oOFD9ABC.mjs → generate-Btrsn1qi.mjs} +28 -9
- package/dist/git-CGHVXXKw.mjs +78 -0
- package/dist/index.d.mts +10 -2
- package/dist/index.mjs +8 -8
- package/dist/{init-Blw2GfC_.mjs → init-B0q3wEQW.mjs} +2 -2
- package/dist/logger-C2dEe5Su.mjs +135 -0
- package/dist/{migrate-DvOrXSw0.mjs → migrate-CfQNwD0T.mjs} +18 -11
- package/dist/{names-C-u50ofE.mjs → names-Ck8cun7B.mjs} +2 -1
- package/dist/package-manager-DcI5TdDE.mjs +80 -0
- package/dist/{publish-DZ3m7qkX.mjs → publish-D_7RqEYL.mjs} +74 -20
- package/dist/{publish-pipeline-1M5GmbdP.mjs → publish-pipeline-ChnqW8nR.mjs} +40 -54
- package/dist/{release-plan-CFnutSHD.mjs → release-plan-BEzwApuK.mjs} +2 -2
- package/dist/{semver-DWO6NFKN.mjs → semver-BTzYh8vc.mjs} +1 -1
- package/dist/shell-Dj7JRD_q.mjs +92 -0
- package/dist/{status-DRpq_Mha.mjs → status--Q8yAxQ4.mjs} +7 -7
- package/dist/{version-CJwf8XIA.mjs → version-cAUkfYPx.mjs} +60 -21
- package/dist/workspace-CxEKakDm.mjs +107 -0
- package/package.json +4 -2
- package/dist/add-u5V9V3L7.mjs +0 -131
- package/dist/changelog-github-n-3zV1p9.mjs +0 -59
- package/dist/ci-8KWWhjXl.mjs +0 -224
- package/dist/logger-ZqggsyGZ.mjs +0 -176
- package/dist/prompt-BP8toAOI.mjs +0 -46
- package/dist/shell-DPlltpzb.mjs +0 -44
- package/dist/workspace-mVjawG8g.mjs +0 -183
- /package/dist/{dep-graph-DiLeAhl9.mjs → dep-graph-E-9-eQ2J.mjs} +0 -0
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-C2dEe5Su.mjs";
|
|
3
|
+
import { n as findRoot } from "./config-BkwIEaQg.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-B0q3wEQW.mjs");
|
|
29
29
|
await initCommand(rootDir);
|
|
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-BjyVIUlr.mjs");
|
|
35
35
|
await addCommand(rootDir, {
|
|
36
36
|
packages: flags.packages,
|
|
37
37
|
message: flags.message,
|
|
@@ -42,7 +42,7 @@ async function main() {
|
|
|
42
42
|
}
|
|
43
43
|
case "status": {
|
|
44
44
|
const rootDir = await findRoot();
|
|
45
|
-
const { statusCommand } = await import("./status
|
|
45
|
+
const { statusCommand } = await import("./status--Q8yAxQ4.mjs");
|
|
46
46
|
await statusCommand(rootDir, {
|
|
47
47
|
json: flags.json === true,
|
|
48
48
|
packagesOnly: flags.packages === true,
|
|
@@ -54,13 +54,13 @@ async function main() {
|
|
|
54
54
|
}
|
|
55
55
|
case "version": {
|
|
56
56
|
const rootDir = await findRoot();
|
|
57
|
-
const { versionCommand } = await import("./version-
|
|
57
|
+
const { versionCommand } = await import("./version-cAUkfYPx.mjs");
|
|
58
58
|
await versionCommand(rootDir);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
case "generate": {
|
|
62
62
|
const rootDir = await findRoot();
|
|
63
|
-
const { generateCommand } = await import("./generate-
|
|
63
|
+
const { generateCommand } = await import("./generate-Btrsn1qi.mjs");
|
|
64
64
|
await generateCommand(rootDir, {
|
|
65
65
|
from: flags.from,
|
|
66
66
|
dryRun: flags["dry-run"] === true,
|
|
@@ -70,13 +70,13 @@ async function main() {
|
|
|
70
70
|
}
|
|
71
71
|
case "migrate": {
|
|
72
72
|
const rootDir = await findRoot();
|
|
73
|
-
const { migrateCommand } = await import("./migrate-
|
|
73
|
+
const { migrateCommand } = await import("./migrate-CfQNwD0T.mjs");
|
|
74
74
|
await migrateCommand(rootDir, { force: flags.force === true });
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
case "check": {
|
|
78
78
|
const rootDir = await findRoot();
|
|
79
|
-
const { checkCommand } = await import("./check-
|
|
79
|
+
const { checkCommand } = await import("./check-jIwike9F.mjs");
|
|
80
80
|
await checkCommand(rootDir);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
@@ -85,27 +85,30 @@ async function main() {
|
|
|
85
85
|
const subcommand = args[1];
|
|
86
86
|
const ciFlags = parseFlags(args.slice(2));
|
|
87
87
|
if (subcommand === "check") {
|
|
88
|
-
const { ciCheckCommand } = await import("./ci-
|
|
88
|
+
const { ciCheckCommand } = await import("./ci-D6LQbR38.mjs");
|
|
89
89
|
await ciCheckCommand(rootDir, {
|
|
90
90
|
comment: ciFlags.comment !== void 0 ? ciFlags.comment === true : void 0,
|
|
91
91
|
failOnMissing: ciFlags["fail-on-missing"] === true
|
|
92
92
|
});
|
|
93
93
|
} else if (subcommand === "release") {
|
|
94
|
-
const { ciReleaseCommand } = await import("./ci-
|
|
94
|
+
const { ciReleaseCommand } = await import("./ci-D6LQbR38.mjs");
|
|
95
95
|
await ciReleaseCommand(rootDir, {
|
|
96
96
|
mode: ciFlags["auto-publish"] === true ? "auto-publish" : "version-pr",
|
|
97
97
|
tag: ciFlags.tag,
|
|
98
98
|
branch: ciFlags.branch
|
|
99
99
|
});
|
|
100
|
+
} else if (subcommand === "setup") {
|
|
101
|
+
const { ciSetupCommand } = await import("./ci-setup-C6FlOfW5.mjs");
|
|
102
|
+
await ciSetupCommand(rootDir);
|
|
100
103
|
} else {
|
|
101
|
-
log.error(`Unknown ci subcommand: ${subcommand}. Use "ci check" or "ci
|
|
104
|
+
log.error(`Unknown ci subcommand: ${subcommand}. Use "ci check", "ci release", or "ci setup".`);
|
|
102
105
|
process.exit(1);
|
|
103
106
|
}
|
|
104
107
|
break;
|
|
105
108
|
}
|
|
106
109
|
case "publish": {
|
|
107
110
|
const rootDir = await findRoot();
|
|
108
|
-
const { publishCommand } = await import("./publish-
|
|
111
|
+
const { publishCommand } = await import("./publish-D_7RqEYL.mjs");
|
|
109
112
|
await publishCommand(rootDir, {
|
|
110
113
|
dryRun: flags["dry-run"] === true,
|
|
111
114
|
tag: flags.tag,
|
|
@@ -119,7 +122,7 @@ async function main() {
|
|
|
119
122
|
const subcommand = args[1];
|
|
120
123
|
const aiFlags = parseFlags(args.slice(2));
|
|
121
124
|
if (subcommand === "setup") {
|
|
122
|
-
const { aiSetupCommand } = await import("./ai-
|
|
125
|
+
const { aiSetupCommand } = await import("./ai-CQhUyHAG.mjs");
|
|
123
126
|
await aiSetupCommand(rootDir, { target: aiFlags.target });
|
|
124
127
|
} else {
|
|
125
128
|
log.error(`Unknown ai subcommand: ${subcommand}. Use "ai setup".`);
|
|
@@ -129,7 +132,7 @@ async function main() {
|
|
|
129
132
|
}
|
|
130
133
|
case "--version":
|
|
131
134
|
case "-v":
|
|
132
|
-
console.log(`bumpy 0.0.
|
|
135
|
+
console.log(`bumpy 0.0.2`);
|
|
133
136
|
break;
|
|
134
137
|
case "help":
|
|
135
138
|
case "--help":
|
|
@@ -149,7 +152,7 @@ async function main() {
|
|
|
149
152
|
}
|
|
150
153
|
function printHelp() {
|
|
151
154
|
console.log(`
|
|
152
|
-
${colorize(`🐸 bumpy v0.0.
|
|
155
|
+
${colorize(`🐸 bumpy v0.0.2`, "bold")} - Modern monorepo versioning
|
|
153
156
|
|
|
154
157
|
Usage: bumpy <command> [options]
|
|
155
158
|
|
|
@@ -163,6 +166,7 @@ function printHelp() {
|
|
|
163
166
|
publish Publish versioned packages
|
|
164
167
|
ci check PR check — report pending releases, comment on PR
|
|
165
168
|
ci release Release — create version PR or auto-publish
|
|
169
|
+
ci setup Set up a token for triggering CI on version PRs
|
|
166
170
|
migrate Migrate from .changeset/ to .bumpy/
|
|
167
171
|
ai setup Install AI skill for creating changesets
|
|
168
172
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as readJson, n as exists } from "./fs-
|
|
1
|
+
import { a as __exportAll } from "./logger-C2dEe5Su.mjs";
|
|
2
|
+
import { a as readJson, n as exists } from "./fs-0AtnPUUe.mjs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
//#region src/types.ts
|
|
5
5
|
const BUMP_LEVELS = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as __exportAll } from "./logger-C2dEe5Su.mjs";
|
|
2
2
|
import { access, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
3
3
|
//#region src/utils/fs.ts
|
|
4
4
|
var fs_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,10 +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 { t as discoverPackages } from "./workspace-
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import { n as slugify, t as randomName } from "./names-
|
|
1
|
+
import { n as log, t as colorize } from "./logger-C2dEe5Su.mjs";
|
|
2
|
+
import { t as ensureDir } from "./fs-0AtnPUUe.mjs";
|
|
3
|
+
import { a as loadConfig, r as getBumpyDir } from "./config-BkwIEaQg.mjs";
|
|
4
|
+
import { t as discoverPackages } from "./workspace-CxEKakDm.mjs";
|
|
5
|
+
import { o as tryRunArgs } from "./shell-Dj7JRD_q.mjs";
|
|
6
|
+
import { i as writeChangeset } from "./changeset-UCZdSRDv.mjs";
|
|
7
|
+
import { n as slugify, t as randomName } from "./names-Ck8cun7B.mjs";
|
|
8
8
|
//#region src/commands/generate.ts
|
|
9
9
|
const BUMP_MAP = {
|
|
10
10
|
feat: "minor",
|
|
@@ -27,7 +27,12 @@ async function generateCommand(rootDir, opts) {
|
|
|
27
27
|
process.exit(1);
|
|
28
28
|
}
|
|
29
29
|
log.step(`Scanning commits from ${colorize(from, "cyan")}...`);
|
|
30
|
-
const rawLog =
|
|
30
|
+
const rawLog = tryRunArgs([
|
|
31
|
+
"git",
|
|
32
|
+
"log",
|
|
33
|
+
`${from}..HEAD`,
|
|
34
|
+
"--format=%H%n%s%n%b%n---END---"
|
|
35
|
+
], { cwd: rootDir });
|
|
31
36
|
if (!rawLog) {
|
|
32
37
|
log.info("No commits found since " + from);
|
|
33
38
|
return;
|
|
@@ -152,7 +157,21 @@ function bumpPriority(type) {
|
|
|
152
157
|
}
|
|
153
158
|
/** Find the most recent version tag in the repo */
|
|
154
159
|
function findLastVersionTag(rootDir) {
|
|
155
|
-
return
|
|
160
|
+
return tryRunArgs([
|
|
161
|
+
"git",
|
|
162
|
+
"describe",
|
|
163
|
+
"--tags",
|
|
164
|
+
"--abbrev=0",
|
|
165
|
+
"--match",
|
|
166
|
+
"v*"
|
|
167
|
+
], { cwd: rootDir }) || tryRunArgs([
|
|
168
|
+
"git",
|
|
169
|
+
"describe",
|
|
170
|
+
"--tags",
|
|
171
|
+
"--abbrev=0",
|
|
172
|
+
"--match",
|
|
173
|
+
"*@*"
|
|
174
|
+
], { cwd: rootDir }) || null;
|
|
156
175
|
}
|
|
157
176
|
//#endregion
|
|
158
177
|
export { generateCommand };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { o as tryRunArgs, t as runArgs } from "./shell-Dj7JRD_q.mjs";
|
|
2
|
+
//#region src/core/git.ts
|
|
3
|
+
/** Create a git tag */
|
|
4
|
+
function createTag(tag, opts) {
|
|
5
|
+
runArgs([
|
|
6
|
+
"git",
|
|
7
|
+
"tag",
|
|
8
|
+
tag
|
|
9
|
+
], opts);
|
|
10
|
+
}
|
|
11
|
+
/** Push commits and tags to remote */
|
|
12
|
+
function pushWithTags(opts) {
|
|
13
|
+
runArgs(["git", "push"], opts);
|
|
14
|
+
runArgs([
|
|
15
|
+
"git",
|
|
16
|
+
"push",
|
|
17
|
+
"--tags"
|
|
18
|
+
], opts);
|
|
19
|
+
}
|
|
20
|
+
/** Check if there are uncommitted changes */
|
|
21
|
+
function hasUncommittedChanges(opts) {
|
|
22
|
+
const result = tryRunArgs([
|
|
23
|
+
"git",
|
|
24
|
+
"status",
|
|
25
|
+
"--porcelain"
|
|
26
|
+
], opts);
|
|
27
|
+
return result !== null && result.length > 0;
|
|
28
|
+
}
|
|
29
|
+
/** Check if a tag already exists */
|
|
30
|
+
function tagExists(tag, opts) {
|
|
31
|
+
return tryRunArgs([
|
|
32
|
+
"git",
|
|
33
|
+
"tag",
|
|
34
|
+
"-l",
|
|
35
|
+
tag
|
|
36
|
+
], opts) === tag;
|
|
37
|
+
}
|
|
38
|
+
/** Get files changed on this branch compared to a base branch */
|
|
39
|
+
function getChangedFiles(rootDir, baseBranch) {
|
|
40
|
+
if (!tryRunArgs([
|
|
41
|
+
"git",
|
|
42
|
+
"rev-parse",
|
|
43
|
+
"--verify",
|
|
44
|
+
`origin/${baseBranch}`
|
|
45
|
+
], { cwd: rootDir })) tryRunArgs([
|
|
46
|
+
"git",
|
|
47
|
+
"fetch",
|
|
48
|
+
"origin",
|
|
49
|
+
baseBranch,
|
|
50
|
+
"--depth=1"
|
|
51
|
+
], { cwd: rootDir });
|
|
52
|
+
const diff = tryRunArgs([
|
|
53
|
+
"git",
|
|
54
|
+
"diff",
|
|
55
|
+
"--name-only",
|
|
56
|
+
tryRunArgs([
|
|
57
|
+
"git",
|
|
58
|
+
"merge-base",
|
|
59
|
+
"HEAD",
|
|
60
|
+
`origin/${baseBranch}`
|
|
61
|
+
], { cwd: rootDir }) || `origin/${baseBranch}`
|
|
62
|
+
], { cwd: rootDir });
|
|
63
|
+
if (!diff) return [];
|
|
64
|
+
return diff.split("\n").filter(Boolean);
|
|
65
|
+
}
|
|
66
|
+
/** Get all tags matching a pattern */
|
|
67
|
+
function listTags(pattern, opts) {
|
|
68
|
+
const result = tryRunArgs([
|
|
69
|
+
"git",
|
|
70
|
+
"tag",
|
|
71
|
+
"-l",
|
|
72
|
+
pattern
|
|
73
|
+
], opts);
|
|
74
|
+
if (!result) return [];
|
|
75
|
+
return result.split("\n").filter(Boolean);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { pushWithTags as a, listTags as i, getChangedFiles as n, tagExists as o, hasUncommittedChanges as r, createTag as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -176,7 +176,7 @@ declare class DependencyGraph {
|
|
|
176
176
|
}
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/core/changeset.d.ts
|
|
179
|
-
/** Read all changeset files from .bumpy/ directory */
|
|
179
|
+
/** Read all changeset files from .bumpy/ directory, sorted by git creation order */
|
|
180
180
|
declare function readChangesets(rootDir: string): Promise<Changeset[]>;
|
|
181
181
|
/** Parse changeset content (for testing) */
|
|
182
182
|
declare function parseChangeset(content: string, id: string): Changeset | null;
|
|
@@ -219,6 +219,14 @@ declare function generateChangelogEntry(release: PlannedRelease, changesets: Cha
|
|
|
219
219
|
/** Prepend a new entry to an existing CHANGELOG.md content */
|
|
220
220
|
declare function prependToChangelog(existingContent: string, newEntry: string): string;
|
|
221
221
|
//#endregion
|
|
222
|
+
//#region src/core/changelog-github.d.ts
|
|
223
|
+
interface GithubChangelogOptions {
|
|
224
|
+
/** "owner/repo" — auto-detected from gh CLI if not provided */
|
|
225
|
+
repo?: string;
|
|
226
|
+
/** GitHub usernames (without @) to skip "Thanks" messages for (e.g. internal team members) */
|
|
227
|
+
internalAuthors?: string[];
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
222
230
|
//#region src/core/semver.d.ts
|
|
223
231
|
declare function bumpVersion(version: string, type: BumpType): string;
|
|
224
232
|
/** Check if a version satisfies a range */
|
|
@@ -251,4 +259,4 @@ interface PublishResult {
|
|
|
251
259
|
*/
|
|
252
260
|
declare function publishPackages(releasePlan: ReleasePlan, packages: Map<string, WorkspacePackage>, depGraph: DependencyGraph, config: BumpyConfig, rootDir: string, opts?: PublishOptions, catalogs?: CatalogMap, detectedPm?: PackageManager): Promise<PublishResult>;
|
|
253
261
|
//#endregion
|
|
254
|
-
export { BUMP_LEVELS, BumpType, BumpTypeWithIsolated, BumpyConfig, type ChangelogContext, type ChangelogFormatter, Changeset, ChangesetRelease, ChangesetReleaseCascade, ChangesetReleaseSimple, DEFAULT_BUMP_RULES, DEFAULT_CONFIG, DEFAULT_PUBLISH_CONFIG, DEP_TYPES, DepType, DependencyBumpRule, DependencyGraph, DependentInfo, PackageConfig, PackageManager, PlannedRelease, PublishConfig, ReleasePlan, WorkspacePackage, applyReleasePlan, assembleReleasePlan, bumpLevel, bumpVersion, defaultFormatter, discoverPackages, findRoot, generateChangelogEntry, getBumpyDir, hasCascade, loadConfig, loadFormatter, matchGlob, maxBump, parseChangeset, parseIsolatedBump, prependToChangelog, publishPackages, readChangesets, satisfies, stripProtocol, writeChangeset };
|
|
262
|
+
export { BUMP_LEVELS, BumpType, BumpTypeWithIsolated, BumpyConfig, type ChangelogContext, type ChangelogFormatter, Changeset, ChangesetRelease, ChangesetReleaseCascade, ChangesetReleaseSimple, DEFAULT_BUMP_RULES, DEFAULT_CONFIG, DEFAULT_PUBLISH_CONFIG, DEP_TYPES, DepType, DependencyBumpRule, DependencyGraph, DependentInfo, type GithubChangelogOptions, PackageConfig, PackageManager, PlannedRelease, PublishConfig, ReleasePlan, WorkspacePackage, applyReleasePlan, assembleReleasePlan, bumpLevel, bumpVersion, defaultFormatter, discoverPackages, findRoot, generateChangelogEntry, getBumpyDir, hasCascade, loadConfig, loadFormatter, matchGlob, maxBump, parseChangeset, parseIsolatedBump, prependToChangelog, publishPackages, readChangesets, satisfies, stripProtocol, writeChangeset };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as loadConfig, c as BUMP_LEVELS, d as DEFAULT_PUBLISH_CONFIG, f as DEP_TYPES, g as parseIsolatedBump, h as maxBump, l as DEFAULT_BUMP_RULES, m as hasCascade, n as findRoot, p as bumpLevel, r as getBumpyDir, s as matchGlob, u as DEFAULT_CONFIG } from "./config-
|
|
2
|
-
import { t as discoverPackages } from "./workspace-
|
|
3
|
-
import { t as DependencyGraph } from "./dep-graph-
|
|
4
|
-
import { i as writeChangeset, n as parseChangeset, r as readChangesets } from "./changeset-
|
|
5
|
-
import { n as satisfies, r as stripProtocol, t as bumpVersion } from "./semver-
|
|
6
|
-
import { t as assembleReleasePlan } from "./release-plan-
|
|
7
|
-
import { a as prependToChangelog, i as loadFormatter, n as defaultFormatter, r as generateChangelogEntry, t as applyReleasePlan } from "./apply-release-plan-
|
|
8
|
-
import { t as publishPackages } from "./publish-pipeline-
|
|
1
|
+
import { a as loadConfig, c as BUMP_LEVELS, d as DEFAULT_PUBLISH_CONFIG, f as DEP_TYPES, g as parseIsolatedBump, h as maxBump, l as DEFAULT_BUMP_RULES, m as hasCascade, n as findRoot, p as bumpLevel, r as getBumpyDir, s as matchGlob, u as DEFAULT_CONFIG } from "./config-BkwIEaQg.mjs";
|
|
2
|
+
import { t as discoverPackages } from "./workspace-CxEKakDm.mjs";
|
|
3
|
+
import { t as DependencyGraph } from "./dep-graph-E-9-eQ2J.mjs";
|
|
4
|
+
import { i as writeChangeset, n as parseChangeset, r as readChangesets } from "./changeset-UCZdSRDv.mjs";
|
|
5
|
+
import { n as satisfies, r as stripProtocol, t as bumpVersion } from "./semver-BTzYh8vc.mjs";
|
|
6
|
+
import { t as assembleReleasePlan } from "./release-plan-BEzwApuK.mjs";
|
|
7
|
+
import { a as prependToChangelog, i as loadFormatter, n as defaultFormatter, r as generateChangelogEntry, t as applyReleasePlan } from "./apply-release-plan-D6TSrcwX.mjs";
|
|
8
|
+
import { t as publishPackages } from "./publish-pipeline-ChnqW8nR.mjs";
|
|
9
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, parseChangeset, parseIsolatedBump, prependToChangelog, publishPackages, readChangesets, satisfies, stripProtocol, writeChangeset };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as log } from "./logger-
|
|
2
|
-
import { c as writeJson, l as writeText, n as exists, t as ensureDir } from "./fs-
|
|
1
|
+
import { n as log } from "./logger-C2dEe5Su.mjs";
|
|
2
|
+
import { c as writeJson, l as writeText, n as exists, t as ensureDir } from "./fs-0AtnPUUe.mjs";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
//#region src/commands/init.ts
|
|
5
5
|
async function initCommand(rootDir) {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
+
var __exportAll = (all, no_symbols) => {
|
|
10
|
+
let target = {};
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
+
key = keys[i];
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
+
get: ((k) => from[k]).bind(null, key),
|
|
23
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
+
value: mod,
|
|
30
|
+
enumerable: true
|
|
31
|
+
}) : target, mod));
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region ../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
34
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
35
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
36
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
37
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
38
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
39
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
40
|
+
};
|
|
41
|
+
let replaceClose = (string, close, replace, index) => {
|
|
42
|
+
let result = "", cursor = 0;
|
|
43
|
+
do {
|
|
44
|
+
result += string.substring(cursor, index) + replace;
|
|
45
|
+
cursor = index + close.length;
|
|
46
|
+
index = string.indexOf(close, cursor);
|
|
47
|
+
} while (~index);
|
|
48
|
+
return result + string.substring(cursor);
|
|
49
|
+
};
|
|
50
|
+
let createColors = (enabled = isColorSupported) => {
|
|
51
|
+
let f = enabled ? formatter : () => String;
|
|
52
|
+
return {
|
|
53
|
+
isColorSupported: enabled,
|
|
54
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
55
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
56
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
57
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
58
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
59
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
60
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
61
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
62
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
63
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
64
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
65
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
66
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
67
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
68
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
69
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
70
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
71
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
72
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
73
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
74
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
75
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
76
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
77
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
78
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
79
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
80
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
81
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
82
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
83
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
84
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
85
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
86
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
87
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
88
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
89
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
90
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
91
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
92
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
93
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
94
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
module.exports = createColors();
|
|
98
|
+
module.exports.createColors = createColors;
|
|
99
|
+
}));
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/utils/logger.ts
|
|
102
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
103
|
+
const log = {
|
|
104
|
+
info(msg) {
|
|
105
|
+
console.log(`${import_picocolors.default.blue("info")} ${msg}`);
|
|
106
|
+
},
|
|
107
|
+
success(msg) {
|
|
108
|
+
console.log(`${import_picocolors.default.green("done")} ${msg}`);
|
|
109
|
+
},
|
|
110
|
+
warn(msg) {
|
|
111
|
+
console.log(`${import_picocolors.default.yellow("warn")} ${msg}`);
|
|
112
|
+
},
|
|
113
|
+
error(msg) {
|
|
114
|
+
console.error(`${import_picocolors.default.red("error")} ${msg}`);
|
|
115
|
+
},
|
|
116
|
+
step(msg) {
|
|
117
|
+
console.log(`${import_picocolors.default.cyan("=>")} ${msg}`);
|
|
118
|
+
},
|
|
119
|
+
dim(msg) {
|
|
120
|
+
console.log(import_picocolors.default.dim(msg));
|
|
121
|
+
},
|
|
122
|
+
bold(msg) {
|
|
123
|
+
console.log(import_picocolors.default.bold(msg));
|
|
124
|
+
},
|
|
125
|
+
table(rows) {
|
|
126
|
+
if (rows.length === 0) return;
|
|
127
|
+
const colWidths = rows[0].map((_, i) => Math.max(...rows.map((r) => (r[i] ?? "").length)));
|
|
128
|
+
for (const row of rows) console.log(row.map((cell, i) => cell.padEnd(colWidths[i])).join(" "));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function colorize(text, color) {
|
|
132
|
+
return import_picocolors.default[color](text);
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { __exportAll as a, __commonJSMin as i, log as n, __toESM as o, require_picocolors as r, colorize as t };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { n as log } from "./logger-
|
|
2
|
-
import { a as readJson, n as exists, o as readText } from "./fs-
|
|
3
|
-
import { r as getBumpyDir } from "./config-
|
|
4
|
-
import { i as writeChangeset } from "./changeset-
|
|
5
|
-
import { n as
|
|
6
|
-
import { initCommand } from "./init-
|
|
1
|
+
import { n as log, o as __toESM, r as require_picocolors } from "./logger-C2dEe5Su.mjs";
|
|
2
|
+
import { a as readJson, n as exists, o as readText } from "./fs-0AtnPUUe.mjs";
|
|
3
|
+
import { r as getBumpyDir } from "./config-BkwIEaQg.mjs";
|
|
4
|
+
import { i as writeChangeset } from "./changeset-UCZdSRDv.mjs";
|
|
5
|
+
import { a as fe, c as ot, n as O, o as gt, s as mt, t as unwrap } from "./clack-CDRCHrC-.mjs";
|
|
6
|
+
import { initCommand } from "./init-B0q3wEQW.mjs";
|
|
7
7
|
import { resolve } from "node:path";
|
|
8
8
|
import { readdir } from "node:fs/promises";
|
|
9
9
|
//#region src/commands/migrate.ts
|
|
10
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
10
11
|
async function migrateCommand(rootDir, opts) {
|
|
11
12
|
const changesetDir = resolve(rootDir, ".changeset");
|
|
12
13
|
if (!await exists(changesetDir)) {
|
|
@@ -45,12 +46,18 @@ async function migrateCommand(rootDir, opts) {
|
|
|
45
46
|
log.success(`Migrated ${migrated} changeset(s)`);
|
|
46
47
|
} else log.info("No pending changesets to migrate.");
|
|
47
48
|
if (!opts.force) {
|
|
48
|
-
|
|
49
|
-
if (await
|
|
49
|
+
mt(import_picocolors.default.bgCyan(import_picocolors.default.black(" bumpy migrate ")));
|
|
50
|
+
if (unwrap(await ot({
|
|
51
|
+
message: "Remove .changeset/ directory?",
|
|
52
|
+
initialValue: false
|
|
53
|
+
}))) {
|
|
54
|
+
const spin = fe();
|
|
55
|
+
spin.start("Removing .changeset/");
|
|
50
56
|
const { rm } = await import("node:fs/promises");
|
|
51
57
|
await rm(changesetDir, { recursive: true });
|
|
52
|
-
|
|
53
|
-
} else
|
|
58
|
+
spin.stop("Removed .changeset/ directory");
|
|
59
|
+
} else O.info("Keeping .changeset/ — you can remove it manually when ready.");
|
|
60
|
+
gt(import_picocolors.default.green("Cleanup complete"));
|
|
54
61
|
}
|
|
55
62
|
console.log();
|
|
56
63
|
log.success("Migration complete!");
|
|
@@ -75,7 +82,7 @@ async function migrateConfig(changesetConfigPath, bumpyDir) {
|
|
|
75
82
|
"updateInternalDependencies",
|
|
76
83
|
"privatePackages"
|
|
77
84
|
]) if (csConfig[field] !== void 0) bumpyConfig[field] = csConfig[field];
|
|
78
|
-
const { writeJson } = await import("./fs-
|
|
85
|
+
const { writeJson } = await import("./fs-0AtnPUUe.mjs").then((n) => n.r);
|
|
79
86
|
await writeJson(bumpyConfigPath, bumpyConfig);
|
|
80
87
|
log.dim(" Migrated config fields: " + Object.keys(bumpyConfig).filter((k) => k !== "baseBranch" || bumpyConfig[k] !== "main").join(", "));
|
|
81
88
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
//#region src/utils/names.ts
|
|
2
2
|
/** Generate a random adjective-noun name for changeset files */
|
|
3
3
|
function randomName() {
|
|
4
|
-
|
|
4
|
+
const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
|
5
|
+
return `${pick(ADJECTIVES)}-${pick(ADJECTIVES)}-${pick(NOUNS)}`;
|
|
5
6
|
}
|
|
6
7
|
/** Sanitize a user-provided name into a valid filename slug */
|
|
7
8
|
function slugify(name) {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { a as readJson, n as exists, o as readText } from "./fs-0AtnPUUe.mjs";
|
|
2
|
+
import { t as jsYaml } from "./js-yaml-DpZfOoD4.mjs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
//#region src/utils/package-manager.ts
|
|
5
|
+
/** Detect the package manager, extract workspace globs, and load catalogs */
|
|
6
|
+
async function detectWorkspaces(rootDir) {
|
|
7
|
+
const pm = await detectPackageManager(rootDir);
|
|
8
|
+
return {
|
|
9
|
+
packageManager: pm,
|
|
10
|
+
globs: await getWorkspaceGlobs(rootDir, pm),
|
|
11
|
+
catalogs: await loadCatalogs(rootDir, pm)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
async function detectPackageManager(rootDir) {
|
|
15
|
+
if (await exists(resolve(rootDir, "bun.lock")) || await exists(resolve(rootDir, "bun.lockb"))) return "bun";
|
|
16
|
+
if (await exists(resolve(rootDir, "pnpm-lock.yaml"))) return "pnpm";
|
|
17
|
+
if (await exists(resolve(rootDir, "yarn.lock"))) return "yarn";
|
|
18
|
+
try {
|
|
19
|
+
const pkg = await readJson(resolve(rootDir, "package.json"));
|
|
20
|
+
if (typeof pkg.packageManager === "string") {
|
|
21
|
+
const name = pkg.packageManager.split("@")[0];
|
|
22
|
+
if (name === "pnpm" || name === "yarn" || name === "bun") return name;
|
|
23
|
+
}
|
|
24
|
+
} catch {}
|
|
25
|
+
return "npm";
|
|
26
|
+
}
|
|
27
|
+
async function getWorkspaceGlobs(rootDir, pm) {
|
|
28
|
+
if (pm === "pnpm") {
|
|
29
|
+
const wsFile = resolve(rootDir, "pnpm-workspace.yaml");
|
|
30
|
+
if (await exists(wsFile)) {
|
|
31
|
+
const content = await readText(wsFile);
|
|
32
|
+
const parsed = jsYaml.load(content);
|
|
33
|
+
if (parsed?.packages) return parsed.packages;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const workspaces = (await readJson(resolve(rootDir, "package.json"))).workspaces;
|
|
38
|
+
if (Array.isArray(workspaces)) return workspaces;
|
|
39
|
+
if (workspaces && typeof workspaces === "object" && "packages" in workspaces) {
|
|
40
|
+
const pkgs = workspaces.packages;
|
|
41
|
+
if (Array.isArray(pkgs)) return pkgs;
|
|
42
|
+
}
|
|
43
|
+
} catch {}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
/** Load catalog definitions from pnpm-workspace.yaml or root package.json */
|
|
47
|
+
async function loadCatalogs(rootDir, pm) {
|
|
48
|
+
const catalogs = /* @__PURE__ */ new Map();
|
|
49
|
+
if (pm === "pnpm") {
|
|
50
|
+
const wsFile = resolve(rootDir, "pnpm-workspace.yaml");
|
|
51
|
+
if (await exists(wsFile)) {
|
|
52
|
+
const content = await readText(wsFile);
|
|
53
|
+
const parsed = jsYaml.load(content);
|
|
54
|
+
if (parsed?.catalog) catalogs.set("", parsed.catalog);
|
|
55
|
+
if (parsed?.catalogs) for (const [name, deps] of Object.entries(parsed.catalogs)) catalogs.set(name, deps);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const pkg = await readJson(resolve(rootDir, "package.json"));
|
|
60
|
+
if (pkg.catalog && typeof pkg.catalog === "object") catalogs.set("", pkg.catalog);
|
|
61
|
+
if (pkg.catalogs && typeof pkg.catalogs === "object") for (const [name, deps] of Object.entries(pkg.catalogs)) catalogs.set(name, deps);
|
|
62
|
+
const workspaces = pkg.workspaces;
|
|
63
|
+
if (workspaces && typeof workspaces === "object" && !Array.isArray(workspaces)) {
|
|
64
|
+
const ws = workspaces;
|
|
65
|
+
if (ws.catalog && typeof ws.catalog === "object") catalogs.set("", ws.catalog);
|
|
66
|
+
if (ws.catalogs && typeof ws.catalogs === "object") for (const [name, deps] of Object.entries(ws.catalogs)) catalogs.set(name, deps);
|
|
67
|
+
}
|
|
68
|
+
} catch {}
|
|
69
|
+
return catalogs;
|
|
70
|
+
}
|
|
71
|
+
/** Resolve a specific dependency's catalog: reference */
|
|
72
|
+
function resolveCatalogDep(depName, range, catalogs) {
|
|
73
|
+
if (!range.startsWith("catalog:")) return null;
|
|
74
|
+
const catalogName = range.slice(8).trim() || "";
|
|
75
|
+
const catalog = catalogs.get(catalogName);
|
|
76
|
+
if (!catalog) return null;
|
|
77
|
+
return catalog[depName] ?? null;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { detectWorkspaces as n, resolveCatalogDep as r, detectPackageManager as t };
|