relizy 0.2.8 → 1.0.0-beta.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/README.md +109 -1093
- package/dist/cli.mjs +18 -3
- package/dist/index.d.mts +415 -14
- package/dist/index.d.ts +415 -14
- package/dist/index.mjs +2 -2
- package/dist/shared/{relizy.DwP99Z7x.mjs → relizy.C2HlcnZB.mjs} +2194 -1449
- package/package.json +21 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { LogLevel } from '@maz-ui/node';
|
|
|
2
2
|
import { GitCommit, ChangelogConfig as ChangelogConfig$1, SemverBumpType } from 'changelogen';
|
|
3
3
|
import { ReleaseType } from 'semver';
|
|
4
4
|
import { DeepPartial } from '@maz-ui/utils';
|
|
5
|
+
import * as _slack_web_api from '@slack/web-api';
|
|
6
|
+
import * as twitter_api_v2 from 'twitter-api-v2';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Generate changelog for a specific package
|
|
8
10
|
*/
|
|
9
|
-
declare function generateChangelog({ pkg, config, dryRun, newVersion, }: {
|
|
11
|
+
declare function generateChangelog({ pkg, config, dryRun, newVersion, minify, }: {
|
|
10
12
|
pkg: {
|
|
11
13
|
fromTag?: string;
|
|
12
14
|
name: string;
|
|
@@ -16,6 +18,7 @@ declare function generateChangelog({ pkg, config, dryRun, newVersion, }: {
|
|
|
16
18
|
config: ResolvedRelizyConfig;
|
|
17
19
|
dryRun: boolean;
|
|
18
20
|
newVersion: string;
|
|
21
|
+
minify?: boolean;
|
|
19
22
|
}): Promise<string>;
|
|
20
23
|
/**
|
|
21
24
|
* Write changelog to file
|
|
@@ -35,6 +38,8 @@ declare function getDefaultConfig(): {
|
|
|
35
38
|
tagMessage: string;
|
|
36
39
|
tagBody: string;
|
|
37
40
|
emptyChangelogContent: string;
|
|
41
|
+
twitterMessage: string;
|
|
42
|
+
slackMessage: undefined;
|
|
38
43
|
};
|
|
39
44
|
excludeAuthors: never[];
|
|
40
45
|
noAuthors: boolean;
|
|
@@ -43,14 +48,34 @@ declare function getDefaultConfig(): {
|
|
|
43
48
|
publish: {
|
|
44
49
|
private: boolean;
|
|
45
50
|
args: never[];
|
|
51
|
+
token: string | undefined;
|
|
52
|
+
registry: string;
|
|
46
53
|
safetyCheck: boolean;
|
|
47
54
|
};
|
|
48
55
|
tokens: {
|
|
56
|
+
registry: string | undefined;
|
|
49
57
|
gitlab: string | undefined;
|
|
50
58
|
github: string | undefined;
|
|
59
|
+
twitter: {
|
|
60
|
+
apiKey: string | undefined;
|
|
61
|
+
apiKeySecret: string | undefined;
|
|
62
|
+
accessToken: string | undefined;
|
|
63
|
+
accessTokenSecret: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
slack: string | undefined;
|
|
51
66
|
};
|
|
52
67
|
scopeMap: {};
|
|
53
68
|
release: Required<ReleaseConfig>;
|
|
69
|
+
social: {
|
|
70
|
+
twitter: {
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
onlyStable: boolean;
|
|
73
|
+
};
|
|
74
|
+
slack: {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
onlyStable: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
54
79
|
logLevel: LogLevel;
|
|
55
80
|
safetyCheck: boolean;
|
|
56
81
|
};
|
|
@@ -100,7 +125,7 @@ declare function expandPackagesToBumpWithDependents({ allPackages, packagesWithC
|
|
|
100
125
|
*/
|
|
101
126
|
declare function topologicalSort(packages: PackageBase[]): PackageBase[];
|
|
102
127
|
|
|
103
|
-
declare function getGitStatus(cwd?: string): string;
|
|
128
|
+
declare function getGitStatus(cwd?: string, trim?: boolean): string;
|
|
104
129
|
declare function checkGitStatusIfDirty(): void;
|
|
105
130
|
declare function fetchGitTags(cwd?: string): Promise<void>;
|
|
106
131
|
declare function detectGitProvider(cwd?: string): GitProvider | null;
|
|
@@ -108,6 +133,13 @@ declare function parseGitRemoteUrl(remoteUrl: string): {
|
|
|
108
133
|
owner: string;
|
|
109
134
|
repo: string;
|
|
110
135
|
} | null;
|
|
136
|
+
/**
|
|
137
|
+
* Get files modified in git status that are relevant for release
|
|
138
|
+
* Returns only package.json, CHANGELOG.md, and lerna.json files
|
|
139
|
+
*/
|
|
140
|
+
declare function getModifiedReleaseFilePatterns({ config }: {
|
|
141
|
+
config: ResolvedRelizyConfig;
|
|
142
|
+
}): string[];
|
|
111
143
|
declare function createCommitAndTags({ config, noVerify, bumpedPackages, newVersion, dryRun, logLevel, }: {
|
|
112
144
|
config: ResolvedRelizyConfig;
|
|
113
145
|
noVerify: boolean;
|
|
@@ -122,6 +154,13 @@ declare function pushCommitAndTags({ config, dryRun, logLevel, cwd }: {
|
|
|
122
154
|
logLevel?: LogLevel;
|
|
123
155
|
cwd: string;
|
|
124
156
|
}): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Rollback modified files to their last committed state
|
|
159
|
+
* Used when publish fails before commit/tag/push operations
|
|
160
|
+
*/
|
|
161
|
+
declare function rollbackModifiedFiles({ config, }: {
|
|
162
|
+
config: ResolvedRelizyConfig;
|
|
163
|
+
}): Promise<void>;
|
|
125
164
|
declare function getFirstCommit(cwd: string): string;
|
|
126
165
|
declare function getCurrentGitBranch(cwd: string): string;
|
|
127
166
|
declare function getCurrentGitRef(cwd: string): string;
|
|
@@ -194,8 +233,7 @@ declare function readPackages({ cwd, patterns, ignorePackageNames, }: {
|
|
|
194
233
|
patterns?: string[];
|
|
195
234
|
ignorePackageNames: NonNullable<ResolvedRelizyConfig['monorepo']>['ignorePackageNames'];
|
|
196
235
|
}): ReadPackage[];
|
|
197
|
-
declare function getPackages({
|
|
198
|
-
patterns?: string[];
|
|
236
|
+
declare function getPackages({ config, suffix, force, }: {
|
|
199
237
|
config: ResolvedRelizyConfig;
|
|
200
238
|
suffix: string | undefined;
|
|
201
239
|
force: boolean;
|
|
@@ -209,6 +247,43 @@ declare function getPackageCommits({ pkg, from, to, config, changelog, }: {
|
|
|
209
247
|
}): Promise<GitCommit[]>;
|
|
210
248
|
declare function hasLernaJson(rootDir: string): boolean;
|
|
211
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Get Slack token from config
|
|
252
|
+
* Priority: social.slack.credentials > config.tokens.slack > environment variables (handled in config.ts)
|
|
253
|
+
*/
|
|
254
|
+
declare function getSlackToken(options: {
|
|
255
|
+
socialCredentials?: SlackCredentials;
|
|
256
|
+
tokenCredential?: string;
|
|
257
|
+
}): string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Format changelog for Slack (convert markdown to Slack's mrkdwn format)
|
|
260
|
+
*/
|
|
261
|
+
declare function formatChangelogForSlack(changelog: string, maxLength?: number): string;
|
|
262
|
+
/**
|
|
263
|
+
* Format the Slack message using blocks
|
|
264
|
+
*/
|
|
265
|
+
declare function formatSlackMessage({ projectName, version, changelog, releaseUrl, changelogUrl, template }: {
|
|
266
|
+
template?: string;
|
|
267
|
+
projectName: string;
|
|
268
|
+
version: string;
|
|
269
|
+
changelog: string;
|
|
270
|
+
releaseUrl?: string;
|
|
271
|
+
changelogUrl?: string;
|
|
272
|
+
}): any[];
|
|
273
|
+
/**
|
|
274
|
+
* Post a release announcement to Slack
|
|
275
|
+
*/
|
|
276
|
+
declare function postReleaseToSlack({ version, projectName, changelog, releaseUrl, changelogUrl, channel, token, template, dryRun, }: SlackOptions): Promise<_slack_web_api.ChatPostMessageResponse | undefined>;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Extract a summary from changelog content
|
|
280
|
+
*/
|
|
281
|
+
declare function extractChangelogSummary(changelog: string, maxLength?: number): string;
|
|
282
|
+
/**
|
|
283
|
+
* Get the release URL from repo config and release tag
|
|
284
|
+
*/
|
|
285
|
+
declare function getReleaseUrl(config: ResolvedRelizyConfig, tag: string): string | undefined;
|
|
286
|
+
|
|
212
287
|
declare function getIndependentTag({ version, name }: {
|
|
213
288
|
version: string;
|
|
214
289
|
name: string;
|
|
@@ -234,7 +309,7 @@ declare function getLastPackageTag({ packageName, onlyStable, currentVersion, lo
|
|
|
234
309
|
logLevel?: LogLevel;
|
|
235
310
|
cwd?: string;
|
|
236
311
|
}): Promise<string | null>;
|
|
237
|
-
type Step = 'bump' | 'changelog' | 'publish' | 'provider-release';
|
|
312
|
+
type Step = 'bump' | 'changelog' | 'publish' | 'provider-release' | 'social';
|
|
238
313
|
interface ResolvedTags {
|
|
239
314
|
from: string;
|
|
240
315
|
to: string;
|
|
@@ -246,6 +321,26 @@ declare function resolveTags<S extends Step, NewVersion = S extends 'bump' ? und
|
|
|
246
321
|
newVersion: NewVersion;
|
|
247
322
|
}): Promise<ResolvedTags>;
|
|
248
323
|
|
|
324
|
+
interface ResolvedTwitterCredentials {
|
|
325
|
+
apiKey: string;
|
|
326
|
+
apiKeySecret: string;
|
|
327
|
+
accessToken: string;
|
|
328
|
+
accessTokenSecret: string;
|
|
329
|
+
}
|
|
330
|
+
declare function getTwitterCredentials({ socialCredentials, tokenCredentials }: {
|
|
331
|
+
socialCredentials?: TwitterCredentials;
|
|
332
|
+
tokenCredentials?: TwitterCredentials;
|
|
333
|
+
}): ResolvedTwitterCredentials | null;
|
|
334
|
+
declare function formatTweetMessage({ template, projectName, version, changelog, releaseUrl, changelogUrl }: {
|
|
335
|
+
template: string;
|
|
336
|
+
projectName: string;
|
|
337
|
+
version: string;
|
|
338
|
+
changelog: string;
|
|
339
|
+
releaseUrl?: string;
|
|
340
|
+
changelogUrl?: string;
|
|
341
|
+
}): string;
|
|
342
|
+
declare function postReleaseToTwitter({ version, projectName, changelog, releaseUrl, changelogUrl, credentials, template, dryRun, }: TwitterOptions): Promise<twitter_api_v2.TweetV2PostTweetResult | undefined>;
|
|
343
|
+
|
|
249
344
|
/**
|
|
250
345
|
* Execute a hook
|
|
251
346
|
*/
|
|
@@ -380,7 +475,7 @@ declare function extractVersionFromTag(tag: string, packageName?: string): strin
|
|
|
380
475
|
declare function isTagVersionCompatibleWithCurrent(tagVersion: string, currentVersion: string): boolean;
|
|
381
476
|
|
|
382
477
|
type VersionMode = 'unified' | 'independent' | 'selective';
|
|
383
|
-
type GitProvider = 'github' | 'gitlab';
|
|
478
|
+
type GitProvider = 'github' | 'gitlab' | 'bitbucket';
|
|
384
479
|
type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';
|
|
385
480
|
/**
|
|
386
481
|
* PACAKGE TYPES
|
|
@@ -488,6 +583,44 @@ interface PostedRelease {
|
|
|
488
583
|
*/
|
|
489
584
|
version: string;
|
|
490
585
|
}
|
|
586
|
+
interface SocialNetworkResult {
|
|
587
|
+
/**
|
|
588
|
+
* Social platform name (e.g., 'twitter', 'slack')
|
|
589
|
+
*/
|
|
590
|
+
platform: string;
|
|
591
|
+
/**
|
|
592
|
+
* Whether the post was successful
|
|
593
|
+
*/
|
|
594
|
+
success: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Error message if the post failed
|
|
597
|
+
*/
|
|
598
|
+
error?: string;
|
|
599
|
+
}
|
|
600
|
+
interface SocialResult {
|
|
601
|
+
/**
|
|
602
|
+
* Results for each social platform
|
|
603
|
+
*/
|
|
604
|
+
results: SocialNetworkResult[];
|
|
605
|
+
/**
|
|
606
|
+
* Whether any of the social posts had errors
|
|
607
|
+
*/
|
|
608
|
+
hasErrors: boolean;
|
|
609
|
+
}
|
|
610
|
+
interface ProviderReleaseResult {
|
|
611
|
+
/**
|
|
612
|
+
* Detected Git provider
|
|
613
|
+
*/
|
|
614
|
+
detectedProvider: GitProvider;
|
|
615
|
+
/**
|
|
616
|
+
* Posted releases
|
|
617
|
+
*/
|
|
618
|
+
postedReleases: PostedRelease[];
|
|
619
|
+
/**
|
|
620
|
+
* Error message if provider release failed
|
|
621
|
+
*/
|
|
622
|
+
error?: string;
|
|
623
|
+
}
|
|
491
624
|
interface MonorepoConfig {
|
|
492
625
|
/**
|
|
493
626
|
* Version mode for the monorepo.
|
|
@@ -680,6 +813,43 @@ interface ProviderReleaseOptions {
|
|
|
680
813
|
*/
|
|
681
814
|
suffix?: string;
|
|
682
815
|
}
|
|
816
|
+
interface SocialOptions {
|
|
817
|
+
/**
|
|
818
|
+
* Start tag
|
|
819
|
+
*/
|
|
820
|
+
from?: string;
|
|
821
|
+
/**
|
|
822
|
+
* End tag
|
|
823
|
+
*/
|
|
824
|
+
to?: string;
|
|
825
|
+
/**
|
|
826
|
+
* Use custom config
|
|
827
|
+
*/
|
|
828
|
+
config?: ResolvedRelizyConfig;
|
|
829
|
+
/**
|
|
830
|
+
* Custom config file name (e.g. `relizy.standalone` for `relizy.standalone.config.ts`)
|
|
831
|
+
* @default 'relizy'
|
|
832
|
+
*/
|
|
833
|
+
configName?: string;
|
|
834
|
+
/**
|
|
835
|
+
* Bump result (contains release information)
|
|
836
|
+
*/
|
|
837
|
+
bumpResult?: BumpResultTruthy;
|
|
838
|
+
/**
|
|
839
|
+
* Set log level
|
|
840
|
+
*/
|
|
841
|
+
logLevel?: LogLevel;
|
|
842
|
+
/**
|
|
843
|
+
* Run without side effects
|
|
844
|
+
* @default false
|
|
845
|
+
*/
|
|
846
|
+
dryRun?: boolean;
|
|
847
|
+
/**
|
|
848
|
+
* Skip safety check
|
|
849
|
+
* @default false
|
|
850
|
+
*/
|
|
851
|
+
safetyCheck?: boolean;
|
|
852
|
+
}
|
|
683
853
|
type PublishConfig = ChangelogConfig$1['publish'] & {
|
|
684
854
|
/**
|
|
685
855
|
* Package manager (e.g. `pnpm`, `npm`, `yarn` or `bun`)
|
|
@@ -793,6 +963,11 @@ interface ReleaseConfig {
|
|
|
793
963
|
* @default true
|
|
794
964
|
*/
|
|
795
965
|
gitTag?: boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Post release announcements to social media platforms
|
|
968
|
+
* @default false
|
|
969
|
+
*/
|
|
970
|
+
social?: boolean;
|
|
796
971
|
}
|
|
797
972
|
interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, PublishConfig {
|
|
798
973
|
/**
|
|
@@ -840,6 +1015,174 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
|
|
|
840
1015
|
*/
|
|
841
1016
|
publishToken?: string;
|
|
842
1017
|
}
|
|
1018
|
+
interface TwitterCredentials {
|
|
1019
|
+
/**
|
|
1020
|
+
* Twitter API Key (Consumer Key)
|
|
1021
|
+
*/
|
|
1022
|
+
apiKey?: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Twitter API Secret (Consumer Secret)
|
|
1025
|
+
*/
|
|
1026
|
+
apiKeySecret?: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* Twitter Access Token
|
|
1029
|
+
*/
|
|
1030
|
+
accessToken?: string;
|
|
1031
|
+
/**
|
|
1032
|
+
* Twitter Access Token Secret
|
|
1033
|
+
*/
|
|
1034
|
+
accessTokenSecret?: string;
|
|
1035
|
+
}
|
|
1036
|
+
interface TwitterSocialConfig {
|
|
1037
|
+
/**
|
|
1038
|
+
* Enable Twitter posting
|
|
1039
|
+
* @default false
|
|
1040
|
+
*/
|
|
1041
|
+
enabled?: boolean;
|
|
1042
|
+
/**
|
|
1043
|
+
* Skip Twitter posting for prerelease versions (alpha, beta, rc, etc.)
|
|
1044
|
+
* Only stable versions will be posted to Twitter
|
|
1045
|
+
* @default true
|
|
1046
|
+
*/
|
|
1047
|
+
onlyStable?: boolean;
|
|
1048
|
+
/**
|
|
1049
|
+
* 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
|
+
*/
|
|
1053
|
+
template?: string;
|
|
1054
|
+
/**
|
|
1055
|
+
* Twitter credentials (optional - falls back to environment variables)
|
|
1056
|
+
*/
|
|
1057
|
+
credentials?: TwitterCredentials;
|
|
1058
|
+
}
|
|
1059
|
+
interface SlackCredentials {
|
|
1060
|
+
/**
|
|
1061
|
+
* Slack Bot Token or User OAuth Token
|
|
1062
|
+
* Required scopes: chat:write, chat:write.public (for public channels)
|
|
1063
|
+
*/
|
|
1064
|
+
token?: string;
|
|
1065
|
+
}
|
|
1066
|
+
interface SlackSocialConfig {
|
|
1067
|
+
/**
|
|
1068
|
+
* Enable Slack posting
|
|
1069
|
+
* @default false
|
|
1070
|
+
*/
|
|
1071
|
+
enabled?: boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Skip Slack posting for prerelease versions (alpha, beta, rc, etc.)
|
|
1074
|
+
* Only stable versions will be posted to Slack
|
|
1075
|
+
* @default true
|
|
1076
|
+
*/
|
|
1077
|
+
onlyStable?: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* Slack channel ID or name (e.g., "#releases" or "C1234567890")
|
|
1080
|
+
*/
|
|
1081
|
+
channel: string;
|
|
1082
|
+
/**
|
|
1083
|
+
* Custom message template
|
|
1084
|
+
* Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
|
|
1085
|
+
*/
|
|
1086
|
+
template?: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* Slack credentials (optional - falls back to environment variables)
|
|
1089
|
+
*/
|
|
1090
|
+
credentials?: SlackCredentials;
|
|
1091
|
+
}
|
|
1092
|
+
interface SocialConfig {
|
|
1093
|
+
/**
|
|
1094
|
+
* Twitter configuration
|
|
1095
|
+
*/
|
|
1096
|
+
twitter?: TwitterSocialConfig;
|
|
1097
|
+
/**
|
|
1098
|
+
* Slack configuration
|
|
1099
|
+
*/
|
|
1100
|
+
slack?: SlackSocialConfig;
|
|
1101
|
+
/**
|
|
1102
|
+
* URL to full changelog (e.g., https://example.com/changelog)
|
|
1103
|
+
* This URL will be included in social media posts to allow users to view the complete changelog
|
|
1104
|
+
*/
|
|
1105
|
+
changelogUrl?: string;
|
|
1106
|
+
}
|
|
1107
|
+
interface TwitterOptions {
|
|
1108
|
+
/**
|
|
1109
|
+
* Release information
|
|
1110
|
+
*/
|
|
1111
|
+
version: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Project name
|
|
1114
|
+
*/
|
|
1115
|
+
projectName: string;
|
|
1116
|
+
/**
|
|
1117
|
+
* Changelog content
|
|
1118
|
+
*/
|
|
1119
|
+
changelog: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* Release URL (GitHub/GitLab)
|
|
1122
|
+
*/
|
|
1123
|
+
releaseUrl?: string;
|
|
1124
|
+
/**
|
|
1125
|
+
* Full changelog URL (e.g., https://example.com/changelog)
|
|
1126
|
+
*/
|
|
1127
|
+
changelogUrl?: string;
|
|
1128
|
+
/**
|
|
1129
|
+
* Twitter credentials (all fields required)
|
|
1130
|
+
*/
|
|
1131
|
+
credentials: {
|
|
1132
|
+
apiKey: string;
|
|
1133
|
+
apiKeySecret: string;
|
|
1134
|
+
accessToken: string;
|
|
1135
|
+
accessTokenSecret: string;
|
|
1136
|
+
};
|
|
1137
|
+
/**
|
|
1138
|
+
* Custom Twitter message template
|
|
1139
|
+
*/
|
|
1140
|
+
template: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Run without side effects
|
|
1143
|
+
* @default false
|
|
1144
|
+
*/
|
|
1145
|
+
dryRun?: boolean;
|
|
1146
|
+
}
|
|
1147
|
+
interface SlackOptions {
|
|
1148
|
+
/**
|
|
1149
|
+
* Release information
|
|
1150
|
+
*/
|
|
1151
|
+
version: string;
|
|
1152
|
+
/**
|
|
1153
|
+
* Project name
|
|
1154
|
+
*/
|
|
1155
|
+
projectName: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Changelog content
|
|
1158
|
+
*/
|
|
1159
|
+
changelog: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* Release URL (GitHub/GitLab)
|
|
1162
|
+
*/
|
|
1163
|
+
releaseUrl?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Full changelog URL (e.g., https://example.com/changelog)
|
|
1166
|
+
*/
|
|
1167
|
+
changelogUrl?: string;
|
|
1168
|
+
/**
|
|
1169
|
+
* Slack channel ID or name
|
|
1170
|
+
*/
|
|
1171
|
+
channel: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* Slack token (required)
|
|
1174
|
+
*/
|
|
1175
|
+
token: string;
|
|
1176
|
+
/**
|
|
1177
|
+
* Custom message template
|
|
1178
|
+
*/
|
|
1179
|
+
template?: string;
|
|
1180
|
+
/**
|
|
1181
|
+
* Run without side effects
|
|
1182
|
+
* @default false
|
|
1183
|
+
*/
|
|
1184
|
+
dryRun?: boolean;
|
|
1185
|
+
}
|
|
843
1186
|
interface TemplatesConfig {
|
|
844
1187
|
/**
|
|
845
1188
|
* Commit message template
|
|
@@ -857,6 +1200,18 @@ interface TemplatesConfig {
|
|
|
857
1200
|
* Empty changelog content
|
|
858
1201
|
*/
|
|
859
1202
|
emptyChangelogContent?: string;
|
|
1203
|
+
/**
|
|
1204
|
+
* 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}}'
|
|
1207
|
+
*/
|
|
1208
|
+
twitterMessage?: string;
|
|
1209
|
+
/**
|
|
1210
|
+
* Slack message template (optional - if not provided, uses rich blocks format)
|
|
1211
|
+
* Available variables: {{projectName}}, {{version}}, {{changelog}}, {{releaseUrl}}, {{changelogUrl}}
|
|
1212
|
+
* @default undefined
|
|
1213
|
+
*/
|
|
1214
|
+
slackMessage?: string;
|
|
860
1215
|
}
|
|
861
1216
|
interface RepoConfig {
|
|
862
1217
|
/**
|
|
@@ -878,7 +1233,43 @@ interface RepoConfig {
|
|
|
878
1233
|
provider?: GitProvider;
|
|
879
1234
|
}
|
|
880
1235
|
type HookType = 'before' | 'success' | 'error';
|
|
881
|
-
type HookStep = 'bump' | 'changelog' | 'commit-and-tag' | 'provider-release' | 'publish' | 'push' | 'release';
|
|
1236
|
+
type HookStep = 'bump' | 'changelog' | 'commit-and-tag' | 'provider-release' | 'publish' | 'push' | 'release' | 'social' | 'twitter' | 'slack';
|
|
1237
|
+
/**
|
|
1238
|
+
* API tokens configuration
|
|
1239
|
+
*/
|
|
1240
|
+
interface TokensConfig {
|
|
1241
|
+
/**
|
|
1242
|
+
* registry token for publishing
|
|
1243
|
+
* Environment variables: NPM_TOKEN, RELIZY_NPM_TOKEN, NODE_AUTH_TOKEN
|
|
1244
|
+
*/
|
|
1245
|
+
registry?: string;
|
|
1246
|
+
/**
|
|
1247
|
+
* GitHub token for creating releases
|
|
1248
|
+
* Environment variables: GITHUB_TOKEN, GH_TOKEN, RELIZY_GITHUB_TOKEN
|
|
1249
|
+
*/
|
|
1250
|
+
github?: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* GitLab token for creating releases
|
|
1253
|
+
* Environment variables: GITLAB_TOKEN, GITLAB_API_TOKEN, CI_JOB_TOKEN, RELIZY_GITLAB_TOKEN
|
|
1254
|
+
*/
|
|
1255
|
+
gitlab?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* Twitter API credentials for posting tweets
|
|
1258
|
+
* Environment variables: TWITTER_API_KEY, TWITTER_API_KEY_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET
|
|
1259
|
+
* Or with RELIZY_ prefix: RELIZY_TWITTER_API_KEY, etc.
|
|
1260
|
+
*/
|
|
1261
|
+
twitter?: {
|
|
1262
|
+
apiKey?: string;
|
|
1263
|
+
apiKeySecret?: string;
|
|
1264
|
+
accessToken?: string;
|
|
1265
|
+
accessTokenSecret?: string;
|
|
1266
|
+
};
|
|
1267
|
+
/**
|
|
1268
|
+
* Slack bot token for posting messages
|
|
1269
|
+
* Environment variables: SLACK_TOKEN, RELIZY_SLACK_TOKEN
|
|
1270
|
+
*/
|
|
1271
|
+
slack?: string;
|
|
1272
|
+
}
|
|
882
1273
|
/**
|
|
883
1274
|
* Hooks configuration
|
|
884
1275
|
* Useful to run custom scripts before, after a step or on error
|
|
@@ -895,7 +1286,7 @@ type HookConfig = {
|
|
|
895
1286
|
* Relizy configuration
|
|
896
1287
|
* @see https://louismazel.github.io/relizy/config/overview
|
|
897
1288
|
*/
|
|
898
|
-
interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templates' | 'publish' | 'types'>> {
|
|
1289
|
+
interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templates' | 'publish' | 'types' | 'tokens'>> {
|
|
899
1290
|
types?: Record<string, {
|
|
900
1291
|
title: string;
|
|
901
1292
|
semver?: SemverBumpType;
|
|
@@ -941,6 +1332,14 @@ interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templ
|
|
|
941
1332
|
* Release config
|
|
942
1333
|
*/
|
|
943
1334
|
release?: ReleaseConfig;
|
|
1335
|
+
/**
|
|
1336
|
+
* Social media configuration
|
|
1337
|
+
*/
|
|
1338
|
+
social?: SocialConfig;
|
|
1339
|
+
/**
|
|
1340
|
+
* API tokens configuration
|
|
1341
|
+
*/
|
|
1342
|
+
tokens?: TokensConfig;
|
|
944
1343
|
/**
|
|
945
1344
|
* Hooks config
|
|
946
1345
|
*/
|
|
@@ -965,10 +1364,7 @@ declare function providerReleaseSafetyCheck({ config, provider }: {
|
|
|
965
1364
|
config: ResolvedRelizyConfig;
|
|
966
1365
|
provider?: GitProvider | null;
|
|
967
1366
|
}): void;
|
|
968
|
-
declare function providerRelease(options?: Partial<ProviderReleaseOptions>): Promise<
|
|
969
|
-
detectedProvider: GitProvider;
|
|
970
|
-
postedReleases: PostedRelease[];
|
|
971
|
-
}>;
|
|
1367
|
+
declare function providerRelease(options?: Partial<ProviderReleaseOptions>): Promise<ProviderReleaseResult>;
|
|
972
1368
|
|
|
973
1369
|
declare function publishSafetyCheck({ config }: {
|
|
974
1370
|
config: ResolvedRelizyConfig;
|
|
@@ -979,5 +1375,10 @@ declare function publish(options?: Partial<PublishOptions>): Promise<{
|
|
|
979
1375
|
|
|
980
1376
|
declare function release(options?: Partial<ReleaseOptions>): Promise<void>;
|
|
981
1377
|
|
|
982
|
-
|
|
983
|
-
|
|
1378
|
+
declare function socialSafetyCheck({ config }: {
|
|
1379
|
+
config: ResolvedRelizyConfig;
|
|
1380
|
+
}): void;
|
|
1381
|
+
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1382
|
+
|
|
1383
|
+
export { bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getSlackToken, getTwitterCredentials, github, gitlab, hasLernaJson, isBumpedPackage, isChangedPreid, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, loadRelizyConfig, parseGitRemoteUrl, postReleaseToSlack, postReleaseToTwitter, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, readPackageJson, readPackages, release, resolveTags, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, topologicalSort, updateLernaVersion, writeChangelogToFile, writeVersion };
|
|
1384
|
+
export type { BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, PackageBase, PackageManager, PostedRelease, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, ReadPackage, ReleaseConfig, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackCredentials, SlackOptions, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { b as bump, c as changelog,
|
|
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';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
|
+
import 'node:process';
|
|
3
4
|
import 'node:fs';
|
|
4
5
|
import 'node:path';
|
|
5
6
|
import 'changelogen';
|
|
@@ -8,7 +9,6 @@ import '@inquirer/prompts';
|
|
|
8
9
|
import '@maz-ui/utils';
|
|
9
10
|
import 'semver';
|
|
10
11
|
import 'node:child_process';
|
|
11
|
-
import 'node:process';
|
|
12
12
|
import 'c12';
|
|
13
13
|
import 'defu';
|
|
14
14
|
import 'convert-gitmoji';
|