relizy 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.
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 { ag as isInCI, ah 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.DXxC5SQS.mjs';
8
+ import { ag as isInCI, ah 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.DgHrn_Fg.mjs';
9
9
  import '@maz-ui/utils';
10
10
  import 'c12';
11
11
  import 'changelogen';
package/dist/index.d.mts CHANGED
@@ -15,6 +15,7 @@ declare function getDefaultConfig(): {
15
15
  emptyChangelogContent: string;
16
16
  twitterMessage: string;
17
17
  slackMessage: undefined;
18
+ changelogTitle: string;
18
19
  };
19
20
  excludeAuthors: never[];
20
21
  noAuthors: boolean;
@@ -319,7 +320,10 @@ declare function postReleaseToSlack({ version, projectName, changelog, releaseUr
319
320
  /**
320
321
  * Extract a summary from changelog content
321
322
  */
322
- declare function extractChangelogSummary(changelog: string, maxLength?: number): string;
323
+ declare function extractChangelogSummary(changelog: string, { stripBoldMarkers, maxLength }?: {
324
+ stripBoldMarkers?: boolean;
325
+ maxLength?: number;
326
+ }): string;
323
327
  /**
324
328
  * Get the release URL from repo config and release tag
325
329
  */
@@ -511,8 +515,11 @@ declare function extractVersionFromTag(tag: string, packageName?: string): strin
511
515
  * This prevents accidentally using tags from future major versions (e.g., v5.0.0-beta.0)
512
516
  * when bumping a current stable version (e.g., 4.1.1 → 4.1.2).
513
517
  *
514
- * @param tagVersion - The semantic version extracted from the tag
515
- * @param currentVersion - The current package version
518
+ * @param payload - The payload to check
519
+ * @param payload.currentVersion - The current package version
520
+ * @param payload.releaseType - The release type
521
+ * @param payload.preid - The pre-release identifier
522
+ * @param payload.sha - The sha of the commit
516
523
  * @returns true if the tag version's major is <= current major version
517
524
  *
518
525
  * @example
@@ -1322,6 +1329,12 @@ interface TemplatesConfig {
1322
1329
  * @default undefined
1323
1330
  */
1324
1331
  slackMessage?: string;
1332
+ /**
1333
+ * Changelog section title template
1334
+ * Available variables: {{oldVersion}}, {{newVersion}}, {{date}}
1335
+ * @default '{{oldVersion}}...{{newVersion}}'
1336
+ */
1337
+ changelogTitle?: string;
1325
1338
  }
1326
1339
  interface RepoConfig {
1327
1340
  /**
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ declare function getDefaultConfig(): {
15
15
  emptyChangelogContent: string;
16
16
  twitterMessage: string;
17
17
  slackMessage: undefined;
18
+ changelogTitle: string;
18
19
  };
19
20
  excludeAuthors: never[];
20
21
  noAuthors: boolean;
@@ -319,7 +320,10 @@ declare function postReleaseToSlack({ version, projectName, changelog, releaseUr
319
320
  /**
320
321
  * Extract a summary from changelog content
321
322
  */
322
- declare function extractChangelogSummary(changelog: string, maxLength?: number): string;
323
+ declare function extractChangelogSummary(changelog: string, { stripBoldMarkers, maxLength }?: {
324
+ stripBoldMarkers?: boolean;
325
+ maxLength?: number;
326
+ }): string;
323
327
  /**
324
328
  * Get the release URL from repo config and release tag
325
329
  */
@@ -511,8 +515,11 @@ declare function extractVersionFromTag(tag: string, packageName?: string): strin
511
515
  * This prevents accidentally using tags from future major versions (e.g., v5.0.0-beta.0)
512
516
  * when bumping a current stable version (e.g., 4.1.1 → 4.1.2).
513
517
  *
514
- * @param tagVersion - The semantic version extracted from the tag
515
- * @param currentVersion - The current package version
518
+ * @param payload - The payload to check
519
+ * @param payload.currentVersion - The current package version
520
+ * @param payload.releaseType - The release type
521
+ * @param payload.preid - The pre-release identifier
522
+ * @param payload.sha - The sha of the commit
516
523
  * @returns true if the tag version's major is <= current major version
517
524
  *
518
525
  * @example
@@ -1322,6 +1329,12 @@ interface TemplatesConfig {
1322
1329
  * @default undefined
1323
1330
  */
1324
1331
  slackMessage?: string;
1332
+ /**
1333
+ * Changelog section title template
1334
+ * Available variables: {{oldVersion}}, {{newVersion}}, {{date}}
1335
+ * @default '{{oldVersion}}...{{newVersion}}'
1336
+ */
1337
+ changelogTitle?: string;
1325
1338
  }
1326
1339
  interface RepoConfig {
1327
1340
  /**
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { aa as NEW_PACKAGE_MARKER, T as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, c as changelog, u as checkGitStatusIfDirty, aA as confirmBump, A as createCommitAndTags, I as createGitlabRelease, k as defineConfig, x as detectGitProvider, K as detectPackageManager, S as detectPullRequest, L as determinePublishTag, ao as determineReleaseType, an as determineSemverChange, aj as executeBuildCmd, ai as executeFormatCmd, af as executeHook, o as expandPackagesToBumpWithDependents, a3 as extractChangelogSummary, as as extractVersionFromPackageTag, aD as extractVersionFromTag, v as fetchGitTags, Q as findGitHubPR, R as findGitLabMR, a0 as formatChangelogForSlack, a1 as formatSlackMessage, ad as formatTweetMessage, i as generateChangelog, O as getAuthCommand, aB as getBumpedIndependentPackages, az as getBumpedPackageIndependently, ah as getCIName, aE as getCanaryVersion, E as getCurrentGitBranch, F as getCurrentGitRef, j as getDefaultConfig, n as getDependentsOf, D as getFirstCommit, q as getGitStatus, a5 as getIndependentTag, a9 as getLastPackageTag, a8 as getLastRepoTag, a6 as getLastStableTag, a7 as getLastTag, z as getModifiedReleaseFilePatterns, Z as getPackageCommits, m as getPackageDependencies, aq as getPackageNewVersion, Y as getPackages, al as getPackagesOrBumpedPackages, N as getPackagesToPublishInIndependentMode, M as getPackagesToPublishInSelectiveMode, ax as getPreid, a4 as getReleaseUrl, W as getRootPackage, G as getShortCommitSha, $ as getSlackToken, ac as getTwitterCredentials, H as github, J as gitlab, _ as hasLernaJson, ak as isBumpedPackage, ay as isChangedPreid, aw as isGraduating, am as isGraduatingToStableBetweenVersion, ag as isInCI, at as isPrerelease, av as isPrereleaseReleaseType, au as isStableReleaseType, aF as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, y as parseGitRemoteUrl, U as postPrComment, a2 as postReleaseToSlack, ae as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, P as publishPackage, f as publishSafetyCheck, B as pushCommitAndTags, V as readPackageJson, X as readPackages, r as release, ab as resolveTags, C as rollbackModifiedFiles, aC as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, ar as updateLernaVersion, w as writeChangelogToFile, ap as writeVersion } from './shared/relizy.DXxC5SQS.mjs';
1
+ export { aa as NEW_PACKAGE_MARKER, T as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, c as changelog, u as checkGitStatusIfDirty, aA as confirmBump, A as createCommitAndTags, I as createGitlabRelease, k as defineConfig, x as detectGitProvider, K as detectPackageManager, S as detectPullRequest, L as determinePublishTag, ao as determineReleaseType, an as determineSemverChange, aj as executeBuildCmd, ai as executeFormatCmd, af as executeHook, o as expandPackagesToBumpWithDependents, a3 as extractChangelogSummary, as as extractVersionFromPackageTag, aD as extractVersionFromTag, v as fetchGitTags, Q as findGitHubPR, R as findGitLabMR, a0 as formatChangelogForSlack, a1 as formatSlackMessage, ad as formatTweetMessage, i as generateChangelog, O as getAuthCommand, aB as getBumpedIndependentPackages, az as getBumpedPackageIndependently, ah as getCIName, aE as getCanaryVersion, E as getCurrentGitBranch, F as getCurrentGitRef, j as getDefaultConfig, n as getDependentsOf, D as getFirstCommit, q as getGitStatus, a5 as getIndependentTag, a9 as getLastPackageTag, a8 as getLastRepoTag, a6 as getLastStableTag, a7 as getLastTag, z as getModifiedReleaseFilePatterns, Z as getPackageCommits, m as getPackageDependencies, aq as getPackageNewVersion, Y as getPackages, al as getPackagesOrBumpedPackages, N as getPackagesToPublishInIndependentMode, M as getPackagesToPublishInSelectiveMode, ax as getPreid, a4 as getReleaseUrl, W as getRootPackage, G as getShortCommitSha, $ as getSlackToken, ac as getTwitterCredentials, H as github, J as gitlab, _ as hasLernaJson, ak as isBumpedPackage, ay as isChangedPreid, aw as isGraduating, am as isGraduatingToStableBetweenVersion, ag as isInCI, at as isPrerelease, av as isPrereleaseReleaseType, au as isStableReleaseType, aF as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, y as parseGitRemoteUrl, U as postPrComment, a2 as postReleaseToSlack, ae as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, P as publishPackage, f as publishSafetyCheck, B as pushCommitAndTags, V as readPackageJson, X as readPackages, r as release, ab as resolveTags, C as rollbackModifiedFiles, aC as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, ar as updateLernaVersion, w as writeChangelogToFile, ap as writeVersion } from './shared/relizy.DgHrn_Fg.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:process';
4
4
  import '@maz-ui/utils';
@@ -1793,8 +1793,9 @@ function getDefaultConfig() {
1793
1793
  tagBody: "v{{newVersion}}",
1794
1794
  emptyChangelogContent: "No relevant changes for this release",
1795
1795
  twitterMessage: "\u{1F680} {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}",
1796
- slackMessage: void 0
1796
+ slackMessage: void 0,
1797
1797
  // Use rich blocks format by default (no template)
1798
+ changelogTitle: "{{oldVersion}}...{{newVersion}}"
1798
1799
  },
1799
1800
  excludeAuthors: [],
1800
1801
  noAuthors: false,
@@ -2221,7 +2222,7 @@ async function generateMarkDown({
2221
2222
  to
2222
2223
  };
2223
2224
  const versionTitle = updatedConfig.to;
2224
- const changelogTitle = `${updatedConfig.from}...${updatedConfig.to}`;
2225
+ const changelogTitle = (updatedConfig.templates?.changelogTitle || "{{oldVersion}}...{{newVersion}}").replace("{{oldVersion}}", updatedConfig.from).replace("{{newVersion}}", updatedConfig.to).replace("{{date}}", (/* @__PURE__ */ new Date()).toISOString().split("T")[0]);
2225
2226
  markdown.push("", `## ${changelogTitle}`, "");
2226
2227
  if (updatedConfig.repo && updatedConfig.from && versionTitle && !minify) {
2227
2228
  const formattedCompareLink = formatCompareChanges(versionTitle, {
@@ -2509,13 +2510,16 @@ async function githubIndependentMode({
2509
2510
  };
2510
2511
  logger.debug(`Creating release for ${to}${release.prerelease ? " (prerelease)" : ""}`);
2511
2512
  if (dryRun) {
2512
- logger.info(`[dry-run] Publish GitHub release for ${to}`);
2513
+ logger.info(`[dry-run] Publish GitHub release for ${release.tag_name}`);
2513
2514
  postedReleases.push({
2514
2515
  name: pkg.name,
2515
2516
  tag: release.tag_name,
2516
2517
  version: newVersion,
2517
2518
  prerelease: release.prerelease
2518
2519
  });
2520
+ logger.box("[dry-run] Release Preview", `Tag: ${release.tag_name}
2521
+
2522
+ ${releaseBody}`);
2519
2523
  } else {
2520
2524
  logger.debug(`Publishing release ${to} to GitHub...`);
2521
2525
  await createGithubRelease({
@@ -2576,6 +2580,9 @@ async function githubUnified({
2576
2580
  }));
2577
2581
  if (dryRun) {
2578
2582
  logger.info("[dry-run] Publish GitHub release for", release.tag_name);
2583
+ logger.box("[dry-run] Release Preview", `Tag: ${release.tag_name}
2584
+
2585
+ ${releaseBody}`);
2579
2586
  } else {
2580
2587
  logger.debug("Publishing release to GitHub...");
2581
2588
  const releaseConfig = {
@@ -2763,7 +2770,10 @@ async function gitlabIndependentMode({
2763
2770
  };
2764
2771
  logger.debug(`Creating release for ${to} (ref: ${release.ref})`);
2765
2772
  if (dryRun) {
2766
- logger.info(`[dry-run] Publish GitLab release for ${to}`);
2773
+ logger.info(`[dry-run] Publish GitLab release for ${release.tag_name}`);
2774
+ logger.box("[dry-run] Release Preview", `Tag: ${release.tag_name}
2775
+
2776
+ ${releaseBody}`);
2767
2777
  } else {
2768
2778
  logger.debug(`Publishing release ${to} to GitLab...`);
2769
2779
  await createGitlabRelease({
@@ -2822,7 +2832,10 @@ async function gitlabUnified({
2822
2832
  ref: release.ref
2823
2833
  }));
2824
2834
  if (dryRun) {
2825
- logger.info("[dry-run] Publish GitLab release for", release.tag_name);
2835
+ logger.info(`[dry-run] Publish GitLab release for ${release.tag_name}`);
2836
+ logger.box("[dry-run] Release Preview", `Tag: ${release.tag_name}
2837
+
2838
+ ${releaseBody}`);
2826
2839
  } else {
2827
2840
  logger.debug("Publishing release to GitLab...");
2828
2841
  await createGitlabRelease({
@@ -3265,11 +3278,15 @@ async function postPrComment({
3265
3278
  }
3266
3279
  }
3267
3280
 
3268
- function extractChangelogSummary(changelog, maxLength) {
3281
+ function extractChangelogSummary(changelog, { stripBoldMarkers = false, maxLength } = {}) {
3269
3282
  if (changelog.trim() === "") {
3270
3283
  return "";
3271
3284
  }
3272
- const cleaned = changelog.split("\n").filter((line) => !line.startsWith("#")).join("\n").trim();
3285
+ let cleaned = changelog.split("\n").filter((line) => !line.startsWith("#")).join("\n");
3286
+ if (stripBoldMarkers) {
3287
+ cleaned = cleaned.replace(/\*\*([^*]+):\*\*/g, "$1:");
3288
+ }
3289
+ cleaned = cleaned.trim();
3273
3290
  let cleanedResult = cleaned;
3274
3291
  if (cleanedResult.endsWith("?") || cleanedResult.endsWith("!") || cleanedResult.endsWith(".")) {
3275
3292
  cleanedResult = cleanedResult.slice(0, -1);
@@ -3319,7 +3336,7 @@ function formatChangelogForSlack(changelog, maxLength = 500) {
3319
3336
  }
3320
3337
  function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template }) {
3321
3338
  if (template) {
3322
- const summary = extractChangelogSummary(changelog, 500);
3339
+ const summary = extractChangelogSummary(changelog, { maxLength: 500 });
3323
3340
  let message = template.replace("{{projectName}}", projectName).replace("{{newVersion}}", version).replace("{{changelog}}", summary);
3324
3341
  if (releaseUrl) {
3325
3342
  message = message.replace("{{releaseUrl}}", releaseUrl);
@@ -3419,7 +3436,10 @@ async function postReleaseToSlack({
3419
3436
  });
3420
3437
  logger.debug(`Message blocks (${blocks.length} blocks)`);
3421
3438
  if (dryRun) {
3422
- logger.info("[dry-run] Would post to Slack:", JSON.stringify(blocks, null, 2));
3439
+ const preview = blocks.filter((b) => b.type === "header" || b.type === "section").map((b) => b.text?.text ?? "").filter(Boolean).join("\n\n");
3440
+ logger.box(`[dry-run] Slack Post Preview (channel: ${channel})
3441
+
3442
+ ${preview}`);
3423
3443
  return;
3424
3444
  }
3425
3445
  try {
@@ -3488,7 +3508,7 @@ function getTwitterCredentials({ socialCredentials, tokenCredentials }) {
3488
3508
  function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl, postMaxLength }) {
3489
3509
  const MAX_LENGTH = postMaxLength;
3490
3510
  const ELLIPSIS = "...";
3491
- const changelogSummary = extractChangelogSummary(changelog, postMaxLength);
3511
+ const changelogSummary = extractChangelogSummary(changelog, { maxLength: MAX_LENGTH, stripBoldMarkers: true });
3492
3512
  let templateWithValues = template.replace("{{projectName}}", projectName).replace("{{newVersion}}", version);
3493
3513
  if (releaseUrl) {
3494
3514
  templateWithValues = templateWithValues.replace("{{releaseUrl}}", releaseUrl);
@@ -3502,10 +3522,11 @@ function formatTweetMessage({ template, projectName, version, changelog, release
3502
3522
  }
3503
3523
  const templateWithoutChangelog = templateWithValues.replace("{{changelog}}", "");
3504
3524
  const availableForChangelog = MAX_LENGTH - templateWithoutChangelog.length;
3505
- let finalChangelog = changelogSummary;
3506
- if (changelogSummary.length > availableForChangelog) {
3525
+ const escapedChangelog = changelogSummary.replace(/@\b/g, "@\u200B");
3526
+ let finalChangelog = escapedChangelog;
3527
+ if (escapedChangelog.length > availableForChangelog) {
3507
3528
  const maxLength = Math.max(0, availableForChangelog - ELLIPSIS.length);
3508
- finalChangelog = changelogSummary.substring(0, maxLength) + ELLIPSIS;
3529
+ finalChangelog = escapedChangelog.substring(0, maxLength) + ELLIPSIS;
3509
3530
  }
3510
3531
  let message = templateWithValues.replace("{{changelog}}", finalChangelog).trim();
3511
3532
  if (message.length > MAX_LENGTH) {
@@ -3537,7 +3558,9 @@ async function postReleaseToTwitter({
3537
3558
  logger.debug(`Tweet message (${message.length} chars):
3538
3559
  ${message}`);
3539
3560
  if (dryRun) {
3540
- logger.info("[dry-run] Would post tweet:", `"${message}"`);
3561
+ logger.box(`[dry-run] Twitter Post Preview (${message.length}/${postMaxLength} chars)
3562
+
3563
+ ${message}`);
3541
3564
  return;
3542
3565
  }
3543
3566
  try {
@@ -4128,7 +4151,7 @@ async function changelog(options = {}) {
4128
4151
  });
4129
4152
  generatedCount++;
4130
4153
  if (dryRun) {
4131
- logger.info(`[dry-run] ${pkg.name}: changelog generated:
4154
+ logger.box(`[dry-run] ${pkg.name}: Changelog Preview:
4132
4155
 
4133
4156
  ${changelog2}`);
4134
4157
  } else {
@@ -5046,7 +5069,11 @@ async function release(options = {}) {
5046
5069
  await releaseSafetyCheck({ config, provider: options.provider });
5047
5070
  try {
5048
5071
  await executeHook("before:release", config, dryRun);
5049
- logger.box("Bump versions", `preid: ${config.bump.preid}`, `options: ${options.preid}`);
5072
+ logger.box(
5073
+ "Bump versions",
5074
+ `- type: ${config.bump.type}`,
5075
+ ...config.bump.preid ? [`- preid: ${config.bump.preid}`] : []
5076
+ );
5050
5077
  const bumpResult = await bump({
5051
5078
  type: config.bump.type,
5052
5079
  preid: config.bump.preid,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.2.1",
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",
@@ -67,39 +67,39 @@
67
67
  }
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/prompts": "^8.2.1",
70
+ "@inquirer/prompts": "^8.3.0",
71
71
  "@maz-ui/node": "4.6.1",
72
- "@maz-ui/utils": "^4.7.0",
72
+ "@maz-ui/utils": "^4.7.4",
73
73
  "c12": "^3.3.3",
74
74
  "changelogen": "^0.6.2",
75
75
  "commander": "^14.0.3",
76
76
  "convert-gitmoji": "^0.1.5",
77
- "defu": "^6.1.4",
77
+ "defu": "6.1.4",
78
78
  "fast-glob": "^3.3.2",
79
79
  "node-fetch-native": "^1.6.7",
80
80
  "semver": "^7.7.4"
81
81
  },
82
82
  "devDependencies": {
83
- "@commitlint/cli": "^20.4.2",
84
- "@commitlint/config-conventional": "^20.4.2",
85
- "@commitlint/cz-commitlint": "^20.4.1",
86
- "@commitlint/types": "^20.4.0",
83
+ "@commitlint/cli": "^20.4.4",
84
+ "@commitlint/config-conventional": "20.4.4",
85
+ "@commitlint/cz-commitlint": "^20.4.4",
86
+ "@commitlint/types": "^20.4.4",
87
87
  "@maz-ui/eslint-config": "^4.7.0",
88
- "@slack/web-api": "^7.14.1",
89
- "@types/node": "^25.3.0",
88
+ "@slack/web-api": "7.15.0",
89
+ "@types/node": "^25.5.0",
90
90
  "@types/semver": "^7.7.1",
91
- "@vitest/coverage-v8": "^4.0.18",
92
- "cross-env": "^10.1.0",
91
+ "@vitest/coverage-v8": "^4.1.0",
92
+ "cross-env": "10.1.0",
93
93
  "eslint": "^9.39.2",
94
- "husky": "^9.1.7",
95
- "jiti": "^2.6.1",
96
- "lint-staged": "^16.2.7",
97
- "memfs": "^4.56.10",
94
+ "husky": "9.1.7",
95
+ "jiti": "2.6.1",
96
+ "lint-staged": "^16.4.0",
97
+ "memfs": "^4.56.11",
98
98
  "tsx": "^4.21.0",
99
99
  "twitter-api-v2": "^1.29.0",
100
100
  "typescript": "^5.9.3",
101
101
  "unbuild": "^3.6.1",
102
- "vitest": "^4.0.18"
102
+ "vitest": "^4.1.0"
103
103
  },
104
104
  "lint-staged": {
105
105
  "*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [