@varlock/bumpy 1.1.0 → 1.2.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.
Files changed (25) hide show
  1. package/README.md +256 -0
  2. package/dist/{add-BmNL5VwL.mjs → add-DF6bawDT.mjs} +6 -6
  3. package/dist/{ai-sMYUf3lP.mjs → ai-STKnq09z.mjs} +1 -1
  4. package/dist/{apply-release-plan-0kH62jhu.mjs → apply-release-plan-B1Wwx3HG.mjs} +5 -5
  5. package/dist/{bump-file-DVqR3k67.mjs → bump-file-C3S_bzSf.mjs} +78 -24
  6. package/dist/{changelog-github-DkACMj0j.mjs → changelog-github-DZSHX3Tb.mjs} +20 -5
  7. package/dist/{check-BjWF6SJm.mjs → check-BJL-YDWz.mjs} +38 -11
  8. package/dist/{ci-DY58ugIi.mjs → ci-C88ecvIP.mjs} +115 -33
  9. package/dist/{ci-setup-BQwktQEe.mjs → ci-setup-CARJFhcE.mjs} +1 -1
  10. package/dist/cli.mjs +24 -17
  11. package/dist/{config-B-Qg3DZH.mjs → config-D7Umr-fT.mjs} +3 -3
  12. package/dist/{fs-DYR2XuFE.mjs → fs-DnDogVn-.mjs} +16 -1
  13. package/dist/{generate-DX46X-rW.mjs → generate-D93b3NAD.mjs} +5 -5
  14. package/dist/{git-YDedMddc.mjs → git-H9S9z6g-.mjs} +10 -1
  15. package/dist/index.d.mts +13 -3
  16. package/dist/index.mjs +6 -6
  17. package/dist/{init-DkTPs_WQ.mjs → init-DJhMaceS.mjs} +3 -3
  18. package/dist/{package-manager-Clsmr-9r.mjs → package-manager-ByJ0wKYh.mjs} +1 -1
  19. package/dist/{publish-CGB4TIKD.mjs → publish-DGSV607z.mjs} +6 -6
  20. package/dist/{publish-pipeline-CXuqce1N.mjs → publish-pipeline-DiwZZ5AF.mjs} +3 -3
  21. package/dist/{release-plan-JNir7bSM.mjs → release-plan-CNOuSI-d.mjs} +1 -1
  22. package/dist/{status-EGYqULJg.mjs → status-S2ztf_8E.mjs} +38 -17
  23. package/dist/{version-BcfidiVX.mjs → version-BXrP4TIO.mjs} +11 -7
  24. package/dist/{workspace-DWXlwcH4.mjs → workspace-BHsAPUmC.mjs} +3 -3
  25. package/package.json +2 -1
@@ -1,11 +1,11 @@
1
1
  import { n as log, t as colorize } from "./logger-C2dEe5Su.mjs";
2
- import { a as loadConfig } from "./config-B-Qg3DZH.mjs";
3
- import { n as detectWorkspaces } from "./package-manager-Clsmr-9r.mjs";
4
- import { n as discoverWorkspace } from "./workspace-DWXlwcH4.mjs";
2
+ import { a as loadConfig } from "./config-D7Umr-fT.mjs";
3
+ import { n as detectWorkspaces } from "./package-manager-ByJ0wKYh.mjs";
4
+ import { n as discoverWorkspace } from "./workspace-BHsAPUmC.mjs";
5
5
  import { t as DependencyGraph } from "./dep-graph-DiLeAhl9.mjs";
6
6
  import { r as runArgsAsync, s as tryRunArgs } from "./shell-CY7OD48z.mjs";
7
- import { a as hasUncommittedChanges, o as listTags, s as pushWithTags } from "./git-YDedMddc.mjs";
8
- import { t as publishPackages } from "./publish-pipeline-CXuqce1N.mjs";
7
+ import { c as pushWithTags, o as hasUncommittedChanges, s as listTags } from "./git-H9S9z6g-.mjs";
8
+ import { t as publishPackages } from "./publish-pipeline-DiwZZ5AF.mjs";
9
9
  //#region src/core/github-release.ts
10
10
  /** Get the current HEAD commit SHA */
11
11
  function getHeadSha(rootDir) {
@@ -148,7 +148,7 @@ async function publishCommand(rootDir, opts) {
148
148
  }
149
149
  let toPublish = await findUnpublishedPackages(packages, config);
150
150
  if (opts.filter) {
151
- const { matchGlob } = await import("./config-B-Qg3DZH.mjs").then((n) => n.t);
151
+ const { matchGlob } = await import("./config-D7Umr-fT.mjs").then((n) => n.t);
152
152
  const patterns = opts.filter.split(",").map((p) => p.trim());
153
153
  toPublish = toPublish.filter((r) => patterns.some((p) => matchGlob(r.name, p)));
154
154
  }
@@ -1,9 +1,9 @@
1
1
  import { n as log, t as colorize } from "./logger-C2dEe5Su.mjs";
2
- import { a as readJson, l as updateJsonNestedField } from "./fs-DYR2XuFE.mjs";
3
- import { r as resolveCatalogDep } from "./package-manager-Clsmr-9r.mjs";
2
+ import { a as readJson, u as updateJsonNestedField } from "./fs-DnDogVn-.mjs";
3
+ import { r as resolveCatalogDep } from "./package-manager-ByJ0wKYh.mjs";
4
4
  import { i as runAsync, o as sq, r as runArgsAsync, s as tryRunArgs } from "./shell-CY7OD48z.mjs";
5
5
  import { r as stripProtocol } from "./semver-BJzWIuRz.mjs";
6
- import { c as tagExists, t as createTag } from "./git-YDedMddc.mjs";
6
+ import { l as tagExists, t as createTag } from "./git-H9S9z6g-.mjs";
7
7
  import { resolve } from "node:path";
8
8
  import { unlink } from "node:fs/promises";
9
9
  import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import { h as maxBump, l as DEFAULT_BUMP_RULES, m as hasCascade, p as bumpLevel, s as matchGlob } from "./config-B-Qg3DZH.mjs";
1
+ import { h as maxBump, l as DEFAULT_BUMP_RULES, m as hasCascade, p as bumpLevel, s as matchGlob } from "./config-D7Umr-fT.mjs";
2
2
  import { n as satisfies, t as bumpVersion } from "./semver-BJzWIuRz.mjs";
3
3
  //#region src/core/release-plan.ts
4
4
  /**
@@ -1,15 +1,17 @@
1
1
  import { n as log, t as colorize } from "./logger-C2dEe5Su.mjs";
2
- import { a as loadConfig } from "./config-B-Qg3DZH.mjs";
3
- import { t as discoverPackages } from "./workspace-DWXlwcH4.mjs";
2
+ import { a as loadConfig } from "./config-D7Umr-fT.mjs";
3
+ import { t as discoverPackages } from "./workspace-BHsAPUmC.mjs";
4
4
  import { t as DependencyGraph } from "./dep-graph-DiLeAhl9.mjs";
5
- import { r as readBumpFiles } from "./bump-file-DVqR3k67.mjs";
6
- import { t as assembleReleasePlan } from "./release-plan-JNir7bSM.mjs";
5
+ import { r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-C3S_bzSf.mjs";
6
+ import { t as assembleReleasePlan } from "./release-plan-CNOuSI-d.mjs";
7
+ import { i as getCurrentBranch, r as getChangedFiles } from "./git-H9S9z6g-.mjs";
7
8
  //#region src/commands/status.ts
8
9
  async function statusCommand(rootDir, opts) {
9
10
  const config = await loadConfig(rootDir);
10
11
  const packages = await discoverPackages(rootDir, config);
11
12
  const depGraph = new DependencyGraph(packages);
12
- const bumpFiles = await readBumpFiles(rootDir);
13
+ const { bumpFiles, errors: parseErrors } = await readBumpFiles(rootDir);
14
+ if (parseErrors.length > 0) for (const err of parseErrors) log.error(err);
13
15
  if (bumpFiles.length === 0) {
14
16
  if (opts.json) console.log(JSON.stringify({
15
17
  bumpFiles: [],
@@ -20,13 +22,16 @@ async function statusCommand(rootDir, opts) {
20
22
  process.exit(1);
21
23
  }
22
24
  const plan = assembleReleasePlan(bumpFiles, packages, depGraph, config);
25
+ let branchBumpFileIds;
26
+ const currentBranch = getCurrentBranch({ cwd: rootDir });
27
+ if (currentBranch && currentBranch !== config.baseBranch) branchBumpFileIds = filterBranchBumpFiles(bumpFiles, getChangedFiles(rootDir, config.baseBranch), rootDir).branchBumpFileIds;
23
28
  let releases = plan.releases;
24
29
  if (opts.bumpType) {
25
30
  const types = opts.bumpType.split(",").map((t) => t.trim());
26
31
  releases = releases.filter((r) => types.includes(r.type));
27
32
  }
28
33
  if (opts.filter) {
29
- const { matchGlob } = await import("./config-B-Qg3DZH.mjs").then((n) => n.t);
34
+ const { matchGlob } = await import("./config-D7Umr-fT.mjs").then((n) => n.t);
30
35
  const patterns = opts.filter.split(",").map((p) => p.trim());
31
36
  releases = releases.filter((r) => patterns.some((p) => matchGlob(r.name, p)));
32
37
  }
@@ -38,18 +43,25 @@ async function statusCommand(rootDir, opts) {
38
43
  releases: bf.releases.map((r) => ({
39
44
  name: r.name,
40
45
  type: r.type
41
- }))
42
- })),
43
- releases: releases.map((r) => ({
44
- name: r.name,
45
- type: r.type,
46
- oldVersion: r.oldVersion,
47
- newVersion: r.newVersion,
48
- dir: packages.get(r.name)?.relativeDir,
49
- bumpFiles: r.bumpFiles,
50
- isDependencyBump: r.isDependencyBump,
51
- isCascadeBump: r.isCascadeBump
46
+ })),
47
+ ...branchBumpFileIds ? { inCurrentBranch: branchBumpFileIds.has(bf.id) } : {}
52
48
  })),
49
+ releases: releases.map((r) => {
50
+ const pkg = packages.get(r.name);
51
+ const pkgConfig = pkg?.bumpy || {};
52
+ return {
53
+ name: r.name,
54
+ type: r.type,
55
+ oldVersion: r.oldVersion,
56
+ newVersion: r.newVersion,
57
+ dir: pkg?.relativeDir,
58
+ bumpFiles: r.bumpFiles,
59
+ isDependencyBump: r.isDependencyBump,
60
+ isCascadeBump: r.isCascadeBump,
61
+ ...branchBumpFileIds ? { inCurrentBranch: r.bumpFiles.some((id) => branchBumpFileIds.has(id)) } : {},
62
+ publishTargets: getPublishTargets(pkg, pkgConfig, config)
63
+ };
64
+ }),
53
65
  packageNames: releases.map((r) => r.name)
54
66
  };
55
67
  console.log(JSON.stringify(jsonOutput, null, 2));
@@ -106,5 +118,14 @@ function printRelease(r, packages) {
106
118
  const suffix = r.isDependencyBump ? colorize(" ← dependency bump", "dim") : r.isCascadeBump ? colorize(" ← cascade", "dim") : "";
107
119
  console.log(` ${r.name}: ${r.oldVersion} → ${colorize(r.newVersion, "cyan")}${suffix}${dir}`);
108
120
  }
121
+ /** Determine which publish targets a package will use */
122
+ function getPublishTargets(pkg, pkgConfig, _config) {
123
+ if (!pkg) return [];
124
+ if (pkg.private && !pkgConfig.publishCommand) return [];
125
+ const targets = [];
126
+ if (pkgConfig.publishCommand) targets.push("custom");
127
+ if (!pkgConfig.publishCommand && !pkgConfig.skipNpmPublish) targets.push("npm");
128
+ return targets;
129
+ }
109
130
  //#endregion
110
131
  export { statusCommand };
@@ -1,19 +1,23 @@
1
1
  import { n as log, t as colorize } from "./logger-C2dEe5Su.mjs";
2
- import { a as loadConfig } from "./config-B-Qg3DZH.mjs";
3
- import { n as detectWorkspaces } from "./package-manager-Clsmr-9r.mjs";
4
- import { t as discoverPackages } from "./workspace-DWXlwcH4.mjs";
2
+ import { a as loadConfig } from "./config-D7Umr-fT.mjs";
3
+ import { n as detectWorkspaces } from "./package-manager-ByJ0wKYh.mjs";
4
+ import { t as discoverPackages } from "./workspace-BHsAPUmC.mjs";
5
5
  import { t as DependencyGraph } from "./dep-graph-DiLeAhl9.mjs";
6
6
  import { n as runArgs, s as tryRunArgs } from "./shell-CY7OD48z.mjs";
7
- import { r as readBumpFiles } from "./bump-file-DVqR3k67.mjs";
8
- import { t as assembleReleasePlan } from "./release-plan-JNir7bSM.mjs";
9
- import { t as applyReleasePlan } from "./apply-release-plan-0kH62jhu.mjs";
7
+ import { r as readBumpFiles } from "./bump-file-C3S_bzSf.mjs";
8
+ import { t as assembleReleasePlan } from "./release-plan-CNOuSI-d.mjs";
9
+ import { t as applyReleasePlan } from "./apply-release-plan-B1Wwx3HG.mjs";
10
10
  import { t as resolveCommitMessage } from "./commit-message-BwsowSds.mjs";
11
11
  //#region src/commands/version.ts
12
12
  async function versionCommand(rootDir, opts = {}) {
13
13
  const config = await loadConfig(rootDir);
14
14
  const packages = await discoverPackages(rootDir, config);
15
15
  const depGraph = new DependencyGraph(packages);
16
- const bumpFiles = await readBumpFiles(rootDir);
16
+ const { bumpFiles, errors: parseErrors } = await readBumpFiles(rootDir);
17
+ if (parseErrors.length > 0) {
18
+ for (const err of parseErrors) log.error(err);
19
+ throw new Error("Bump file parse errors must be fixed before versioning.");
20
+ }
17
21
  if (bumpFiles.length === 0) {
18
22
  log.info("No pending bump files.");
19
23
  return;
@@ -1,6 +1,6 @@
1
- import { a as readJson, n as exists } from "./fs-DYR2XuFE.mjs";
2
- import { i as isPackageManaged, o as loadPackageConfig } from "./config-B-Qg3DZH.mjs";
3
- import { n as detectWorkspaces } from "./package-manager-Clsmr-9r.mjs";
1
+ import { a as readJson, n as exists } from "./fs-DnDogVn-.mjs";
2
+ import { i as isPackageManaged, o as loadPackageConfig } from "./config-D7Umr-fT.mjs";
3
+ import { n as detectWorkspaces } from "./package-manager-ByJ0wKYh.mjs";
4
4
  import { relative, resolve } from "node:path";
5
5
  import { readdir, stat } from "node:fs/promises";
6
6
  //#region src/core/workspace.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlock/bumpy",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Modern monorepo versioning and changelog tool",
5
5
  "keywords": [
6
6
  "bump",
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsdown",
40
+ "prepack": "cp ../../README.md .",
40
41
  "check": "bun run tsc --noEmit",
41
42
  "test": "bun test"
42
43
  },