relizy 1.0.0-beta.0 → 1.0.0-beta.2

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/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  <p>
12
12
  <a href="https://codecov.io/gh/LouisMazel/relizy">
13
- <img src="https://codecov.io/gh/LouisMazel/relizy/branch/main/graph/badge.svg?token=YOUR_TOKEN_HERE" alt="codecov" />
13
+ <img src="https://codecov.io/gh/LouisMazel/relizy/graph/badge.svg?token=KLWVQUN37O" alt="codecov" />
14
14
  </a>
15
15
  <a href="https://github.com/LouisMazel/relizy/actions/workflows/test-unit.yml">
16
16
  <img src="https://github.com/LouisMazel/relizy/actions/workflows/test-unit.yml/badge.svg" alt="Unit Tests" />
@@ -29,6 +29,8 @@
29
29
 
30
30
  ---
31
31
 
32
+ ![Relizy Illustration](./resources/relizy-illustration.jpeg)
33
+
32
34
  Seamless and automated release manager with elegant changelog generation based on Conventional Commits, supporting both monorepos and single packages. Handles version bumping, changelog generation, Git tagging, and publishing to npm, GitHub & GitLab effortlessly.
33
35
 
34
36
  ## 🎯 Why use this tool?
@@ -240,7 +242,7 @@ When submitting a PR:
240
242
 
241
243
  1. Ensure all tests pass (`pnpm test:unit`)
242
244
  2. Check TypeScript types (`pnpm typecheck`)
243
- 3. Lint your code (`pnpm lint`)
245
+ 3. Lint your code (`pnpm lint:all`)
244
246
  4. Add tests for new features
245
247
  5. Maintain or improve code coverage (Codecov will comment on your PR)
246
248
 
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 { a7 as isInCI, a8 as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, f as social, r as release } from './shared/relizy.C2HlcnZB.mjs';
8
+ import { a7 as isInCI, a8 as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, f as social, r as release } from './shared/relizy.H6UfHwti.mjs';
9
9
  import 'changelogen';
10
10
  import 'fast-glob';
11
11
  import '@inquirer/prompts';
package/dist/index.d.mts CHANGED
@@ -68,8 +68,9 @@ declare function getDefaultConfig(): {
68
68
  release: Required<ReleaseConfig>;
69
69
  social: {
70
70
  twitter: {
71
- enabled: boolean;
72
- onlyStable: boolean;
71
+ enabled: false;
72
+ onlyStable: true;
73
+ postMaxLength: number;
73
74
  };
74
75
  slack: {
75
76
  enabled: boolean;
@@ -331,15 +332,16 @@ declare function getTwitterCredentials({ socialCredentials, tokenCredentials }:
331
332
  socialCredentials?: TwitterCredentials;
332
333
  tokenCredentials?: TwitterCredentials;
333
334
  }): ResolvedTwitterCredentials | null;
334
- declare function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl }: {
335
+ declare function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl, postMaxLength }: {
335
336
  template: string;
336
337
  projectName: string;
337
338
  version: string;
338
339
  changelog: string;
339
340
  releaseUrl?: string;
340
341
  changelogUrl?: string;
342
+ postMaxLength: number;
341
343
  }): string;
342
- declare function postReleaseToTwitter({ version, projectName, changelog, releaseUrl, changelogUrl, credentials, template, dryRun, }: TwitterOptions): Promise<twitter_api_v2.TweetV2PostTweetResult | undefined>;
344
+ declare function postReleaseToTwitter({ version, projectName, changelog, releaseUrl, changelogUrl, credentials, template, postMaxLength, dryRun, }: TwitterOptions): Promise<twitter_api_v2.TweetV2PostTweetResult | undefined>;
343
345
 
344
346
  /**
345
347
  * Execute a hook
@@ -800,7 +802,7 @@ interface ProviderReleaseOptions {
800
802
  dryRun?: boolean;
801
803
  /**
802
804
  * Skip safety check
803
- * @default false
805
+ * @default true
804
806
  */
805
807
  safetyCheck?: boolean;
806
808
  /**
@@ -846,7 +848,7 @@ interface SocialOptions {
846
848
  dryRun?: boolean;
847
849
  /**
848
850
  * Skip safety check
849
- * @default false
851
+ * @default true
850
852
  */
851
853
  safetyCheck?: boolean;
852
854
  }
@@ -885,7 +887,7 @@ type PublishConfig = ChangelogConfig$1['publish'] & {
885
887
  token?: string;
886
888
  /**
887
889
  * Skip safety check
888
- * @default false
890
+ * @default true
889
891
  */
890
892
  safetyCheck?: boolean;
891
893
  };
@@ -1047,14 +1049,19 @@ interface TwitterSocialConfig {
1047
1049
  onlyStable?: boolean;
1048
1050
  /**
1049
1051
  * Custom message template
1050
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1051
- * @default '🚀 {{projectName}} {{version}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1052
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1053
+ * @default '🚀 {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1052
1054
  */
1053
1055
  template?: string;
1054
1056
  /**
1055
1057
  * Twitter credentials (optional - falls back to environment variables)
1056
1058
  */
1057
1059
  credentials?: TwitterCredentials;
1060
+ /**
1061
+ * Maximum length of the tweet
1062
+ * @default 280
1063
+ */
1064
+ postMaxLength?: number;
1058
1065
  }
1059
1066
  interface SlackCredentials {
1060
1067
  /**
@@ -1081,7 +1088,7 @@ interface SlackSocialConfig {
1081
1088
  channel: string;
1082
1089
  /**
1083
1090
  * Custom message template
1084
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1091
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1085
1092
  */
1086
1093
  template?: string;
1087
1094
  /**
@@ -1143,6 +1150,11 @@ interface TwitterOptions {
1143
1150
  * @default false
1144
1151
  */
1145
1152
  dryRun?: boolean;
1153
+ /**
1154
+ * Maximum length of the tweet
1155
+ * @default 280
1156
+ */
1157
+ postMaxLength: number;
1146
1158
  }
1147
1159
  interface SlackOptions {
1148
1160
  /**
@@ -1202,13 +1214,13 @@ interface TemplatesConfig {
1202
1214
  emptyChangelogContent?: string;
1203
1215
  /**
1204
1216
  * Twitter message template
1205
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1206
- * @default '🚀 {{projectName}} {{version}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1217
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1218
+ * @default '🚀 {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1207
1219
  */
1208
1220
  twitterMessage?: string;
1209
1221
  /**
1210
1222
  * Slack message template (optional - if not provided, uses rich blocks format)
1211
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1223
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1212
1224
  * @default undefined
1213
1225
  */
1214
1226
  slackMessage?: string;
@@ -1350,7 +1362,7 @@ interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templ
1350
1362
  */
1351
1363
  logLevel?: LogLevel;
1352
1364
  /**
1353
- * The safety check will verify if tokens or others required for release are set (depends on the release options)
1365
+ * Global safety check. The safety check will verify if tokens or others required for release are set (depends on the release options)
1354
1366
  * @default true
1355
1367
  */
1356
1368
  safetyCheck?: boolean;
package/dist/index.d.ts CHANGED
@@ -68,8 +68,9 @@ declare function getDefaultConfig(): {
68
68
  release: Required<ReleaseConfig>;
69
69
  social: {
70
70
  twitter: {
71
- enabled: boolean;
72
- onlyStable: boolean;
71
+ enabled: false;
72
+ onlyStable: true;
73
+ postMaxLength: number;
73
74
  };
74
75
  slack: {
75
76
  enabled: boolean;
@@ -331,15 +332,16 @@ declare function getTwitterCredentials({ socialCredentials, tokenCredentials }:
331
332
  socialCredentials?: TwitterCredentials;
332
333
  tokenCredentials?: TwitterCredentials;
333
334
  }): ResolvedTwitterCredentials | null;
334
- declare function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl }: {
335
+ declare function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl, postMaxLength }: {
335
336
  template: string;
336
337
  projectName: string;
337
338
  version: string;
338
339
  changelog: string;
339
340
  releaseUrl?: string;
340
341
  changelogUrl?: string;
342
+ postMaxLength: number;
341
343
  }): string;
342
- declare function postReleaseToTwitter({ version, projectName, changelog, releaseUrl, changelogUrl, credentials, template, dryRun, }: TwitterOptions): Promise<twitter_api_v2.TweetV2PostTweetResult | undefined>;
344
+ declare function postReleaseToTwitter({ version, projectName, changelog, releaseUrl, changelogUrl, credentials, template, postMaxLength, dryRun, }: TwitterOptions): Promise<twitter_api_v2.TweetV2PostTweetResult | undefined>;
343
345
 
344
346
  /**
345
347
  * Execute a hook
@@ -800,7 +802,7 @@ interface ProviderReleaseOptions {
800
802
  dryRun?: boolean;
801
803
  /**
802
804
  * Skip safety check
803
- * @default false
805
+ * @default true
804
806
  */
805
807
  safetyCheck?: boolean;
806
808
  /**
@@ -846,7 +848,7 @@ interface SocialOptions {
846
848
  dryRun?: boolean;
847
849
  /**
848
850
  * Skip safety check
849
- * @default false
851
+ * @default true
850
852
  */
851
853
  safetyCheck?: boolean;
852
854
  }
@@ -885,7 +887,7 @@ type PublishConfig = ChangelogConfig$1['publish'] & {
885
887
  token?: string;
886
888
  /**
887
889
  * Skip safety check
888
- * @default false
890
+ * @default true
889
891
  */
890
892
  safetyCheck?: boolean;
891
893
  };
@@ -1047,14 +1049,19 @@ interface TwitterSocialConfig {
1047
1049
  onlyStable?: boolean;
1048
1050
  /**
1049
1051
  * Custom message template
1050
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1051
- * @default '🚀 {{projectName}} {{version}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1052
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1053
+ * @default '🚀 {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1052
1054
  */
1053
1055
  template?: string;
1054
1056
  /**
1055
1057
  * Twitter credentials (optional - falls back to environment variables)
1056
1058
  */
1057
1059
  credentials?: TwitterCredentials;
1060
+ /**
1061
+ * Maximum length of the tweet
1062
+ * @default 280
1063
+ */
1064
+ postMaxLength?: number;
1058
1065
  }
1059
1066
  interface SlackCredentials {
1060
1067
  /**
@@ -1081,7 +1088,7 @@ interface SlackSocialConfig {
1081
1088
  channel: string;
1082
1089
  /**
1083
1090
  * Custom message template
1084
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1091
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1085
1092
  */
1086
1093
  template?: string;
1087
1094
  /**
@@ -1143,6 +1150,11 @@ interface TwitterOptions {
1143
1150
  * @default false
1144
1151
  */
1145
1152
  dryRun?: boolean;
1153
+ /**
1154
+ * Maximum length of the tweet
1155
+ * @default 280
1156
+ */
1157
+ postMaxLength: number;
1146
1158
  }
1147
1159
  interface SlackOptions {
1148
1160
  /**
@@ -1202,13 +1214,13 @@ interface TemplatesConfig {
1202
1214
  emptyChangelogContent?: string;
1203
1215
  /**
1204
1216
  * Twitter message template
1205
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1206
- * @default '🚀 {{projectName}} {{version}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1217
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1218
+ * @default '🚀 {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'
1207
1219
  */
1208
1220
  twitterMessage?: string;
1209
1221
  /**
1210
1222
  * Slack message template (optional - if not provided, uses rich blocks format)
1211
- * Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1223
+ * Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
1212
1224
  * @default undefined
1213
1225
  */
1214
1226
  slackMessage?: string;
@@ -1350,7 +1362,7 @@ interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templ
1350
1362
  */
1351
1363
  logLevel?: LogLevel;
1352
1364
  /**
1353
- * The safety check will verify if tokens or others required for release are set (depends on the release options)
1365
+ * Global safety check. The safety check will verify if tokens or others required for release are set (depends on the release options)
1354
1366
  * @default true
1355
1367
  */
1356
1368
  safetyCheck?: boolean;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { b as bump, c as changelog, o as checkGitStatusIfDirty, ar as confirmBump, y as createCommitAndTags, F as createGitlabRelease, i as defineConfig, u as detectGitProvider, H as detectPackageManager, I as determinePublishTag, af as determineReleaseType, ae as determineSemverChange, aa as executeBuildCmd, a9 as executeFormatCmd, a6 as executeHook, m as expandPackagesToBumpWithDependents, X as extractChangelogSummary, aj as extractVersionFromPackageTag, au as extractVersionFromTag, q as fetchGitTags, U as formatChangelogForSlack, V as formatSlackMessage, a4 as formatTweetMessage, g as generateChangelog, L as getAuthCommand, as as getBumpedIndependentPackages, aq as getBumpedPackageIndependently, a8 as getCIName, C as getCurrentGitBranch, D as getCurrentGitRef, h as getDefaultConfig, k as getDependentsOf, B as getFirstCommit, n as getGitStatus, Z as getIndependentTag, a1 as getLastPackageTag, a0 as getLastRepoTag, _ as getLastStableTag, $ as getLastTag, x as getModifiedReleaseFilePatterns, R as getPackageCommits, j as getPackageDependencies, ah as getPackageNewVersion, Q as getPackages, ac as getPackagesOrBumpedPackages, K as getPackagesToPublishInIndependentMode, J as getPackagesToPublishInSelectiveMode, ao as getPreid, Y as getReleaseUrl, O as getRootPackage, T as getSlackToken, a3 as getTwitterCredentials, E as github, G as gitlab, S as hasLernaJson, ab as isBumpedPackage, ap as isChangedPreid, an as isGraduating, ad as isGraduatingToStableBetweenVersion, a7 as isInCI, ak as isPrerelease, am as isPrereleaseReleaseType, al as isStableReleaseType, av as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, v as parseGitRemoteUrl, W as postReleaseToSlack, a5 as postReleaseToTwitter, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, M as publishPackage, d as publishSafetyCheck, z as pushCommitAndTags, N as readPackageJson, P as readPackages, r as release, a2 as resolveTags, A as rollbackModifiedFiles, at as shouldFilterPrereleaseTags, f as social, s as socialSafetyCheck, t as topologicalSort, ai as updateLernaVersion, w as writeChangelogToFile, ag as writeVersion } from './shared/relizy.C2HlcnZB.mjs';
1
+ export { b as bump, c as changelog, o as checkGitStatusIfDirty, ar as confirmBump, y as createCommitAndTags, F as createGitlabRelease, i as defineConfig, u as detectGitProvider, H as detectPackageManager, I as determinePublishTag, af as determineReleaseType, ae as determineSemverChange, aa as executeBuildCmd, a9 as executeFormatCmd, a6 as executeHook, m as expandPackagesToBumpWithDependents, X as extractChangelogSummary, aj as extractVersionFromPackageTag, au as extractVersionFromTag, q as fetchGitTags, U as formatChangelogForSlack, V as formatSlackMessage, a4 as formatTweetMessage, g as generateChangelog, L as getAuthCommand, as as getBumpedIndependentPackages, aq as getBumpedPackageIndependently, a8 as getCIName, C as getCurrentGitBranch, D as getCurrentGitRef, h as getDefaultConfig, k as getDependentsOf, B as getFirstCommit, n as getGitStatus, Z as getIndependentTag, a1 as getLastPackageTag, a0 as getLastRepoTag, _ as getLastStableTag, $ as getLastTag, x as getModifiedReleaseFilePatterns, R as getPackageCommits, j as getPackageDependencies, ah as getPackageNewVersion, Q as getPackages, ac as getPackagesOrBumpedPackages, K as getPackagesToPublishInIndependentMode, J as getPackagesToPublishInSelectiveMode, ao as getPreid, Y as getReleaseUrl, O as getRootPackage, T as getSlackToken, a3 as getTwitterCredentials, E as github, G as gitlab, S as hasLernaJson, ab as isBumpedPackage, ap as isChangedPreid, an as isGraduating, ad as isGraduatingToStableBetweenVersion, a7 as isInCI, ak as isPrerelease, am as isPrereleaseReleaseType, al as isStableReleaseType, av as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, v as parseGitRemoteUrl, W as postReleaseToSlack, a5 as postReleaseToTwitter, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, M as publishPackage, d as publishSafetyCheck, z as pushCommitAndTags, N as readPackageJson, P as readPackages, r as release, a2 as resolveTags, A as rollbackModifiedFiles, at as shouldFilterPrereleaseTags, f as social, s as socialSafetyCheck, t as topologicalSort, ai as updateLernaVersion, w as writeChangelogToFile, ag as writeVersion } from './shared/relizy.H6UfHwti.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:process';
4
4
  import 'node:fs';
@@ -2008,7 +2008,7 @@ function getDefaultConfig() {
2008
2008
  tagMessage: "Bump version to {{newVersion}}",
2009
2009
  tagBody: "v{{newVersion}}",
2010
2010
  emptyChangelogContent: "No relevant changes for this release",
2011
- twitterMessage: "\u{1F680} {{projectName}} {{version}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}",
2011
+ twitterMessage: "\u{1F680} {{projectName}} {{newVersion}} is out!\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}",
2012
2012
  slackMessage: void 0
2013
2013
  // Use rich blocks format by default (no template)
2014
2014
  },
@@ -2029,7 +2029,7 @@ function getDefaultConfig() {
2029
2029
  args: [],
2030
2030
  token: process$1.env.RELIZY_NPM_TOKEN || process$1.env.NPM_TOKEN || process$1.env.NODE_AUTH_TOKEN,
2031
2031
  registry: "https://registry.npmjs.org/",
2032
- safetyCheck: false
2032
+ safetyCheck: true
2033
2033
  },
2034
2034
  tokens: {
2035
2035
  registry: process$1.env.RELIZY_NPM_TOKEN || process$1.env.NPM_TOKEN || process$1.env.NODE_AUTH_TOKEN,
@@ -2058,7 +2058,8 @@ function getDefaultConfig() {
2058
2058
  social: {
2059
2059
  twitter: {
2060
2060
  enabled: false,
2061
- onlyStable: true
2061
+ onlyStable: true,
2062
+ postMaxLength: 280
2062
2063
  },
2063
2064
  slack: {
2064
2065
  enabled: false,
@@ -2854,7 +2855,7 @@ async function publishPackage({
2854
2855
  }
2855
2856
  }
2856
2857
 
2857
- function extractChangelogSummary(changelog, maxLength = 150) {
2858
+ function extractChangelogSummary(changelog, maxLength) {
2858
2859
  if (changelog.trim() === "") {
2859
2860
  return "";
2860
2861
  }
@@ -2866,7 +2867,7 @@ function extractChangelogSummary(changelog, maxLength = 150) {
2866
2867
  const sentences = cleanedResult.split(/[.!?]\s+/);
2867
2868
  let summary = "";
2868
2869
  for (const sentence of sentences) {
2869
- if ((summary + sentence).length > maxLength || sentence.trim() === "") {
2870
+ if (maxLength && (summary + sentence).length > maxLength || sentence.trim() === "") {
2870
2871
  break;
2871
2872
  }
2872
2873
  summary += `${sentence}. `;
@@ -2909,7 +2910,7 @@ function formatChangelogForSlack(changelog, maxLength = 500) {
2909
2910
  function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template }) {
2910
2911
  if (template) {
2911
2912
  const summary = extractChangelogSummary(changelog, 500);
2912
- let message = template.replace("{{projectName}}", projectName).replace("{{version}}", version).replace("{{changelog}}", summary);
2913
+ let message = template.replace("{{projectName}}", projectName).replace("{{newVersion}}", version).replace("{{changelog}}", summary);
2913
2914
  if (releaseUrl) {
2914
2915
  message = message.replace("{{releaseUrl}}", releaseUrl);
2915
2916
  } else {
@@ -3070,10 +3071,11 @@ function getTwitterCredentials({ socialCredentials, tokenCredentials }) {
3070
3071
  accessTokenSecret
3071
3072
  };
3072
3073
  }
3073
- function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl }) {
3074
- const TWITTER_MAX_LENGTH = 280;
3074
+ function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl, postMaxLength }) {
3075
+ const MAX_LENGTH = postMaxLength;
3075
3076
  const ELLIPSIS = "...";
3076
- let templateWithValues = template.replace("{{projectName}}", projectName).replace("{{version}}", version);
3077
+ const changelogSummary = extractChangelogSummary(changelog, postMaxLength);
3078
+ let templateWithValues = template.replace("{{projectName}}", projectName).replace("{{newVersion}}", version);
3077
3079
  if (releaseUrl) {
3078
3080
  templateWithValues = templateWithValues.replace("{{releaseUrl}}", releaseUrl);
3079
3081
  } else {
@@ -3085,15 +3087,15 @@ function formatTweetMessage({ template, projectName, version, changelog, release
3085
3087
  templateWithValues = templateWithValues.replace("{{changelogUrl}}", "");
3086
3088
  }
3087
3089
  const templateWithoutChangelog = templateWithValues.replace("{{changelog}}", "");
3088
- const availableForChangelog = TWITTER_MAX_LENGTH - templateWithoutChangelog.length;
3089
- let finalChangelog = changelog;
3090
- if (changelog.length > availableForChangelog) {
3090
+ const availableForChangelog = MAX_LENGTH - templateWithoutChangelog.length;
3091
+ let finalChangelog = changelogSummary;
3092
+ if (changelogSummary.length > availableForChangelog) {
3091
3093
  const maxLength = Math.max(0, availableForChangelog - ELLIPSIS.length);
3092
- finalChangelog = changelog.substring(0, maxLength) + ELLIPSIS;
3094
+ finalChangelog = changelogSummary.substring(0, maxLength) + ELLIPSIS;
3093
3095
  }
3094
3096
  let message = templateWithValues.replace("{{changelog}}", finalChangelog).trim();
3095
- if (message.length > TWITTER_MAX_LENGTH) {
3096
- message = message.substring(0, TWITTER_MAX_LENGTH - ELLIPSIS.length) + ELLIPSIS;
3097
+ if (message.length > MAX_LENGTH) {
3098
+ message = message.substring(0, MAX_LENGTH - ELLIPSIS.length) + ELLIPSIS;
3097
3099
  }
3098
3100
  return message;
3099
3101
  }
@@ -3105,22 +3107,23 @@ async function postReleaseToTwitter({
3105
3107
  changelogUrl,
3106
3108
  credentials,
3107
3109
  template,
3110
+ postMaxLength,
3108
3111
  dryRun = false
3109
3112
  }) {
3110
3113
  logger.debug("Preparing Twitter post...");
3111
- const changelogSummary = extractChangelogSummary(changelog, 150);
3112
3114
  const message = formatTweetMessage({
3113
3115
  template,
3114
3116
  projectName,
3115
3117
  version,
3116
- changelog: changelogSummary,
3118
+ changelog,
3117
3119
  releaseUrl,
3118
- changelogUrl
3120
+ changelogUrl,
3121
+ postMaxLength
3119
3122
  });
3120
3123
  logger.debug(`Tweet message (${message.length} chars):
3121
3124
  ${message}`);
3122
3125
  if (dryRun) {
3123
- logger.info("[dry-run] Would post tweet:", message);
3126
+ logger.info("[dry-run] Would post tweet:", `"${message}"`);
3124
3127
  return;
3125
3128
  }
3126
3129
  try {
@@ -3482,7 +3485,13 @@ ${packageChangelogs.join("\n\n")}`;
3482
3485
  changelog: aggregatedChangelog,
3483
3486
  dryRun
3484
3487
  });
3485
- logger.debug("Aggregated root changelog written");
3488
+ if (dryRun) {
3489
+ logger.info(`[dry-run] Root package "${rootPackageRead.name}" - ${date} - Changelog:
3490
+
3491
+ ${aggregatedChangelog}`);
3492
+ } else {
3493
+ logger.debug("Aggregated root changelog written");
3494
+ }
3486
3495
  }
3487
3496
  async function generateSimpleRootChangelog({
3488
3497
  config,
@@ -3523,17 +3532,20 @@ async function generateSimpleRootChangelog({
3523
3532
  dryRun,
3524
3533
  newVersion
3525
3534
  });
3526
- if (rootChangelog) {
3527
- writeChangelogToFile({
3528
- cwd: config.cwd,
3529
- changelog: rootChangelog,
3530
- pkg: rootPackage,
3531
- dryRun
3532
- });
3533
- logger.debug("Root changelog written");
3535
+ writeChangelogToFile({
3536
+ cwd: config.cwd,
3537
+ changelog: rootChangelog,
3538
+ pkg: rootPackage,
3539
+ dryRun
3540
+ });
3541
+ if (dryRun) {
3542
+ logger.info(`[dry-run] Root package "${rootPackage.name}" - ${fromTag}...${to} - Changelog:
3543
+
3544
+ ${rootChangelog}`);
3534
3545
  } else {
3535
- logger.debug("No changelog to generate for root package");
3546
+ logger.debug("Root changelog written");
3536
3547
  }
3548
+ return rootChangelog;
3537
3549
  }
3538
3550
  async function changelog(options = {}) {
3539
3551
  const config = await loadRelizyConfig({
@@ -3598,14 +3610,18 @@ async function changelog(options = {}) {
3598
3610
  dryRun,
3599
3611
  newVersion
3600
3612
  });
3601
- if (changelog2) {
3602
- writeChangelogToFile({
3603
- cwd: config.cwd,
3604
- pkg,
3605
- changelog: changelog2,
3606
- dryRun
3607
- });
3608
- generatedCount++;
3613
+ writeChangelogToFile({
3614
+ cwd: config.cwd,
3615
+ pkg,
3616
+ changelog: changelog2,
3617
+ dryRun
3618
+ });
3619
+ generatedCount++;
3620
+ if (dryRun) {
3621
+ logger.info(`[dry-run] ${pkg.name}: changelog generated:
3622
+
3623
+ ${changelog2}`);
3624
+ } else {
3609
3625
  logger.debug(`${pkg.name}: changelog written`);
3610
3626
  }
3611
3627
  }
@@ -3941,17 +3957,16 @@ async function handleTwitterPost({
3941
3957
  const changelogUrl = config.social?.changelogUrl;
3942
3958
  logger.debug(`Changelog URL: ${changelogUrl || "none"}`);
3943
3959
  logger.debug(`Changelog generated (${changelog.length} chars)`);
3944
- const changelogSummary = extractChangelogSummary(changelog, 150);
3945
- logger.debug(`Changelog summary: ${changelogSummary.substring(0, 50)}...`);
3946
3960
  const response = await postReleaseToTwitter({
3947
3961
  template: config.social.twitter.template || config.templates.twitterMessage,
3948
3962
  version: newVersion,
3949
3963
  projectName: rootPackageBase.name,
3950
- changelog: changelogSummary,
3964
+ changelog,
3951
3965
  releaseUrl,
3952
3966
  changelogUrl,
3953
3967
  credentials,
3954
- dryRun
3968
+ dryRun,
3969
+ postMaxLength: config.social.twitter.postMaxLength
3955
3970
  });
3956
3971
  await executeHook("success:twitter", config, dryRun);
3957
3972
  return { success: true, response };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.0",
4
+ "version": "1.0.0-beta.2",
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",
@@ -106,8 +106,6 @@
106
106
  ]
107
107
  },
108
108
  "scripts": {
109
- "preinstall": "npx only-allow pnpm",
110
- "postinstall": "npx husky",
111
109
  "build": "unbuild",
112
110
  "dev": "unbuild --stub",
113
111
  "relizy": "node bin/relizy.mjs",