relizy 1.0.1 → 1.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +20 -5
- package/dist/index.d.mts +116 -6
- package/dist/index.d.ts +116 -6
- package/dist/index.mjs +2 -2
- package/dist/shared/{relizy.DrY7TMl7.mjs → relizy.DkafkQl2.mjs} +761 -50
- package/package.json +13 -13
package/dist/cli.mjs
CHANGED
|
@@ -5,13 +5,13 @@ 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 {
|
|
8
|
+
import { af as isInCI, ag as getCIName, b as bump, c as changelog, g as publish, e as providerRelease, h as social, p as prComment, r as release } from './shared/relizy.DkafkQl2.mjs';
|
|
9
|
+
import 'node:child_process';
|
|
9
10
|
import 'changelogen';
|
|
10
11
|
import 'fast-glob';
|
|
11
12
|
import '@inquirer/prompts';
|
|
12
13
|
import '@maz-ui/utils';
|
|
13
14
|
import 'semver';
|
|
14
|
-
import 'node:child_process';
|
|
15
15
|
import 'c12';
|
|
16
16
|
import 'defu';
|
|
17
17
|
import 'convert-gitmoji';
|
|
@@ -65,7 +65,7 @@ function getReleaseType(options) {
|
|
|
65
65
|
type = "prepatch";
|
|
66
66
|
return type;
|
|
67
67
|
}
|
|
68
|
-
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");
|
|
68
|
+
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);
|
|
69
69
|
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").action(async (options) => {
|
|
70
70
|
try {
|
|
71
71
|
await bump({
|
|
@@ -149,7 +149,20 @@ program.command("social").description("Post release announcements to social medi
|
|
|
149
149
|
process.exit(1);
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
-
program.command("
|
|
152
|
+
program.command("pr-comment").description("Post or re-post a PR comment with release information").action(async () => {
|
|
153
|
+
try {
|
|
154
|
+
await prComment({
|
|
155
|
+
prNumber: program.opts().prNumber,
|
|
156
|
+
dryRun: program.opts().dryRun,
|
|
157
|
+
logLevel: program.opts().logLevel,
|
|
158
|
+
configName: program.opts().config
|
|
159
|
+
});
|
|
160
|
+
} catch (error) {
|
|
161
|
+
logger.error("Failed to post PR comment -", error);
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
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').action(async (options) => {
|
|
153
166
|
try {
|
|
154
167
|
await release({
|
|
155
168
|
type: getReleaseType(options),
|
|
@@ -180,7 +193,9 @@ program.command("release").description("Complete release workflow (bump + change
|
|
|
180
193
|
yes: options.yes,
|
|
181
194
|
configName: program.opts().config,
|
|
182
195
|
safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0,
|
|
183
|
-
social: hasCliFlag("--no-social") ? false : void 0
|
|
196
|
+
social: hasCliFlag("--no-social") ? false : void 0,
|
|
197
|
+
prComment: hasCliFlag("--no-pr-comment") ? false : void 0,
|
|
198
|
+
prNumber: program.opts().prNumber
|
|
184
199
|
});
|
|
185
200
|
} catch (error) {
|
|
186
201
|
logger.error("Failed to release -", error);
|
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,7 @@ declare function getDefaultConfig(): {
|
|
|
77
77
|
onlyStable: boolean;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
prComment: Required<PrCommentConfig>;
|
|
80
81
|
logLevel: LogLevel;
|
|
81
82
|
safetyCheck: boolean;
|
|
82
83
|
};
|
|
@@ -215,6 +216,43 @@ declare function publishPackage({ pkg, config, packageManager, dryRun, }: {
|
|
|
215
216
|
dryRun: boolean;
|
|
216
217
|
}): Promise<void>;
|
|
217
218
|
|
|
219
|
+
interface PullRequestInfo {
|
|
220
|
+
/**
|
|
221
|
+
* PR/MR number
|
|
222
|
+
*/
|
|
223
|
+
number: number;
|
|
224
|
+
/**
|
|
225
|
+
* PR/MR URL
|
|
226
|
+
*/
|
|
227
|
+
url: string;
|
|
228
|
+
/**
|
|
229
|
+
* Git provider
|
|
230
|
+
*/
|
|
231
|
+
provider: GitProvider;
|
|
232
|
+
}
|
|
233
|
+
declare function findGitHubPR({ token, repo, branch, domain, }: {
|
|
234
|
+
token: string;
|
|
235
|
+
repo: string;
|
|
236
|
+
branch: string;
|
|
237
|
+
domain?: string;
|
|
238
|
+
}): Promise<PullRequestInfo | null>;
|
|
239
|
+
declare function findGitLabMR({ token, repo, branch, domain, }: {
|
|
240
|
+
token: string;
|
|
241
|
+
repo: string;
|
|
242
|
+
branch: string;
|
|
243
|
+
domain?: string;
|
|
244
|
+
}): Promise<PullRequestInfo | null>;
|
|
245
|
+
declare function detectPullRequest({ config, prNumber, }: {
|
|
246
|
+
config: ResolvedRelizyConfig;
|
|
247
|
+
prNumber?: number;
|
|
248
|
+
}): Promise<PullRequestInfo | null>;
|
|
249
|
+
declare const PR_COMMENT_MARKER = "<!-- relizy-pr-comment -->";
|
|
250
|
+
declare function postPrComment({ config, pr, body, }: {
|
|
251
|
+
config: ResolvedRelizyConfig;
|
|
252
|
+
pr: PullRequestInfo;
|
|
253
|
+
body: string;
|
|
254
|
+
}): Promise<void>;
|
|
255
|
+
|
|
218
256
|
declare function readPackageJson(packagePath: string): ReadPackage | undefined;
|
|
219
257
|
interface RootPackage extends ReadPackage {
|
|
220
258
|
fromTag: string;
|
|
@@ -299,14 +337,13 @@ declare function getLastTag({ logLevel, cwd }: {
|
|
|
299
337
|
}): Promise<string>;
|
|
300
338
|
declare function getLastRepoTag(options?: {
|
|
301
339
|
onlyStable?: boolean;
|
|
302
|
-
|
|
340
|
+
pkg?: ReadPackage;
|
|
303
341
|
logLevel?: LogLevel;
|
|
304
342
|
cwd?: string;
|
|
305
343
|
}): Promise<string | null>;
|
|
306
|
-
declare function getLastPackageTag({
|
|
307
|
-
|
|
344
|
+
declare function getLastPackageTag({ pkg, onlyStable, logLevel, cwd, }: {
|
|
345
|
+
pkg: ReadPackage;
|
|
308
346
|
onlyStable?: boolean;
|
|
309
|
-
currentVersion?: string;
|
|
310
347
|
logLevel?: LogLevel;
|
|
311
348
|
cwd?: string;
|
|
312
349
|
}): Promise<string | null>;
|
|
@@ -315,6 +352,13 @@ interface ResolvedTags {
|
|
|
315
352
|
from: string;
|
|
316
353
|
to: string;
|
|
317
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Special marker indicating this is a new package with no previous tags.
|
|
357
|
+
* When this marker is returned as the "from" tag, getPackageCommits should
|
|
358
|
+
* return an empty array instead of analyzing all commits from the beginning
|
|
359
|
+
* of the repository (which would cause ENOBUFS errors on large repos).
|
|
360
|
+
*/
|
|
361
|
+
declare const NEW_PACKAGE_MARKER: "__NEW_PACKAGE__";
|
|
318
362
|
declare function resolveTags<S extends Step, NewVersion = S extends 'bump' ? undefined : string>({ config, step, pkg, newVersion, }: {
|
|
319
363
|
config: ResolvedRelizyConfig;
|
|
320
364
|
step: S;
|
|
@@ -623,6 +667,33 @@ interface ProviderReleaseResult {
|
|
|
623
667
|
*/
|
|
624
668
|
error?: string;
|
|
625
669
|
}
|
|
670
|
+
type PrCommentMode = 'append' | 'update';
|
|
671
|
+
interface PrCommentConfig {
|
|
672
|
+
/**
|
|
673
|
+
* PR comment mode
|
|
674
|
+
* @default 'append'
|
|
675
|
+
*/
|
|
676
|
+
mode?: PrCommentMode;
|
|
677
|
+
}
|
|
678
|
+
type PrCommentStatus = 'success' | 'no-release' | 'failed';
|
|
679
|
+
interface ReleaseContext {
|
|
680
|
+
/**
|
|
681
|
+
* Release status
|
|
682
|
+
*/
|
|
683
|
+
status: PrCommentStatus;
|
|
684
|
+
/**
|
|
685
|
+
* Bump result (available when status is 'success')
|
|
686
|
+
*/
|
|
687
|
+
bumpResult?: BumpResultTruthy;
|
|
688
|
+
/**
|
|
689
|
+
* Git tags created during release
|
|
690
|
+
*/
|
|
691
|
+
tags?: string[];
|
|
692
|
+
/**
|
|
693
|
+
* Error message (available when status is 'failed')
|
|
694
|
+
*/
|
|
695
|
+
error?: string;
|
|
696
|
+
}
|
|
626
697
|
interface MonorepoConfig {
|
|
627
698
|
/**
|
|
628
699
|
* Version mode for the monorepo.
|
|
@@ -970,6 +1041,11 @@ interface ReleaseConfig {
|
|
|
970
1041
|
* @default false
|
|
971
1042
|
*/
|
|
972
1043
|
social?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Post release announcements to social media platforms
|
|
1046
|
+
* @default false
|
|
1047
|
+
*/
|
|
1048
|
+
prComment?: boolean;
|
|
973
1049
|
}
|
|
974
1050
|
interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, PublishConfig {
|
|
975
1051
|
/**
|
|
@@ -1016,6 +1092,10 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
|
|
|
1016
1092
|
* NPM token (e.g. "123456")
|
|
1017
1093
|
*/
|
|
1018
1094
|
publishToken?: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* Override PR/MR number for PR comment features
|
|
1097
|
+
*/
|
|
1098
|
+
prNumber?: number;
|
|
1019
1099
|
}
|
|
1020
1100
|
interface TwitterCredentials {
|
|
1021
1101
|
/**
|
|
@@ -1353,6 +1433,10 @@ interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templ
|
|
|
1353
1433
|
* Social media configuration
|
|
1354
1434
|
*/
|
|
1355
1435
|
social?: SocialConfig;
|
|
1436
|
+
/**
|
|
1437
|
+
* PR comment configuration
|
|
1438
|
+
*/
|
|
1439
|
+
prComment?: PrCommentConfig;
|
|
1356
1440
|
/**
|
|
1357
1441
|
* API tokens configuration
|
|
1358
1442
|
*/
|
|
@@ -1377,6 +1461,32 @@ declare function bump(options?: Partial<BumpOptions>): Promise<BumpResult>;
|
|
|
1377
1461
|
|
|
1378
1462
|
declare function changelog(options?: Partial<ChangelogOptions>): Promise<void>;
|
|
1379
1463
|
|
|
1464
|
+
interface PrCommentOptions {
|
|
1465
|
+
prNumber?: number;
|
|
1466
|
+
dryRun?: boolean;
|
|
1467
|
+
logLevel?: LogLevel;
|
|
1468
|
+
configName?: string;
|
|
1469
|
+
/** Pre-loaded config to avoid redundant config loading when called from release flow */
|
|
1470
|
+
config?: ResolvedRelizyConfig;
|
|
1471
|
+
/** Release context passed from the release flow. When absent, standalone mode is used. */
|
|
1472
|
+
releaseContext?: ReleaseContext;
|
|
1473
|
+
}
|
|
1474
|
+
interface CommentBodyParams {
|
|
1475
|
+
config: ResolvedRelizyConfig;
|
|
1476
|
+
branch: string;
|
|
1477
|
+
date: string;
|
|
1478
|
+
releaseContext?: ReleaseContext;
|
|
1479
|
+
/** Fallback packages for standalone CLI mode (no releaseContext) */
|
|
1480
|
+
packages?: Array<{
|
|
1481
|
+
name: string;
|
|
1482
|
+
version: string;
|
|
1483
|
+
}>;
|
|
1484
|
+
/** Fallback root version for standalone CLI mode */
|
|
1485
|
+
rootVersion?: string;
|
|
1486
|
+
}
|
|
1487
|
+
declare function buildCommentBody(params: CommentBodyParams): string;
|
|
1488
|
+
declare function prComment(options?: PrCommentOptions): Promise<void>;
|
|
1489
|
+
|
|
1380
1490
|
declare function providerReleaseSafetyCheck({ config, provider }: {
|
|
1381
1491
|
config: ResolvedRelizyConfig;
|
|
1382
1492
|
provider?: GitProvider | null;
|
|
@@ -1397,5 +1507,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1397
1507
|
}): Promise<void>;
|
|
1398
1508
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1399
1509
|
|
|
1400
|
-
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 };
|
|
1401
|
-
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 };
|
|
1510
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, findGitHubPR, findGitLabMR, 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, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, readPackageJson, readPackages, release, resolveTags, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, topologicalSort, updateLernaVersion, writeChangelogToFile, writeVersion };
|
|
1511
|
+
export type { BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, PackageBase, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, ReleaseConfig, ReleaseContext, 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.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ declare function getDefaultConfig(): {
|
|
|
77
77
|
onlyStable: boolean;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
prComment: Required<PrCommentConfig>;
|
|
80
81
|
logLevel: LogLevel;
|
|
81
82
|
safetyCheck: boolean;
|
|
82
83
|
};
|
|
@@ -215,6 +216,43 @@ declare function publishPackage({ pkg, config, packageManager, dryRun, }: {
|
|
|
215
216
|
dryRun: boolean;
|
|
216
217
|
}): Promise<void>;
|
|
217
218
|
|
|
219
|
+
interface PullRequestInfo {
|
|
220
|
+
/**
|
|
221
|
+
* PR/MR number
|
|
222
|
+
*/
|
|
223
|
+
number: number;
|
|
224
|
+
/**
|
|
225
|
+
* PR/MR URL
|
|
226
|
+
*/
|
|
227
|
+
url: string;
|
|
228
|
+
/**
|
|
229
|
+
* Git provider
|
|
230
|
+
*/
|
|
231
|
+
provider: GitProvider;
|
|
232
|
+
}
|
|
233
|
+
declare function findGitHubPR({ token, repo, branch, domain, }: {
|
|
234
|
+
token: string;
|
|
235
|
+
repo: string;
|
|
236
|
+
branch: string;
|
|
237
|
+
domain?: string;
|
|
238
|
+
}): Promise<PullRequestInfo | null>;
|
|
239
|
+
declare function findGitLabMR({ token, repo, branch, domain, }: {
|
|
240
|
+
token: string;
|
|
241
|
+
repo: string;
|
|
242
|
+
branch: string;
|
|
243
|
+
domain?: string;
|
|
244
|
+
}): Promise<PullRequestInfo | null>;
|
|
245
|
+
declare function detectPullRequest({ config, prNumber, }: {
|
|
246
|
+
config: ResolvedRelizyConfig;
|
|
247
|
+
prNumber?: number;
|
|
248
|
+
}): Promise<PullRequestInfo | null>;
|
|
249
|
+
declare const PR_COMMENT_MARKER = "<!-- relizy-pr-comment -->";
|
|
250
|
+
declare function postPrComment({ config, pr, body, }: {
|
|
251
|
+
config: ResolvedRelizyConfig;
|
|
252
|
+
pr: PullRequestInfo;
|
|
253
|
+
body: string;
|
|
254
|
+
}): Promise<void>;
|
|
255
|
+
|
|
218
256
|
declare function readPackageJson(packagePath: string): ReadPackage | undefined;
|
|
219
257
|
interface RootPackage extends ReadPackage {
|
|
220
258
|
fromTag: string;
|
|
@@ -299,14 +337,13 @@ declare function getLastTag({ logLevel, cwd }: {
|
|
|
299
337
|
}): Promise<string>;
|
|
300
338
|
declare function getLastRepoTag(options?: {
|
|
301
339
|
onlyStable?: boolean;
|
|
302
|
-
|
|
340
|
+
pkg?: ReadPackage;
|
|
303
341
|
logLevel?: LogLevel;
|
|
304
342
|
cwd?: string;
|
|
305
343
|
}): Promise<string | null>;
|
|
306
|
-
declare function getLastPackageTag({
|
|
307
|
-
|
|
344
|
+
declare function getLastPackageTag({ pkg, onlyStable, logLevel, cwd, }: {
|
|
345
|
+
pkg: ReadPackage;
|
|
308
346
|
onlyStable?: boolean;
|
|
309
|
-
currentVersion?: string;
|
|
310
347
|
logLevel?: LogLevel;
|
|
311
348
|
cwd?: string;
|
|
312
349
|
}): Promise<string | null>;
|
|
@@ -315,6 +352,13 @@ interface ResolvedTags {
|
|
|
315
352
|
from: string;
|
|
316
353
|
to: string;
|
|
317
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Special marker indicating this is a new package with no previous tags.
|
|
357
|
+
* When this marker is returned as the "from" tag, getPackageCommits should
|
|
358
|
+
* return an empty array instead of analyzing all commits from the beginning
|
|
359
|
+
* of the repository (which would cause ENOBUFS errors on large repos).
|
|
360
|
+
*/
|
|
361
|
+
declare const NEW_PACKAGE_MARKER: "__NEW_PACKAGE__";
|
|
318
362
|
declare function resolveTags<S extends Step, NewVersion = S extends 'bump' ? undefined : string>({ config, step, pkg, newVersion, }: {
|
|
319
363
|
config: ResolvedRelizyConfig;
|
|
320
364
|
step: S;
|
|
@@ -623,6 +667,33 @@ interface ProviderReleaseResult {
|
|
|
623
667
|
*/
|
|
624
668
|
error?: string;
|
|
625
669
|
}
|
|
670
|
+
type PrCommentMode = 'append' | 'update';
|
|
671
|
+
interface PrCommentConfig {
|
|
672
|
+
/**
|
|
673
|
+
* PR comment mode
|
|
674
|
+
* @default 'append'
|
|
675
|
+
*/
|
|
676
|
+
mode?: PrCommentMode;
|
|
677
|
+
}
|
|
678
|
+
type PrCommentStatus = 'success' | 'no-release' | 'failed';
|
|
679
|
+
interface ReleaseContext {
|
|
680
|
+
/**
|
|
681
|
+
* Release status
|
|
682
|
+
*/
|
|
683
|
+
status: PrCommentStatus;
|
|
684
|
+
/**
|
|
685
|
+
* Bump result (available when status is 'success')
|
|
686
|
+
*/
|
|
687
|
+
bumpResult?: BumpResultTruthy;
|
|
688
|
+
/**
|
|
689
|
+
* Git tags created during release
|
|
690
|
+
*/
|
|
691
|
+
tags?: string[];
|
|
692
|
+
/**
|
|
693
|
+
* Error message (available when status is 'failed')
|
|
694
|
+
*/
|
|
695
|
+
error?: string;
|
|
696
|
+
}
|
|
626
697
|
interface MonorepoConfig {
|
|
627
698
|
/**
|
|
628
699
|
* Version mode for the monorepo.
|
|
@@ -970,6 +1041,11 @@ interface ReleaseConfig {
|
|
|
970
1041
|
* @default false
|
|
971
1042
|
*/
|
|
972
1043
|
social?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Post release announcements to social media platforms
|
|
1046
|
+
* @default false
|
|
1047
|
+
*/
|
|
1048
|
+
prComment?: boolean;
|
|
973
1049
|
}
|
|
974
1050
|
interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, PublishConfig {
|
|
975
1051
|
/**
|
|
@@ -1016,6 +1092,10 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
|
|
|
1016
1092
|
* NPM token (e.g. "123456")
|
|
1017
1093
|
*/
|
|
1018
1094
|
publishToken?: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* Override PR/MR number for PR comment features
|
|
1097
|
+
*/
|
|
1098
|
+
prNumber?: number;
|
|
1019
1099
|
}
|
|
1020
1100
|
interface TwitterCredentials {
|
|
1021
1101
|
/**
|
|
@@ -1353,6 +1433,10 @@ interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templ
|
|
|
1353
1433
|
* Social media configuration
|
|
1354
1434
|
*/
|
|
1355
1435
|
social?: SocialConfig;
|
|
1436
|
+
/**
|
|
1437
|
+
* PR comment configuration
|
|
1438
|
+
*/
|
|
1439
|
+
prComment?: PrCommentConfig;
|
|
1356
1440
|
/**
|
|
1357
1441
|
* API tokens configuration
|
|
1358
1442
|
*/
|
|
@@ -1377,6 +1461,32 @@ declare function bump(options?: Partial<BumpOptions>): Promise<BumpResult>;
|
|
|
1377
1461
|
|
|
1378
1462
|
declare function changelog(options?: Partial<ChangelogOptions>): Promise<void>;
|
|
1379
1463
|
|
|
1464
|
+
interface PrCommentOptions {
|
|
1465
|
+
prNumber?: number;
|
|
1466
|
+
dryRun?: boolean;
|
|
1467
|
+
logLevel?: LogLevel;
|
|
1468
|
+
configName?: string;
|
|
1469
|
+
/** Pre-loaded config to avoid redundant config loading when called from release flow */
|
|
1470
|
+
config?: ResolvedRelizyConfig;
|
|
1471
|
+
/** Release context passed from the release flow. When absent, standalone mode is used. */
|
|
1472
|
+
releaseContext?: ReleaseContext;
|
|
1473
|
+
}
|
|
1474
|
+
interface CommentBodyParams {
|
|
1475
|
+
config: ResolvedRelizyConfig;
|
|
1476
|
+
branch: string;
|
|
1477
|
+
date: string;
|
|
1478
|
+
releaseContext?: ReleaseContext;
|
|
1479
|
+
/** Fallback packages for standalone CLI mode (no releaseContext) */
|
|
1480
|
+
packages?: Array<{
|
|
1481
|
+
name: string;
|
|
1482
|
+
version: string;
|
|
1483
|
+
}>;
|
|
1484
|
+
/** Fallback root version for standalone CLI mode */
|
|
1485
|
+
rootVersion?: string;
|
|
1486
|
+
}
|
|
1487
|
+
declare function buildCommentBody(params: CommentBodyParams): string;
|
|
1488
|
+
declare function prComment(options?: PrCommentOptions): Promise<void>;
|
|
1489
|
+
|
|
1380
1490
|
declare function providerReleaseSafetyCheck({ config, provider }: {
|
|
1381
1491
|
config: ResolvedRelizyConfig;
|
|
1382
1492
|
provider?: GitProvider | null;
|
|
@@ -1397,5 +1507,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1397
1507
|
}): Promise<void>;
|
|
1398
1508
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1399
1509
|
|
|
1400
|
-
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 };
|
|
1401
|
-
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 };
|
|
1510
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, findGitHubPR, findGitLabMR, 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, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, readPackageJson, readPackages, release, resolveTags, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, topologicalSort, updateLernaVersion, writeChangelogToFile, writeVersion };
|
|
1511
|
+
export type { BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, PackageBase, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, ReleaseConfig, ReleaseContext, 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,6 +1,7 @@
|
|
|
1
|
-
export { b as bump, c as changelog,
|
|
1
|
+
export { a9 as NEW_PACKAGE_MARKER, S as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, c as changelog, u as checkGitStatusIfDirty, az as confirmBump, A as createCommitAndTags, H as createGitlabRelease, k as defineConfig, x as detectGitProvider, J as detectPackageManager, R as detectPullRequest, K as determinePublishTag, an as determineReleaseType, am as determineSemverChange, ai as executeBuildCmd, ah as executeFormatCmd, ae as executeHook, o as expandPackagesToBumpWithDependents, a2 as extractChangelogSummary, ar as extractVersionFromPackageTag, aC as extractVersionFromTag, v as fetchGitTags, P as findGitHubPR, Q as findGitLabMR, $ as formatChangelogForSlack, a0 as formatSlackMessage, ac as formatTweetMessage, i as generateChangelog, N as getAuthCommand, aA as getBumpedIndependentPackages, ay as getBumpedPackageIndependently, ag as getCIName, E as getCurrentGitBranch, F as getCurrentGitRef, j as getDefaultConfig, n as getDependentsOf, D as getFirstCommit, q as getGitStatus, a4 as getIndependentTag, a8 as getLastPackageTag, a7 as getLastRepoTag, a5 as getLastStableTag, a6 as getLastTag, z as getModifiedReleaseFilePatterns, Y as getPackageCommits, m as getPackageDependencies, ap as getPackageNewVersion, X as getPackages, ak as getPackagesOrBumpedPackages, M as getPackagesToPublishInIndependentMode, L as getPackagesToPublishInSelectiveMode, aw as getPreid, a3 as getReleaseUrl, V as getRootPackage, _ as getSlackToken, ab as getTwitterCredentials, G as github, I as gitlab, Z as hasLernaJson, aj as isBumpedPackage, ax as isChangedPreid, av as isGraduating, al as isGraduatingToStableBetweenVersion, af as isInCI, as as isPrerelease, au as isPrereleaseReleaseType, at as isStableReleaseType, aD as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, y as parseGitRemoteUrl, T as postPrComment, a1 as postReleaseToSlack, ad as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, O as publishPackage, f as publishSafetyCheck, B as pushCommitAndTags, U as readPackageJson, W as readPackages, r as release, aa as resolveTags, C as rollbackModifiedFiles, aB as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, aq as updateLernaVersion, w as writeChangelogToFile, ao as writeVersion } from './shared/relizy.DkafkQl2.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:process';
|
|
4
|
+
import 'node:child_process';
|
|
4
5
|
import 'node:fs';
|
|
5
6
|
import 'node:path';
|
|
6
7
|
import 'changelogen';
|
|
@@ -8,7 +9,6 @@ import 'fast-glob';
|
|
|
8
9
|
import '@inquirer/prompts';
|
|
9
10
|
import '@maz-ui/utils';
|
|
10
11
|
import 'semver';
|
|
11
|
-
import 'node:child_process';
|
|
12
12
|
import 'c12';
|
|
13
13
|
import 'defu';
|
|
14
14
|
import 'convert-gitmoji';
|