@varlock/bumpy 0.0.0 → 0.0.1

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.
@@ -0,0 +1,64 @@
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 };
@@ -0,0 +1,51 @@
1
+ import { i as __exportAll } from "./logger-ZqggsyGZ.mjs";
2
+ import { access, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
3
+ //#region src/utils/fs.ts
4
+ var fs_exports = /* @__PURE__ */ __exportAll({
5
+ ensureDir: () => ensureDir,
6
+ exists: () => exists,
7
+ listFiles: () => listFiles,
8
+ readJson: () => readJson,
9
+ readText: () => readText,
10
+ removeFile: () => removeFile,
11
+ writeJson: () => writeJson,
12
+ writeText: () => writeText
13
+ });
14
+ async function readJson(filePath) {
15
+ const content = await readFile(filePath, "utf-8");
16
+ return JSON.parse(content);
17
+ }
18
+ async function writeJson(filePath, data, indent = 2) {
19
+ await writeFile(filePath, JSON.stringify(data, null, indent) + "\n", "utf-8");
20
+ }
21
+ async function readText(filePath) {
22
+ return readFile(filePath, "utf-8");
23
+ }
24
+ async function writeText(filePath, content) {
25
+ await writeFile(filePath, content, "utf-8");
26
+ }
27
+ async function exists(filePath) {
28
+ try {
29
+ await access(filePath);
30
+ return true;
31
+ } catch {
32
+ return false;
33
+ }
34
+ }
35
+ async function listFiles(dir, ext) {
36
+ try {
37
+ const entries = await readdir(dir);
38
+ if (ext) return entries.filter((e) => e.endsWith(ext));
39
+ return entries;
40
+ } catch {
41
+ return [];
42
+ }
43
+ }
44
+ async function removeFile(filePath) {
45
+ await unlink(filePath);
46
+ }
47
+ async function ensureDir(dir) {
48
+ await mkdir(dir, { recursive: true });
49
+ }
50
+ //#endregion
51
+ export { readJson as a, writeJson as c, listFiles as i, writeText as l, exists as n, readText as o, fs_exports as r, removeFile as s, ensureDir as t };
@@ -0,0 +1,158 @@
1
+ import { n as log, t as colorize } from "./logger-ZqggsyGZ.mjs";
2
+ import { t as ensureDir } from "./fs-DbNNEyzq.mjs";
3
+ import { a as loadConfig, r as getBumpyDir } from "./config-CJ2orhTL.mjs";
4
+ import { t as discoverPackages } from "./workspace-mVjawG8g.mjs";
5
+ import { i as writeChangeset } from "./changeset-ClCYsChu.mjs";
6
+ import { i as tryRun } from "./shell-DPlltpzb.mjs";
7
+ import { n as slugify, t as randomName } from "./names-C-u50ofE.mjs";
8
+ //#region src/commands/generate.ts
9
+ const BUMP_MAP = {
10
+ feat: "minor",
11
+ fix: "patch",
12
+ perf: "patch",
13
+ refactor: "patch",
14
+ docs: "patch",
15
+ style: "patch",
16
+ test: "patch",
17
+ build: "patch",
18
+ ci: "patch",
19
+ chore: "patch"
20
+ };
21
+ async function generateCommand(rootDir, opts) {
22
+ const config = await loadConfig(rootDir);
23
+ const packages = await discoverPackages(rootDir, config);
24
+ const from = opts.from || findLastVersionTag(rootDir);
25
+ if (!from) {
26
+ log.error("Could not detect last version tag. Use --from <ref> to specify.");
27
+ process.exit(1);
28
+ }
29
+ log.step(`Scanning commits from ${colorize(from, "cyan")}...`);
30
+ const rawLog = tryRun(`git log ${from}..HEAD --format="%H%n%s%n%b%n---END---"`, { cwd: rootDir });
31
+ if (!rawLog) {
32
+ log.info("No commits found since " + from);
33
+ return;
34
+ }
35
+ const conventional = parseGitLog(rawLog).map(parseConventionalCommit).filter((c) => c !== null);
36
+ if (conventional.length === 0) {
37
+ log.info("No conventional commits found. Commits must follow the format: type(scope): description");
38
+ return;
39
+ }
40
+ log.dim(` Found ${conventional.length} conventional commit(s)`);
41
+ const scopeMap = buildScopeMap(packages, config);
42
+ const releaseMap = /* @__PURE__ */ new Map();
43
+ for (const commit of conventional) {
44
+ const bump = commit.breaking ? "major" : BUMP_MAP[commit.type] || "patch";
45
+ let pkgNames = [];
46
+ if (commit.scope) {
47
+ const resolved = resolveScope(commit.scope, scopeMap, packages);
48
+ if (resolved.length > 0) pkgNames = resolved;
49
+ else {
50
+ log.dim(` Skipping: unknown scope "${commit.scope}" in: ${commit.description}`);
51
+ continue;
52
+ }
53
+ } else {
54
+ log.dim(` Skipping (no scope): ${commit.type}: ${commit.description}`);
55
+ continue;
56
+ }
57
+ for (const name of pkgNames) {
58
+ const existing = releaseMap.get(name);
59
+ if (existing) {
60
+ if (bumpPriority(bump) > bumpPriority(existing.type)) existing.type = bump;
61
+ existing.messages.push(commit.description);
62
+ } else releaseMap.set(name, {
63
+ type: bump,
64
+ messages: [commit.description]
65
+ });
66
+ }
67
+ }
68
+ if (releaseMap.size === 0) {
69
+ log.info("No package bumps detected from conventional commits.");
70
+ return;
71
+ }
72
+ const releases = [];
73
+ const summaryLines = [];
74
+ for (const [name, info] of releaseMap) {
75
+ releases.push({
76
+ name,
77
+ type: info.type
78
+ });
79
+ for (const msg of info.messages) summaryLines.push(`- ${name}: ${msg}`);
80
+ }
81
+ if (opts.dryRun) {
82
+ log.bold("Would create changeset:");
83
+ for (const r of releases) console.log(` ${r.name}: ${colorize(r.type, r.type === "major" ? "red" : r.type === "minor" ? "yellow" : "green")}`);
84
+ console.log();
85
+ log.dim("Summary:");
86
+ for (const line of summaryLines) log.dim(` ${line}`);
87
+ return;
88
+ }
89
+ await ensureDir(getBumpyDir(rootDir));
90
+ const filename = opts.name ? slugify(opts.name) : randomName();
91
+ await writeChangeset(rootDir, filename, releases, summaryLines.join("\n"));
92
+ log.success(`Created changeset: .bumpy/${filename}.md`);
93
+ for (const r of releases) log.dim(` ${r.name}: ${r.type}`);
94
+ }
95
+ /** Parse raw git log output into individual commits */
96
+ function parseGitLog(raw) {
97
+ const commits = [];
98
+ const entries = raw.split("---END---").filter((e) => e.trim());
99
+ for (const entry of entries) {
100
+ const lines = entry.trim().split("\n");
101
+ if (lines.length < 2) continue;
102
+ commits.push({
103
+ hash: lines[0].trim(),
104
+ subject: lines[1].trim(),
105
+ body: lines.slice(2).join("\n").trim()
106
+ });
107
+ }
108
+ return commits;
109
+ }
110
+ /** Parse a commit subject into conventional commit format */
111
+ function parseConventionalCommit(commit) {
112
+ const match = commit.subject.match(/^(\w+)(!)?(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/);
113
+ if (!match) return null;
114
+ const [, type, bang1, scope, bang2, description] = match;
115
+ const breaking = !!bang1 || !!bang2 || commit.body.includes("BREAKING CHANGE");
116
+ return {
117
+ hash: commit.hash,
118
+ type: type.toLowerCase(),
119
+ scope: scope || null,
120
+ breaking,
121
+ description: description.trim(),
122
+ body: commit.body
123
+ };
124
+ }
125
+ /** Build a map of scope aliases → package names from config and package names */
126
+ function buildScopeMap(packages, _config) {
127
+ const map = /* @__PURE__ */ new Map();
128
+ for (const [name, pkg] of packages) {
129
+ const shortName = name.includes("/") ? name.split("/").pop() : name;
130
+ if (!map.has(shortName)) map.set(shortName, []);
131
+ map.get(shortName).push(name);
132
+ if (!map.has(name)) map.set(name, []);
133
+ map.get(name).push(name);
134
+ const dirName = pkg.relativeDir.split("/").pop();
135
+ if (dirName !== shortName) {
136
+ if (!map.has(dirName)) map.set(dirName, []);
137
+ map.get(dirName).push(name);
138
+ }
139
+ }
140
+ return map;
141
+ }
142
+ /** Resolve a scope string to package name(s) */
143
+ function resolveScope(scope, scopeMap, packages) {
144
+ const mapped = scopeMap.get(scope);
145
+ if (mapped) return [...new Set(mapped)];
146
+ for (const [key, value] of scopeMap) if (key.toLowerCase() === scope.toLowerCase()) return [...new Set(value)];
147
+ if (packages.has(scope)) return [scope];
148
+ return [];
149
+ }
150
+ function bumpPriority(type) {
151
+ return type === "major" ? 2 : type === "minor" ? 1 : 0;
152
+ }
153
+ /** Find the most recent version tag in the repo */
154
+ function findLastVersionTag(rootDir) {
155
+ return tryRun("git describe --tags --abbrev=0 --match \"v*\" 2>/dev/null || git describe --tags --abbrev=0 --match \"*@*\" 2>/dev/null", { cwd: rootDir }) || null;
156
+ }
157
+ //#endregion
158
+ export { generateCommand };
@@ -0,0 +1,254 @@
1
+ //#region src/types.d.ts
2
+ type BumpType = 'major' | 'minor' | 'patch';
3
+ type BumpTypeWithIsolated = BumpType | 'minor-isolated' | 'patch-isolated';
4
+ declare const BUMP_LEVELS: Record<BumpType, number>;
5
+ declare function bumpLevel(type: BumpType): number;
6
+ declare function parseIsolatedBump(type: BumpTypeWithIsolated): {
7
+ bump: BumpType;
8
+ isolated: boolean;
9
+ };
10
+ declare function maxBump(a: BumpType | undefined, b: BumpType): BumpType;
11
+ interface DependencyBumpRule {
12
+ /** What bump level in the dependency triggers propagation */
13
+ trigger: BumpType | 'none';
14
+ /** What bump to apply to the dependent */
15
+ bumpAs: BumpType | 'match';
16
+ }
17
+ declare const DEFAULT_BUMP_RULES: Record<string, DependencyBumpRule>;
18
+ type DepType = 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies';
19
+ declare const DEP_TYPES: DepType[];
20
+ interface PublishConfig {
21
+ /** Package manager to use for packing. "auto" detects from lockfile. Default: "auto" */
22
+ packManager: 'auto' | 'npm' | 'pnpm' | 'bun' | 'yarn';
23
+ /** Command to use for publishing. "npm" uses npm publish (supports OIDC). Default: "npm" */
24
+ publishManager: 'npm' | 'pnpm' | 'bun' | 'yarn';
25
+ /** Extra args appended to the publish command (e.g., "--provenance") */
26
+ publishArgs: string[];
27
+ /**
28
+ * How to handle workspace:/catalog: protocol resolution.
29
+ * "pack" = use PM's pack to build a clean tarball, then publish the tarball (recommended)
30
+ * "in-place" = resolve protocols by rewriting package.json before publish
31
+ * "none" = don't resolve (only if PM's publish handles it natively)
32
+ * Default: "pack"
33
+ */
34
+ protocolResolution: 'pack' | 'in-place' | 'none';
35
+ }
36
+ interface BumpyConfig {
37
+ baseBranch: string;
38
+ access: 'public' | 'restricted';
39
+ commit: boolean;
40
+ changelog: string | [string, Record<string, unknown>];
41
+ fixed: string[][];
42
+ linked: string[][];
43
+ /** Package names/globs to exclude from version management */
44
+ ignore: string[];
45
+ /** Package names/globs to explicitly include (overrides private + ignore) */
46
+ include: string[];
47
+ updateInternalDependencies: 'patch' | 'minor' | 'out-of-range' | 'none';
48
+ dependencyBumpRules: Partial<Record<DepType, DependencyBumpRule>>;
49
+ privatePackages: {
50
+ version: boolean;
51
+ tag: boolean;
52
+ };
53
+ packages: Record<string, PackageConfig>;
54
+ publish: PublishConfig;
55
+ /**
56
+ * GitHub release creation (requires `gh` CLI).
57
+ * false = individual release per package (default)
58
+ * true = single aggregated release for all packages
59
+ * { enabled: true, title: "..." } = aggregate with custom title (supports {{date}})
60
+ */
61
+ aggregateRelease: boolean | {
62
+ enabled: boolean;
63
+ title?: string;
64
+ };
65
+ /** Git identity used for CI commits. Defaults to bumpy-bot. */
66
+ gitUser: {
67
+ name: string;
68
+ email: string;
69
+ };
70
+ /** Version PR settings */
71
+ versionPr: {
72
+ /** PR title. Default: "🐸 Versioned release" */title: string; /** Branch name. Default: "bumpy/version-packages" */
73
+ branch: string; /** Preamble text shown at the top of the PR body */
74
+ preamble: string;
75
+ };
76
+ }
77
+ interface PackageConfig {
78
+ /** Explicitly opt in or out of version management (overrides private/ignore/include) */
79
+ managed?: boolean;
80
+ access?: 'public' | 'restricted';
81
+ publishCommand?: string | string[];
82
+ buildCommand?: string;
83
+ registry?: string;
84
+ skipNpmPublish?: boolean;
85
+ /** Command to check if a version is already published. Should output the published version string. */
86
+ checkPublished?: string;
87
+ dependencyBumpRules?: Partial<Record<DepType, DependencyBumpRule>>;
88
+ specificDependencyRules?: Record<string, DependencyBumpRule>;
89
+ cascadeTo?: Record<string, DependencyBumpRule>;
90
+ }
91
+ declare const DEFAULT_PUBLISH_CONFIG: PublishConfig;
92
+ declare const DEFAULT_CONFIG: BumpyConfig;
93
+ interface ChangesetReleaseSimple {
94
+ name: string;
95
+ type: BumpTypeWithIsolated;
96
+ }
97
+ interface ChangesetReleaseCascade {
98
+ name: string;
99
+ type: BumpTypeWithIsolated;
100
+ cascade: Record<string, BumpType>;
101
+ }
102
+ type ChangesetRelease = ChangesetReleaseSimple | ChangesetReleaseCascade;
103
+ declare function hasCascade(r: ChangesetRelease): r is ChangesetReleaseCascade;
104
+ interface Changeset {
105
+ id: string;
106
+ releases: ChangesetRelease[];
107
+ summary: string;
108
+ }
109
+ interface WorkspacePackage {
110
+ name: string;
111
+ version: string;
112
+ dir: string;
113
+ relativeDir: string;
114
+ packageJson: Record<string, unknown>;
115
+ private: boolean;
116
+ dependencies: Record<string, string>;
117
+ devDependencies: Record<string, string>;
118
+ peerDependencies: Record<string, string>;
119
+ optionalDependencies: Record<string, string>;
120
+ bumpy?: PackageConfig;
121
+ }
122
+ type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
123
+ interface DependentInfo {
124
+ /** The package that depends on the source */
125
+ name: string;
126
+ depType: DepType;
127
+ versionRange: string;
128
+ }
129
+ interface PlannedRelease {
130
+ name: string;
131
+ type: BumpType;
132
+ oldVersion: string;
133
+ newVersion: string;
134
+ changesets: string[];
135
+ isDependencyBump: boolean;
136
+ isCascadeBump: boolean;
137
+ }
138
+ interface ReleasePlan {
139
+ changesets: Changeset[];
140
+ releases: PlannedRelease[];
141
+ }
142
+ //#endregion
143
+ //#region src/core/config.d.ts
144
+ /** Find the monorepo root by walking up from cwd looking for .bumpy/ */
145
+ declare function findRoot(startDir?: string): Promise<string>;
146
+ /** Load the root bumpy config, merging with defaults */
147
+ declare function loadConfig(rootDir: string): Promise<BumpyConfig>;
148
+ /** Simple glob matching for package names (supports * and **) */
149
+ declare function matchGlob(name: string, pattern: string): boolean;
150
+ declare function getBumpyDir(rootDir: string): string;
151
+ //#endregion
152
+ //#region src/utils/package-manager.d.ts
153
+ /** Map of catalog name → { depName → version }. Default catalog uses "" as key. */
154
+ type CatalogMap = Map<string, Record<string, string>>;
155
+ //#endregion
156
+ //#region src/core/workspace.d.ts
157
+ /** Convenience wrapper that returns just packages (backwards compat) */
158
+ declare function discoverPackages(rootDir: string, config: BumpyConfig): Promise<Map<string, WorkspacePackage>>;
159
+ //#endregion
160
+ //#region src/core/dep-graph.d.ts
161
+ declare class DependencyGraph {
162
+ /** Map from package name → packages that depend on it */
163
+ private dependents;
164
+ /** Set of all internal package names */
165
+ private internalPackages;
166
+ constructor(packages: Map<string, WorkspacePackage>);
167
+ private build;
168
+ /** Get all packages that depend on the given package */
169
+ getDependents(pkgName: string): DependentInfo[];
170
+ /** Check if a package is an internal workspace package */
171
+ isInternal(pkgName: string): boolean;
172
+ /** Get all internal package names */
173
+ allPackages(): string[];
174
+ /** Topological sort — returns packages in dependency order (deps first) */
175
+ topologicalSort(packages: Map<string, WorkspacePackage>): string[];
176
+ }
177
+ //#endregion
178
+ //#region src/core/changeset.d.ts
179
+ /** Read all changeset files from .bumpy/ directory */
180
+ declare function readChangesets(rootDir: string): Promise<Changeset[]>;
181
+ /** Parse changeset content (for testing) */
182
+ declare function parseChangeset(content: string, id: string): Changeset | null;
183
+ /** Write a changeset file */
184
+ declare function writeChangeset(rootDir: string, filename: string, releases: ChangesetRelease[], summary: string): Promise<string>;
185
+ //#endregion
186
+ //#region src/core/release-plan.d.ts
187
+ /**
188
+ * Build a release plan from pending changesets, the dependency graph, and config.
189
+ * This is the core algorithm of bumpy.
190
+ */
191
+ declare function assembleReleasePlan(changesets: Changeset[], packages: Map<string, WorkspacePackage>, depGraph: DependencyGraph, config: BumpyConfig): ReleasePlan;
192
+ //#endregion
193
+ //#region src/core/apply-release-plan.d.ts
194
+ /** Apply the release plan: bump versions, update changelogs, delete changesets */
195
+ declare function applyReleasePlan(releasePlan: ReleasePlan, packages: Map<string, WorkspacePackage>, rootDir: string, config: BumpyConfig): Promise<void>;
196
+ //#endregion
197
+ //#region src/core/changelog.d.ts
198
+ interface ChangelogContext {
199
+ release: PlannedRelease;
200
+ /** Changesets that contributed to this release */
201
+ changesets: Changeset[];
202
+ /** ISO date string (YYYY-MM-DD) */
203
+ date: string;
204
+ }
205
+ /**
206
+ * A changelog formatter receives full context and returns the complete
207
+ * changelog entry string for a single release.
208
+ */
209
+ type ChangelogFormatter = (ctx: ChangelogContext) => string | Promise<string>;
210
+ /** Default formatter — version heading, date, bullet points */
211
+ declare const defaultFormatter: ChangelogFormatter;
212
+ /**
213
+ * Load a changelog formatter from config.
214
+ * Supports: "default", "./path/to/formatter.ts", or a module name.
215
+ */
216
+ declare function loadFormatter(changelog: BumpyConfig['changelog'], rootDir: string): Promise<ChangelogFormatter>;
217
+ /** Generate a changelog entry using the configured formatter */
218
+ declare function generateChangelogEntry(release: PlannedRelease, changesets: Changeset[], formatter?: ChangelogFormatter, date?: string): Promise<string>;
219
+ /** Prepend a new entry to an existing CHANGELOG.md content */
220
+ declare function prependToChangelog(existingContent: string, newEntry: string): string;
221
+ //#endregion
222
+ //#region src/core/semver.d.ts
223
+ declare function bumpVersion(version: string, type: BumpType): string;
224
+ /** Check if a version satisfies a range */
225
+ declare function satisfies(version: string, range: string): boolean;
226
+ /** Strip workspace: protocol from version ranges */
227
+ declare function stripProtocol(range: string): string;
228
+ //#endregion
229
+ //#region src/core/publish-pipeline.d.ts
230
+ interface PublishOptions {
231
+ dryRun?: boolean;
232
+ tag?: string;
233
+ }
234
+ interface PublishResult {
235
+ published: {
236
+ name: string;
237
+ version: string;
238
+ }[];
239
+ skipped: {
240
+ name: string;
241
+ reason: string;
242
+ }[];
243
+ failed: {
244
+ name: string;
245
+ error: string;
246
+ }[];
247
+ }
248
+ /**
249
+ * Publish all packages in the release plan.
250
+ * Order: topological (dependencies published before dependents).
251
+ */
252
+ declare function publishPackages(releasePlan: ReleasePlan, packages: Map<string, WorkspacePackage>, depGraph: DependencyGraph, config: BumpyConfig, rootDir: string, opts?: PublishOptions, catalogs?: CatalogMap, detectedPm?: PackageManager): Promise<PublishResult>;
253
+ //#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 };
package/dist/index.mjs ADDED
@@ -0,0 +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-CJ2orhTL.mjs";
2
+ import { t as discoverPackages } from "./workspace-mVjawG8g.mjs";
3
+ import { t as DependencyGraph } from "./dep-graph-DiLeAhl9.mjs";
4
+ import { i as writeChangeset, n as parseChangeset, r as readChangesets } from "./changeset-ClCYsChu.mjs";
5
+ import { n as satisfies, r as stripProtocol, t as bumpVersion } from "./semver-DWO6NFKN.mjs";
6
+ import { t as assembleReleasePlan } from "./release-plan-CFnutSHD.mjs";
7
+ import { a as prependToChangelog, i as loadFormatter, n as defaultFormatter, r as generateChangelogEntry, t as applyReleasePlan } from "./apply-release-plan-DtU3rVyL.mjs";
8
+ import { t as publishPackages } from "./publish-pipeline-1M5GmbdP.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, parseChangeset, parseIsolatedBump, prependToChangelog, publishPackages, readChangesets, satisfies, stripProtocol, writeChangeset };
@@ -0,0 +1,22 @@
1
+ import { n as log } from "./logger-ZqggsyGZ.mjs";
2
+ import { c as writeJson, l as writeText, n as exists, t as ensureDir } from "./fs-DbNNEyzq.mjs";
3
+ import { resolve } from "node:path";
4
+ //#region src/commands/init.ts
5
+ async function initCommand(rootDir) {
6
+ const bumpyDir = resolve(rootDir, ".bumpy");
7
+ if (await exists(resolve(bumpyDir, "_config.json"))) {
8
+ log.warn(".bumpy/_config.json already exists");
9
+ return;
10
+ }
11
+ await ensureDir(bumpyDir);
12
+ await writeJson(resolve(bumpyDir, "_config.json"), {
13
+ baseBranch: "main",
14
+ changelog: "default"
15
+ });
16
+ await writeText(resolve(bumpyDir, "README.md"), `# 🐸 Bumpy\n\nThis directory is used by [bumpy](https://github.com/dmno-dev/bumpy) to manage versioning.\n\nChangeset files (\`.md\`) in this directory describe pending version bumps.\nRun \`bumpy add\` to create a new changeset.\n`);
17
+ log.success("Initialized .bumpy/ directory");
18
+ log.dim(" Created .bumpy/_config.json");
19
+ log.dim(" Created .bumpy/README.md");
20
+ }
21
+ //#endregion
22
+ export { initCommand };