relizy 1.4.2 → 1.4.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 { aq as isInCI, ar as getCIName, b as bump, c as changelog, g as publish, e as providerRelease, h as social, p as prComment, r as release } from './shared/relizy.D4m3ji0j.mjs';
8
+ import { aq as isInCI, ar as getCIName, b as bump, c as changelog, g as publish, e as providerRelease, h as social, p as prComment, r as release } from './shared/relizy.D5bCkAG-.mjs';
9
9
  import 'node:child_process';
10
10
  import '@maz-ui/utils';
11
11
  import 'c12';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { ak as NEW_PACKAGE_MARKER, $ as PR_COMMENT_MARKER, M as buildChangelogBody, a as buildCommentBody, L as buildCompareLink, O as buildContributors, b as bump, ay as capReleaseTypeForZeroMajor, c as changelog, v as checkGitStatusIfDirty, N as collectContributorNames, X as collectPackageBumps, aM as confirmBump, B as createCommitAndTags, J as createGitlabRelease, k as defineConfig, y as detectGitProvider, R as detectPackageManager, _ as detectPullRequest, S as determinePublishTag, aA as determineReleaseType, az as determineSemverChange, at as executeBuildCmd, as as executeFormatCmd, ap as executeHook, q as expandPackagesToBumpWithDependents, ad as extractChangelogSummary, aE as extractVersionFromPackageTag, aP as extractVersionFromTag, x as fetchGitTags, av as filterOutPrivatePackages, Y as findGitHubPR, Z as findGitLabMR, a9 as formatChangelogForSlack, aa as formatPackagesForSlack, ab as formatSlackMessage, an as formatTweetMessage, i as generateChangelog, P as generateMarkDown, V as getAuthCommand, aN as getBumpedIndependentPackages, aL as getBumpedPackageIndependently, ar as getCIName, aQ as getCanaryVersion, F as getCurrentGitBranch, G as getCurrentGitRef, j as getDefaultConfig, o as getDependentsOf, E as getFirstCommit, u as getGitStatus, af as getIndependentTag, aj as getLastPackageTag, ai as getLastRepoTag, ag as getLastStableTag, ah as getLastTag, A as getModifiedReleaseFilePatterns, a5 as getPackageCommits, n as getPackageDependencies, aC as getPackageNewVersion, a4 as getPackages, aw as getPackagesOrBumpedPackages, U as getPackagesToPublishInIndependentMode, T as getPackagesToPublishInSelectiveMode, aJ as getPreid, ae as getReleaseUrl, a2 as getRootPackage, H as getShortCommitSha, a7 as getSlackToken, a8 as getSlackWebhookUrl, am as getTwitterCredentials, I as github, K as gitlab, a6 as hasLernaJson, au as isBumpedPackage, aK as isChangedPreid, aI as isGraduating, ax as isGraduatingToStableBetweenVersion, aq as isInCI, aF as isPrerelease, aH as isPrereleaseReleaseType, aG as isStableReleaseType, aR as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, m as mergeTypes, Q as parseChangelogMarkdown, z as parseGitRemoteUrl, a0 as postPrComment, ac as postReleaseToSlack, ao as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, W as publishPackage, f as publishSafetyCheck, C as pushCommitAndTags, a1 as readPackageJson, a3 as readPackages, r as release, al as resolveTags, D as rollbackModifiedFiles, aO as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, aD as updateLernaVersion, w as writeChangelogToFile, aB as writeVersion } from './shared/relizy.D4m3ji0j.mjs';
1
+ export { ak as NEW_PACKAGE_MARKER, $ as PR_COMMENT_MARKER, M as buildChangelogBody, a as buildCommentBody, L as buildCompareLink, O as buildContributors, b as bump, ay as capReleaseTypeForZeroMajor, c as changelog, v as checkGitStatusIfDirty, N as collectContributorNames, X as collectPackageBumps, aM as confirmBump, B as createCommitAndTags, J as createGitlabRelease, k as defineConfig, y as detectGitProvider, R as detectPackageManager, _ as detectPullRequest, S as determinePublishTag, aA as determineReleaseType, az as determineSemverChange, at as executeBuildCmd, as as executeFormatCmd, ap as executeHook, q as expandPackagesToBumpWithDependents, ad as extractChangelogSummary, aE as extractVersionFromPackageTag, aP as extractVersionFromTag, x as fetchGitTags, av as filterOutPrivatePackages, Y as findGitHubPR, Z as findGitLabMR, a9 as formatChangelogForSlack, aa as formatPackagesForSlack, ab as formatSlackMessage, an as formatTweetMessage, i as generateChangelog, P as generateMarkDown, V as getAuthCommand, aN as getBumpedIndependentPackages, aL as getBumpedPackageIndependently, ar as getCIName, aQ as getCanaryVersion, F as getCurrentGitBranch, G as getCurrentGitRef, j as getDefaultConfig, o as getDependentsOf, E as getFirstCommit, u as getGitStatus, af as getIndependentTag, aj as getLastPackageTag, ai as getLastRepoTag, ag as getLastStableTag, ah as getLastTag, A as getModifiedReleaseFilePatterns, a5 as getPackageCommits, n as getPackageDependencies, aC as getPackageNewVersion, a4 as getPackages, aw as getPackagesOrBumpedPackages, U as getPackagesToPublishInIndependentMode, T as getPackagesToPublishInSelectiveMode, aJ as getPreid, ae as getReleaseUrl, a2 as getRootPackage, H as getShortCommitSha, a7 as getSlackToken, a8 as getSlackWebhookUrl, am as getTwitterCredentials, I as github, K as gitlab, a6 as hasLernaJson, au as isBumpedPackage, aK as isChangedPreid, aI as isGraduating, ax as isGraduatingToStableBetweenVersion, aq as isInCI, aF as isPrerelease, aH as isPrereleaseReleaseType, aG as isStableReleaseType, aR as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, m as mergeTypes, Q as parseChangelogMarkdown, z as parseGitRemoteUrl, a0 as postPrComment, ac as postReleaseToSlack, ao as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, W as publishPackage, f as publishSafetyCheck, C as pushCommitAndTags, a1 as readPackageJson, a3 as readPackages, r as release, al as resolveTags, D as rollbackModifiedFiles, aO as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, aD as updateLernaVersion, w as writeChangelogToFile, aB as writeVersion } from './shared/relizy.D5bCkAG-.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:child_process';
4
4
  import 'node:process';
@@ -1267,12 +1267,21 @@ async function resolveFromTagUnified({
1267
1267
  }) {
1268
1268
  const filterPrereleases = shouldFilterPrereleaseTags(pkg.version, graduating);
1269
1269
  const onlyStable = graduating || filterPrereleases;
1270
- return await getLastRepoTag({
1270
+ const lastRepoTag = await getLastRepoTag({
1271
1271
  pkg,
1272
1272
  onlyStable,
1273
1273
  logLevel,
1274
1274
  cwd: config.cwd
1275
- }) || getFirstCommit(config.cwd);
1275
+ });
1276
+ if (lastRepoTag) {
1277
+ return lastRepoTag;
1278
+ }
1279
+ const isRootPackage = pkg.path === config.cwd;
1280
+ if (!isRootPackage) {
1281
+ logger.debug(`No compatible repo tag for new sub-package ${pkg.name}, marking as new package`);
1282
+ return NEW_PACKAGE_MARKER;
1283
+ }
1284
+ return getFirstCommit(config.cwd);
1276
1285
  }
1277
1286
  async function resolveFromTag({
1278
1287
  config,
@@ -1767,41 +1776,57 @@ async function publishPackage({
1767
1776
  const tag = determinePublishTag(pkg.newVersion || pkg.version, config.publish.tag);
1768
1777
  const packageNameAndVersion = getIndependentTag({ name: pkg.name, version: pkg.newVersion || pkg.version });
1769
1778
  logger.debug(`Building publish command for ${pkg.name}`);
1770
- let dynamicOtp;
1771
- const maxAttempts = 2;
1772
- for (let attempt = 0; attempt < maxAttempts; attempt++) {
1773
- try {
1774
- const command = getPublishCommand({
1775
- packageManager,
1776
- tag,
1777
- config,
1778
- otp: dynamicOtp,
1779
- dryRun
1780
- });
1781
- process.chdir(pkg.path);
1782
- await executePublishCommand({
1783
- command,
1784
- packageNameAndVersion,
1785
- packageManager,
1786
- pkg,
1787
- config,
1788
- dryRun,
1789
- tag
1790
- });
1791
- if (dynamicOtp && !sessionOtp) {
1792
- sessionOtp = dynamicOtp;
1793
- logger.debug("OTP stored for session");
1794
- }
1795
- return;
1796
- } catch (error) {
1797
- if (isOtpError(error) && attempt < maxAttempts - 1) {
1798
- dynamicOtp = await handleOtpError();
1799
- } else {
1800
- logger.error(`Failed to publish ${packageNameAndVersion}:`, error);
1801
- throw error;
1779
+ const needsTempVersionWrite = dryRun && (packageManager === "npm" || packageManager === "pnpm") && !!pkg.newVersion && pkg.newVersion !== pkg.version;
1780
+ let originalVersion;
1781
+ if (needsTempVersionWrite) {
1782
+ const packageJsonPath = join(pkg.path, "package.json");
1783
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
1784
+ originalVersion = packageJson.version;
1785
+ logger.debug(`[dry-run] Temporarily writing ${pkg.newVersion} to ${pkg.name} for publish --dry-run validation`);
1786
+ writeVersion(pkg.path, pkg.newVersion, false);
1787
+ }
1788
+ try {
1789
+ let dynamicOtp;
1790
+ const maxAttempts = 2;
1791
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
1792
+ try {
1793
+ const command = getPublishCommand({
1794
+ packageManager,
1795
+ tag,
1796
+ config,
1797
+ otp: dynamicOtp,
1798
+ dryRun
1799
+ });
1800
+ process.chdir(pkg.path);
1801
+ await executePublishCommand({
1802
+ command,
1803
+ packageNameAndVersion,
1804
+ packageManager,
1805
+ pkg,
1806
+ config,
1807
+ dryRun,
1808
+ tag
1809
+ });
1810
+ if (dynamicOtp && !sessionOtp) {
1811
+ sessionOtp = dynamicOtp;
1812
+ logger.debug("OTP stored for session");
1813
+ }
1814
+ return;
1815
+ } catch (error) {
1816
+ if (isOtpError(error) && attempt < maxAttempts - 1) {
1817
+ dynamicOtp = await handleOtpError();
1818
+ } else {
1819
+ logger.error(`Failed to publish ${packageNameAndVersion}:`, error);
1820
+ throw error;
1821
+ }
1822
+ } finally {
1823
+ process.chdir(config.cwd);
1802
1824
  }
1803
- } finally {
1804
- process.chdir(config.cwd);
1825
+ }
1826
+ } finally {
1827
+ if (needsTempVersionWrite && originalVersion) {
1828
+ logger.debug(`[dry-run] Restoring ${pkg.name} version to ${originalVersion}`);
1829
+ writeVersion(pkg.path, originalVersion, false);
1805
1830
  }
1806
1831
  }
1807
1832
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "1.4.2",
4
+ "version": "1.4.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",