relizy 1.8.0 → 1.9.0
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 +14 -6
- package/dist/index.d.mts +162 -11
- package/dist/index.d.ts +162 -11
- package/dist/index.mjs +4 -1
- package/dist/shared/{relizy.BljqIKug.mjs → relizy.CN-7XcP7.mjs} +795 -80
- package/package.json +5 -1
package/dist/cli.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { dirname, join } from 'node:path';
|
|
|
4
4
|
import process from 'node:process';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { printBanner, logger } from '@maz-ui/node';
|
|
7
|
-
import { Command } from 'commander';
|
|
8
|
-
import {
|
|
7
|
+
import { Command, Option } from 'commander';
|
|
8
|
+
import { aJ as isInCI, a0 as getCIName, m as bump, o as changelog, b1 as publish, a$ as providerRelease, bn as social, a_ as prComment, ba as release } from './shared/relizy.CN-7XcP7.mjs';
|
|
9
9
|
import 'node:child_process';
|
|
10
10
|
import '@maz-ui/utils/helpers/formatJson';
|
|
11
11
|
import 'c12';
|
|
@@ -19,6 +19,9 @@ import 'fast-glob';
|
|
|
19
19
|
import '@maz-ui/utils/helpers/upperFirst';
|
|
20
20
|
import 'convert-gitmoji';
|
|
21
21
|
import 'node-fetch-native';
|
|
22
|
+
import 'mdast-util-from-markdown';
|
|
23
|
+
import 'mdast-util-gfm';
|
|
24
|
+
import 'micromark-extension-gfm';
|
|
22
25
|
|
|
23
26
|
const hasSilentFlag = process.argv.includes("--log-level") && process.argv.includes("silent");
|
|
24
27
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
@@ -68,6 +71,9 @@ function getReleaseType(options) {
|
|
|
68
71
|
type = "prepatch";
|
|
69
72
|
return type;
|
|
70
73
|
}
|
|
74
|
+
function slackFormatOption() {
|
|
75
|
+
return new Option("--slack-format <format>", "Slack changelog format, overrides social.slack.changelogFormat").choices(["summary", "full"]);
|
|
76
|
+
}
|
|
71
77
|
program.name("relizy").description("Release management tool for monorepos and standalone packages").version(version).option("--config <name>", "Config file name (without .config.ts - e.g. changelog-test)").option("--no-safety-check", "Skip safety check").option("--log-level <level>", "Set log level (silent, error, warning, normal, default, debug, trace, verbose)", "default").option("--dry-run", "Preview changes without writing files, creating tags, commits or publishing").option("--pr-number <number>", "Override PR/MR number for PR comment features", Number);
|
|
72
78
|
program.command("bump").description("Bump package versions").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--no-clean", "Skip check if the working directory is clean").option("--force", "Bump even if there are no commits").option("--yes", "Skip confirmation prompt about bumping packages").option("--canary", "Publish a canary release from the current commit").option("--include-private", "Include private packages in the bump").action(async (options) => {
|
|
73
79
|
try {
|
|
@@ -146,7 +152,7 @@ program.command("provider-release").description("Publish release to git provider
|
|
|
146
152
|
process.exit(1);
|
|
147
153
|
}
|
|
148
154
|
});
|
|
149
|
-
program.command("social").description("Post release announcements to social media platforms").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--ai", "Force-enable AI for social posts").option("--no-ai", "Force-disable AI for social posts").action(async (options) => {
|
|
155
|
+
program.command("social").description("Post release announcements to social media platforms").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--ai", "Force-enable AI for social posts").option("--no-ai", "Force-disable AI for social posts").addOption(slackFormatOption()).action(async (options) => {
|
|
150
156
|
try {
|
|
151
157
|
await social({
|
|
152
158
|
from: options.from,
|
|
@@ -155,7 +161,8 @@ program.command("social").description("Post release announcements to social medi
|
|
|
155
161
|
logLevel: program.opts().logLevel,
|
|
156
162
|
configName: program.opts().config,
|
|
157
163
|
safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0,
|
|
158
|
-
ai: hasCliFlag("--ai") ? true : hasCliFlag("--no-ai") ? false : void 0
|
|
164
|
+
ai: hasCliFlag("--ai") ? true : hasCliFlag("--no-ai") ? false : void 0,
|
|
165
|
+
slackFormat: options.slackFormat
|
|
159
166
|
});
|
|
160
167
|
} catch {
|
|
161
168
|
process.exit(1);
|
|
@@ -174,7 +181,7 @@ program.command("pr-comment").description("Post or re-post a PR comment with rel
|
|
|
174
181
|
process.exit(1);
|
|
175
182
|
}
|
|
176
183
|
});
|
|
177
|
-
program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-provider-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-git-tag", "Skip tag creation").option("--no-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--no-social", "Skip social media posting").option("--no-pr-comment", "Skip PR comment posting").option("--yes", "Skip confirmation prompt about bumping packages").option("--publish-token <token>", 'NPM token (e.g. "123456") - only supported for pnpm and npm').option("--skip-existing-versions", "Skip packages whose version already exists on the registry instead of failing").option("--canary", "Publish a canary release from the current commit").option("--include-private", "Include private packages in bump and changelog phases").option("--ai", "Force-enable AI for release notes and social posts").option("--no-ai", "Force-disable AI for release notes and social posts").action(async (options) => {
|
|
184
|
+
program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-provider-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-git-tag", "Skip tag creation").option("--no-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--no-social", "Skip social media posting").option("--no-pr-comment", "Skip PR comment posting").option("--yes", "Skip confirmation prompt about bumping packages").option("--publish-token <token>", 'NPM token (e.g. "123456") - only supported for pnpm and npm').option("--skip-existing-versions", "Skip packages whose version already exists on the registry instead of failing").option("--canary", "Publish a canary release from the current commit").option("--include-private", "Include private packages in bump and changelog phases").option("--ai", "Force-enable AI for release notes and social posts").option("--no-ai", "Force-disable AI for release notes and social posts").addOption(slackFormatOption()).action(async (options) => {
|
|
178
185
|
try {
|
|
179
186
|
await release({
|
|
180
187
|
type: getReleaseType(options),
|
|
@@ -211,7 +218,8 @@ program.command("release").description("Complete release workflow (bump + change
|
|
|
211
218
|
social: hasCliFlag("--no-social") ? false : void 0,
|
|
212
219
|
prComment: hasCliFlag("--no-pr-comment") ? false : void 0,
|
|
213
220
|
prNumber: program.opts().prNumber,
|
|
214
|
-
ai: hasCliFlag("--ai") ? true : hasCliFlag("--no-ai") ? false : void 0
|
|
221
|
+
ai: hasCliFlag("--ai") ? true : hasCliFlag("--no-ai") ? false : void 0,
|
|
222
|
+
slackFormat: options.slackFormat
|
|
215
223
|
});
|
|
216
224
|
} catch (error) {
|
|
217
225
|
logger.error("Failed to release -", error);
|
package/dist/index.d.mts
CHANGED
|
@@ -62,7 +62,7 @@ declare function getDefaultConfig(): {
|
|
|
62
62
|
slack: {
|
|
63
63
|
enabled: boolean;
|
|
64
64
|
onlyStable: boolean;
|
|
65
|
-
|
|
65
|
+
changelogFormat: string;
|
|
66
66
|
noAuthors: boolean;
|
|
67
67
|
noPackages: boolean;
|
|
68
68
|
};
|
|
@@ -705,6 +705,17 @@ declare function getSlackToken(options: {
|
|
|
705
705
|
declare function getSlackWebhookUrl(options: {
|
|
706
706
|
socialWebhookUrl?: string;
|
|
707
707
|
}): string | null;
|
|
708
|
+
/** Default changelog budget of the `summary` format. */
|
|
709
|
+
declare const SLACK_SUMMARY_MAX_LENGTH = 2500;
|
|
710
|
+
/**
|
|
711
|
+
* Resolve the changelog budget of a Slack post: `postMaxLength` when set,
|
|
712
|
+
* otherwise 2500 chars in `summary` format and no limit in `full` format
|
|
713
|
+
* (the message is then only bounded by Slack's 50 blocks).
|
|
714
|
+
*/
|
|
715
|
+
declare function resolveSlackPostMaxLength({ changelogFormat, postMaxLength }: {
|
|
716
|
+
changelogFormat?: SlackChangelogFormat;
|
|
717
|
+
postMaxLength?: number;
|
|
718
|
+
}): number | undefined;
|
|
708
719
|
/**
|
|
709
720
|
* Format changelog for Slack (convert markdown to Slack's mrkdwn format)
|
|
710
721
|
*/
|
|
@@ -716,9 +727,14 @@ declare function formatChangelogForSlack(changelog: string, maxLength?: number):
|
|
|
716
727
|
*/
|
|
717
728
|
declare function formatPackagesForSlack(packages: PackageBumpEntry[]): string;
|
|
718
729
|
/**
|
|
719
|
-
* Format the Slack message using blocks
|
|
730
|
+
* Format the Slack message using blocks.
|
|
731
|
+
* - `summary` format: the changelog is a single mrkdwn section (2500 chars by default).
|
|
732
|
+
* - `full` format: the changelog is rendered as rich_text blocks, commit bodies
|
|
733
|
+
* included, split per section. It is bounded by `postMaxLength` when set and
|
|
734
|
+
* always by Slack's limits (50 blocks, ~13,200 chars for rich text messages).
|
|
735
|
+
* Every block is kept within Slack's limits so the post is never rejected.
|
|
720
736
|
*/
|
|
721
|
-
declare function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template, contributors, packages, postMaxLength }: {
|
|
737
|
+
declare function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template, contributors, packages, postMaxLength, changelogFormat }: {
|
|
722
738
|
template?: string;
|
|
723
739
|
projectName: string;
|
|
724
740
|
version: string;
|
|
@@ -728,17 +744,112 @@ declare function formatSlackMessage({ projectName, version, changelog, releaseUr
|
|
|
728
744
|
contributors?: string[];
|
|
729
745
|
packages?: PackageBumpEntry[];
|
|
730
746
|
postMaxLength?: number;
|
|
747
|
+
changelogFormat?: SlackChangelogFormat;
|
|
731
748
|
}): any[];
|
|
732
749
|
/**
|
|
733
750
|
* Post a release announcement to Slack.
|
|
734
751
|
* Dispatches to Incoming Webhook (if `webhookUrl` is set) or Web API (`token` + `channel`).
|
|
735
752
|
* When both are provided, the webhook takes priority.
|
|
736
753
|
*/
|
|
737
|
-
declare function postReleaseToSlack({ version, projectName, changelog, releaseUrl, changelogUrl, channel, token, webhookUrl, template, contributors, packages, postMaxLength, dryRun, }: SlackOptions): Promise<{
|
|
754
|
+
declare function postReleaseToSlack({ version, projectName, changelog, releaseUrl, changelogUrl, channel, token, webhookUrl, template, contributors, packages, postMaxLength, changelogFormat, dryRun, }: SlackOptions): Promise<{
|
|
738
755
|
ok: true;
|
|
739
756
|
transport: "webhook";
|
|
740
757
|
} | _slack_web_api.ChatPostMessageResponse | undefined>;
|
|
741
758
|
|
|
759
|
+
/** Maximum number of blocks in a Slack message. */
|
|
760
|
+
declare const SLACK_MAX_BLOCKS = 50;
|
|
761
|
+
/** Maximum length of the text of a Slack section block. */
|
|
762
|
+
declare const SLACK_SECTION_MAX_LENGTH = 3000;
|
|
763
|
+
/**
|
|
764
|
+
* Soft cap of the text carried by a single rich_text block. Slack documents no
|
|
765
|
+
* limit for rich_text, so the section limit is reused as a conservative bound.
|
|
766
|
+
*/
|
|
767
|
+
declare const SLACK_RICH_TEXT_BLOCK_MAX_LENGTH = 3000;
|
|
768
|
+
/**
|
|
769
|
+
* Budget of the JSON of all the blocks of a message containing rich_text blocks.
|
|
770
|
+
* Slack rejects such messages above ~13,200 characters with `msg_blocks_too_long`
|
|
771
|
+
* (https://github.com/slackapi/bolt-js/issues/2509): measuring the JSON, which is
|
|
772
|
+
* larger than the text Slack counts, keeps a safe margin.
|
|
773
|
+
*/
|
|
774
|
+
declare const SLACK_RICH_TEXT_MESSAGE_MAX_LENGTH = 11000;
|
|
775
|
+
/** Maximum length of the text of a Slack header block. */
|
|
776
|
+
declare const SLACK_HEADER_MAX_LENGTH = 150;
|
|
777
|
+
interface SlackRichTextStyle {
|
|
778
|
+
bold?: boolean;
|
|
779
|
+
italic?: boolean;
|
|
780
|
+
strike?: boolean;
|
|
781
|
+
code?: boolean;
|
|
782
|
+
}
|
|
783
|
+
interface SlackRichTextText {
|
|
784
|
+
type: 'text';
|
|
785
|
+
text: string;
|
|
786
|
+
style?: SlackRichTextStyle;
|
|
787
|
+
}
|
|
788
|
+
interface SlackRichTextLink {
|
|
789
|
+
type: 'link';
|
|
790
|
+
url: string;
|
|
791
|
+
text?: string;
|
|
792
|
+
style?: SlackRichTextStyle;
|
|
793
|
+
}
|
|
794
|
+
type SlackRichTextInline = SlackRichTextText | SlackRichTextLink;
|
|
795
|
+
interface SlackRichTextSection {
|
|
796
|
+
type: 'rich_text_section';
|
|
797
|
+
elements: SlackRichTextInline[];
|
|
798
|
+
}
|
|
799
|
+
interface SlackRichTextList {
|
|
800
|
+
type: 'rich_text_list';
|
|
801
|
+
style: 'bullet' | 'ordered';
|
|
802
|
+
indent?: number;
|
|
803
|
+
offset?: number;
|
|
804
|
+
elements: SlackRichTextSection[];
|
|
805
|
+
}
|
|
806
|
+
interface SlackRichTextQuote {
|
|
807
|
+
type: 'rich_text_quote';
|
|
808
|
+
elements: SlackRichTextInline[];
|
|
809
|
+
}
|
|
810
|
+
interface SlackRichTextPreformatted {
|
|
811
|
+
type: 'rich_text_preformatted';
|
|
812
|
+
elements: SlackRichTextInline[];
|
|
813
|
+
}
|
|
814
|
+
type SlackRichTextElement = SlackRichTextSection | SlackRichTextList | SlackRichTextQuote | SlackRichTextPreformatted;
|
|
815
|
+
interface SlackRichTextBlock {
|
|
816
|
+
type: 'rich_text';
|
|
817
|
+
elements: SlackRichTextElement[];
|
|
818
|
+
}
|
|
819
|
+
/** Cut a text without splitting a UTF-16 surrogate pair (emoji), which Slack would render broken. */
|
|
820
|
+
declare function sliceSlackText(text: string, length: number): string;
|
|
821
|
+
/**
|
|
822
|
+
* Render a markdown changelog as Slack mrkdwn.
|
|
823
|
+
* When `maxLength` is exceeded, whole commits are dropped from the end and
|
|
824
|
+
* replaced with an "… and N more changes" line; a single block longer than
|
|
825
|
+
* the budget is cut instead.
|
|
826
|
+
*/
|
|
827
|
+
declare function markdownToSlackMrkdwn(markdown: string, { maxLength, cutCommits }?: {
|
|
828
|
+
maxLength?: number;
|
|
829
|
+
/** Cut the first commit that does not fit where the limit is reached, instead of dropping it whole */
|
|
830
|
+
cutCommits?: boolean;
|
|
831
|
+
}): string;
|
|
832
|
+
/**
|
|
833
|
+
* Render a markdown changelog as Slack rich_text blocks.
|
|
834
|
+
* Commit bodies are rendered under their bullet: paragraphs as quotes, nested
|
|
835
|
+
* lists as indented lists, code as preformatted blocks.
|
|
836
|
+
* When `maxLength`, `maxBlocks` or `maxPayloadLength` is exceeded, the changelog
|
|
837
|
+
* is cut where the limit is reached, even inside a commit body, with an ellipsis,
|
|
838
|
+
* and the commits left out entirely are announced with an "… and N more changes" line.
|
|
839
|
+
*/
|
|
840
|
+
declare function markdownToSlackRichText(markdown: string, { maxLength, maxBlocks, maxPayloadLength, blockMaxLength, }?: {
|
|
841
|
+
/** Maximum number of text characters of the changelog */
|
|
842
|
+
maxLength?: number;
|
|
843
|
+
/** Maximum number of returned blocks */
|
|
844
|
+
maxBlocks?: number;
|
|
845
|
+
/** Maximum length of the JSON of the returned blocks */
|
|
846
|
+
maxPayloadLength?: number;
|
|
847
|
+
/** Soft cap of the text characters of a single block */
|
|
848
|
+
blockMaxLength?: number;
|
|
849
|
+
}): SlackRichTextBlock[];
|
|
850
|
+
/** Plain-text rendering of a rich_text block, used for dry-run previews. */
|
|
851
|
+
declare function richTextToPlainText(block: SlackRichTextBlock): string;
|
|
852
|
+
|
|
742
853
|
/**
|
|
743
854
|
* Extract a summary from changelog content
|
|
744
855
|
*/
|
|
@@ -1470,6 +1581,10 @@ interface SocialOptions {
|
|
|
1470
1581
|
* true = force-enable AI, false = force-disable AI, undefined = use config
|
|
1471
1582
|
*/
|
|
1472
1583
|
ai?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* Override `social.slack.changelogFormat` for this run
|
|
1586
|
+
*/
|
|
1587
|
+
slackFormat?: SlackChangelogFormat;
|
|
1473
1588
|
/**
|
|
1474
1589
|
* Prerelease suffix, forwarded to package discovery in independent mode
|
|
1475
1590
|
* when no bump result is available (standalone `social` runs).
|
|
@@ -1738,6 +1853,10 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
|
|
|
1738
1853
|
* true = force-enable AI, false = force-disable AI, undefined = use config
|
|
1739
1854
|
*/
|
|
1740
1855
|
ai?: boolean;
|
|
1856
|
+
/**
|
|
1857
|
+
* Override `social.slack.changelogFormat` for this run
|
|
1858
|
+
*/
|
|
1859
|
+
slackFormat?: SlackChangelogFormat;
|
|
1741
1860
|
}
|
|
1742
1861
|
interface TwitterCredentials {
|
|
1743
1862
|
/**
|
|
@@ -1794,6 +1913,12 @@ interface SlackCredentials {
|
|
|
1794
1913
|
*/
|
|
1795
1914
|
token?: string;
|
|
1796
1915
|
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Slack changelog rendering:
|
|
1918
|
+
* - `summary`: short changelog (commit titles only) in a single mrkdwn section.
|
|
1919
|
+
* - `full`: complete changelog (commit bodies and PR/issue links) rendered as rich text blocks.
|
|
1920
|
+
*/
|
|
1921
|
+
type SlackChangelogFormat = 'summary' | 'full';
|
|
1797
1922
|
interface SlackSocialConfig {
|
|
1798
1923
|
/**
|
|
1799
1924
|
* Enable Slack posting
|
|
@@ -1827,10 +1952,22 @@ interface SlackSocialConfig {
|
|
|
1827
1952
|
* Slack credentials (optional - falls back to environment variables)
|
|
1828
1953
|
*/
|
|
1829
1954
|
credentials?: SlackCredentials;
|
|
1955
|
+
/**
|
|
1956
|
+
* Changelog rendering of the Slack message.
|
|
1957
|
+
* - `summary`: commit titles only, in a single section capped at `postMaxLength`.
|
|
1958
|
+
* - `full`: commit bodies and PR/issue links included, rendered as rich text blocks
|
|
1959
|
+
* (one per changelog section). Commit bodies follow `changelog.includeCommitBody`.
|
|
1960
|
+
* Can be overridden with the `--slack-format` CLI flag.
|
|
1961
|
+
* @default 'summary'
|
|
1962
|
+
*/
|
|
1963
|
+
changelogFormat?: SlackChangelogFormat;
|
|
1830
1964
|
/**
|
|
1831
1965
|
* Maximum length (in characters) of the changelog rendered inside the Slack message.
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1966
|
+
* When exceeded, `summary` drops the last commits, `full` cuts the changelog where the limit
|
|
1967
|
+
* is reached (even inside a commit body) with an ellipsis; the commits left out entirely are
|
|
1968
|
+
* announced with an "… and N more changes" line.
|
|
1969
|
+
* Defaults to 2500 in `summary` format (Slack's section limit is 3000) and to no limit
|
|
1970
|
+
* in `full` format, where the message is only bounded by Slack's 50 blocks.
|
|
1834
1971
|
*/
|
|
1835
1972
|
postMaxLength?: number;
|
|
1836
1973
|
/**
|
|
@@ -1878,6 +2015,12 @@ interface AiSdkProviderOptions {
|
|
|
1878
2015
|
}
|
|
1879
2016
|
type AIPromptTarget = 'providerRelease' | 'twitter' | 'slack';
|
|
1880
2017
|
type AISystemPromptOverrides = Partial<Record<AIPromptTarget, string>>;
|
|
2018
|
+
interface AIExtraGuidelines extends Partial<Record<AIPromptTarget, string>> {
|
|
2019
|
+
/**
|
|
2020
|
+
* Directives appended to every target, before the target-specific ones
|
|
2021
|
+
*/
|
|
2022
|
+
global?: string;
|
|
2023
|
+
}
|
|
1881
2024
|
interface AITargetConfig {
|
|
1882
2025
|
/**
|
|
1883
2026
|
* Enable AI for this target
|
|
@@ -1921,10 +2064,13 @@ interface AIConfig {
|
|
|
1921
2064
|
*/
|
|
1922
2065
|
fallback?: 'raw' | 'fail';
|
|
1923
2066
|
/**
|
|
1924
|
-
* Extra directives appended to
|
|
2067
|
+
* Extra directives appended to the built-in system prompts.
|
|
2068
|
+
* A string applies to every target; an object adds directives per target,
|
|
2069
|
+
* appended after the `global` ones.
|
|
1925
2070
|
* @example 'Always use emojis in the changelog'
|
|
2071
|
+
* @example { global: 'Keep package names in English.', slack: 'Mention the owning team.' }
|
|
1926
2072
|
*/
|
|
1927
|
-
extraGuidelines?: string;
|
|
2073
|
+
extraGuidelines?: string | AIExtraGuidelines;
|
|
1928
2074
|
/**
|
|
1929
2075
|
* Full replacement of the built-in system prompts.
|
|
1930
2076
|
* When set, the extraGuidelines and base prompts are ignored for that target.
|
|
@@ -2038,9 +2184,14 @@ interface SlackOptions {
|
|
|
2038
2184
|
template?: string;
|
|
2039
2185
|
/**
|
|
2040
2186
|
* Maximum chars of the changelog rendered in the message.
|
|
2041
|
-
*
|
|
2187
|
+
* Defaults to 2500 in `summary` format and to no limit in `full` format.
|
|
2042
2188
|
*/
|
|
2043
2189
|
postMaxLength?: number;
|
|
2190
|
+
/**
|
|
2191
|
+
* Changelog rendering of the message
|
|
2192
|
+
* @default 'summary'
|
|
2193
|
+
*/
|
|
2194
|
+
changelogFormat?: SlackChangelogFormat;
|
|
2044
2195
|
/**
|
|
2045
2196
|
* Contributor names (plain strings, no email/handle). Empty array or undefined → no contributors block.
|
|
2046
2197
|
*/
|
|
@@ -2391,5 +2542,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2391
2542
|
}): Promise<void>;
|
|
2392
2543
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2393
2544
|
|
|
2394
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, assertBranchUpToDateWithRemote, assertReleaseTagsAvailable, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromRepoTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, filterPrivatePackagesUnlessIncluded, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getGitUpstream, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNewPackageCompareBase, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseTagNames, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, listTags, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2395
|
-
export type { AIConfig, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, AiSdkProviderOptions, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitUpstream, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackCredentials, SlackOptions, SlackPackageEntry, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
|
2545
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, SLACK_HEADER_MAX_LENGTH, SLACK_MAX_BLOCKS, SLACK_RICH_TEXT_BLOCK_MAX_LENGTH, SLACK_RICH_TEXT_MESSAGE_MAX_LENGTH, SLACK_SECTION_MAX_LENGTH, SLACK_SUMMARY_MAX_LENGTH, assertBranchUpToDateWithRemote, assertReleaseTagsAvailable, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromRepoTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, filterPrivatePackagesUnlessIncluded, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getGitUpstream, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNewPackageCompareBase, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseTagNames, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, listTags, loadRelizyConfig, markdownToSlackMrkdwn, markdownToSlackRichText, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveSlackPostMaxLength, resolveTags, retagAnnotatedLocal, richTextToPlainText, rollbackModifiedFiles, shouldFilterPrereleaseTags, sliceSlackText, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2546
|
+
export type { AIConfig, AIExtraGuidelines, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, AiSdkProviderOptions, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitUpstream, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackChangelogFormat, SlackCredentials, SlackOptions, SlackPackageEntry, SlackRichTextBlock, SlackRichTextElement, SlackRichTextInline, SlackRichTextLink, SlackRichTextList, SlackRichTextPreformatted, SlackRichTextQuote, SlackRichTextSection, SlackRichTextStyle, SlackRichTextText, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ declare function getDefaultConfig(): {
|
|
|
62
62
|
slack: {
|
|
63
63
|
enabled: boolean;
|
|
64
64
|
onlyStable: boolean;
|
|
65
|
-
|
|
65
|
+
changelogFormat: string;
|
|
66
66
|
noAuthors: boolean;
|
|
67
67
|
noPackages: boolean;
|
|
68
68
|
};
|
|
@@ -705,6 +705,17 @@ declare function getSlackToken(options: {
|
|
|
705
705
|
declare function getSlackWebhookUrl(options: {
|
|
706
706
|
socialWebhookUrl?: string;
|
|
707
707
|
}): string | null;
|
|
708
|
+
/** Default changelog budget of the `summary` format. */
|
|
709
|
+
declare const SLACK_SUMMARY_MAX_LENGTH = 2500;
|
|
710
|
+
/**
|
|
711
|
+
* Resolve the changelog budget of a Slack post: `postMaxLength` when set,
|
|
712
|
+
* otherwise 2500 chars in `summary` format and no limit in `full` format
|
|
713
|
+
* (the message is then only bounded by Slack's 50 blocks).
|
|
714
|
+
*/
|
|
715
|
+
declare function resolveSlackPostMaxLength({ changelogFormat, postMaxLength }: {
|
|
716
|
+
changelogFormat?: SlackChangelogFormat;
|
|
717
|
+
postMaxLength?: number;
|
|
718
|
+
}): number | undefined;
|
|
708
719
|
/**
|
|
709
720
|
* Format changelog for Slack (convert markdown to Slack's mrkdwn format)
|
|
710
721
|
*/
|
|
@@ -716,9 +727,14 @@ declare function formatChangelogForSlack(changelog: string, maxLength?: number):
|
|
|
716
727
|
*/
|
|
717
728
|
declare function formatPackagesForSlack(packages: PackageBumpEntry[]): string;
|
|
718
729
|
/**
|
|
719
|
-
* Format the Slack message using blocks
|
|
730
|
+
* Format the Slack message using blocks.
|
|
731
|
+
* - `summary` format: the changelog is a single mrkdwn section (2500 chars by default).
|
|
732
|
+
* - `full` format: the changelog is rendered as rich_text blocks, commit bodies
|
|
733
|
+
* included, split per section. It is bounded by `postMaxLength` when set and
|
|
734
|
+
* always by Slack's limits (50 blocks, ~13,200 chars for rich text messages).
|
|
735
|
+
* Every block is kept within Slack's limits so the post is never rejected.
|
|
720
736
|
*/
|
|
721
|
-
declare function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template, contributors, packages, postMaxLength }: {
|
|
737
|
+
declare function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template, contributors, packages, postMaxLength, changelogFormat }: {
|
|
722
738
|
template?: string;
|
|
723
739
|
projectName: string;
|
|
724
740
|
version: string;
|
|
@@ -728,17 +744,112 @@ declare function formatSlackMessage({ projectName, version, changelog, releaseUr
|
|
|
728
744
|
contributors?: string[];
|
|
729
745
|
packages?: PackageBumpEntry[];
|
|
730
746
|
postMaxLength?: number;
|
|
747
|
+
changelogFormat?: SlackChangelogFormat;
|
|
731
748
|
}): any[];
|
|
732
749
|
/**
|
|
733
750
|
* Post a release announcement to Slack.
|
|
734
751
|
* Dispatches to Incoming Webhook (if `webhookUrl` is set) or Web API (`token` + `channel`).
|
|
735
752
|
* When both are provided, the webhook takes priority.
|
|
736
753
|
*/
|
|
737
|
-
declare function postReleaseToSlack({ version, projectName, changelog, releaseUrl, changelogUrl, channel, token, webhookUrl, template, contributors, packages, postMaxLength, dryRun, }: SlackOptions): Promise<{
|
|
754
|
+
declare function postReleaseToSlack({ version, projectName, changelog, releaseUrl, changelogUrl, channel, token, webhookUrl, template, contributors, packages, postMaxLength, changelogFormat, dryRun, }: SlackOptions): Promise<{
|
|
738
755
|
ok: true;
|
|
739
756
|
transport: "webhook";
|
|
740
757
|
} | _slack_web_api.ChatPostMessageResponse | undefined>;
|
|
741
758
|
|
|
759
|
+
/** Maximum number of blocks in a Slack message. */
|
|
760
|
+
declare const SLACK_MAX_BLOCKS = 50;
|
|
761
|
+
/** Maximum length of the text of a Slack section block. */
|
|
762
|
+
declare const SLACK_SECTION_MAX_LENGTH = 3000;
|
|
763
|
+
/**
|
|
764
|
+
* Soft cap of the text carried by a single rich_text block. Slack documents no
|
|
765
|
+
* limit for rich_text, so the section limit is reused as a conservative bound.
|
|
766
|
+
*/
|
|
767
|
+
declare const SLACK_RICH_TEXT_BLOCK_MAX_LENGTH = 3000;
|
|
768
|
+
/**
|
|
769
|
+
* Budget of the JSON of all the blocks of a message containing rich_text blocks.
|
|
770
|
+
* Slack rejects such messages above ~13,200 characters with `msg_blocks_too_long`
|
|
771
|
+
* (https://github.com/slackapi/bolt-js/issues/2509): measuring the JSON, which is
|
|
772
|
+
* larger than the text Slack counts, keeps a safe margin.
|
|
773
|
+
*/
|
|
774
|
+
declare const SLACK_RICH_TEXT_MESSAGE_MAX_LENGTH = 11000;
|
|
775
|
+
/** Maximum length of the text of a Slack header block. */
|
|
776
|
+
declare const SLACK_HEADER_MAX_LENGTH = 150;
|
|
777
|
+
interface SlackRichTextStyle {
|
|
778
|
+
bold?: boolean;
|
|
779
|
+
italic?: boolean;
|
|
780
|
+
strike?: boolean;
|
|
781
|
+
code?: boolean;
|
|
782
|
+
}
|
|
783
|
+
interface SlackRichTextText {
|
|
784
|
+
type: 'text';
|
|
785
|
+
text: string;
|
|
786
|
+
style?: SlackRichTextStyle;
|
|
787
|
+
}
|
|
788
|
+
interface SlackRichTextLink {
|
|
789
|
+
type: 'link';
|
|
790
|
+
url: string;
|
|
791
|
+
text?: string;
|
|
792
|
+
style?: SlackRichTextStyle;
|
|
793
|
+
}
|
|
794
|
+
type SlackRichTextInline = SlackRichTextText | SlackRichTextLink;
|
|
795
|
+
interface SlackRichTextSection {
|
|
796
|
+
type: 'rich_text_section';
|
|
797
|
+
elements: SlackRichTextInline[];
|
|
798
|
+
}
|
|
799
|
+
interface SlackRichTextList {
|
|
800
|
+
type: 'rich_text_list';
|
|
801
|
+
style: 'bullet' | 'ordered';
|
|
802
|
+
indent?: number;
|
|
803
|
+
offset?: number;
|
|
804
|
+
elements: SlackRichTextSection[];
|
|
805
|
+
}
|
|
806
|
+
interface SlackRichTextQuote {
|
|
807
|
+
type: 'rich_text_quote';
|
|
808
|
+
elements: SlackRichTextInline[];
|
|
809
|
+
}
|
|
810
|
+
interface SlackRichTextPreformatted {
|
|
811
|
+
type: 'rich_text_preformatted';
|
|
812
|
+
elements: SlackRichTextInline[];
|
|
813
|
+
}
|
|
814
|
+
type SlackRichTextElement = SlackRichTextSection | SlackRichTextList | SlackRichTextQuote | SlackRichTextPreformatted;
|
|
815
|
+
interface SlackRichTextBlock {
|
|
816
|
+
type: 'rich_text';
|
|
817
|
+
elements: SlackRichTextElement[];
|
|
818
|
+
}
|
|
819
|
+
/** Cut a text without splitting a UTF-16 surrogate pair (emoji), which Slack would render broken. */
|
|
820
|
+
declare function sliceSlackText(text: string, length: number): string;
|
|
821
|
+
/**
|
|
822
|
+
* Render a markdown changelog as Slack mrkdwn.
|
|
823
|
+
* When `maxLength` is exceeded, whole commits are dropped from the end and
|
|
824
|
+
* replaced with an "… and N more changes" line; a single block longer than
|
|
825
|
+
* the budget is cut instead.
|
|
826
|
+
*/
|
|
827
|
+
declare function markdownToSlackMrkdwn(markdown: string, { maxLength, cutCommits }?: {
|
|
828
|
+
maxLength?: number;
|
|
829
|
+
/** Cut the first commit that does not fit where the limit is reached, instead of dropping it whole */
|
|
830
|
+
cutCommits?: boolean;
|
|
831
|
+
}): string;
|
|
832
|
+
/**
|
|
833
|
+
* Render a markdown changelog as Slack rich_text blocks.
|
|
834
|
+
* Commit bodies are rendered under their bullet: paragraphs as quotes, nested
|
|
835
|
+
* lists as indented lists, code as preformatted blocks.
|
|
836
|
+
* When `maxLength`, `maxBlocks` or `maxPayloadLength` is exceeded, the changelog
|
|
837
|
+
* is cut where the limit is reached, even inside a commit body, with an ellipsis,
|
|
838
|
+
* and the commits left out entirely are announced with an "… and N more changes" line.
|
|
839
|
+
*/
|
|
840
|
+
declare function markdownToSlackRichText(markdown: string, { maxLength, maxBlocks, maxPayloadLength, blockMaxLength, }?: {
|
|
841
|
+
/** Maximum number of text characters of the changelog */
|
|
842
|
+
maxLength?: number;
|
|
843
|
+
/** Maximum number of returned blocks */
|
|
844
|
+
maxBlocks?: number;
|
|
845
|
+
/** Maximum length of the JSON of the returned blocks */
|
|
846
|
+
maxPayloadLength?: number;
|
|
847
|
+
/** Soft cap of the text characters of a single block */
|
|
848
|
+
blockMaxLength?: number;
|
|
849
|
+
}): SlackRichTextBlock[];
|
|
850
|
+
/** Plain-text rendering of a rich_text block, used for dry-run previews. */
|
|
851
|
+
declare function richTextToPlainText(block: SlackRichTextBlock): string;
|
|
852
|
+
|
|
742
853
|
/**
|
|
743
854
|
* Extract a summary from changelog content
|
|
744
855
|
*/
|
|
@@ -1470,6 +1581,10 @@ interface SocialOptions {
|
|
|
1470
1581
|
* true = force-enable AI, false = force-disable AI, undefined = use config
|
|
1471
1582
|
*/
|
|
1472
1583
|
ai?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* Override `social.slack.changelogFormat` for this run
|
|
1586
|
+
*/
|
|
1587
|
+
slackFormat?: SlackChangelogFormat;
|
|
1473
1588
|
/**
|
|
1474
1589
|
* Prerelease suffix, forwarded to package discovery in independent mode
|
|
1475
1590
|
* when no bump result is available (standalone `social` runs).
|
|
@@ -1738,6 +1853,10 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
|
|
|
1738
1853
|
* true = force-enable AI, false = force-disable AI, undefined = use config
|
|
1739
1854
|
*/
|
|
1740
1855
|
ai?: boolean;
|
|
1856
|
+
/**
|
|
1857
|
+
* Override `social.slack.changelogFormat` for this run
|
|
1858
|
+
*/
|
|
1859
|
+
slackFormat?: SlackChangelogFormat;
|
|
1741
1860
|
}
|
|
1742
1861
|
interface TwitterCredentials {
|
|
1743
1862
|
/**
|
|
@@ -1794,6 +1913,12 @@ interface SlackCredentials {
|
|
|
1794
1913
|
*/
|
|
1795
1914
|
token?: string;
|
|
1796
1915
|
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Slack changelog rendering:
|
|
1918
|
+
* - `summary`: short changelog (commit titles only) in a single mrkdwn section.
|
|
1919
|
+
* - `full`: complete changelog (commit bodies and PR/issue links) rendered as rich text blocks.
|
|
1920
|
+
*/
|
|
1921
|
+
type SlackChangelogFormat = 'summary' | 'full';
|
|
1797
1922
|
interface SlackSocialConfig {
|
|
1798
1923
|
/**
|
|
1799
1924
|
* Enable Slack posting
|
|
@@ -1827,10 +1952,22 @@ interface SlackSocialConfig {
|
|
|
1827
1952
|
* Slack credentials (optional - falls back to environment variables)
|
|
1828
1953
|
*/
|
|
1829
1954
|
credentials?: SlackCredentials;
|
|
1955
|
+
/**
|
|
1956
|
+
* Changelog rendering of the Slack message.
|
|
1957
|
+
* - `summary`: commit titles only, in a single section capped at `postMaxLength`.
|
|
1958
|
+
* - `full`: commit bodies and PR/issue links included, rendered as rich text blocks
|
|
1959
|
+
* (one per changelog section). Commit bodies follow `changelog.includeCommitBody`.
|
|
1960
|
+
* Can be overridden with the `--slack-format` CLI flag.
|
|
1961
|
+
* @default 'summary'
|
|
1962
|
+
*/
|
|
1963
|
+
changelogFormat?: SlackChangelogFormat;
|
|
1830
1964
|
/**
|
|
1831
1965
|
* Maximum length (in characters) of the changelog rendered inside the Slack message.
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1966
|
+
* When exceeded, `summary` drops the last commits, `full` cuts the changelog where the limit
|
|
1967
|
+
* is reached (even inside a commit body) with an ellipsis; the commits left out entirely are
|
|
1968
|
+
* announced with an "… and N more changes" line.
|
|
1969
|
+
* Defaults to 2500 in `summary` format (Slack's section limit is 3000) and to no limit
|
|
1970
|
+
* in `full` format, where the message is only bounded by Slack's 50 blocks.
|
|
1834
1971
|
*/
|
|
1835
1972
|
postMaxLength?: number;
|
|
1836
1973
|
/**
|
|
@@ -1878,6 +2015,12 @@ interface AiSdkProviderOptions {
|
|
|
1878
2015
|
}
|
|
1879
2016
|
type AIPromptTarget = 'providerRelease' | 'twitter' | 'slack';
|
|
1880
2017
|
type AISystemPromptOverrides = Partial<Record<AIPromptTarget, string>>;
|
|
2018
|
+
interface AIExtraGuidelines extends Partial<Record<AIPromptTarget, string>> {
|
|
2019
|
+
/**
|
|
2020
|
+
* Directives appended to every target, before the target-specific ones
|
|
2021
|
+
*/
|
|
2022
|
+
global?: string;
|
|
2023
|
+
}
|
|
1881
2024
|
interface AITargetConfig {
|
|
1882
2025
|
/**
|
|
1883
2026
|
* Enable AI for this target
|
|
@@ -1921,10 +2064,13 @@ interface AIConfig {
|
|
|
1921
2064
|
*/
|
|
1922
2065
|
fallback?: 'raw' | 'fail';
|
|
1923
2066
|
/**
|
|
1924
|
-
* Extra directives appended to
|
|
2067
|
+
* Extra directives appended to the built-in system prompts.
|
|
2068
|
+
* A string applies to every target; an object adds directives per target,
|
|
2069
|
+
* appended after the `global` ones.
|
|
1925
2070
|
* @example 'Always use emojis in the changelog'
|
|
2071
|
+
* @example { global: 'Keep package names in English.', slack: 'Mention the owning team.' }
|
|
1926
2072
|
*/
|
|
1927
|
-
extraGuidelines?: string;
|
|
2073
|
+
extraGuidelines?: string | AIExtraGuidelines;
|
|
1928
2074
|
/**
|
|
1929
2075
|
* Full replacement of the built-in system prompts.
|
|
1930
2076
|
* When set, the extraGuidelines and base prompts are ignored for that target.
|
|
@@ -2038,9 +2184,14 @@ interface SlackOptions {
|
|
|
2038
2184
|
template?: string;
|
|
2039
2185
|
/**
|
|
2040
2186
|
* Maximum chars of the changelog rendered in the message.
|
|
2041
|
-
*
|
|
2187
|
+
* Defaults to 2500 in `summary` format and to no limit in `full` format.
|
|
2042
2188
|
*/
|
|
2043
2189
|
postMaxLength?: number;
|
|
2190
|
+
/**
|
|
2191
|
+
* Changelog rendering of the message
|
|
2192
|
+
* @default 'summary'
|
|
2193
|
+
*/
|
|
2194
|
+
changelogFormat?: SlackChangelogFormat;
|
|
2044
2195
|
/**
|
|
2045
2196
|
* Contributor names (plain strings, no email/handle). Empty array or undefined → no contributors block.
|
|
2046
2197
|
*/
|
|
@@ -2391,5 +2542,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2391
2542
|
}): Promise<void>;
|
|
2392
2543
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2393
2544
|
|
|
2394
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, assertBranchUpToDateWithRemote, assertReleaseTagsAvailable, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromRepoTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, filterPrivatePackagesUnlessIncluded, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getGitUpstream, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNewPackageCompareBase, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseTagNames, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, listTags, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2395
|
-
export type { AIConfig, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, AiSdkProviderOptions, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitUpstream, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackCredentials, SlackOptions, SlackPackageEntry, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
|
2545
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, SLACK_HEADER_MAX_LENGTH, SLACK_MAX_BLOCKS, SLACK_RICH_TEXT_BLOCK_MAX_LENGTH, SLACK_RICH_TEXT_MESSAGE_MAX_LENGTH, SLACK_SECTION_MAX_LENGTH, SLACK_SUMMARY_MAX_LENGTH, assertBranchUpToDateWithRemote, assertReleaseTagsAvailable, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromRepoTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, filterPrivatePackagesUnlessIncluded, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getGitUpstream, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNewPackageCompareBase, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseTagNames, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, listTags, loadRelizyConfig, markdownToSlackMrkdwn, markdownToSlackRichText, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveSlackPostMaxLength, resolveTags, retagAnnotatedLocal, richTextToPlainText, rollbackModifiedFiles, shouldFilterPrereleaseTags, sliceSlackText, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2546
|
+
export type { AIConfig, AIExtraGuidelines, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, AiSdkProviderOptions, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitUpstream, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackChangelogFormat, SlackCredentials, SlackOptions, SlackPackageEntry, SlackRichTextBlock, SlackRichTextElement, SlackRichTextInline, SlackRichTextLink, SlackRichTextList, SlackRichTextPreformatted, SlackRichTextQuote, SlackRichTextSection, SlackRichTextStyle, SlackRichTextText, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|