relizy 0.2.5-beta.2 → 0.2.5-beta.4

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/cli.mjs CHANGED
@@ -5,7 +5,7 @@ import process from 'node:process';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { printBanner, logger } from '@maz-ui/node';
7
7
  import { Command } from 'commander';
8
- import { U as isInCI, V as getCIName, b as bump, c as changelog, d as publish, a as providerRelease, r as release } from './shared/relizy.BrFHoMjL.mjs';
8
+ import { U as isInCI, V as getCIName, b as bump, c as changelog, d as publish, a as providerRelease, r as release } from './shared/relizy.CdNX5T_h.mjs';
9
9
  import 'node:child_process';
10
10
  import '@maz-ui/utils';
11
11
  import 'c12';
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- export { b as bump, c as changelog, m as checkGitStatusIfDirty, aa as confirmBump, s as createCommitAndTags, A as createGitlabRelease, f as defineConfig, o as detectGitProvider, C as detectPackageManager, D as determinePublishTag, _ as determineReleaseType, Z as determineSemverChange, X as executeBuildCmd, W as executeFormatCmd, T as executeHook, j as expandPackagesToBumpWithDependents, a2 as extractVersionFromPackageTag, n as fetchGitTags, g as generateChangelog, ab as getBumpedIndependentPackages, a9 as getBumpedPackageIndependently, V as getCIName, x as getCurrentGitBranch, y as getCurrentGitRef, e as getDefaultConfig, i as getDependentsOf, v as getFirstCommit, k as getGitStatus, N as getIndependentTag, R as getLastPackageTag, Q as getLastRepoTag, O as getLastStableTag, P as getLastTag, L as getPackageCommits, h as getPackageDependencies, a0 as getPackageNewVersion, K as getPackages, F as getPackagesToPublishInIndependentMode, E as getPackagesToPublishInSelectiveMode, a7 as getPreid, I as getRootPackage, z as github, B as gitlab, M as hasLernaJson, Y as isBumpedPackage, a8 as isChangedPreid, a6 as isGraduating, U as isInCI, a3 as isPrerelease, a5 as isPrereleaseReleaseType, a4 as isStableReleaseType, l as loadRelizyConfig, q as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, d as publish, G as publishPackage, u as pushCommitAndTags, H as readPackageJson, J as readPackages, r as release, S as resolveTags, t as topologicalSort, a1 as updateLernaVersion, w as writeChangelogToFile, $ as writeVersion } from './shared/relizy.BrFHoMjL.mjs';
1
+ export { b as bump, c as changelog, m as checkGitStatusIfDirty, aa as confirmBump, s as createCommitAndTags, A as createGitlabRelease, f as defineConfig, o as detectGitProvider, C as detectPackageManager, D as determinePublishTag, _ as determineReleaseType, Z as determineSemverChange, X as executeBuildCmd, W as executeFormatCmd, T as executeHook, j as expandPackagesToBumpWithDependents, a2 as extractVersionFromPackageTag, n as fetchGitTags, g as generateChangelog, ab as getBumpedIndependentPackages, a9 as getBumpedPackageIndependently, V as getCIName, x as getCurrentGitBranch, y as getCurrentGitRef, e as getDefaultConfig, i as getDependentsOf, v as getFirstCommit, k as getGitStatus, N as getIndependentTag, R as getLastPackageTag, Q as getLastRepoTag, O as getLastStableTag, P as getLastTag, L as getPackageCommits, h as getPackageDependencies, a0 as getPackageNewVersion, K as getPackages, F as getPackagesToPublishInIndependentMode, E as getPackagesToPublishInSelectiveMode, a7 as getPreid, I as getRootPackage, z as github, B as gitlab, M as hasLernaJson, Y as isBumpedPackage, a8 as isChangedPreid, a6 as isGraduating, U as isInCI, a3 as isPrerelease, a5 as isPrereleaseReleaseType, a4 as isStableReleaseType, l as loadRelizyConfig, q as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, d as publish, G as publishPackage, u as pushCommitAndTags, H as readPackageJson, J as readPackages, r as release, S as resolveTags, t as topologicalSort, a1 as updateLernaVersion, w as writeChangelogToFile, $ as writeVersion } from './shared/relizy.CdNX5T_h.mjs';
2
2
  import '@maz-ui/node';
3
+ import 'node:process';
3
4
  import 'node:child_process';
4
5
  import 'node:fs';
5
6
  import 'node:path';
6
- import 'node:process';
7
7
  import '@maz-ui/utils';
8
8
  import 'c12';
9
9
  import 'changelogen';
@@ -1,8 +1,8 @@
1
1
  import { logger, execPromise } from '@maz-ui/node';
2
+ import process$1, { exit } from 'node:process';
2
3
  import { execSync } from 'node:child_process';
3
4
  import { existsSync, readFileSync, writeFileSync, statSync } from 'node:fs';
4
5
  import path, { join, relative } from 'node:path';
5
- import process$1 from 'node:process';
6
6
  import { upperFirst, formatJson } from '@maz-ui/utils';
7
7
  import { setupDotenv, loadConfig } from 'c12';
8
8
  import { formatCompareChanges, formatReference, resolveRepoConfig, getRepoConfig, createGithubRelease, getGitDiff, parseCommits } from 'changelogen';
@@ -812,23 +812,33 @@ function topologicalSort(packages) {
812
812
  for (const pkg of packages) {
813
813
  packageMap.set(pkg.name, pkg);
814
814
  }
815
- function visit(pkgName) {
816
- if (visited.has(pkgName))
817
- return;
815
+ function visit(pkgName, path = []) {
816
+ logger.debug(`Visiting ${pkgName}, path: ${path.join(" \u2192 ")}, visiting: ${Array.from(visiting).join(", ")}`);
818
817
  if (visiting.has(pkgName)) {
819
- logger.fail(`Circular dependency detected involving ${pkgName}`);
818
+ const cycle = [...path, pkgName];
819
+ logger.warn(`Circular dependency detected: ${cycle.join(" \u2192 ")}`);
820
+ return;
821
+ }
822
+ if (visited.has(pkgName)) {
823
+ logger.debug(`${pkgName} already visited globally, skipping`);
820
824
  return;
821
825
  }
822
826
  visiting.add(pkgName);
827
+ logger.debug(`Added ${pkgName} to visiting set`);
823
828
  const pkg = packageMap.get(pkgName);
824
- if (!pkg)
829
+ if (!pkg) {
830
+ logger.debug(`Package ${pkgName} not found in packageMap`);
831
+ visiting.delete(pkgName);
825
832
  return;
833
+ }
834
+ logger.debug(`${pkgName} has dependencies: ${pkg.dependencies.join(", ")}`);
826
835
  for (const depName of pkg.dependencies) {
827
- visit(depName);
836
+ visit(depName, [...path, pkgName]);
828
837
  }
829
838
  visiting.delete(pkgName);
830
839
  visited.add(pkgName);
831
840
  sorted.push(pkg);
841
+ logger.debug(`Finished visiting ${pkgName}`);
832
842
  }
833
843
  for (const pkg of packages) {
834
844
  visit(pkg.name);
@@ -2446,6 +2456,10 @@ async function bumpUnifiedMode({
2446
2456
  suffix,
2447
2457
  force
2448
2458
  });
2459
+ if (packages.length === 0) {
2460
+ logger.fail("No packages to bump");
2461
+ return { bumped: false };
2462
+ }
2449
2463
  if (!config.bump.yes) {
2450
2464
  await confirmBump({
2451
2465
  versionMode: "unified",
@@ -2519,7 +2533,7 @@ async function bumpSelectiveMode({
2519
2533
  force
2520
2534
  });
2521
2535
  if (packages.length === 0) {
2522
- logger.debug("No packages have commits, skipping bump");
2536
+ logger.debug("No packages to bump");
2523
2537
  return { bumped: false };
2524
2538
  }
2525
2539
  if (!config.bump.yes) {
@@ -2587,7 +2601,7 @@ async function bumpIndependentMode({
2587
2601
  force
2588
2602
  });
2589
2603
  if (packagesToBump.length === 0) {
2590
- logger.debug("No packages have commits");
2604
+ logger.debug("No packages to bump");
2591
2605
  return { bumped: false };
2592
2606
  }
2593
2607
  if (!config.bump.yes) {
@@ -2679,7 +2693,8 @@ async function bump(options = {}) {
2679
2693
  const resultLog = result.bumpedPackages.length === 1 ? result.bumpedPackages[0].name : result.bumpedPackages.length;
2680
2694
  logger.success(`${dryRun ? "[dry-run] " : ""}Version bump completed (${resultLog} package${resultLog === 1 || typeof resultLog === "string" ? "" : "s"} bumped)`);
2681
2695
  } else {
2682
- logger.fail("No packages to bump, no commits found");
2696
+ logger.fail("No packages to bump, no relevant commits found");
2697
+ exit(0);
2683
2698
  }
2684
2699
  await executeHook("success:bump", config, dryRun);
2685
2700
  return result;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "0.2.5-beta.2",
4
+ "version": "0.2.5-beta.4",
5
5
  "description": "Changelogen adapter for monorepo management with unified and independent versioning",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",