relizy 1.5.0 → 1.5.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 +1 -1
- package/dist/index.d.mts +38 -13
- package/dist/index.d.ts +38 -13
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.CobLJLr_.mjs → relizy.DDpPSTvS.mjs} +42 -16
- 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 {
|
|
8
|
+
import { aw as isInCI, S as getCIName, f as bump, h as changelog, aN as publish, aL as providerRelease, b4 as social, aK as prComment, aW as release } from './shared/relizy.DDpPSTvS.mjs';
|
|
9
9
|
import 'node:child_process';
|
|
10
10
|
import '@maz-ui/utils/helpers/formatJson';
|
|
11
11
|
import 'c12';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel } from '@maz-ui/node';
|
|
2
|
-
import { GitCommit, ChangelogConfig as ChangelogConfig$1, SemverBumpType } from 'changelogen';
|
|
2
|
+
import { RawGitCommit, GitCommit, ChangelogConfig as ChangelogConfig$1, SemverBumpType } from 'changelogen';
|
|
3
3
|
import { ReleaseType } from 'semver';
|
|
4
4
|
import { DeepPartial } from '@maz-ui/utils/ts-helpers/DeepPartial';
|
|
5
5
|
import * as _slack_web_api from '@slack/web-api';
|
|
@@ -249,6 +249,14 @@ declare function retagAnnotatedLocal({ tag, commit, message, signed, cwd, logLev
|
|
|
249
249
|
* Force-push a single tag to origin. Used only after explicit confirmation.
|
|
250
250
|
*/
|
|
251
251
|
declare function pushTagForce(tag: string, cwd?: string, logLevel?: LogLevel): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Drop-in replacement for changelogen's `getGitDiff`, which splits the
|
|
254
|
+
* `git log` output on `----\n` and the subject line on `|`. A commit body
|
|
255
|
+
* containing a `----` line (GitHub adds `---------` before the
|
|
256
|
+
* `Co-authored-by:` trailers of a squash merge) then loses its trailers and its
|
|
257
|
+
* `--name-status` file list, and a subject containing `|` is truncated.
|
|
258
|
+
*/
|
|
259
|
+
declare function getGitDiff(from: string | undefined, to?: string, cwd?: string): RawGitCommit[];
|
|
252
260
|
|
|
253
261
|
declare function github(options: ProviderReleaseOptions): Promise<PostedRelease[]>;
|
|
254
262
|
|
|
@@ -869,23 +877,24 @@ declare function shouldFilterPrereleaseTags(currentVersion: string, graduating:
|
|
|
869
877
|
*/
|
|
870
878
|
declare function extractVersionFromTag(tag: string, packageName?: string): string | null;
|
|
871
879
|
/**
|
|
872
|
-
*
|
|
873
|
-
* A tag is compatible if its major version is less than or equal to the current major version.
|
|
880
|
+
* Computes a canary version with format `{nextVersion}-0.{preid}-{sha}`.
|
|
874
881
|
*
|
|
875
|
-
*
|
|
876
|
-
*
|
|
882
|
+
* The leading numeric `0` prerelease identifier makes the canary sort below
|
|
883
|
+
* every named prerelease (alpha, beta, rc...) and the stable release of the
|
|
884
|
+
* same version, so it never matches a range like `^5.0.0-beta.0` and is never
|
|
885
|
+
* suggested by update tools. Keeping preid and sha in a single identifier also
|
|
886
|
+
* keeps the version valid when the sha is all digits with a leading zero.
|
|
877
887
|
*
|
|
878
|
-
* @param payload - The payload to
|
|
888
|
+
* @param payload - The payload to compute the canary version from
|
|
879
889
|
* @param payload.currentVersion - The current package version
|
|
880
|
-
* @param payload.releaseType - The release type
|
|
890
|
+
* @param payload.releaseType - The release type detected from commits (defaults to patch)
|
|
881
891
|
* @param payload.preid - The pre-release identifier
|
|
882
|
-
* @param payload.sha - The sha of the commit
|
|
883
|
-
* @returns
|
|
892
|
+
* @param payload.sha - The short sha of the commit
|
|
893
|
+
* @returns The canary version
|
|
884
894
|
*
|
|
885
895
|
* @example
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
* isTagVersionCompatibleWithCurrent('3.9.9', '4.1.1') // true - older major
|
|
896
|
+
* getCanaryVersion({ currentVersion: '1.2.3', releaseType: 'minor', sha: 'a3f4b2c' }) // '1.3.0-0.canary-a3f4b2c'
|
|
897
|
+
* getCanaryVersion({ currentVersion: '5.0.0-beta.44', releaseType: 'patch', sha: 'a3f4b2c' }) // '5.0.0-0.canary-a3f4b2c'
|
|
889
898
|
*/
|
|
890
899
|
declare function getCanaryVersion({ currentVersion, releaseType, preid, sha, }: {
|
|
891
900
|
currentVersion: string;
|
|
@@ -893,6 +902,22 @@ declare function getCanaryVersion({ currentVersion, releaseType, preid, sha, }:
|
|
|
893
902
|
preid?: string;
|
|
894
903
|
sha: string;
|
|
895
904
|
}): string;
|
|
905
|
+
/**
|
|
906
|
+
* Checks if a tag's version is compatible with the current version.
|
|
907
|
+
* A tag is compatible if its major version is less than or equal to the current major version.
|
|
908
|
+
*
|
|
909
|
+
* This prevents accidentally using tags from future major versions (e.g., v5.0.0-beta.0)
|
|
910
|
+
* when bumping a current stable version (e.g., 4.1.1 → 4.1.2).
|
|
911
|
+
*
|
|
912
|
+
* @param tagVersion - The version extracted from the tag
|
|
913
|
+
* @param currentVersion - The current package version
|
|
914
|
+
* @returns true if the tag version's major is <= current major version
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* isTagVersionCompatibleWithCurrent('4.1.1', '4.1.0') // true - same major
|
|
918
|
+
* isTagVersionCompatibleWithCurrent('5.0.0-beta.0', '4.1.1') // false - newer major
|
|
919
|
+
* isTagVersionCompatibleWithCurrent('3.9.9', '4.1.1') // true - older major
|
|
920
|
+
*/
|
|
896
921
|
declare function isTagVersionCompatibleWithCurrent(tagVersion: string, currentVersion: string): boolean;
|
|
897
922
|
|
|
898
923
|
type VersionMode = 'unified' | 'independent' | 'selective';
|
|
@@ -2264,5 +2289,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2264
2289
|
}): Promise<void>;
|
|
2265
2290
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2266
2291
|
|
|
2267
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2292
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2268
2293
|
export type { AIConfig, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackCredentials, SlackOptions, SlackPackageEntry, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel } from '@maz-ui/node';
|
|
2
|
-
import { GitCommit, ChangelogConfig as ChangelogConfig$1, SemverBumpType } from 'changelogen';
|
|
2
|
+
import { RawGitCommit, GitCommit, ChangelogConfig as ChangelogConfig$1, SemverBumpType } from 'changelogen';
|
|
3
3
|
import { ReleaseType } from 'semver';
|
|
4
4
|
import { DeepPartial } from '@maz-ui/utils/ts-helpers/DeepPartial';
|
|
5
5
|
import * as _slack_web_api from '@slack/web-api';
|
|
@@ -249,6 +249,14 @@ declare function retagAnnotatedLocal({ tag, commit, message, signed, cwd, logLev
|
|
|
249
249
|
* Force-push a single tag to origin. Used only after explicit confirmation.
|
|
250
250
|
*/
|
|
251
251
|
declare function pushTagForce(tag: string, cwd?: string, logLevel?: LogLevel): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Drop-in replacement for changelogen's `getGitDiff`, which splits the
|
|
254
|
+
* `git log` output on `----\n` and the subject line on `|`. A commit body
|
|
255
|
+
* containing a `----` line (GitHub adds `---------` before the
|
|
256
|
+
* `Co-authored-by:` trailers of a squash merge) then loses its trailers and its
|
|
257
|
+
* `--name-status` file list, and a subject containing `|` is truncated.
|
|
258
|
+
*/
|
|
259
|
+
declare function getGitDiff(from: string | undefined, to?: string, cwd?: string): RawGitCommit[];
|
|
252
260
|
|
|
253
261
|
declare function github(options: ProviderReleaseOptions): Promise<PostedRelease[]>;
|
|
254
262
|
|
|
@@ -869,23 +877,24 @@ declare function shouldFilterPrereleaseTags(currentVersion: string, graduating:
|
|
|
869
877
|
*/
|
|
870
878
|
declare function extractVersionFromTag(tag: string, packageName?: string): string | null;
|
|
871
879
|
/**
|
|
872
|
-
*
|
|
873
|
-
* A tag is compatible if its major version is less than or equal to the current major version.
|
|
880
|
+
* Computes a canary version with format `{nextVersion}-0.{preid}-{sha}`.
|
|
874
881
|
*
|
|
875
|
-
*
|
|
876
|
-
*
|
|
882
|
+
* The leading numeric `0` prerelease identifier makes the canary sort below
|
|
883
|
+
* every named prerelease (alpha, beta, rc...) and the stable release of the
|
|
884
|
+
* same version, so it never matches a range like `^5.0.0-beta.0` and is never
|
|
885
|
+
* suggested by update tools. Keeping preid and sha in a single identifier also
|
|
886
|
+
* keeps the version valid when the sha is all digits with a leading zero.
|
|
877
887
|
*
|
|
878
|
-
* @param payload - The payload to
|
|
888
|
+
* @param payload - The payload to compute the canary version from
|
|
879
889
|
* @param payload.currentVersion - The current package version
|
|
880
|
-
* @param payload.releaseType - The release type
|
|
890
|
+
* @param payload.releaseType - The release type detected from commits (defaults to patch)
|
|
881
891
|
* @param payload.preid - The pre-release identifier
|
|
882
|
-
* @param payload.sha - The sha of the commit
|
|
883
|
-
* @returns
|
|
892
|
+
* @param payload.sha - The short sha of the commit
|
|
893
|
+
* @returns The canary version
|
|
884
894
|
*
|
|
885
895
|
* @example
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
* isTagVersionCompatibleWithCurrent('3.9.9', '4.1.1') // true - older major
|
|
896
|
+
* getCanaryVersion({ currentVersion: '1.2.3', releaseType: 'minor', sha: 'a3f4b2c' }) // '1.3.0-0.canary-a3f4b2c'
|
|
897
|
+
* getCanaryVersion({ currentVersion: '5.0.0-beta.44', releaseType: 'patch', sha: 'a3f4b2c' }) // '5.0.0-0.canary-a3f4b2c'
|
|
889
898
|
*/
|
|
890
899
|
declare function getCanaryVersion({ currentVersion, releaseType, preid, sha, }: {
|
|
891
900
|
currentVersion: string;
|
|
@@ -893,6 +902,22 @@ declare function getCanaryVersion({ currentVersion, releaseType, preid, sha, }:
|
|
|
893
902
|
preid?: string;
|
|
894
903
|
sha: string;
|
|
895
904
|
}): string;
|
|
905
|
+
/**
|
|
906
|
+
* Checks if a tag's version is compatible with the current version.
|
|
907
|
+
* A tag is compatible if its major version is less than or equal to the current major version.
|
|
908
|
+
*
|
|
909
|
+
* This prevents accidentally using tags from future major versions (e.g., v5.0.0-beta.0)
|
|
910
|
+
* when bumping a current stable version (e.g., 4.1.1 → 4.1.2).
|
|
911
|
+
*
|
|
912
|
+
* @param tagVersion - The version extracted from the tag
|
|
913
|
+
* @param currentVersion - The current package version
|
|
914
|
+
* @returns true if the tag version's major is <= current major version
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* isTagVersionCompatibleWithCurrent('4.1.1', '4.1.0') // true - same major
|
|
918
|
+
* isTagVersionCompatibleWithCurrent('5.0.0-beta.0', '4.1.1') // false - newer major
|
|
919
|
+
* isTagVersionCompatibleWithCurrent('3.9.9', '4.1.1') // true - older major
|
|
920
|
+
*/
|
|
896
921
|
declare function isTagVersionCompatibleWithCurrent(tagVersion: string, currentVersion: string): boolean;
|
|
897
922
|
|
|
898
923
|
type VersionMode = 'unified' | 'independent' | 'selective';
|
|
@@ -2264,5 +2289,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2264
2289
|
}): Promise<void>;
|
|
2265
2290
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2266
2291
|
|
|
2267
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2292
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, buildReleaseSummary, bump, capReleaseTypeForZeroMajor, changelog, checkGitStatusIfDirty, collectContributorNames, collectPackageBumps, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, filterOutPrivatePackages, findGitHubPR, findGitLabMR, findReachableCommitBySubject, formatChangelogForSlack, formatPackagesForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, generateMarkDown, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCanaryVersion, getCommitChangedFiles, getCommitSubject, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitDiff, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getNpmRegistry, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getShortCommitSha, getSlackToken, getSlackWebhookUrl, getTwitterCredentials, github, gitlab, globDirsAbsolute, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, isCommitOnlyInIgnoredPackages, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, isVersionAlreadyPublishedError, isVersionPublished, loadRelizyConfig, mergeTypes, parseChangelogMarkdown, parseGitRemoteUrl, postPrComment, postReleaseToSlack, postReleaseToTwitter, prComment, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, pushTagForce, readPackageJson, readPackages, reconcileFromTag, redactSecrets, release, resetRewrittenTagCache, resolveAllConfiguredRegistryTargets, resolveIgnoredPackagePaths, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2268
2293
|
export type { AIConfig, AIPromptTarget, AIProviderName, AISocialConfig, AISystemPromptOverrides, AITargetConfig, BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogInclude, ChangelogOptions, ClaudeCodeProviderOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, OnRewrittenTag, PackageBase, PackageBumpEntry, PackageManager, PostedRelease, PrCommentConfig, PrCommentMode, PrCommentOptions, PrCommentStatus, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, PullRequestInfo, ReadPackage, Reference, RegistryTarget, ReleaseConfig, ReleaseContext, ReleaseOptions, RelizyConfig, RepoConfig, ResolvedConfig, ResolvedRelizyConfig, ResolvedTags, ResolvedTwitterCredentials, RootPackage, SlackCredentials, SlackOptions, SlackPackageEntry, SlackSocialConfig, SocialConfig, SocialNetworkResult, SocialOptions, SocialResult, Step, TemplatesConfig, TokensConfig, TwitterCredentials, TwitterOptions, TwitterSocialConfig, VersionMode };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { N as NEW_PACKAGE_MARKER, P as PR_COMMENT_MARKER, b as buildChangelogBody, a as buildCommentBody, c as buildCompareLink, d as buildContributors, e as buildReleaseSummary, f as bump, g as capReleaseTypeForZeroMajor, h as changelog, i as checkGitStatusIfDirty, j as collectContributorNames, k as collectPackageBumps, l as confirmBump, m as createCommitAndTags, n as createGitlabRelease, o as defineConfig, p as detectGitProvider, q as detectPackageManager, r as detectPullRequest, s as determinePublishTag, t as determineReleaseType, u as determineSemverChange, v as executeBuildCmd, w as executeFormatCmd, x as executeHook, y as expandPackagesToBumpWithDependents, z as extractChangelogSummary, A as extractVersionFromPackageTag, B as extractVersionFromTag, C as fetchGitTags, D as filterOutPrivatePackages, E as findGitHubPR, F as findGitLabMR, G as findReachableCommitBySubject, H as formatChangelogForSlack, I as formatPackagesForSlack, J as formatSlackMessage, K as formatTweetMessage, L as generateChangelog, M as generateMarkDown, O as getAuthCommand, Q as getBumpedIndependentPackages, R as getBumpedPackageIndependently, S as getCIName, T as getCanaryVersion, U as getCommitChangedFiles, V as getCommitSubject, W as getCurrentGitBranch, X as getCurrentGitRef, Y as getDefaultConfig, Z as getDependentsOf, _ as getFirstCommit, $ as
|
|
1
|
+
export { N as NEW_PACKAGE_MARKER, P as PR_COMMENT_MARKER, b as buildChangelogBody, a as buildCommentBody, c as buildCompareLink, d as buildContributors, e as buildReleaseSummary, f as bump, g as capReleaseTypeForZeroMajor, h as changelog, i as checkGitStatusIfDirty, j as collectContributorNames, k as collectPackageBumps, l as confirmBump, m as createCommitAndTags, n as createGitlabRelease, o as defineConfig, p as detectGitProvider, q as detectPackageManager, r as detectPullRequest, s as determinePublishTag, t as determineReleaseType, u as determineSemverChange, v as executeBuildCmd, w as executeFormatCmd, x as executeHook, y as expandPackagesToBumpWithDependents, z as extractChangelogSummary, A as extractVersionFromPackageTag, B as extractVersionFromTag, C as fetchGitTags, D as filterOutPrivatePackages, E as findGitHubPR, F as findGitLabMR, G as findReachableCommitBySubject, H as formatChangelogForSlack, I as formatPackagesForSlack, J as formatSlackMessage, K as formatTweetMessage, L as generateChangelog, M as generateMarkDown, O as getAuthCommand, Q as getBumpedIndependentPackages, R as getBumpedPackageIndependently, S as getCIName, T as getCanaryVersion, U as getCommitChangedFiles, V as getCommitSubject, W as getCurrentGitBranch, X as getCurrentGitRef, Y as getDefaultConfig, Z as getDependentsOf, _ as getFirstCommit, $ as getGitDiff, a0 as getGitStatus, a1 as getIndependentTag, a2 as getLastPackageTag, a3 as getLastRepoTag, a4 as getLastStableTag, a5 as getLastTag, a6 as getModifiedReleaseFilePatterns, a7 as getNpmRegistry, a8 as getPackageCommits, a9 as getPackageDependencies, aa as getPackageNewVersion, ab as getPackages, ac as getPackagesOrBumpedPackages, ad as getPackagesToPublishInIndependentMode, ae as getPackagesToPublishInSelectiveMode, af as getPreid, ag as getReleaseUrl, ah as getRootPackage, ai as getShortCommitSha, aj as getSlackToken, ak as getSlackWebhookUrl, al as getTwitterCredentials, am as github, an as gitlab, ao as globDirsAbsolute, ap as hasLernaJson, aq as isAncestor, ar as isBumpedPackage, as as isChangedPreid, at as isCommitOnlyInIgnoredPackages, au as isGraduating, av as isGraduatingToStableBetweenVersion, aw as isInCI, ax as isPrerelease, ay as isPrereleaseReleaseType, az as isStableReleaseType, aA as isTagVersionCompatibleWithCurrent, aB as isVersionAlreadyPublishedError, aC as isVersionPublished, aD as loadRelizyConfig, aE as mergeTypes, aF as parseChangelogMarkdown, aG as parseGitRemoteUrl, aH as postPrComment, aI as postReleaseToSlack, aJ as postReleaseToTwitter, aK as prComment, aL as providerRelease, aM as providerReleaseSafetyCheck, aN as publish, aO as publishPackage, aP as publishSafetyCheck, aQ as pushCommitAndTags, aR as pushTagForce, aS as readPackageJson, aT as readPackages, aU as reconcileFromTag, aV as redactSecrets, aW as release, aX as resetRewrittenTagCache, aY as resolveAllConfiguredRegistryTargets, aZ as resolveIgnoredPackagePaths, a_ as resolveRegistryTargetsForPackage, a$ as resolveRegistryTargetsForPackages, b0 as resolveTags, b1 as retagAnnotatedLocal, b2 as rollbackModifiedFiles, b3 as shouldFilterPrereleaseTags, b4 as social, b5 as socialSafetyCheck, b6 as tagExists, b7 as topologicalSort, b8 as tryPostPrComment, b9 as updateLernaVersion, ba as withRegistryNpmrc, bb as writeChangelogToFile, bc as writeVersion } from './shared/relizy.DDpPSTvS.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:child_process';
|
|
4
4
|
import 'node:process';
|
|
@@ -3,7 +3,7 @@ import { execSync, spawnSync } from 'node:child_process';
|
|
|
3
3
|
import process$1 from 'node:process';
|
|
4
4
|
import { formatJson } from '@maz-ui/utils/helpers/formatJson';
|
|
5
5
|
import { setupDotenv, loadConfig } from 'c12';
|
|
6
|
-
import {
|
|
6
|
+
import { parseCommits, resolveRepoConfig, getRepoConfig, formatCompareChanges, formatReference, createGithubRelease } from 'changelogen';
|
|
7
7
|
import { defu } from 'defu';
|
|
8
8
|
import { existsSync, readFileSync, statSync, writeFileSync, rmSync } from 'node:fs';
|
|
9
9
|
import path, { join, relative, sep } from 'node:path';
|
|
@@ -202,6 +202,25 @@ async function pushTagForce(tag, cwd, logLevel) {
|
|
|
202
202
|
{ cwd, logLevel, noStderr: true, noStdout: true }
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
+
const COMMIT_SEPARATOR = "";
|
|
206
|
+
const FIELD_SEPARATOR = "";
|
|
207
|
+
function getGitDiff(from, to = "HEAD", cwd) {
|
|
208
|
+
const range = from ? `${from}...${to}` : to;
|
|
209
|
+
const output = execSync(
|
|
210
|
+
`git --no-pager log "${range}" --pretty="%x1E%s%x1F%h%x1F%an%x1F%ae%n%b" --name-status`,
|
|
211
|
+
{ cwd, encoding: "utf8" }
|
|
212
|
+
).trim();
|
|
213
|
+
return output.split(COMMIT_SEPARATOR).slice(1).map((record) => {
|
|
214
|
+
const [firstLine = "", ...body] = record.split("\n");
|
|
215
|
+
const [message = "", shortHash = "", authorName = "", authorEmail = ""] = firstLine.split(FIELD_SEPARATOR);
|
|
216
|
+
return {
|
|
217
|
+
message,
|
|
218
|
+
shortHash,
|
|
219
|
+
author: { name: authorName, email: authorEmail },
|
|
220
|
+
body: body.join("\n")
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
}
|
|
205
224
|
|
|
206
225
|
const sessionCache = /* @__PURE__ */ new Map();
|
|
207
226
|
function resetRewrittenTagCache() {
|
|
@@ -764,7 +783,7 @@ async function getPackageCommits({
|
|
|
764
783
|
from: actualFrom,
|
|
765
784
|
to
|
|
766
785
|
};
|
|
767
|
-
const rawCommits =
|
|
786
|
+
const rawCommits = getGitDiff(actualFrom, to, changelogConfig.cwd);
|
|
768
787
|
const allCommits = parseCommits(rawCommits, changelogConfig);
|
|
769
788
|
const hasBreakingChanges = allCommits.some((commit) => commit.isBreaking);
|
|
770
789
|
logger.debug(`Has breaking changes: ${hasBreakingChanges}`);
|
|
@@ -1345,7 +1364,7 @@ function getCanaryVersion({
|
|
|
1345
1364
|
if (!nextStable) {
|
|
1346
1365
|
throw new Error(`Unable to compute canary version from "${currentVersion}" with release type "${effectiveType}"`);
|
|
1347
1366
|
}
|
|
1348
|
-
return `${nextStable}
|
|
1367
|
+
return `${nextStable}-0.${preid}-${sha}`;
|
|
1349
1368
|
}
|
|
1350
1369
|
function isTagVersionCompatibleWithCurrent(tagVersion, currentVersion) {
|
|
1351
1370
|
try {
|
|
@@ -3061,6 +3080,7 @@ function getShortCommitSha(cwd, length = 7) {
|
|
|
3061
3080
|
|
|
3062
3081
|
const CHANGELOG_RELEASE_HEAD_REGEX = /^#{2,}\s+(?:\S.*)?(v?(\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?)).*$/gm;
|
|
3063
3082
|
const VERSION_REGEX = /^v?(\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?)$/;
|
|
3083
|
+
const GITHUB_NOREPLY_EMAIL_REGEX = /^(?:\d+\+)?([^@]+)@users\.noreply\.github\.com$/i;
|
|
3064
3084
|
function buildCompareLink({ config, from, to, isFirstCommit }) {
|
|
3065
3085
|
if (!config.repo || !from || !to) {
|
|
3066
3086
|
return "";
|
|
@@ -3106,16 +3126,13 @@ function collectContributorNames({ commits, config }) {
|
|
|
3106
3126
|
return [];
|
|
3107
3127
|
}
|
|
3108
3128
|
const names = /* @__PURE__ */ new Set();
|
|
3109
|
-
for (const
|
|
3110
|
-
|
|
3111
|
-
continue;
|
|
3112
|
-
}
|
|
3113
|
-
const name = formatName(commit.author.name);
|
|
3129
|
+
for (const author of commits.flatMap(getCommitAuthors)) {
|
|
3130
|
+
const name = formatName(author.name);
|
|
3114
3131
|
if (!name || name.includes("[bot]")) {
|
|
3115
3132
|
continue;
|
|
3116
3133
|
}
|
|
3117
3134
|
if (config.excludeAuthors && config.excludeAuthors.some(
|
|
3118
|
-
(v) => name.includes(v) ||
|
|
3135
|
+
(v) => name.includes(v) || author.email?.includes(v)
|
|
3119
3136
|
)) {
|
|
3120
3137
|
continue;
|
|
3121
3138
|
}
|
|
@@ -3123,6 +3140,12 @@ function collectContributorNames({ commits, config }) {
|
|
|
3123
3140
|
}
|
|
3124
3141
|
return Array.from(names);
|
|
3125
3142
|
}
|
|
3143
|
+
function getCommitAuthors(commit) {
|
|
3144
|
+
return [commit.author, ...commit.authors ?? []].filter(Boolean);
|
|
3145
|
+
}
|
|
3146
|
+
function getGithubUsernameFromNoreplyEmail(email) {
|
|
3147
|
+
return GITHUB_NOREPLY_EMAIL_REGEX.exec(email)?.[1];
|
|
3148
|
+
}
|
|
3126
3149
|
async function buildContributors({ commits, config }) {
|
|
3127
3150
|
const names = collectContributorNames({ commits, config });
|
|
3128
3151
|
if (names.length === 0) {
|
|
@@ -3132,13 +3155,11 @@ async function buildContributors({ commits, config }) {
|
|
|
3132
3155
|
for (const name of names) {
|
|
3133
3156
|
_authors.set(name, { email: /* @__PURE__ */ new Set(), name });
|
|
3134
3157
|
}
|
|
3135
|
-
for (const
|
|
3136
|
-
|
|
3137
|
-
continue;
|
|
3138
|
-
const name = formatName(commit.author.name);
|
|
3158
|
+
for (const author of commits.flatMap(getCommitAuthors)) {
|
|
3159
|
+
const name = formatName(author.name);
|
|
3139
3160
|
const entry = _authors.get(name);
|
|
3140
|
-
if (entry &&
|
|
3141
|
-
entry.email.add(
|
|
3161
|
+
if (entry && author.email) {
|
|
3162
|
+
entry.email.add(author.email);
|
|
3142
3163
|
}
|
|
3143
3164
|
}
|
|
3144
3165
|
if (config.repo?.provider === "github") {
|
|
@@ -3148,6 +3169,11 @@ async function buildContributors({ commits, config }) {
|
|
|
3148
3169
|
if (!meta) {
|
|
3149
3170
|
return;
|
|
3150
3171
|
}
|
|
3172
|
+
const noreplyUsername = [...meta.email].map(getGithubUsernameFromNoreplyEmail).find(Boolean);
|
|
3173
|
+
if (noreplyUsername) {
|
|
3174
|
+
meta.github = noreplyUsername;
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3151
3177
|
for (const data of [...meta.email, meta.name]) {
|
|
3152
3178
|
const { user } = await fetch$1(`https://ungh.cc/users/find/${data}`).then((r) => r.json()).catch(() => ({ user: null }));
|
|
3153
3179
|
if (user) {
|
|
@@ -6937,4 +6963,4 @@ async function release(options = {}) {
|
|
|
6937
6963
|
}
|
|
6938
6964
|
}
|
|
6939
6965
|
|
|
6940
|
-
export {
|
|
6966
|
+
export { getGitDiff as $, extractVersionFromPackageTag as A, extractVersionFromTag as B, fetchGitTags as C, filterOutPrivatePackages as D, findGitHubPR as E, findGitLabMR as F, findReachableCommitBySubject as G, formatChangelogForSlack as H, formatPackagesForSlack as I, formatSlackMessage as J, formatTweetMessage as K, generateChangelog as L, generateMarkDown as M, NEW_PACKAGE_MARKER as N, getAuthCommand as O, PR_COMMENT_MARKER as P, getBumpedIndependentPackages as Q, getBumpedPackageIndependently as R, getCIName as S, getCanaryVersion as T, getCommitChangedFiles as U, getCommitSubject as V, getCurrentGitBranch as W, getCurrentGitRef as X, getDefaultConfig as Y, getDependentsOf as Z, getFirstCommit as _, buildCommentBody as a, resolveRegistryTargetsForPackages as a$, getGitStatus as a0, getIndependentTag as a1, getLastPackageTag as a2, getLastRepoTag as a3, getLastStableTag as a4, getLastTag as a5, getModifiedReleaseFilePatterns as a6, getNpmRegistry as a7, getPackageCommits as a8, getPackageDependencies as a9, isTagVersionCompatibleWithCurrent as aA, isVersionAlreadyPublishedError as aB, isVersionPublished as aC, loadRelizyConfig as aD, mergeTypes as aE, parseChangelogMarkdown as aF, parseGitRemoteUrl as aG, postPrComment as aH, postReleaseToSlack as aI, postReleaseToTwitter as aJ, prComment as aK, providerRelease as aL, providerReleaseSafetyCheck as aM, publish as aN, publishPackage as aO, publishSafetyCheck as aP, pushCommitAndTags as aQ, pushTagForce as aR, readPackageJson as aS, readPackages as aT, reconcileFromTag as aU, redactSecrets as aV, release as aW, resetRewrittenTagCache as aX, resolveAllConfiguredRegistryTargets as aY, resolveIgnoredPackagePaths as aZ, resolveRegistryTargetsForPackage as a_, getPackageNewVersion as aa, getPackages as ab, getPackagesOrBumpedPackages as ac, getPackagesToPublishInIndependentMode as ad, getPackagesToPublishInSelectiveMode as ae, getPreid as af, getReleaseUrl as ag, getRootPackage as ah, getShortCommitSha as ai, getSlackToken as aj, getSlackWebhookUrl as ak, getTwitterCredentials as al, github as am, gitlab as an, globDirsAbsolute as ao, hasLernaJson as ap, isAncestor as aq, isBumpedPackage as ar, isChangedPreid as as, isCommitOnlyInIgnoredPackages as at, isGraduating as au, isGraduatingToStableBetweenVersion as av, isInCI as aw, isPrerelease as ax, isPrereleaseReleaseType as ay, isStableReleaseType as az, buildChangelogBody as b, resolveTags as b0, retagAnnotatedLocal as b1, rollbackModifiedFiles as b2, shouldFilterPrereleaseTags as b3, social as b4, socialSafetyCheck as b5, tagExists as b6, topologicalSort as b7, tryPostPrComment as b8, updateLernaVersion as b9, withRegistryNpmrc as ba, writeChangelogToFile as bb, writeVersion as bc, buildCompareLink as c, buildContributors as d, buildReleaseSummary as e, bump as f, capReleaseTypeForZeroMajor as g, changelog as h, checkGitStatusIfDirty as i, collectContributorNames as j, collectPackageBumps as k, confirmBump as l, createCommitAndTags as m, createGitlabRelease as n, defineConfig as o, detectGitProvider as p, detectPackageManager as q, detectPullRequest as r, determinePublishTag as s, determineReleaseType as t, determineSemverChange as u, executeBuildCmd as v, executeFormatCmd as w, executeHook as x, expandPackagesToBumpWithDependents as y, extractChangelogSummary as z };
|
package/package.json
CHANGED