relizy 1.5.0-beta.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.CdiXgxMk.mjs → relizy.CobLJLr_.mjs} +94 -20
- 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 { av as isInCI, S as getCIName, f as bump, h as changelog, aM as publish, aK as providerRelease, b3 as social, aJ as prComment, aV as release } from './shared/relizy.CobLJLr_.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
|
@@ -530,6 +530,33 @@ declare function postPrComment({ config, pr, body, }: {
|
|
|
530
530
|
declare function redactSecrets<T>(value: T): T;
|
|
531
531
|
|
|
532
532
|
declare function readPackageJson(packagePath: string): ReadPackage | undefined;
|
|
533
|
+
/**
|
|
534
|
+
* Resolve a set of path globs (relative to `cwd`) to the absolute directories
|
|
535
|
+
* they match. Shared by package discovery and ignore resolution.
|
|
536
|
+
*/
|
|
537
|
+
declare function globDirsAbsolute(cwd: string, globs?: string[]): Set<string>;
|
|
538
|
+
/**
|
|
539
|
+
* Relative POSIX paths of every package ignored by config, resolved from BOTH
|
|
540
|
+
* `monorepo.ignored` (path globs) and `monorepo.ignorePackageNames` (names).
|
|
541
|
+
*
|
|
542
|
+
* The name-based source is resolved against the configured `packages` globs so
|
|
543
|
+
* the two options behave identically downstream (path filtering + root commit
|
|
544
|
+
* exclusion).
|
|
545
|
+
*/
|
|
546
|
+
declare function resolveIgnoredPackagePaths(config: ResolvedRelizyConfig): string[];
|
|
547
|
+
/**
|
|
548
|
+
* Extract the changed file paths (POSIX) from a commit body. `getGitDiff` runs
|
|
549
|
+
* `git log --name-status`, so the body carries lines like `M\tpath/to/file`
|
|
550
|
+
* (renames/copies use `R100\told\tnew` - the new path is the last field).
|
|
551
|
+
*/
|
|
552
|
+
declare function getCommitChangedFiles(commit: GitCommit): string[];
|
|
553
|
+
/**
|
|
554
|
+
* True when EVERY changed file of the commit lives inside an ignored package.
|
|
555
|
+
* Such commits are excluded from the root (unified/selective) version bump and
|
|
556
|
+
* changelog so a breaking change scoped to an ignored package never bumps the
|
|
557
|
+
* whole repository. Commits with no detectable files are kept (fail-open).
|
|
558
|
+
*/
|
|
559
|
+
declare function isCommitOnlyInIgnoredPackages(commit: GitCommit, ignoredPaths: string[]): boolean;
|
|
533
560
|
interface RootPackage extends ReadPackage {
|
|
534
561
|
fromTag: string;
|
|
535
562
|
commits: GitCommit[];
|
|
@@ -544,10 +571,11 @@ declare function getRootPackage({ config, force, from, to, suffix, changelog, dr
|
|
|
544
571
|
changelog: boolean;
|
|
545
572
|
dryRun?: boolean;
|
|
546
573
|
}): Promise<RootPackage>;
|
|
547
|
-
declare function readPackages({ cwd, patterns, ignorePackageNames, includePrivates, }: {
|
|
574
|
+
declare function readPackages({ cwd, patterns, ignorePackageNames, ignored, includePrivates, }: {
|
|
548
575
|
cwd: string;
|
|
549
576
|
patterns?: string[];
|
|
550
577
|
ignorePackageNames: NonNullable<ResolvedRelizyConfig['monorepo']>['ignorePackageNames'];
|
|
578
|
+
ignored?: NonNullable<ResolvedRelizyConfig['monorepo']>['ignored'];
|
|
551
579
|
includePrivates?: boolean;
|
|
552
580
|
}): ReadPackage[];
|
|
553
581
|
declare function getPackages({ config, suffix, force, includeAll, dryRun, }: {
|
|
@@ -761,14 +789,15 @@ type SemverChangeType = 'major' | 'minor' | 'patch' | undefined;
|
|
|
761
789
|
* through this function — only commit-based detection is capped.
|
|
762
790
|
*/
|
|
763
791
|
declare function capReleaseTypeForZeroMajor(currentVersion: string, detected: SemverChangeType): SemverChangeType;
|
|
764
|
-
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string): SemverChangeType;
|
|
765
|
-
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
|
|
792
|
+
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string, capZeroMajor?: boolean): SemverChangeType;
|
|
793
|
+
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, capZeroMajor, }: {
|
|
766
794
|
currentVersion: string;
|
|
767
795
|
commits?: GitCommit[];
|
|
768
796
|
releaseType: ReleaseType;
|
|
769
797
|
preid: string | undefined;
|
|
770
798
|
types: ResolvedRelizyConfig['types'];
|
|
771
799
|
force: boolean;
|
|
800
|
+
capZeroMajor?: boolean;
|
|
772
801
|
}): ReleaseType | undefined;
|
|
773
802
|
declare function writeVersion(pkgPath: string, newVersion: string, dryRun?: boolean): void;
|
|
774
803
|
declare function getPackageNewVersion({ name, currentVersion, releaseType, preid, suffix, }: {
|
|
@@ -1051,9 +1080,26 @@ interface MonorepoConfig {
|
|
|
1051
1080
|
packages: string[];
|
|
1052
1081
|
/**
|
|
1053
1082
|
* Package names to ignore.
|
|
1083
|
+
* @deprecated Use `ignored` (path globs) instead, for consistency with
|
|
1084
|
+
* `packages`. Both options are still honored and merged together.
|
|
1054
1085
|
* @default []
|
|
1055
1086
|
*/
|
|
1056
1087
|
ignorePackageNames?: string[];
|
|
1088
|
+
/**
|
|
1089
|
+
* Glob patterns (relative to `cwd`, POSIX separators) of package directories
|
|
1090
|
+
* to ignore - matched the same way as `packages`. Ignored packages are
|
|
1091
|
+
* excluded from bump, changelog, publish, provider-release and pr-comment.
|
|
1092
|
+
*
|
|
1093
|
+
* In `unified`/`selective` mode, commits whose changed files all live inside
|
|
1094
|
+
* ignored packages are also excluded from the root version bump and the root
|
|
1095
|
+
* changelog (a breaking change in an ignored package no longer bumps the
|
|
1096
|
+
* whole repository).
|
|
1097
|
+
*
|
|
1098
|
+
* Prefer this over `ignorePackageNames` for path-based configuration
|
|
1099
|
+
* consistent with `packages`. Both options are honored and merged together.
|
|
1100
|
+
* @default []
|
|
1101
|
+
*/
|
|
1102
|
+
ignored?: string[];
|
|
1057
1103
|
/**
|
|
1058
1104
|
* Include private packages (with `"private": true` in package.json) in
|
|
1059
1105
|
* bump and changelog operations. Private packages remain excluded from
|
|
@@ -1097,6 +1143,18 @@ interface BumpConfig {
|
|
|
1097
1143
|
* @default true
|
|
1098
1144
|
*/
|
|
1099
1145
|
yes?: boolean;
|
|
1146
|
+
/**
|
|
1147
|
+
* Cap commit-detected `major` bumps to `minor` while the current version is
|
|
1148
|
+
* in the `0.x.y` range (semver §4, initial development), so a breaking change
|
|
1149
|
+
* does not graduate a `0.x` package to `1.0.0` automatically.
|
|
1150
|
+
*
|
|
1151
|
+
* Set to `false` to opt out: a breaking commit then bumps `0.x.y` straight to
|
|
1152
|
+
* `1.0.0`. This only affects **commit-based** detection; explicit CLI release
|
|
1153
|
+
* types (`--major`, `--premajor`, …) are never capped. Once the package
|
|
1154
|
+
* reaches `1.x`, this option is a no-op.
|
|
1155
|
+
* @default true
|
|
1156
|
+
*/
|
|
1157
|
+
capZeroMajor?: boolean;
|
|
1100
1158
|
}
|
|
1101
1159
|
interface BumpOptions extends BumpConfig {
|
|
1102
1160
|
/**
|
|
@@ -2206,5 +2264,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2206
2264
|
}): Promise<void>;
|
|
2207
2265
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2208
2266
|
|
|
2209
|
-
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, 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, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, 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, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
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 };
|
|
2210
2268
|
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
|
@@ -530,6 +530,33 @@ declare function postPrComment({ config, pr, body, }: {
|
|
|
530
530
|
declare function redactSecrets<T>(value: T): T;
|
|
531
531
|
|
|
532
532
|
declare function readPackageJson(packagePath: string): ReadPackage | undefined;
|
|
533
|
+
/**
|
|
534
|
+
* Resolve a set of path globs (relative to `cwd`) to the absolute directories
|
|
535
|
+
* they match. Shared by package discovery and ignore resolution.
|
|
536
|
+
*/
|
|
537
|
+
declare function globDirsAbsolute(cwd: string, globs?: string[]): Set<string>;
|
|
538
|
+
/**
|
|
539
|
+
* Relative POSIX paths of every package ignored by config, resolved from BOTH
|
|
540
|
+
* `monorepo.ignored` (path globs) and `monorepo.ignorePackageNames` (names).
|
|
541
|
+
*
|
|
542
|
+
* The name-based source is resolved against the configured `packages` globs so
|
|
543
|
+
* the two options behave identically downstream (path filtering + root commit
|
|
544
|
+
* exclusion).
|
|
545
|
+
*/
|
|
546
|
+
declare function resolveIgnoredPackagePaths(config: ResolvedRelizyConfig): string[];
|
|
547
|
+
/**
|
|
548
|
+
* Extract the changed file paths (POSIX) from a commit body. `getGitDiff` runs
|
|
549
|
+
* `git log --name-status`, so the body carries lines like `M\tpath/to/file`
|
|
550
|
+
* (renames/copies use `R100\told\tnew` - the new path is the last field).
|
|
551
|
+
*/
|
|
552
|
+
declare function getCommitChangedFiles(commit: GitCommit): string[];
|
|
553
|
+
/**
|
|
554
|
+
* True when EVERY changed file of the commit lives inside an ignored package.
|
|
555
|
+
* Such commits are excluded from the root (unified/selective) version bump and
|
|
556
|
+
* changelog so a breaking change scoped to an ignored package never bumps the
|
|
557
|
+
* whole repository. Commits with no detectable files are kept (fail-open).
|
|
558
|
+
*/
|
|
559
|
+
declare function isCommitOnlyInIgnoredPackages(commit: GitCommit, ignoredPaths: string[]): boolean;
|
|
533
560
|
interface RootPackage extends ReadPackage {
|
|
534
561
|
fromTag: string;
|
|
535
562
|
commits: GitCommit[];
|
|
@@ -544,10 +571,11 @@ declare function getRootPackage({ config, force, from, to, suffix, changelog, dr
|
|
|
544
571
|
changelog: boolean;
|
|
545
572
|
dryRun?: boolean;
|
|
546
573
|
}): Promise<RootPackage>;
|
|
547
|
-
declare function readPackages({ cwd, patterns, ignorePackageNames, includePrivates, }: {
|
|
574
|
+
declare function readPackages({ cwd, patterns, ignorePackageNames, ignored, includePrivates, }: {
|
|
548
575
|
cwd: string;
|
|
549
576
|
patterns?: string[];
|
|
550
577
|
ignorePackageNames: NonNullable<ResolvedRelizyConfig['monorepo']>['ignorePackageNames'];
|
|
578
|
+
ignored?: NonNullable<ResolvedRelizyConfig['monorepo']>['ignored'];
|
|
551
579
|
includePrivates?: boolean;
|
|
552
580
|
}): ReadPackage[];
|
|
553
581
|
declare function getPackages({ config, suffix, force, includeAll, dryRun, }: {
|
|
@@ -761,14 +789,15 @@ type SemverChangeType = 'major' | 'minor' | 'patch' | undefined;
|
|
|
761
789
|
* through this function — only commit-based detection is capped.
|
|
762
790
|
*/
|
|
763
791
|
declare function capReleaseTypeForZeroMajor(currentVersion: string, detected: SemverChangeType): SemverChangeType;
|
|
764
|
-
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string): SemverChangeType;
|
|
765
|
-
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
|
|
792
|
+
declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>, currentVersion?: string, capZeroMajor?: boolean): SemverChangeType;
|
|
793
|
+
declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, capZeroMajor, }: {
|
|
766
794
|
currentVersion: string;
|
|
767
795
|
commits?: GitCommit[];
|
|
768
796
|
releaseType: ReleaseType;
|
|
769
797
|
preid: string | undefined;
|
|
770
798
|
types: ResolvedRelizyConfig['types'];
|
|
771
799
|
force: boolean;
|
|
800
|
+
capZeroMajor?: boolean;
|
|
772
801
|
}): ReleaseType | undefined;
|
|
773
802
|
declare function writeVersion(pkgPath: string, newVersion: string, dryRun?: boolean): void;
|
|
774
803
|
declare function getPackageNewVersion({ name, currentVersion, releaseType, preid, suffix, }: {
|
|
@@ -1051,9 +1080,26 @@ interface MonorepoConfig {
|
|
|
1051
1080
|
packages: string[];
|
|
1052
1081
|
/**
|
|
1053
1082
|
* Package names to ignore.
|
|
1083
|
+
* @deprecated Use `ignored` (path globs) instead, for consistency with
|
|
1084
|
+
* `packages`. Both options are still honored and merged together.
|
|
1054
1085
|
* @default []
|
|
1055
1086
|
*/
|
|
1056
1087
|
ignorePackageNames?: string[];
|
|
1088
|
+
/**
|
|
1089
|
+
* Glob patterns (relative to `cwd`, POSIX separators) of package directories
|
|
1090
|
+
* to ignore - matched the same way as `packages`. Ignored packages are
|
|
1091
|
+
* excluded from bump, changelog, publish, provider-release and pr-comment.
|
|
1092
|
+
*
|
|
1093
|
+
* In `unified`/`selective` mode, commits whose changed files all live inside
|
|
1094
|
+
* ignored packages are also excluded from the root version bump and the root
|
|
1095
|
+
* changelog (a breaking change in an ignored package no longer bumps the
|
|
1096
|
+
* whole repository).
|
|
1097
|
+
*
|
|
1098
|
+
* Prefer this over `ignorePackageNames` for path-based configuration
|
|
1099
|
+
* consistent with `packages`. Both options are honored and merged together.
|
|
1100
|
+
* @default []
|
|
1101
|
+
*/
|
|
1102
|
+
ignored?: string[];
|
|
1057
1103
|
/**
|
|
1058
1104
|
* Include private packages (with `"private": true` in package.json) in
|
|
1059
1105
|
* bump and changelog operations. Private packages remain excluded from
|
|
@@ -1097,6 +1143,18 @@ interface BumpConfig {
|
|
|
1097
1143
|
* @default true
|
|
1098
1144
|
*/
|
|
1099
1145
|
yes?: boolean;
|
|
1146
|
+
/**
|
|
1147
|
+
* Cap commit-detected `major` bumps to `minor` while the current version is
|
|
1148
|
+
* in the `0.x.y` range (semver §4, initial development), so a breaking change
|
|
1149
|
+
* does not graduate a `0.x` package to `1.0.0` automatically.
|
|
1150
|
+
*
|
|
1151
|
+
* Set to `false` to opt out: a breaking commit then bumps `0.x.y` straight to
|
|
1152
|
+
* `1.0.0`. This only affects **commit-based** detection; explicit CLI release
|
|
1153
|
+
* types (`--major`, `--premajor`, …) are never capped. Once the package
|
|
1154
|
+
* reaches `1.x`, this option is a no-op.
|
|
1155
|
+
* @default true
|
|
1156
|
+
*/
|
|
1157
|
+
capZeroMajor?: boolean;
|
|
1100
1158
|
}
|
|
1101
1159
|
interface BumpOptions extends BumpConfig {
|
|
1102
1160
|
/**
|
|
@@ -2206,5 +2264,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2206
2264
|
}): Promise<void>;
|
|
2207
2265
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2208
2266
|
|
|
2209
|
-
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, 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, hasLernaJson, isAncestor, isBumpedPackage, isChangedPreid, 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, resolveRegistryTargetsForPackage, resolveRegistryTargetsForPackages, resolveTags, retagAnnotatedLocal, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, tagExists, topologicalSort, tryPostPrComment, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
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 };
|
|
2210
2268
|
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
|
|
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 getGitStatus, a0 as getIndependentTag, a1 as getLastPackageTag, a2 as getLastRepoTag, a3 as getLastStableTag, a4 as getLastTag, a5 as getModifiedReleaseFilePatterns, a6 as getNpmRegistry, a7 as getPackageCommits, a8 as getPackageDependencies, a9 as getPackageNewVersion, aa as getPackages, ab as getPackagesOrBumpedPackages, ac as getPackagesToPublishInIndependentMode, ad as getPackagesToPublishInSelectiveMode, ae as getPreid, af as getReleaseUrl, ag as getRootPackage, ah as getShortCommitSha, ai as getSlackToken, aj as getSlackWebhookUrl, ak as getTwitterCredentials, al as github, am as gitlab, an as globDirsAbsolute, ao as hasLernaJson, ap as isAncestor, aq as isBumpedPackage, ar as isChangedPreid, as as isCommitOnlyInIgnoredPackages, at as isGraduating, au as isGraduatingToStableBetweenVersion, av as isInCI, aw as isPrerelease, ax as isPrereleaseReleaseType, ay as isStableReleaseType, az as isTagVersionCompatibleWithCurrent, aA as isVersionAlreadyPublishedError, aB as isVersionPublished, aC as loadRelizyConfig, aD as mergeTypes, aE as parseChangelogMarkdown, aF as parseGitRemoteUrl, aG as postPrComment, aH as postReleaseToSlack, aI as postReleaseToTwitter, aJ as prComment, aK as providerRelease, aL as providerReleaseSafetyCheck, aM as publish, aN as publishPackage, aO as publishSafetyCheck, aP as pushCommitAndTags, aQ as pushTagForce, aR as readPackageJson, aS as readPackages, aT as reconcileFromTag, aU as redactSecrets, aV as release, aW as resetRewrittenTagCache, aX as resolveAllConfiguredRegistryTargets, aY as resolveIgnoredPackagePaths, aZ as resolveRegistryTargetsForPackage, a_ as resolveRegistryTargetsForPackages, a$ as resolveTags, b0 as retagAnnotatedLocal, b1 as rollbackModifiedFiles, b2 as shouldFilterPrereleaseTags, b3 as social, b4 as socialSafetyCheck, b5 as tagExists, b6 as topologicalSort, b7 as tryPostPrComment, b8 as updateLernaVersion, b9 as withRegistryNpmrc, ba as writeChangelogToFile, bb as writeVersion } from './shared/relizy.CobLJLr_.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:child_process';
|
|
4
4
|
import 'node:process';
|
|
@@ -416,6 +416,58 @@ function readPackageJson(packagePath) {
|
|
|
416
416
|
path: packagePath
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
|
+
const GLOB_IGNORE = ["**/node_modules/**", "**/dist/**", "**/.git/**"];
|
|
420
|
+
function globDirsAbsolute(cwd, globs) {
|
|
421
|
+
const dirs = /* @__PURE__ */ new Set();
|
|
422
|
+
for (const pattern of globs ?? []) {
|
|
423
|
+
const matches = fastGlob.sync(pattern, {
|
|
424
|
+
cwd,
|
|
425
|
+
onlyDirectories: true,
|
|
426
|
+
absolute: true,
|
|
427
|
+
ignore: GLOB_IGNORE
|
|
428
|
+
});
|
|
429
|
+
for (const match of matches) {
|
|
430
|
+
dirs.add(match);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return dirs;
|
|
434
|
+
}
|
|
435
|
+
function resolveIgnoredPackagePaths(config) {
|
|
436
|
+
const cwd = config.cwd;
|
|
437
|
+
const paths = /* @__PURE__ */ new Set();
|
|
438
|
+
for (const absolutePath of globDirsAbsolute(cwd, config.monorepo?.ignored)) {
|
|
439
|
+
paths.add(relative(cwd, absolutePath).split(sep).join("/"));
|
|
440
|
+
}
|
|
441
|
+
const ignorePackageNames = config.monorepo?.ignorePackageNames ?? [];
|
|
442
|
+
if (ignorePackageNames.length > 0) {
|
|
443
|
+
for (const absolutePath of globDirsAbsolute(cwd, config.monorepo?.packages)) {
|
|
444
|
+
const packageBase = readPackageJson(absolutePath);
|
|
445
|
+
if (packageBase && ignorePackageNames.includes(packageBase.name)) {
|
|
446
|
+
paths.add(relative(cwd, absolutePath).split(sep).join("/"));
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return [...paths].filter(Boolean);
|
|
451
|
+
}
|
|
452
|
+
function getCommitChangedFiles(commit) {
|
|
453
|
+
return commit.body.split("\n").filter((line) => /^[A-Z]\d*\t/.test(line)).map((line) => {
|
|
454
|
+
const parts = line.split(" ");
|
|
455
|
+
return parts[parts.length - 1]?.trim();
|
|
456
|
+
}).filter((path) => Boolean(path));
|
|
457
|
+
}
|
|
458
|
+
function isUnderIgnoredPath(file, ignoredPaths) {
|
|
459
|
+
return ignoredPaths.some((ignored) => file === ignored || file.startsWith(`${ignored}/`));
|
|
460
|
+
}
|
|
461
|
+
function isCommitOnlyInIgnoredPackages(commit, ignoredPaths) {
|
|
462
|
+
if (ignoredPaths.length === 0) {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
const files = getCommitChangedFiles(commit);
|
|
466
|
+
if (files.length === 0) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
return files.every((file) => isUnderIgnoredPath(file, ignoredPaths));
|
|
470
|
+
}
|
|
419
471
|
async function getRootPackage({
|
|
420
472
|
config,
|
|
421
473
|
force,
|
|
@@ -446,7 +498,8 @@ async function getRootPackage({
|
|
|
446
498
|
releaseType: config.bump.type,
|
|
447
499
|
preid: config.bump.preid,
|
|
448
500
|
types: config.types,
|
|
449
|
-
force
|
|
501
|
+
force,
|
|
502
|
+
capZeroMajor: config.bump.capZeroMajor
|
|
450
503
|
});
|
|
451
504
|
if (!releaseType) {
|
|
452
505
|
logger.debug("No commits require a version bump");
|
|
@@ -475,11 +528,13 @@ function readPackages({
|
|
|
475
528
|
cwd,
|
|
476
529
|
patterns,
|
|
477
530
|
ignorePackageNames,
|
|
531
|
+
ignored,
|
|
478
532
|
includePrivates
|
|
479
533
|
}) {
|
|
480
534
|
const packages = [];
|
|
481
535
|
const foundPaths = /* @__PURE__ */ new Set();
|
|
482
536
|
const patternsSet = new Set(patterns);
|
|
537
|
+
const ignoredDirs = globDirsAbsolute(cwd, ignored);
|
|
483
538
|
if (!patterns)
|
|
484
539
|
patternsSet.add(".");
|
|
485
540
|
logger.debug(`Read package.json files from patterns: ${[...patternsSet].join(", ")}`);
|
|
@@ -494,6 +549,8 @@ function readPackages({
|
|
|
494
549
|
for (const matchPath of matches) {
|
|
495
550
|
if (foundPaths.has(matchPath))
|
|
496
551
|
continue;
|
|
552
|
+
if (ignoredDirs.has(matchPath))
|
|
553
|
+
continue;
|
|
497
554
|
const packageBase = readPackageJson(matchPath);
|
|
498
555
|
if (!packageBase || packageBase.private && !includePrivates || ignorePackageNames?.includes(packageBase.name))
|
|
499
556
|
continue;
|
|
@@ -522,7 +579,8 @@ function getPackageReleaseType({
|
|
|
522
579
|
releaseType,
|
|
523
580
|
preid: config.bump.preid,
|
|
524
581
|
types: config.types,
|
|
525
|
-
force
|
|
582
|
+
force,
|
|
583
|
+
capZeroMajor: config.bump.capZeroMajor
|
|
526
584
|
});
|
|
527
585
|
}
|
|
528
586
|
if (pkg.reason === "dependency") {
|
|
@@ -538,7 +596,8 @@ function getPackageReleaseType({
|
|
|
538
596
|
releaseType,
|
|
539
597
|
preid: config.bump.preid,
|
|
540
598
|
types: config.types,
|
|
541
|
-
force
|
|
599
|
+
force,
|
|
600
|
+
capZeroMajor: config.bump.capZeroMajor
|
|
542
601
|
});
|
|
543
602
|
}
|
|
544
603
|
async function getPackages({
|
|
@@ -553,11 +612,13 @@ async function getPackages({
|
|
|
553
612
|
cwd: config.cwd,
|
|
554
613
|
patterns,
|
|
555
614
|
ignorePackageNames: config.monorepo?.ignorePackageNames,
|
|
615
|
+
ignored: config.monorepo?.ignored,
|
|
556
616
|
includePrivates: config.monorepo?.includePrivates
|
|
557
617
|
});
|
|
558
618
|
const packages = /* @__PURE__ */ new Map();
|
|
559
619
|
const foundPaths = /* @__PURE__ */ new Set();
|
|
560
620
|
const patternsSet = new Set(patterns);
|
|
621
|
+
const ignoredDirs = globDirsAbsolute(config.cwd, config.monorepo?.ignored);
|
|
561
622
|
if (!patterns)
|
|
562
623
|
patternsSet.add(".");
|
|
563
624
|
logger.debug(`Getting packages from patterns: ${patternsSet.values()}`);
|
|
@@ -571,6 +632,10 @@ async function getPackages({
|
|
|
571
632
|
for (const matchPath of matches) {
|
|
572
633
|
if (foundPaths.has(matchPath))
|
|
573
634
|
continue;
|
|
635
|
+
if (ignoredDirs.has(matchPath)) {
|
|
636
|
+
logger.debug(`${matchPath} ignored by config (monorepo.ignored)`);
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
574
639
|
const packageBase = readPackageJson(matchPath);
|
|
575
640
|
if (!packageBase) {
|
|
576
641
|
logger.debug(`Failed to read package.json at ${matchPath} - ignored`);
|
|
@@ -708,12 +773,17 @@ async function getPackageCommits({
|
|
|
708
773
|
throw new Error("Failed to read root package.json");
|
|
709
774
|
}
|
|
710
775
|
const isRootPackage = pkg.path === changelogConfig.cwd || pkg.name === rootPackage.name;
|
|
776
|
+
const ignoredPackagePaths = isRootPackage ? resolveIgnoredPackagePaths(changelogConfig) : [];
|
|
711
777
|
const commits = allCommits.filter((commit) => {
|
|
712
778
|
const type = changelogConfig?.types[commit.type];
|
|
713
779
|
if (!isAllowedCommit({ commit, type, changelog })) {
|
|
714
780
|
return false;
|
|
715
781
|
}
|
|
716
782
|
if (isRootPackage) {
|
|
783
|
+
if (isCommitOnlyInIgnoredPackages(commit, ignoredPackagePaths)) {
|
|
784
|
+
logger.debug(`Commit "${commit.message}" only touches ignored packages, excluded from root`);
|
|
785
|
+
return false;
|
|
786
|
+
}
|
|
717
787
|
return true;
|
|
718
788
|
}
|
|
719
789
|
const packageRelativePath = relative(changelogConfig.cwd, pkg.path).split(sep).join("/");
|
|
@@ -749,7 +819,7 @@ function capReleaseTypeForZeroMajor(currentVersion, detected) {
|
|
|
749
819
|
}
|
|
750
820
|
return detected;
|
|
751
821
|
}
|
|
752
|
-
function determineSemverChange(commits, types, currentVersion) {
|
|
822
|
+
function determineSemverChange(commits, types, currentVersion, capZeroMajor = true) {
|
|
753
823
|
let [hasMajor, hasMinor, hasPatch] = [false, false, false];
|
|
754
824
|
for (const commit of commits) {
|
|
755
825
|
const commitType = types[commit.type];
|
|
@@ -766,12 +836,12 @@ function determineSemverChange(commits, types, currentVersion) {
|
|
|
766
836
|
}
|
|
767
837
|
}
|
|
768
838
|
const detected = hasMajor ? "major" : hasMinor ? "minor" : hasPatch ? "patch" : void 0;
|
|
769
|
-
if (currentVersion)
|
|
839
|
+
if (currentVersion && capZeroMajor)
|
|
770
840
|
return capReleaseTypeForZeroMajor(currentVersion, detected);
|
|
771
841
|
return detected;
|
|
772
842
|
}
|
|
773
|
-
function detectReleaseTypeFromCommits(commits, types, currentVersion) {
|
|
774
|
-
return determineSemverChange(commits, types, currentVersion);
|
|
843
|
+
function detectReleaseTypeFromCommits(commits, types, currentVersion, capZeroMajor = true) {
|
|
844
|
+
return determineSemverChange(commits, types, currentVersion, capZeroMajor);
|
|
775
845
|
}
|
|
776
846
|
function validatePrereleaseDowngrade(currentVersion, targetPreid, configuredType) {
|
|
777
847
|
if (configuredType !== "prerelease" || !targetPreid || !isPrerelease(currentVersion)) {
|
|
@@ -783,12 +853,12 @@ function validatePrereleaseDowngrade(currentVersion, targetPreid, configuredType
|
|
|
783
853
|
throw new Error(`Unable to graduate from ${currentVersion} to ${testVersion}, it's not a valid prerelease`);
|
|
784
854
|
}
|
|
785
855
|
}
|
|
786
|
-
function handleStableVersionWithReleaseType(currentVersion, commits, types, force) {
|
|
856
|
+
function handleStableVersionWithReleaseType(currentVersion, commits, types, force, capZeroMajor) {
|
|
787
857
|
if (!commits?.length && !force) {
|
|
788
858
|
logger.debug('No commits found for stable version with "release" type, skipping bump');
|
|
789
859
|
return void 0;
|
|
790
860
|
}
|
|
791
|
-
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion) : void 0;
|
|
861
|
+
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion, capZeroMajor) : void 0;
|
|
792
862
|
if (!detectedType && !force) {
|
|
793
863
|
logger.debug("No significant commits found, skipping bump");
|
|
794
864
|
return void 0;
|
|
@@ -796,12 +866,12 @@ function handleStableVersionWithReleaseType(currentVersion, commits, types, forc
|
|
|
796
866
|
logger.debug(`Auto-detected release type from commits: ${detectedType}`);
|
|
797
867
|
return detectedType;
|
|
798
868
|
}
|
|
799
|
-
function handleStableVersionWithPrereleaseType(currentVersion, commits, types, force) {
|
|
869
|
+
function handleStableVersionWithPrereleaseType(currentVersion, commits, types, force, capZeroMajor) {
|
|
800
870
|
if (!commits?.length && !force) {
|
|
801
871
|
logger.debug('No commits found for stable version with "prerelease" type, skipping bump');
|
|
802
872
|
return void 0;
|
|
803
873
|
}
|
|
804
|
-
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion) : void 0;
|
|
874
|
+
const detectedType = commits?.length ? detectReleaseTypeFromCommits(commits, types, currentVersion, capZeroMajor) : void 0;
|
|
805
875
|
if (!detectedType) {
|
|
806
876
|
logger.debug("No significant commits found, using prepatch as default");
|
|
807
877
|
return "prepatch";
|
|
@@ -835,7 +905,7 @@ function getImpliedBumpFromPrerelease(version) {
|
|
|
835
905
|
return "minor";
|
|
836
906
|
return "major";
|
|
837
907
|
}
|
|
838
|
-
function handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, commits, force, types }) {
|
|
908
|
+
function handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, commits, force, types, capZeroMajor }) {
|
|
839
909
|
const currentPreid = getPreid(currentVersion);
|
|
840
910
|
const hasChangedPreid = preid && currentPreid && currentPreid !== preid;
|
|
841
911
|
if (hasChangedPreid) {
|
|
@@ -854,7 +924,7 @@ function handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, comm
|
|
|
854
924
|
return void 0;
|
|
855
925
|
}
|
|
856
926
|
if (commits?.length) {
|
|
857
|
-
const detectedType = detectReleaseTypeFromCommits(commits, types, currentVersion);
|
|
927
|
+
const detectedType = detectReleaseTypeFromCommits(commits, types, currentVersion, capZeroMajor);
|
|
858
928
|
const impliedBump = getImpliedBumpFromPrerelease(currentVersion);
|
|
859
929
|
const detectedRank = getSemverRank(detectedType);
|
|
860
930
|
const impliedRank = getSemverRank(impliedBump);
|
|
@@ -886,7 +956,8 @@ function determineReleaseType({
|
|
|
886
956
|
releaseType,
|
|
887
957
|
preid,
|
|
888
958
|
types,
|
|
889
|
-
force
|
|
959
|
+
force,
|
|
960
|
+
capZeroMajor = true
|
|
890
961
|
}) {
|
|
891
962
|
if (releaseType === "release" && preid) {
|
|
892
963
|
throw new Error('You cannot use a "release" type with a "preid", to use a preid you must use a "prerelease" type');
|
|
@@ -899,10 +970,10 @@ function determineReleaseType({
|
|
|
899
970
|
const isCurrentPrerelease = isPrerelease(currentVersion);
|
|
900
971
|
if (!isCurrentPrerelease) {
|
|
901
972
|
if (releaseType === "release") {
|
|
902
|
-
return handleStableVersionWithReleaseType(currentVersion, commits, types, force);
|
|
973
|
+
return handleStableVersionWithReleaseType(currentVersion, commits, types, force, capZeroMajor);
|
|
903
974
|
}
|
|
904
975
|
if (releaseType === "prerelease") {
|
|
905
|
-
return handleStableVersionWithPrereleaseType(currentVersion, commits, types, force);
|
|
976
|
+
return handleStableVersionWithPrereleaseType(currentVersion, commits, types, force, capZeroMajor);
|
|
906
977
|
}
|
|
907
978
|
return handleExplicitReleaseType({ releaseType, currentVersion });
|
|
908
979
|
}
|
|
@@ -910,7 +981,7 @@ function determineReleaseType({
|
|
|
910
981
|
return handlePrereleaseVersionToStable(currentVersion);
|
|
911
982
|
}
|
|
912
983
|
if (releaseType === "prerelease") {
|
|
913
|
-
return handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, commits, force, types });
|
|
984
|
+
return handlePrereleaseVersionWithPrereleaseType({ currentVersion, preid, commits, force, types, capZeroMajor });
|
|
914
985
|
}
|
|
915
986
|
return handleExplicitReleaseType({ releaseType, currentVersion });
|
|
916
987
|
}
|
|
@@ -2492,7 +2563,8 @@ function getDefaultConfig() {
|
|
|
2492
2563
|
type: "release",
|
|
2493
2564
|
clean: true,
|
|
2494
2565
|
dependencyTypes: ["dependencies"],
|
|
2495
|
-
yes: false
|
|
2566
|
+
yes: false,
|
|
2567
|
+
capZeroMajor: true
|
|
2496
2568
|
},
|
|
2497
2569
|
changelog: {
|
|
2498
2570
|
rootChangelog: true,
|
|
@@ -5270,7 +5342,8 @@ async function bump(options = {}) {
|
|
|
5270
5342
|
const packages = readPackages({
|
|
5271
5343
|
cwd: config.cwd,
|
|
5272
5344
|
patterns: config.monorepo?.packages,
|
|
5273
|
-
ignorePackageNames: config.monorepo?.ignorePackageNames
|
|
5345
|
+
ignorePackageNames: config.monorepo?.ignorePackageNames,
|
|
5346
|
+
ignored: config.monorepo?.ignored
|
|
5274
5347
|
});
|
|
5275
5348
|
logger.debug(`Found ${packages.length} package(s)`);
|
|
5276
5349
|
let result;
|
|
@@ -5723,6 +5796,7 @@ async function prComment(options = {}) {
|
|
|
5723
5796
|
cwd: config.cwd,
|
|
5724
5797
|
patterns: config.monorepo?.packages,
|
|
5725
5798
|
ignorePackageNames: config.monorepo?.ignorePackageNames,
|
|
5799
|
+
ignored: config.monorepo?.ignored,
|
|
5726
5800
|
includePrivates: config.monorepo?.includePrivates
|
|
5727
5801
|
}));
|
|
5728
5802
|
packages = readPkgs.map((pkg) => ({ name: pkg.name, version: pkg.version }));
|
|
@@ -6863,4 +6937,4 @@ async function release(options = {}) {
|
|
|
6863
6937
|
}
|
|
6864
6938
|
}
|
|
6865
6939
|
|
|
6866
|
-
export {
|
|
6940
|
+
export { getGitStatus 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, resolveTags as a$, getIndependentTag as a0, getLastPackageTag as a1, getLastRepoTag as a2, getLastStableTag as a3, getLastTag as a4, getModifiedReleaseFilePatterns as a5, getNpmRegistry as a6, getPackageCommits as a7, getPackageDependencies as a8, getPackageNewVersion as a9, isVersionAlreadyPublishedError as aA, isVersionPublished as aB, loadRelizyConfig as aC, mergeTypes as aD, parseChangelogMarkdown as aE, parseGitRemoteUrl as aF, postPrComment as aG, postReleaseToSlack as aH, postReleaseToTwitter as aI, prComment as aJ, providerRelease as aK, providerReleaseSafetyCheck as aL, publish as aM, publishPackage as aN, publishSafetyCheck as aO, pushCommitAndTags as aP, pushTagForce as aQ, readPackageJson as aR, readPackages as aS, reconcileFromTag as aT, redactSecrets as aU, release as aV, resetRewrittenTagCache as aW, resolveAllConfiguredRegistryTargets as aX, resolveIgnoredPackagePaths as aY, resolveRegistryTargetsForPackage as aZ, resolveRegistryTargetsForPackages as a_, getPackages as aa, getPackagesOrBumpedPackages as ab, getPackagesToPublishInIndependentMode as ac, getPackagesToPublishInSelectiveMode as ad, getPreid as ae, getReleaseUrl as af, getRootPackage as ag, getShortCommitSha as ah, getSlackToken as ai, getSlackWebhookUrl as aj, getTwitterCredentials as ak, github as al, gitlab as am, globDirsAbsolute as an, hasLernaJson as ao, isAncestor as ap, isBumpedPackage as aq, isChangedPreid as ar, isCommitOnlyInIgnoredPackages as as, isGraduating as at, isGraduatingToStableBetweenVersion as au, isInCI as av, isPrerelease as aw, isPrereleaseReleaseType as ax, isStableReleaseType as ay, isTagVersionCompatibleWithCurrent as az, buildChangelogBody as b, retagAnnotatedLocal as b0, rollbackModifiedFiles as b1, shouldFilterPrereleaseTags as b2, social as b3, socialSafetyCheck as b4, tagExists as b5, topologicalSort as b6, tryPostPrComment as b7, updateLernaVersion as b8, withRegistryNpmrc as b9, writeChangelogToFile as ba, writeVersion as bb, 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