relizy 1.0.0-beta.1 → 1.0.0-beta.3
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 +1 -1
- package/dist/index.d.mts +20 -8
- package/dist/index.d.ts +20 -8
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.Bpj1yhpn.mjs → relizy.DztEySZj.mjs} +66 -45
- package/package.json +11 -12
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.
|
|
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.DztEySZj.mjs';
|
|
9
9
|
import 'changelogen';
|
|
10
10
|
import 'fast-glob';
|
|
11
11
|
import '@inquirer/prompts';
|
package/dist/index.d.mts
CHANGED
|
@@ -70,6 +70,7 @@ declare function getDefaultConfig(): {
|
|
|
70
70
|
twitter: {
|
|
71
71
|
enabled: false;
|
|
72
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
|
|
@@ -1047,14 +1049,19 @@ interface TwitterSocialConfig {
|
|
|
1047
1049
|
onlyStable?: boolean;
|
|
1048
1050
|
/**
|
|
1049
1051
|
* Custom message template
|
|
1050
|
-
* Available variables: {{projectName}}, {{
|
|
1051
|
-
* @default '🚀 {{projectName}} {{
|
|
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}}, {{
|
|
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}}, {{
|
|
1206
|
-
* @default '🚀 {{projectName}} {{
|
|
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}}, {{
|
|
1223
|
+
* Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
|
|
1212
1224
|
* @default undefined
|
|
1213
1225
|
*/
|
|
1214
1226
|
slackMessage?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ declare function getDefaultConfig(): {
|
|
|
70
70
|
twitter: {
|
|
71
71
|
enabled: false;
|
|
72
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
|
|
@@ -1047,14 +1049,19 @@ interface TwitterSocialConfig {
|
|
|
1047
1049
|
onlyStable?: boolean;
|
|
1048
1050
|
/**
|
|
1049
1051
|
* Custom message template
|
|
1050
|
-
* Available variables: {{projectName}}, {{
|
|
1051
|
-
* @default '🚀 {{projectName}} {{
|
|
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}}, {{
|
|
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}}, {{
|
|
1206
|
-
* @default '🚀 {{projectName}} {{
|
|
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}}, {{
|
|
1223
|
+
* Available variables: {{projectName}}, {{newVersion}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
|
|
1212
1224
|
* @default undefined
|
|
1213
1225
|
*/
|
|
1214
1226
|
slackMessage?: string;
|
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.
|
|
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.DztEySZj.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}} {{
|
|
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
|
},
|
|
@@ -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
|
|
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("{{
|
|
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 {
|
|
@@ -3056,10 +3057,14 @@ function getTwitterCredentials({ socialCredentials, tokenCredentials }) {
|
|
|
3056
3057
|
if (!apiKey || !apiKeySecret || !accessToken || !accessTokenSecret) {
|
|
3057
3058
|
logger.warn("Twitter is enabled but credentials are missing.");
|
|
3058
3059
|
logger.log("Set the following environment variables or configure them in social.twitter.credentials or tokens.twitter:");
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3060
|
+
if (!apiKey)
|
|
3061
|
+
logger.log(" - TWITTER_API_KEY or RELIZY_TWITTER_API_KEY");
|
|
3062
|
+
if (!apiKeySecret)
|
|
3063
|
+
logger.log(" - TWITTER_API_KEY_SECRET or RELIZY_TWITTER_API_KEY_SECRET");
|
|
3064
|
+
if (!accessToken)
|
|
3065
|
+
logger.log(" - TWITTER_ACCESS_TOKEN or RELIZY_TWITTER_ACCESS_TOKEN");
|
|
3066
|
+
if (!accessTokenSecret)
|
|
3067
|
+
logger.log(" - TWITTER_ACCESS_TOKEN_SECRET or RELIZY_TWITTER_ACCESS_TOKEN_SECRET");
|
|
3063
3068
|
logger.info("Skipping Twitter post");
|
|
3064
3069
|
return null;
|
|
3065
3070
|
}
|
|
@@ -3070,10 +3075,11 @@ function getTwitterCredentials({ socialCredentials, tokenCredentials }) {
|
|
|
3070
3075
|
accessTokenSecret
|
|
3071
3076
|
};
|
|
3072
3077
|
}
|
|
3073
|
-
function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl }) {
|
|
3074
|
-
const
|
|
3078
|
+
function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl, postMaxLength }) {
|
|
3079
|
+
const MAX_LENGTH = postMaxLength;
|
|
3075
3080
|
const ELLIPSIS = "...";
|
|
3076
|
-
|
|
3081
|
+
const changelogSummary = extractChangelogSummary(changelog, postMaxLength);
|
|
3082
|
+
let templateWithValues = template.replace("{{projectName}}", projectName).replace("{{newVersion}}", version);
|
|
3077
3083
|
if (releaseUrl) {
|
|
3078
3084
|
templateWithValues = templateWithValues.replace("{{releaseUrl}}", releaseUrl);
|
|
3079
3085
|
} else {
|
|
@@ -3085,15 +3091,15 @@ function formatTweetMessage({ template, projectName, version, changelog, release
|
|
|
3085
3091
|
templateWithValues = templateWithValues.replace("{{changelogUrl}}", "");
|
|
3086
3092
|
}
|
|
3087
3093
|
const templateWithoutChangelog = templateWithValues.replace("{{changelog}}", "");
|
|
3088
|
-
const availableForChangelog =
|
|
3089
|
-
let finalChangelog =
|
|
3090
|
-
if (
|
|
3094
|
+
const availableForChangelog = MAX_LENGTH - templateWithoutChangelog.length;
|
|
3095
|
+
let finalChangelog = changelogSummary;
|
|
3096
|
+
if (changelogSummary.length > availableForChangelog) {
|
|
3091
3097
|
const maxLength = Math.max(0, availableForChangelog - ELLIPSIS.length);
|
|
3092
|
-
finalChangelog =
|
|
3098
|
+
finalChangelog = changelogSummary.substring(0, maxLength) + ELLIPSIS;
|
|
3093
3099
|
}
|
|
3094
3100
|
let message = templateWithValues.replace("{{changelog}}", finalChangelog).trim();
|
|
3095
|
-
if (message.length >
|
|
3096
|
-
message = message.substring(0,
|
|
3101
|
+
if (message.length > MAX_LENGTH) {
|
|
3102
|
+
message = message.substring(0, MAX_LENGTH - ELLIPSIS.length) + ELLIPSIS;
|
|
3097
3103
|
}
|
|
3098
3104
|
return message;
|
|
3099
3105
|
}
|
|
@@ -3105,22 +3111,23 @@ async function postReleaseToTwitter({
|
|
|
3105
3111
|
changelogUrl,
|
|
3106
3112
|
credentials,
|
|
3107
3113
|
template,
|
|
3114
|
+
postMaxLength,
|
|
3108
3115
|
dryRun = false
|
|
3109
3116
|
}) {
|
|
3110
3117
|
logger.debug("Preparing Twitter post...");
|
|
3111
|
-
const changelogSummary = extractChangelogSummary(changelog, 150);
|
|
3112
3118
|
const message = formatTweetMessage({
|
|
3113
3119
|
template,
|
|
3114
3120
|
projectName,
|
|
3115
3121
|
version,
|
|
3116
|
-
changelog
|
|
3122
|
+
changelog,
|
|
3117
3123
|
releaseUrl,
|
|
3118
|
-
changelogUrl
|
|
3124
|
+
changelogUrl,
|
|
3125
|
+
postMaxLength
|
|
3119
3126
|
});
|
|
3120
3127
|
logger.debug(`Tweet message (${message.length} chars):
|
|
3121
3128
|
${message}`);
|
|
3122
3129
|
if (dryRun) {
|
|
3123
|
-
logger.info("[dry-run] Would post tweet:", message);
|
|
3130
|
+
logger.info("[dry-run] Would post tweet:", `"${message}"`);
|
|
3124
3131
|
return;
|
|
3125
3132
|
}
|
|
3126
3133
|
try {
|
|
@@ -3482,7 +3489,13 @@ ${packageChangelogs.join("\n\n")}`;
|
|
|
3482
3489
|
changelog: aggregatedChangelog,
|
|
3483
3490
|
dryRun
|
|
3484
3491
|
});
|
|
3485
|
-
|
|
3492
|
+
if (dryRun) {
|
|
3493
|
+
logger.info(`[dry-run] Root package "${rootPackageRead.name}" - ${date} - Changelog:
|
|
3494
|
+
|
|
3495
|
+
${aggregatedChangelog}`);
|
|
3496
|
+
} else {
|
|
3497
|
+
logger.debug("Aggregated root changelog written");
|
|
3498
|
+
}
|
|
3486
3499
|
}
|
|
3487
3500
|
async function generateSimpleRootChangelog({
|
|
3488
3501
|
config,
|
|
@@ -3523,17 +3536,20 @@ async function generateSimpleRootChangelog({
|
|
|
3523
3536
|
dryRun,
|
|
3524
3537
|
newVersion
|
|
3525
3538
|
});
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
logger.
|
|
3539
|
+
writeChangelogToFile({
|
|
3540
|
+
cwd: config.cwd,
|
|
3541
|
+
changelog: rootChangelog,
|
|
3542
|
+
pkg: rootPackage,
|
|
3543
|
+
dryRun
|
|
3544
|
+
});
|
|
3545
|
+
if (dryRun) {
|
|
3546
|
+
logger.info(`[dry-run] Root package "${rootPackage.name}" - ${fromTag}...${to} - Changelog:
|
|
3547
|
+
|
|
3548
|
+
${rootChangelog}`);
|
|
3534
3549
|
} else {
|
|
3535
|
-
logger.debug("
|
|
3550
|
+
logger.debug("Root changelog written");
|
|
3536
3551
|
}
|
|
3552
|
+
return rootChangelog;
|
|
3537
3553
|
}
|
|
3538
3554
|
async function changelog(options = {}) {
|
|
3539
3555
|
const config = await loadRelizyConfig({
|
|
@@ -3598,14 +3614,18 @@ async function changelog(options = {}) {
|
|
|
3598
3614
|
dryRun,
|
|
3599
3615
|
newVersion
|
|
3600
3616
|
});
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3617
|
+
writeChangelogToFile({
|
|
3618
|
+
cwd: config.cwd,
|
|
3619
|
+
pkg,
|
|
3620
|
+
changelog: changelog2,
|
|
3621
|
+
dryRun
|
|
3622
|
+
});
|
|
3623
|
+
generatedCount++;
|
|
3624
|
+
if (dryRun) {
|
|
3625
|
+
logger.info(`[dry-run] ${pkg.name}: changelog generated:
|
|
3626
|
+
|
|
3627
|
+
${changelog2}`);
|
|
3628
|
+
} else {
|
|
3609
3629
|
logger.debug(`${pkg.name}: changelog written`);
|
|
3610
3630
|
}
|
|
3611
3631
|
}
|
|
@@ -3646,7 +3666,7 @@ function providerReleaseSafetyCheck({ config, provider }) {
|
|
|
3646
3666
|
throw new Error(`Unsupported Git provider: ${internalProvider || "unknown"}`);
|
|
3647
3667
|
}
|
|
3648
3668
|
if (!token) {
|
|
3649
|
-
throw new Error(`No token provided for ${internalProvider
|
|
3669
|
+
throw new Error(`No token provided for ${internalProvider} - The release will not be published - Please refer to the documentation: https://louismazel.github.io/relizy/guide/installation#environment-setup`);
|
|
3650
3670
|
}
|
|
3651
3671
|
logger.info("provider release config checked successfully");
|
|
3652
3672
|
}
|
|
@@ -3759,6 +3779,8 @@ async function publishSafetyCheck({ config }) {
|
|
|
3759
3779
|
} catch (error) {
|
|
3760
3780
|
throw new Error("Failed to authenticate to package registry", { cause: error });
|
|
3761
3781
|
}
|
|
3782
|
+
} else {
|
|
3783
|
+
logger.debug(`Skipping authentication to package registry because "${packageManager}" is not supported`);
|
|
3762
3784
|
}
|
|
3763
3785
|
}
|
|
3764
3786
|
async function publish(options = {}) {
|
|
@@ -3941,17 +3963,16 @@ async function handleTwitterPost({
|
|
|
3941
3963
|
const changelogUrl = config.social?.changelogUrl;
|
|
3942
3964
|
logger.debug(`Changelog URL: ${changelogUrl || "none"}`);
|
|
3943
3965
|
logger.debug(`Changelog generated (${changelog.length} chars)`);
|
|
3944
|
-
const changelogSummary = extractChangelogSummary(changelog, 150);
|
|
3945
|
-
logger.debug(`Changelog summary: ${changelogSummary.substring(0, 50)}...`);
|
|
3946
3966
|
const response = await postReleaseToTwitter({
|
|
3947
3967
|
template: config.social.twitter.template || config.templates.twitterMessage,
|
|
3948
3968
|
version: newVersion,
|
|
3949
3969
|
projectName: rootPackageBase.name,
|
|
3950
|
-
changelog
|
|
3970
|
+
changelog,
|
|
3951
3971
|
releaseUrl,
|
|
3952
3972
|
changelogUrl,
|
|
3953
3973
|
credentials,
|
|
3954
|
-
dryRun
|
|
3974
|
+
dryRun,
|
|
3975
|
+
postMaxLength: config.social.twitter.postMaxLength
|
|
3955
3976
|
});
|
|
3956
3977
|
await executeHook("success:twitter", config, dryRun);
|
|
3957
3978
|
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.
|
|
4
|
+
"version": "1.0.0-beta.3",
|
|
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,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@inquirer/prompts": "^8.
|
|
70
|
+
"@inquirer/prompts": "^8.2.0",
|
|
71
71
|
"@maz-ui/node": "4.3.4-beta.0",
|
|
72
72
|
"@maz-ui/utils": "^4.3.0",
|
|
73
73
|
"c12": "^3.3.3",
|
|
@@ -80,25 +80,25 @@
|
|
|
80
80
|
"semver": "^7.7.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@commitlint/cli": "^20.
|
|
84
|
-
"@commitlint/config-conventional": "^20.
|
|
85
|
-
"@commitlint/cz-commitlint": "^20.
|
|
86
|
-
"@commitlint/types": "^20.
|
|
83
|
+
"@commitlint/cli": "^20.3.1",
|
|
84
|
+
"@commitlint/config-conventional": "^20.3.1",
|
|
85
|
+
"@commitlint/cz-commitlint": "^20.3.1",
|
|
86
|
+
"@commitlint/types": "^20.3.1",
|
|
87
87
|
"@maz-ui/eslint-config": "4.3.2",
|
|
88
88
|
"@slack/web-api": "^7.12.0",
|
|
89
|
-
"@types/node": "^25.0.
|
|
89
|
+
"@types/node": "^25.0.9",
|
|
90
90
|
"@types/semver": "^7.7.1",
|
|
91
|
-
"@vitest/coverage-v8": "^4.0.
|
|
91
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
92
92
|
"cross-env": "^10.1.0",
|
|
93
93
|
"eslint": "^9.39.2",
|
|
94
94
|
"husky": "^9.1.7",
|
|
95
95
|
"jiti": "^2.6.1",
|
|
96
96
|
"lint-staged": "^16.2.7",
|
|
97
|
-
"memfs": "^4.
|
|
98
|
-
"twitter-api-v2": "^1.
|
|
97
|
+
"memfs": "^4.56.2",
|
|
98
|
+
"twitter-api-v2": "^1.29.0",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
100
|
"unbuild": "^3.6.1",
|
|
101
|
-
"vitest": "^4.0.
|
|
101
|
+
"vitest": "^4.0.17"
|
|
102
102
|
},
|
|
103
103
|
"lint-staged": {
|
|
104
104
|
"*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [
|
|
@@ -106,7 +106,6 @@
|
|
|
106
106
|
]
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
|
-
"preinstall": "npx only-allow pnpm",
|
|
110
109
|
"build": "unbuild",
|
|
111
110
|
"dev": "unbuild --stub",
|
|
112
111
|
"relizy": "node bin/relizy.mjs",
|