relizy 1.3.0-beta.0 → 1.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +37 -4
- package/dist/index.d.ts +37 -4
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.B5flwwGK.mjs → relizy.CupzvopJ.mjs} +68 -18
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import process from 'node:process';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { printBanner, logger } from '@maz-ui/node';
|
|
7
7
|
import { Command } from 'commander';
|
|
8
|
-
import { ag as isInCI, ah 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.
|
|
8
|
+
import { ag as isInCI, ah 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.CupzvopJ.mjs';
|
|
9
9
|
import '@maz-ui/utils';
|
|
10
10
|
import 'c12';
|
|
11
11
|
import 'changelogen';
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,8 @@ declare function getDefaultConfig(): {
|
|
|
9
9
|
cwd: string;
|
|
10
10
|
types: NonNullable<RelizyConfig["types"]>;
|
|
11
11
|
templates: {
|
|
12
|
-
commitMessage: string;
|
|
12
|
+
commitMessage: string | undefined;
|
|
13
|
+
commitBody: string | undefined;
|
|
13
14
|
tagMessage: string;
|
|
14
15
|
tagBody: string;
|
|
15
16
|
emptyChangelogContent: string;
|
|
@@ -436,7 +437,15 @@ declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force
|
|
|
436
437
|
|
|
437
438
|
declare function isGraduatingToStableBetweenVersion(version: string, newVersion: string): boolean;
|
|
438
439
|
type SemverChangeType = 'major' | 'minor' | 'patch' | undefined;
|
|
439
|
-
|
|
440
|
+
/**
|
|
441
|
+
* When the current version is in the `0.x.y` range (initial development per
|
|
442
|
+
* semver §4), breaking changes must not graduate to `1.0.0` automatically.
|
|
443
|
+
* This helper downgrades an auto-detected `major` change to `minor` in that
|
|
444
|
+
* case. Explicit CLI release types (major, premajor, ...) are NOT passed
|
|
445
|
+
* through this function — only commit-based detection is capped.
|
|
446
|
+
*/
|
|
447
|
+
declare function capReleaseTypeForZeroMajor(currentVersion: string, detected: SemverChangeType): SemverChangeType;
|
|
448
|
+
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string): SemverChangeType;
|
|
440
449
|
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
|
|
441
450
|
currentVersion: string;
|
|
442
451
|
commits?: GitCommit[];
|
|
@@ -1330,19 +1339,43 @@ interface SlackOptions {
|
|
|
1330
1339
|
}
|
|
1331
1340
|
interface TemplatesConfig {
|
|
1332
1341
|
/**
|
|
1333
|
-
* Commit message template
|
|
1342
|
+
* Commit message template (title).
|
|
1343
|
+
*
|
|
1344
|
+
* Default in `unified`/`selective` modes: `'chore(release): bump version to {{newVersion}}'`.
|
|
1345
|
+
* Default in `independent` mode (when not customized): `'chore(release): bump {{packageCount}} packages'`.
|
|
1346
|
+
*
|
|
1347
|
+
* Available variables:
|
|
1348
|
+
* - `{{newVersion}}` — in `independent` mode, comma-separated list of bumped `name@version` (legacy behavior); otherwise the new version.
|
|
1349
|
+
* - `{{packageCount}}` — number of bumped packages.
|
|
1350
|
+
* - `{{packageNames}}` — comma-separated list of bumped package names.
|
|
1351
|
+
* - `{{packageList}}` — comma-separated list of bumped `name@version`.
|
|
1352
|
+
* - `{{rootVersion}}` — version from the root `package.json`.
|
|
1334
1353
|
*/
|
|
1335
1354
|
commitMessage?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Commit message body template. When defined, it is passed as the commit body.
|
|
1357
|
+
*
|
|
1358
|
+
* Default in `unified`/`selective` modes: `undefined` (no body).
|
|
1359
|
+
* Default in `independent` mode (when `commitMessage` and `commitBody` are not customized): `'{{packageList}}'`.
|
|
1360
|
+
*
|
|
1361
|
+
* Same variables as `commitMessage`.
|
|
1362
|
+
*/
|
|
1363
|
+
commitBody?: string;
|
|
1336
1364
|
/**
|
|
1337
1365
|
* Tag message template
|
|
1366
|
+
* @default 'Bump version to {{newVersion}}'
|
|
1367
|
+
* Available variables: {{newVersion}}
|
|
1338
1368
|
*/
|
|
1339
1369
|
tagMessage?: string;
|
|
1340
1370
|
/**
|
|
1341
1371
|
* Not used with "independent" version mode
|
|
1372
|
+
* @default 'v{{newVersion}}'
|
|
1373
|
+
* Available variables: {{newVersion}}
|
|
1342
1374
|
*/
|
|
1343
1375
|
tagBody?: string;
|
|
1344
1376
|
/**
|
|
1345
1377
|
* Empty changelog content
|
|
1378
|
+
* @default 'No relevant changes for this release'
|
|
1346
1379
|
*/
|
|
1347
1380
|
emptyChangelogContent?: string;
|
|
1348
1381
|
/**
|
|
@@ -1566,5 +1599,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1566
1599
|
}): Promise<void>;
|
|
1567
1600
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1568
1601
|
|
|
1569
|
-
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, filterOutPrivatePackages, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, 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 };
|
|
1602
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, 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 };
|
|
1570
1603
|
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
|
@@ -9,7 +9,8 @@ declare function getDefaultConfig(): {
|
|
|
9
9
|
cwd: string;
|
|
10
10
|
types: NonNullable<RelizyConfig["types"]>;
|
|
11
11
|
templates: {
|
|
12
|
-
commitMessage: string;
|
|
12
|
+
commitMessage: string | undefined;
|
|
13
|
+
commitBody: string | undefined;
|
|
13
14
|
tagMessage: string;
|
|
14
15
|
tagBody: string;
|
|
15
16
|
emptyChangelogContent: string;
|
|
@@ -436,7 +437,15 @@ declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force
|
|
|
436
437
|
|
|
437
438
|
declare function isGraduatingToStableBetweenVersion(version: string, newVersion: string): boolean;
|
|
438
439
|
type SemverChangeType = 'major' | 'minor' | 'patch' | undefined;
|
|
439
|
-
|
|
440
|
+
/**
|
|
441
|
+
* When the current version is in the `0.x.y` range (initial development per
|
|
442
|
+
* semver §4), breaking changes must not graduate to `1.0.0` automatically.
|
|
443
|
+
* This helper downgrades an auto-detected `major` change to `minor` in that
|
|
444
|
+
* case. Explicit CLI release types (major, premajor, ...) are NOT passed
|
|
445
|
+
* through this function — only commit-based detection is capped.
|
|
446
|
+
*/
|
|
447
|
+
declare function capReleaseTypeForZeroMajor(currentVersion: string, detected: SemverChangeType): SemverChangeType;
|
|
448
|
+
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string): SemverChangeType;
|
|
440
449
|
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
|
|
441
450
|
currentVersion: string;
|
|
442
451
|
commits?: GitCommit[];
|
|
@@ -1330,19 +1339,43 @@ interface SlackOptions {
|
|
|
1330
1339
|
}
|
|
1331
1340
|
interface TemplatesConfig {
|
|
1332
1341
|
/**
|
|
1333
|
-
* Commit message template
|
|
1342
|
+
* Commit message template (title).
|
|
1343
|
+
*
|
|
1344
|
+
* Default in `unified`/`selective` modes: `'chore(release): bump version to {{newVersion}}'`.
|
|
1345
|
+
* Default in `independent` mode (when not customized): `'chore(release): bump {{packageCount}} packages'`.
|
|
1346
|
+
*
|
|
1347
|
+
* Available variables:
|
|
1348
|
+
* - `{{newVersion}}` — in `independent` mode, comma-separated list of bumped `name@version` (legacy behavior); otherwise the new version.
|
|
1349
|
+
* - `{{packageCount}}` — number of bumped packages.
|
|
1350
|
+
* - `{{packageNames}}` — comma-separated list of bumped package names.
|
|
1351
|
+
* - `{{packageList}}` — comma-separated list of bumped `name@version`.
|
|
1352
|
+
* - `{{rootVersion}}` — version from the root `package.json`.
|
|
1334
1353
|
*/
|
|
1335
1354
|
commitMessage?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Commit message body template. When defined, it is passed as the commit body.
|
|
1357
|
+
*
|
|
1358
|
+
* Default in `unified`/`selective` modes: `undefined` (no body).
|
|
1359
|
+
* Default in `independent` mode (when `commitMessage` and `commitBody` are not customized): `'{{packageList}}'`.
|
|
1360
|
+
*
|
|
1361
|
+
* Same variables as `commitMessage`.
|
|
1362
|
+
*/
|
|
1363
|
+
commitBody?: string;
|
|
1336
1364
|
/**
|
|
1337
1365
|
* Tag message template
|
|
1366
|
+
* @default 'Bump version to {{newVersion}}'
|
|
1367
|
+
* Available variables: {{newVersion}}
|
|
1338
1368
|
*/
|
|
1339
1369
|
tagMessage?: string;
|
|
1340
1370
|
/**
|
|
1341
1371
|
* Not used with "independent" version mode
|
|
1372
|
+
* @default 'v{{newVersion}}'
|
|
1373
|
+
* Available variables: {{newVersion}}
|
|
1342
1374
|
*/
|
|
1343
1375
|
tagBody?: string;
|
|
1344
1376
|
/**
|
|
1345
1377
|
* Empty changelog content
|
|
1378
|
+
* @default 'No relevant changes for this release'
|
|
1346
1379
|
*/
|
|
1347
1380
|
emptyChangelogContent?: string;
|
|
1348
1381
|
/**
|
|
@@ -1566,5 +1599,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1566
1599
|
}): Promise<void>;
|
|
1567
1600
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1568
1601
|
|
|
1569
|
-
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, filterOutPrivatePackages, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, 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 };
|
|
1602
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, 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 };
|
|
1570
1603
|
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,4 +1,4 @@
|
|
|
1
|
-
export { aa as NEW_PACKAGE_MARKER, T as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, c as changelog, u as checkGitStatusIfDirty,
|
|
1
|
+
export { aa as NEW_PACKAGE_MARKER, T as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, ao as capReleaseTypeForZeroMajor, c as changelog, u as checkGitStatusIfDirty, aC as confirmBump, A as createCommitAndTags, I as createGitlabRelease, k as defineConfig, x as detectGitProvider, K as detectPackageManager, S as detectPullRequest, L as determinePublishTag, aq as determineReleaseType, ap as determineSemverChange, aj as executeBuildCmd, ai as executeFormatCmd, af as executeHook, o as expandPackagesToBumpWithDependents, a3 as extractChangelogSummary, au as extractVersionFromPackageTag, aF as extractVersionFromTag, v as fetchGitTags, al as filterOutPrivatePackages, Q as findGitHubPR, R as findGitLabMR, a0 as formatChangelogForSlack, a1 as formatSlackMessage, ad as formatTweetMessage, i as generateChangelog, O as getAuthCommand, aD as getBumpedIndependentPackages, aB as getBumpedPackageIndependently, ah as getCIName, aG as getCanaryVersion, E as getCurrentGitBranch, F as getCurrentGitRef, j as getDefaultConfig, n as getDependentsOf, D as getFirstCommit, q as getGitStatus, a5 as getIndependentTag, a9 as getLastPackageTag, a8 as getLastRepoTag, a6 as getLastStableTag, a7 as getLastTag, z as getModifiedReleaseFilePatterns, Z as getPackageCommits, m as getPackageDependencies, as as getPackageNewVersion, Y as getPackages, am as getPackagesOrBumpedPackages, N as getPackagesToPublishInIndependentMode, M as getPackagesToPublishInSelectiveMode, az as getPreid, a4 as getReleaseUrl, W as getRootPackage, G as getShortCommitSha, $ as getSlackToken, ac as getTwitterCredentials, H as github, J as gitlab, _ as hasLernaJson, ak as isBumpedPackage, aA as isChangedPreid, ay as isGraduating, an as isGraduatingToStableBetweenVersion, ag as isInCI, av as isPrerelease, ax as isPrereleaseReleaseType, aw as isStableReleaseType, aH as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, y as parseGitRemoteUrl, U as postPrComment, a2 as postReleaseToSlack, ae as postReleaseToTwitter, p as prComment, e as providerRelease, d as providerReleaseSafetyCheck, g as publish, P as publishPackage, f as publishSafetyCheck, B as pushCommitAndTags, V as readPackageJson, X as readPackages, r as release, ab as resolveTags, C as rollbackModifiedFiles, aE as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, at as updateLernaVersion, w as writeChangelogToFile, ar as writeVersion } from './shared/relizy.CupzvopJ.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:process';
|
|
4
4
|
import '@maz-ui/utils';
|
|
@@ -502,7 +502,18 @@ function isGraduatingToStableBetweenVersion(version, newVersion) {
|
|
|
502
502
|
const toStable = semver.prerelease(newVersion) === null;
|
|
503
503
|
return isSameBase && fromPrerelease && toStable;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function capReleaseTypeForZeroMajor(currentVersion, detected) {
|
|
506
|
+
if (detected !== "major")
|
|
507
|
+
return detected;
|
|
508
|
+
try {
|
|
509
|
+
if (semver.major(currentVersion) === 0)
|
|
510
|
+
return "minor";
|
|
511
|
+
} catch {
|
|
512
|
+
return detected;
|
|
513
|
+
}
|
|
514
|
+
return detected;
|
|
515
|
+
}
|
|
516
|
+
function determineSemverChange(commits, types, currentVersion) {
|
|
506
517
|
let [hasMajor, hasMinor, hasPatch] = [false, false, false];
|
|
507
518
|
for (const commit of commits) {
|
|
508
519
|
const commitType = types[commit.type];
|
|
@@ -518,10 +529,13 @@ function determineSemverChange(commits, types) {
|
|
|
518
529
|
hasPatch = true;
|
|
519
530
|
}
|
|
520
531
|
}
|
|
521
|
-
|
|
532
|
+
const detected = hasMajor ? "major" : hasMinor ? "minor" : hasPatch ? "patch" : void 0;
|
|
533
|
+
if (currentVersion)
|
|
534
|
+
return capReleaseTypeForZeroMajor(currentVersion, detected);
|
|
535
|
+
return detected;
|
|
522
536
|
}
|
|
523
|
-
function detectReleaseTypeFromCommits(commits, types) {
|
|
524
|
-
return determineSemverChange(commits, types);
|
|
537
|
+
function detectReleaseTypeFromCommits(commits, types, currentVersion) {
|
|
538
|
+
return determineSemverChange(commits, types, currentVersion);
|
|
525
539
|
}
|
|
526
540
|
function validatePrereleaseDowngrade(currentVersion, targetPreid, configuredType) {
|
|
527
541
|
if (configuredType !== "prerelease" || !targetPreid || !isPrerelease(currentVersion)) {
|
|
@@ -533,12 +547,12 @@ function validatePrereleaseDowngrade(currentVersion, targetPreid, configuredType
|
|
|
533
547
|
throw new Error(`Unable to graduate from ${currentVersion} to ${testVersion}, it's not a valid prerelease`);
|
|
534
548
|
}
|
|
535
549
|
}
|
|
536
|
-
function handleStableVersionWithReleaseType(commits, types, force) {
|
|
550
|
+
function handleStableVersionWithReleaseType(currentVersion, commits, types, force) {
|
|
537
551
|
if (!commits?.length && !force) {
|
|
538
552
|
logger.debug('No commits found for stable version with "release" type, skipping bump');
|
|
539
553
|
return void 0;
|
|
540
554
|
}
|
|
541
|
-
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types) : void 0;
|
|
555
|
+
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion) : void 0;
|
|
542
556
|
if (!detectedType && !force) {
|
|
543
557
|
logger.debug("No significant commits found, skipping bump");
|
|
544
558
|
return void 0;
|
|
@@ -546,12 +560,12 @@ function handleStableVersionWithReleaseType(commits, types, force) {
|
|
|
546
560
|
logger.debug(`Auto-detected release type from commits: ${detectedType}`);
|
|
547
561
|
return detectedType;
|
|
548
562
|
}
|
|
549
|
-
function handleStableVersionWithPrereleaseType(commits, types, force) {
|
|
563
|
+
function handleStableVersionWithPrereleaseType(currentVersion, commits, types, force) {
|
|
550
564
|
if (!commits?.length && !force) {
|
|
551
565
|
logger.debug('No commits found for stable version with "prerelease" type, skipping bump');
|
|
552
566
|
return void 0;
|
|
553
567
|
}
|
|
554
|
-
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types) : void 0;
|
|
568
|
+
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion) : void 0;
|
|
555
569
|
if (!detectedType) {
|
|
556
570
|
logger.debug("No significant commits found, using prepatch as default");
|
|
557
571
|
return "prepatch";
|
|
@@ -604,7 +618,7 @@ function handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, comm
|
|
|
604
618
|
return void 0;
|
|
605
619
|
}
|
|
606
620
|
if (commits?.length) {
|
|
607
|
-
const detectedType = detectReleaseTypeFromCommits(commits, types);
|
|
621
|
+
const detectedType = detectReleaseTypeFromCommits(commits, types, currentVersion);
|
|
608
622
|
const impliedBump = getImpliedBumpFromPrerelease(currentVersion);
|
|
609
623
|
const detectedRank = getSemverRank(detectedType);
|
|
610
624
|
const impliedRank = getSemverRank(impliedBump);
|
|
@@ -649,10 +663,10 @@ function determineReleaseType({
|
|
|
649
663
|
const isCurrentPrerelease = isPrerelease(currentVersion);
|
|
650
664
|
if (!isCurrentPrerelease) {
|
|
651
665
|
if (releaseType === "release") {
|
|
652
|
-
return handleStableVersionWithReleaseType(commits, types, force);
|
|
666
|
+
return handleStableVersionWithReleaseType(currentVersion, commits, types, force);
|
|
653
667
|
}
|
|
654
668
|
if (releaseType === "prerelease") {
|
|
655
|
-
return handleStableVersionWithPrereleaseType(commits, types, force);
|
|
669
|
+
return handleStableVersionWithPrereleaseType(currentVersion, commits, types, force);
|
|
656
670
|
}
|
|
657
671
|
return handleExplicitReleaseType({ releaseType, currentVersion });
|
|
658
672
|
}
|
|
@@ -1827,7 +1841,9 @@ function getDefaultConfig() {
|
|
|
1827
1841
|
ci: { title: "\u{1F916} CI" }
|
|
1828
1842
|
},
|
|
1829
1843
|
templates: {
|
|
1830
|
-
commitMessage
|
|
1844
|
+
// commitMessage & commitBody are resolved dynamically in loadRelizyConfig based on monorepo.versionMode.
|
|
1845
|
+
commitMessage: void 0,
|
|
1846
|
+
commitBody: void 0,
|
|
1831
1847
|
tagMessage: "Bump version to {{newVersion}}",
|
|
1832
1848
|
tagBody: "v{{newVersion}}",
|
|
1833
1849
|
emptyChangelogContent: "No relevant changes for this release",
|
|
@@ -1902,6 +1918,16 @@ function getDefaultConfig() {
|
|
|
1902
1918
|
safetyCheck: true
|
|
1903
1919
|
};
|
|
1904
1920
|
}
|
|
1921
|
+
function resolveTemplateDefaults(config) {
|
|
1922
|
+
const templates = config.templates ?? (config.templates = {});
|
|
1923
|
+
const isIndependent = config.monorepo?.versionMode === "independent";
|
|
1924
|
+
if (templates.commitMessage === void 0) {
|
|
1925
|
+
templates.commitMessage = isIndependent ? "chore(release): bump {{packageCount}} packages" : "chore(release): bump version to {{newVersion}}";
|
|
1926
|
+
if (isIndependent && templates.commitBody === void 0) {
|
|
1927
|
+
templates.commitBody = "{{packageList}}";
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1905
1931
|
function setupLogger(logLevel) {
|
|
1906
1932
|
if (logLevel) {
|
|
1907
1933
|
logger.setLevel(logLevel);
|
|
@@ -1948,6 +1974,7 @@ async function loadRelizyConfig(options) {
|
|
|
1948
1974
|
}
|
|
1949
1975
|
setupLogger(options?.overrides?.logLevel || results.config.logLevel);
|
|
1950
1976
|
logger.verbose("User config:", formatJson(results.config.changelog));
|
|
1977
|
+
resolveTemplateDefaults(results.config);
|
|
1951
1978
|
const resolvedConfig = await resolveConfig(results.config, cwd);
|
|
1952
1979
|
logger.debug("Resolved config:", formatJson(resolvedConfig));
|
|
1953
1980
|
return resolvedConfig;
|
|
@@ -2089,15 +2116,38 @@ async function createCommitAndTags({
|
|
|
2089
2116
|
throw new Error("Failed to read root package.json");
|
|
2090
2117
|
}
|
|
2091
2118
|
newVersion = newVersion || rootPackage.version;
|
|
2092
|
-
const
|
|
2093
|
-
const
|
|
2119
|
+
const isIndependent = internalConfig.monorepo?.versionMode === "independent";
|
|
2120
|
+
const packageList = bumpedPackages?.map((pkg) => getIndependentTag({ name: pkg.name, version: pkg.newVersion || pkg.version })).join(", ") || "";
|
|
2121
|
+
const packageNames = bumpedPackages?.map((pkg) => pkg.name).join(", ") || "";
|
|
2122
|
+
const packageCount = bumpedPackages?.length ?? 0;
|
|
2123
|
+
const versionForMessage = isIndependent ? packageList || "unknown" : newVersion || "unknown";
|
|
2124
|
+
const placeholders = {
|
|
2125
|
+
newVersion: versionForMessage,
|
|
2126
|
+
rootVersion: rootPackage.version || "unknown",
|
|
2127
|
+
packageCount: String(packageCount),
|
|
2128
|
+
packageNames: packageNames || "unknown",
|
|
2129
|
+
packageList: packageList || "unknown"
|
|
2130
|
+
};
|
|
2131
|
+
const applyPlaceholders = (template) => {
|
|
2132
|
+
let out = template;
|
|
2133
|
+
for (const [key, value] of Object.entries(placeholders)) {
|
|
2134
|
+
out = out.replaceAll(`{{${key}}}`, value);
|
|
2135
|
+
}
|
|
2136
|
+
return out;
|
|
2137
|
+
};
|
|
2138
|
+
const titleTemplate = internalConfig.templates.commitMessage ?? "chore(release): bump version to {{newVersion}}";
|
|
2139
|
+
const bodyTemplate = internalConfig.templates.commitBody;
|
|
2140
|
+
const commitMessage = applyPlaceholders(titleTemplate);
|
|
2141
|
+
const commitBody = bodyTemplate ? applyPlaceholders(bodyTemplate) : void 0;
|
|
2094
2142
|
const noVerifyFlag = noVerify ? "--no-verify " : "";
|
|
2095
2143
|
logger.debug(`No verify: ${noVerify}`);
|
|
2144
|
+
const bodyFlag = commitBody ? ` -m "${commitBody.replaceAll('"', '\\"')}"` : "";
|
|
2145
|
+
const fullCommitCmd = `git commit ${noVerifyFlag}-m "${commitMessage.replaceAll('"', '\\"')}"${bodyFlag}`;
|
|
2096
2146
|
if (dryRun) {
|
|
2097
|
-
logger.info(`[dry-run]
|
|
2147
|
+
logger.info(`[dry-run] ${fullCommitCmd}`);
|
|
2098
2148
|
} else {
|
|
2099
|
-
logger.debug(`Executing:
|
|
2100
|
-
await execPromise(
|
|
2149
|
+
logger.debug(`Executing: ${fullCommitCmd}`);
|
|
2150
|
+
await execPromise(fullCommitCmd, {
|
|
2101
2151
|
logLevel,
|
|
2102
2152
|
noStderr: true,
|
|
2103
2153
|
noStdout: true,
|
|
@@ -5397,4 +5447,4 @@ Git provider: ${provider}`);
|
|
|
5397
5447
|
}
|
|
5398
5448
|
}
|
|
5399
5449
|
|
|
5400
|
-
export { getSlackToken as $, createCommitAndTags as A, pushCommitAndTags as B, rollbackModifiedFiles as C, getFirstCommit as D, getCurrentGitBranch as E, getCurrentGitRef as F, getShortCommitSha as G, github as H, createGitlabRelease as I, gitlab as J, detectPackageManager as K, determinePublishTag as L, getPackagesToPublishInSelectiveMode as M, getPackagesToPublishInIndependentMode as N, getAuthCommand as O, publishPackage as P, findGitHubPR as Q, findGitLabMR as R, detectPullRequest as S, PR_COMMENT_MARKER as T, postPrComment as U, readPackageJson as V, getRootPackage as W, readPackages as X, getPackages as Y, getPackageCommits as Z, hasLernaJson as _, buildCommentBody as a, formatChangelogForSlack as a0, formatSlackMessage as a1, postReleaseToSlack as a2, extractChangelogSummary as a3, getReleaseUrl as a4, getIndependentTag as a5, getLastStableTag as a6, getLastTag as a7, getLastRepoTag as a8, getLastPackageTag as a9,
|
|
5450
|
+
export { getSlackToken as $, createCommitAndTags as A, pushCommitAndTags as B, rollbackModifiedFiles as C, getFirstCommit as D, getCurrentGitBranch as E, getCurrentGitRef as F, getShortCommitSha as G, github as H, createGitlabRelease as I, gitlab as J, detectPackageManager as K, determinePublishTag as L, getPackagesToPublishInSelectiveMode as M, getPackagesToPublishInIndependentMode as N, getAuthCommand as O, publishPackage as P, findGitHubPR as Q, findGitLabMR as R, detectPullRequest as S, PR_COMMENT_MARKER as T, postPrComment as U, readPackageJson as V, getRootPackage as W, readPackages as X, getPackages as Y, getPackageCommits as Z, hasLernaJson as _, buildCommentBody as a, formatChangelogForSlack as a0, formatSlackMessage as a1, postReleaseToSlack as a2, extractChangelogSummary as a3, getReleaseUrl as a4, getIndependentTag as a5, getLastStableTag as a6, getLastTag as a7, getLastRepoTag as a8, getLastPackageTag as a9, isChangedPreid as aA, getBumpedPackageIndependently as aB, confirmBump as aC, getBumpedIndependentPackages as aD, shouldFilterPrereleaseTags as aE, extractVersionFromTag as aF, getCanaryVersion as aG, isTagVersionCompatibleWithCurrent as aH, NEW_PACKAGE_MARKER as aa, resolveTags as ab, getTwitterCredentials as ac, formatTweetMessage as ad, postReleaseToTwitter as ae, executeHook as af, isInCI as ag, getCIName as ah, executeFormatCmd as ai, executeBuildCmd as aj, isBumpedPackage as ak, filterOutPrivatePackages as al, getPackagesOrBumpedPackages as am, isGraduatingToStableBetweenVersion as an, capReleaseTypeForZeroMajor as ao, determineSemverChange as ap, determineReleaseType as aq, writeVersion as ar, getPackageNewVersion as as, updateLernaVersion as at, extractVersionFromPackageTag as au, isPrerelease as av, isStableReleaseType as aw, isPrereleaseReleaseType as ax, isGraduating as ay, getPreid as az, bump as b, changelog as c, providerReleaseSafetyCheck as d, providerRelease as e, publishSafetyCheck as f, publish as g, social as h, generateChangelog as i, getDefaultConfig as j, defineConfig as k, loadRelizyConfig as l, getPackageDependencies as m, getDependentsOf as n, expandPackagesToBumpWithDependents as o, prComment as p, getGitStatus as q, release as r, socialSafetyCheck as s, topologicalSort as t, checkGitStatusIfDirty as u, fetchGitTags as v, writeChangelogToFile as w, detectGitProvider as x, parseGitRemoteUrl as y, getModifiedReleaseFilePatterns as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relizy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.0-beta.
|
|
4
|
+
"version": "1.3.0-beta.2",
|
|
5
5
|
"description": "Changelogen adapter for monorepo management with unified and independent versioning",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|