relizy 1.2.2-beta.0 → 1.2.2-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 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.B3g_9J7u.mjs';
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.CiHvixG7.mjs';
9
9
  import '@maz-ui/utils';
10
10
  import 'c12';
11
11
  import 'changelogen';
@@ -66,7 +66,7 @@ function getReleaseType(options) {
66
66
  return type;
67
67
  }
68
68
  program.name("relizy").description("Release management tool for monorepos and standalone packages").version(version).option("--config <name>", "Config file name (without .config.ts - e.g. changelog-test)").option("--no-safety-check", "Skip safety check").option("--log-level <level>", "Set log level (silent, error, warning, normal, default, debug, trace, verbose)", "default").option("--dry-run", "Preview changes without writing files, creating tags, commits or publishing").option("--pr-number <number>", "Override PR/MR number for PR comment features", Number);
69
- program.command("bump").description("Bump package versions").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--no-clean", "Skip check if the working directory is clean").option("--force", "Bump even if there are no commits").option("--yes", "Skip confirmation prompt about bumping packages").option("--canary", "Publish a canary release from the current commit").action(async (options) => {
69
+ program.command("bump").description("Bump package versions").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--no-clean", "Skip check if the working directory is clean").option("--force", "Bump even if there are no commits").option("--yes", "Skip confirmation prompt about bumping packages").option("--canary", "Publish a canary release from the current commit").option("--include-private", "Include private packages in the bump").action(async (options) => {
70
70
  try {
71
71
  const result = await bump({
72
72
  type: getReleaseType(options),
@@ -78,7 +78,8 @@ program.command("bump").description("Bump package versions").option("--major", "
78
78
  yes: options.yes,
79
79
  suffix: options.suffix,
80
80
  configName: program.opts().config,
81
- canary: options.canary
81
+ canary: options.canary,
82
+ includePrivates: options.includePrivate || void 0
82
83
  });
83
84
  if (!result.bumped) {
84
85
  process.exit(1);
@@ -88,7 +89,7 @@ program.command("bump").description("Bump package versions").option("--major", "
88
89
  process.exit(1);
89
90
  }
90
91
  });
91
- program.command("changelog").description("Generate changelogs for all packages").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--no-root-changelog", "Skip generation of root changelog file").action(async (options) => {
92
+ program.command("changelog").description("Generate changelogs for all packages").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--no-root-changelog", "Skip generation of root changelog file").option("--include-private", "Include private packages in changelog generation").action(async (options) => {
92
93
  try {
93
94
  await changelog({
94
95
  from: options.from,
@@ -97,7 +98,8 @@ program.command("changelog").description("Generate changelogs for all packages")
97
98
  rootChangelog: hasCliFlag("--no-root-changelog") ? false : void 0,
98
99
  dryRun: program.opts().dryRun,
99
100
  logLevel: program.opts().logLevel,
100
- configName: program.opts().config
101
+ configName: program.opts().config,
102
+ includePrivates: options.includePrivate || void 0
101
103
  });
102
104
  } catch (error) {
103
105
  logger.error("Failed to generate changelog -", error);
@@ -166,13 +168,14 @@ program.command("pr-comment").description("Post or re-post a PR comment with rel
166
168
  process.exit(1);
167
169
  }
168
170
  });
169
- program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-provider-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-git-tag", "Skip tag creation").option("--no-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--no-social", "Skip social media posting").option("--no-pr-comment", "Skip PR comment posting").option("--yes", "Skip confirmation prompt about bumping packages").option("--publish-token <token>", 'NPM token (e.g. "123456") - only supported for pnpm and npm').option("--canary", "Publish a canary release from the current commit").action(async (options) => {
171
+ program.command("release").description("Complete release workflow (bump + changelog + commit + tag + push to remote + publish release)").option("--major", "Bump major version").option("--minor", "Bump minor version").option("--patch", "Bump patch version").option("--prerelease", "Bump prerelease version").option("--premajor", "Bump premajor version").option("--preminor", "Bump preminor version").option("--prepatch", "Bump prepatch version").option("--preid <id>", "Prerelease identifier (alpha, beta, rc, etc.)").option("--suffix <suffix>", "Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)").option("--from <ref>", "Start commit reference").option("--to <ref>", "End commit reference").option("--no-push", "Skip push changes and tags to remote").option("--no-provider-release", "Skip release creation (GitHub/GitLab)").option("--no-publish", "Skip npm publish").option("--registry <url>", "Custom npm registry URL").option("--tag <tag>", "Publish with specific tag (default: latest for stable, next for prerelease)").option("--access <type>", "Package access level (public or restricted)").option("--otp <code>", "One-time password for 2FA").option("--no-verify", "Skip git hooks during commit").option("--format-cmd <cmd>", 'Command to format CHANGELOG files after generation (e.g. "pnpm lint")').option("--build-cmd <cmd>", 'Command to build packages before publish (e.g. "pnpm build")').option("--no-root-changelog", "Skip generation of root changelog file").option("--token <token>", "Git token (github or gitlab)").option("--force", "Bump even if there are no commits").option("--no-clean", "Skip check if the working directory is clean").option("--no-commit", "Skip commit and tag").option("--no-git-tag", "Skip tag creation").option("--no-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--no-social", "Skip social media posting").option("--no-pr-comment", "Skip PR comment posting").option("--yes", "Skip confirmation prompt about bumping packages").option("--publish-token <token>", 'NPM token (e.g. "123456") - only supported for pnpm and npm').option("--canary", "Publish a canary release from the current commit").option("--include-private", "Include private packages in bump and changelog phases").action(async (options) => {
170
172
  try {
171
173
  await release({
172
174
  type: getReleaseType(options),
173
175
  preid: options.preid,
174
176
  suffix: options.suffix,
175
177
  canary: options.canary,
178
+ includePrivates: options.includePrivate || void 0,
176
179
  from: options.from,
177
180
  to: options.to,
178
181
  changelog: hasCliFlag("--no-changelog") ? false : void 0,
package/dist/index.d.mts CHANGED
@@ -21,6 +21,7 @@ declare function getDefaultConfig(): {
21
21
  noAuthors: boolean;
22
22
  bump: Required<Omit<BumpConfig, "preid">>;
23
23
  changelog: Required<ChangelogConfig>;
24
+ monorepo: MonorepoConfig;
24
25
  publish: {
25
26
  private: false;
26
27
  args: never[];
@@ -270,10 +271,11 @@ declare function getRootPackage({ config, force, from, to, suffix, changelog, }:
270
271
  suffix: string | undefined;
271
272
  changelog: boolean;
272
273
  }): Promise<RootPackage>;
273
- declare function readPackages({ cwd, patterns, ignorePackageNames, }: {
274
+ declare function readPackages({ cwd, patterns, ignorePackageNames, includePrivates, }: {
274
275
  cwd: string;
275
276
  patterns?: string[];
276
277
  ignorePackageNames: NonNullable<ResolvedRelizyConfig['monorepo']>['ignorePackageNames'];
278
+ includePrivates?: boolean;
277
279
  }): ReadPackage[];
278
280
  declare function getPackages({ config, suffix, force, }: {
279
281
  config: ResolvedRelizyConfig;
@@ -422,6 +424,9 @@ declare function executeBuildCmd({ config, dryRun, }: {
422
424
  declare function isBumpedPackage(pkg: PackageBase): pkg is PackageBase & {
423
425
  oldVersion: string;
424
426
  };
427
+ declare function filterOutPrivatePackages<T extends {
428
+ private: boolean;
429
+ }>(packages: T[]): T[];
425
430
  declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force, }: {
426
431
  config: ResolvedRelizyConfig;
427
432
  bumpResult: BumpResultTruthy | undefined;
@@ -723,6 +728,13 @@ interface MonorepoConfig {
723
728
  * @default []
724
729
  */
725
730
  ignorePackageNames?: string[];
731
+ /**
732
+ * Include private packages (with `"private": true` in package.json) in
733
+ * bump and changelog operations. Private packages remain excluded from
734
+ * publish, provider-release, and pr-comment regardless of this flag.
735
+ * @default false
736
+ */
737
+ includePrivates?: boolean;
726
738
  }
727
739
  type ConfigType = {
728
740
  /**
@@ -793,6 +805,11 @@ interface BumpOptions extends BumpConfig {
793
805
  * @default false
794
806
  */
795
807
  canary?: boolean;
808
+ /**
809
+ * Include private packages in the bump.
810
+ * @default false
811
+ */
812
+ includePrivates?: boolean;
796
813
  }
797
814
  interface ChangelogConfig {
798
815
  /**
@@ -850,6 +867,11 @@ interface ChangelogOptions extends ChangelogConfig {
850
867
  * Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)
851
868
  */
852
869
  suffix?: string;
870
+ /**
871
+ * Include private packages in the changelog generation.
872
+ * @default false
873
+ */
874
+ includePrivates?: boolean;
853
875
  }
854
876
  interface ProviderReleaseOptions {
855
877
  /**
@@ -1121,6 +1143,11 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
1121
1143
  * @default false
1122
1144
  */
1123
1145
  canary?: boolean;
1146
+ /**
1147
+ * Include private packages in bump and changelog operations.
1148
+ * @default false
1149
+ */
1150
+ includePrivates?: boolean;
1124
1151
  }
1125
1152
  interface TwitterCredentials {
1126
1153
  /**
@@ -1538,5 +1565,5 @@ declare function socialSafetyCheck({ config }: {
1538
1565
  }): Promise<void>;
1539
1566
  declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
1540
1567
 
1541
- export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, 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 };
1568
+ 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 };
1542
1569
  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
@@ -21,6 +21,7 @@ declare function getDefaultConfig(): {
21
21
  noAuthors: boolean;
22
22
  bump: Required<Omit<BumpConfig, "preid">>;
23
23
  changelog: Required<ChangelogConfig>;
24
+ monorepo: MonorepoConfig;
24
25
  publish: {
25
26
  private: false;
26
27
  args: never[];
@@ -270,10 +271,11 @@ declare function getRootPackage({ config, force, from, to, suffix, changelog, }:
270
271
  suffix: string | undefined;
271
272
  changelog: boolean;
272
273
  }): Promise<RootPackage>;
273
- declare function readPackages({ cwd, patterns, ignorePackageNames, }: {
274
+ declare function readPackages({ cwd, patterns, ignorePackageNames, includePrivates, }: {
274
275
  cwd: string;
275
276
  patterns?: string[];
276
277
  ignorePackageNames: NonNullable<ResolvedRelizyConfig['monorepo']>['ignorePackageNames'];
278
+ includePrivates?: boolean;
277
279
  }): ReadPackage[];
278
280
  declare function getPackages({ config, suffix, force, }: {
279
281
  config: ResolvedRelizyConfig;
@@ -422,6 +424,9 @@ declare function executeBuildCmd({ config, dryRun, }: {
422
424
  declare function isBumpedPackage(pkg: PackageBase): pkg is PackageBase & {
423
425
  oldVersion: string;
424
426
  };
427
+ declare function filterOutPrivatePackages<T extends {
428
+ private: boolean;
429
+ }>(packages: T[]): T[];
425
430
  declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force, }: {
426
431
  config: ResolvedRelizyConfig;
427
432
  bumpResult: BumpResultTruthy | undefined;
@@ -723,6 +728,13 @@ interface MonorepoConfig {
723
728
  * @default []
724
729
  */
725
730
  ignorePackageNames?: string[];
731
+ /**
732
+ * Include private packages (with `"private": true` in package.json) in
733
+ * bump and changelog operations. Private packages remain excluded from
734
+ * publish, provider-release, and pr-comment regardless of this flag.
735
+ * @default false
736
+ */
737
+ includePrivates?: boolean;
726
738
  }
727
739
  type ConfigType = {
728
740
  /**
@@ -793,6 +805,11 @@ interface BumpOptions extends BumpConfig {
793
805
  * @default false
794
806
  */
795
807
  canary?: boolean;
808
+ /**
809
+ * Include private packages in the bump.
810
+ * @default false
811
+ */
812
+ includePrivates?: boolean;
796
813
  }
797
814
  interface ChangelogConfig {
798
815
  /**
@@ -850,6 +867,11 @@ interface ChangelogOptions extends ChangelogConfig {
850
867
  * Custom suffix for prerelease versions - replace the last .X with .suffix (e.g. 1.0.0-beta.0 -> 1.0.0-beta.suffix)
851
868
  */
852
869
  suffix?: string;
870
+ /**
871
+ * Include private packages in the changelog generation.
872
+ * @default false
873
+ */
874
+ includePrivates?: boolean;
853
875
  }
854
876
  interface ProviderReleaseOptions {
855
877
  /**
@@ -1121,6 +1143,11 @@ interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, Pub
1121
1143
  * @default false
1122
1144
  */
1123
1145
  canary?: boolean;
1146
+ /**
1147
+ * Include private packages in bump and changelog operations.
1148
+ * @default false
1149
+ */
1150
+ includePrivates?: boolean;
1124
1151
  }
1125
1152
  interface TwitterCredentials {
1126
1153
  /**
@@ -1538,5 +1565,5 @@ declare function socialSafetyCheck({ config }: {
1538
1565
  }): Promise<void>;
1539
1566
  declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
1540
1567
 
1541
- export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildCommentBody, bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, detectPullRequest, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, findGitHubPR, findGitLabMR, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, 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 };
1568
+ 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 };
1542
1569
  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, aA as confirmBump, A as createCommitAndTags, I as createGitlabRelease, k as defineConfig, x as detectGitProvider, K as detectPackageManager, S as detectPullRequest, L as determinePublishTag, ao as determineReleaseType, an as determineSemverChange, aj as executeBuildCmd, ai as executeFormatCmd, af as executeHook, o as expandPackagesToBumpWithDependents, a3 as extractChangelogSummary, as as extractVersionFromPackageTag, aD as extractVersionFromTag, v as fetchGitTags, Q as findGitHubPR, R as findGitLabMR, a0 as formatChangelogForSlack, a1 as formatSlackMessage, ad as formatTweetMessage, i as generateChangelog, O as getAuthCommand, aB as getBumpedIndependentPackages, az as getBumpedPackageIndependently, ah as getCIName, aE 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, aq as getPackageNewVersion, Y as getPackages, al as getPackagesOrBumpedPackages, N as getPackagesToPublishInIndependentMode, M as getPackagesToPublishInSelectiveMode, ax 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, ay as isChangedPreid, aw as isGraduating, am as isGraduatingToStableBetweenVersion, ag as isInCI, at as isPrerelease, av as isPrereleaseReleaseType, au as isStableReleaseType, aF 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, aC as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, ar as updateLernaVersion, w as writeChangelogToFile, ap as writeVersion } from './shared/relizy.B3g_9J7u.mjs';
1
+ export { aa as NEW_PACKAGE_MARKER, T as PR_COMMENT_MARKER, a as buildCommentBody, b as bump, c as changelog, u as checkGitStatusIfDirty, aB as confirmBump, A as createCommitAndTags, I as createGitlabRelease, k as defineConfig, x as detectGitProvider, K as detectPackageManager, S as detectPullRequest, L as determinePublishTag, ap as determineReleaseType, ao as determineSemverChange, aj as executeBuildCmd, ai as executeFormatCmd, af as executeHook, o as expandPackagesToBumpWithDependents, a3 as extractChangelogSummary, at as extractVersionFromPackageTag, aE 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, aC as getBumpedIndependentPackages, aA as getBumpedPackageIndependently, ah as getCIName, aF 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, ar as getPackageNewVersion, Y as getPackages, am as getPackagesOrBumpedPackages, N as getPackagesToPublishInIndependentMode, M as getPackagesToPublishInSelectiveMode, ay 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, az as isChangedPreid, ax as isGraduating, an as isGraduatingToStableBetweenVersion, ag as isInCI, au as isPrerelease, aw as isPrereleaseReleaseType, av as isStableReleaseType, aG 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, aD as shouldFilterPrereleaseTags, h as social, s as socialSafetyCheck, t as topologicalSort, as as updateLernaVersion, w as writeChangelogToFile, aq as writeVersion } from './shared/relizy.CiHvixG7.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:process';
4
4
  import '@maz-ui/utils';
@@ -1,6 +1,6 @@
1
1
  import { logger, execPromise } from '@maz-ui/node';
2
2
  import process$1 from 'node:process';
3
- import { formatJson, upperFirst } from '@maz-ui/utils';
3
+ import { getErrorMessage, formatJson, upperFirst } from '@maz-ui/utils';
4
4
  import { setupDotenv, loadConfig } from 'c12';
5
5
  import { getGitDiff, parseCommits, resolveRepoConfig, getRepoConfig, formatCompareChanges, formatReference, createGithubRelease } from 'changelogen';
6
6
  import { defu } from 'defu';
@@ -219,14 +219,14 @@ async function getRootPackage({
219
219
  newVersion
220
220
  };
221
221
  } catch (error) {
222
- const errorMessage = error instanceof Error ? error.message : String(error);
223
- throw new Error(errorMessage);
222
+ throw new Error(`Failed to get root package: ${getErrorMessage(error)}`, { cause: error });
224
223
  }
225
224
  }
226
225
  function readPackages({
227
226
  cwd,
228
227
  patterns,
229
- ignorePackageNames
228
+ ignorePackageNames,
229
+ includePrivates
230
230
  }) {
231
231
  const packages = [];
232
232
  const foundPaths = /* @__PURE__ */ new Set();
@@ -246,7 +246,7 @@ function readPackages({
246
246
  if (foundPaths.has(matchPath))
247
247
  continue;
248
248
  const packageBase = readPackageJson(matchPath);
249
- if (!packageBase || packageBase.private || ignorePackageNames?.includes(packageBase.name))
249
+ if (!packageBase || packageBase.private && !includePrivates || ignorePackageNames?.includes(packageBase.name))
250
250
  continue;
251
251
  foundPaths.add(matchPath);
252
252
  packages.push({
@@ -301,7 +301,8 @@ async function getPackages({
301
301
  const readedPackages = readPackages({
302
302
  cwd: config.cwd,
303
303
  patterns,
304
- ignorePackageNames: config.monorepo?.ignorePackageNames
304
+ ignorePackageNames: config.monorepo?.ignorePackageNames,
305
+ includePrivates: config.monorepo?.includePrivates
305
306
  });
306
307
  const packages = /* @__PURE__ */ new Map();
307
308
  const foundPaths = /* @__PURE__ */ new Set();
@@ -324,7 +325,7 @@ async function getPackages({
324
325
  logger.debug(`Failed to read package.json at ${matchPath} - ignored`);
325
326
  continue;
326
327
  }
327
- if (packageBase.private) {
328
+ if (packageBase.private && !config.monorepo?.includePrivates) {
328
329
  logger.debug(`${packageBase.name} is private and will be ignored`);
329
330
  continue;
330
331
  }
@@ -429,7 +430,8 @@ function isCommitOfTrackedPackages({
429
430
  const packages = readPackages({
430
431
  cwd: config.cwd,
431
432
  patterns: config.monorepo.packages,
432
- ignorePackageNames: config.monorepo?.ignorePackageNames
433
+ ignorePackageNames: config.monorepo?.ignorePackageNames,
434
+ includePrivates: config.monorepo?.includePrivates
433
435
  });
434
436
  return packages.some((pkg) => {
435
437
  const path = relative(config.cwd, pkg.path).split(sep).join("/");
@@ -646,7 +648,7 @@ function writeVersion(pkgPath, newVersion, dryRun = false) {
646
648
  `, "utf8");
647
649
  logger.debug(`Updated ${packageJson.name}: ${oldVersion} \u2192 ${newVersion}`);
648
650
  } catch (error) {
649
- throw new Error(`Unable to write version to ${packageJsonPath}: ${error}`);
651
+ throw new Error(`Unable to write version to ${packageJsonPath}: ${getErrorMessage(error)}`, { cause: error });
650
652
  }
651
653
  }
652
654
  function getPackageNewVersion({
@@ -785,6 +787,7 @@ function displayRootAndLernaUpdates({
785
787
  }
786
788
  }
787
789
  }
790
+ const PRIVATE_SUFFIX = " \u{1F512} [private: bump only, not published]";
788
791
  function displayUnifiedModePackages({
789
792
  packages,
790
793
  newVersion,
@@ -792,7 +795,7 @@ function displayUnifiedModePackages({
792
795
  }) {
793
796
  logger.log(`${packages.length} package(s):`);
794
797
  packages.forEach((pkg) => {
795
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}`);
798
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
796
799
  });
797
800
  logger.log("");
798
801
  }
@@ -804,7 +807,7 @@ function displaySelectiveModePackages({
804
807
  if (force) {
805
808
  logger.log(`${packages.length} package(s):`);
806
809
  packages.forEach((pkg) => {
807
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (force)`);
810
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (force)${pkg.private ? PRIVATE_SUFFIX : ""}`);
808
811
  });
809
812
  logger.log("");
810
813
  } else {
@@ -814,21 +817,21 @@ function displaySelectiveModePackages({
814
817
  if (packagesWithCommits.length > 0) {
815
818
  logger.log(`${packagesWithCommits.length} package(s) with commits:`);
816
819
  packagesWithCommits.forEach((pkg) => {
817
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}`);
820
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
818
821
  });
819
822
  logger.log("");
820
823
  }
821
824
  if (packagesAsDependents.length > 0) {
822
825
  logger.log(`${packagesAsDependents.length} dependent package(s):`);
823
826
  packagesAsDependents.forEach((pkg) => {
824
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} ${force ? "(force)" : ""}`);
827
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
825
828
  });
826
829
  logger.log("");
827
830
  }
828
831
  if (packagesAsGraduation.length > 0) {
829
832
  logger.log(`${packagesAsGraduation.length} graduation package(s):`);
830
833
  packagesAsGraduation.forEach((pkg) => {
831
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} ${force ? "(force)" : ""}`);
834
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${newVersion} ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
832
835
  });
833
836
  logger.log("");
834
837
  }
@@ -841,7 +844,7 @@ function displayIndependentModePackages({
841
844
  if (force) {
842
845
  logger.log(`${packages.length} package(s):`);
843
846
  packages.forEach((pkg) => {
844
- logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} (force)`);
847
+ logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} (force)${pkg.private ? PRIVATE_SUFFIX : ""}`);
845
848
  });
846
849
  logger.log("");
847
850
  } else {
@@ -851,21 +854,21 @@ function displayIndependentModePackages({
851
854
  if (packagesWithCommits.length > 0) {
852
855
  logger.log(`${packagesWithCommits.length} package(s) with commits:`);
853
856
  packagesWithCommits.forEach((pkg) => {
854
- pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}`);
857
+ pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} (${pkg.commits.length} commits) ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
855
858
  });
856
859
  logger.log("");
857
860
  }
858
861
  if (packagesAsDependents.length > 0) {
859
862
  logger.log(`${packagesAsDependents.length} dependent package(s):`);
860
863
  packagesAsDependents.forEach((pkg) => {
861
- pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} ${force ? "(force)" : ""}`);
864
+ pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
862
865
  });
863
866
  logger.log("");
864
867
  }
865
868
  if (packagesAsGraduation.length > 0) {
866
869
  logger.log(`${packagesAsGraduation.length} graduation package(s):`);
867
870
  packagesAsGraduation.forEach((pkg) => {
868
- pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} ${force ? "(force)" : ""}`);
871
+ pkg.newVersion && logger.log(` \u2022 ${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} ${force ? "(force)" : ""}${pkg.private ? PRIVATE_SUFFIX : ""}`);
869
872
  });
870
873
  logger.log("");
871
874
  }
@@ -888,6 +891,9 @@ async function confirmBump({
888
891
  logger.log("");
889
892
  logger.info(`${dryRun ? "[dry-run] " : ""}The following packages will be updated:
890
893
  `);
894
+ if (packages.some((p) => p.private)) {
895
+ logger.log("\u{1F512} Private packages are versioned and get a CHANGELOG, but are never published to a registry, nor included in provider releases or PR comments.\n");
896
+ }
891
897
  displayRootAndLernaUpdates({
892
898
  versionMode,
893
899
  currentVersion,
@@ -1232,13 +1238,12 @@ async function resolveFromTagUnified({
1232
1238
  }) {
1233
1239
  const filterPrereleases = shouldFilterPrereleaseTags(pkg.version, graduating);
1234
1240
  const onlyStable = graduating || filterPrereleases;
1235
- const from = await getLastRepoTag({
1241
+ return await getLastRepoTag({
1236
1242
  pkg,
1237
1243
  onlyStable,
1238
1244
  logLevel,
1239
1245
  cwd: config.cwd
1240
1246
  }) || getFirstCommit(config.cwd);
1241
- return from;
1242
1247
  }
1243
1248
  async function resolveFromTag({
1244
1249
  config,
@@ -1427,7 +1432,7 @@ async function executeFormatCmd({
1427
1432
  logger.log("[dry-run] exec format command: ", config.changelog.formatCmd);
1428
1433
  }
1429
1434
  } catch (error) {
1430
- throw new Error(`Format command failed: ${error}`);
1435
+ throw new Error(`Format command failed: ${getErrorMessage(error)}`, { cause: error });
1431
1436
  }
1432
1437
  } else {
1433
1438
  logger.debug("No format command specified");
@@ -1458,6 +1463,9 @@ async function executeBuildCmd({
1458
1463
  function isBumpedPackage(pkg) {
1459
1464
  return "oldVersion" in pkg && !!pkg.oldVersion;
1460
1465
  }
1466
+ function filterOutPrivatePackages(packages) {
1467
+ return packages.filter((p) => !p.private);
1468
+ }
1461
1469
  async function getPackagesOrBumpedPackages({
1462
1470
  config,
1463
1471
  bumpResult,
@@ -1630,8 +1638,7 @@ function isOtpError(error) {
1630
1638
  "2fa",
1631
1639
  "two factor"
1632
1640
  ];
1633
- const isOtp = otpPatterns.some((pattern) => searchText.includes(pattern));
1634
- return isOtp;
1641
+ return otpPatterns.some((pattern) => searchText.includes(pattern));
1635
1642
  }
1636
1643
  function promptOtpWithTimeout(timeout = 9e4) {
1637
1644
  return new Promise((resolve, reject) => {
@@ -1809,6 +1816,9 @@ function getDefaultConfig() {
1809
1816
  rootChangelog: true,
1810
1817
  includeCommitBody: true
1811
1818
  },
1819
+ monorepo: {
1820
+ includePrivates: false
1821
+ },
1812
1822
  publish: {
1813
1823
  private: false,
1814
1824
  args: [],
@@ -2278,7 +2288,7 @@ async function generateMarkDown({
2278
2288
  }
2279
2289
  if (updatedConfig.repo?.provider === "github") {
2280
2290
  await Promise.all(
2281
- [..._authors.keys()].map(async (authorName) => {
2291
+ Array.from(_authors.keys(), async (authorName) => {
2282
2292
  const meta = _authors.get(authorName);
2283
2293
  if (!meta) {
2284
2294
  return;
@@ -2293,7 +2303,7 @@ async function generateMarkDown({
2293
2303
  })
2294
2304
  );
2295
2305
  }
2296
- const authors = [..._authors.entries()].map((e) => ({
2306
+ const authors = Array.from(_authors.entries(), (e) => ({
2297
2307
  name: e[0],
2298
2308
  ...e[1]
2299
2309
  }));
@@ -2312,8 +2322,7 @@ async function generateMarkDown({
2312
2322
  })
2313
2323
  );
2314
2324
  }
2315
- const result = convert(markdown.join("\n").trim(), true);
2316
- return result;
2325
+ return convert(markdown.join("\n").trim(), true);
2317
2326
  }
2318
2327
  function getCommitBody(commit) {
2319
2328
  if (!commit.body) {
@@ -2425,7 +2434,7 @@ ${changelog}
2425
2434
  }
2426
2435
  return changelog;
2427
2436
  } catch (error) {
2428
- throw new Error(`Error generating changelog for ${pkg.name} (${fromTag}...${toTag}): ${error}`);
2437
+ throw new Error(`Error generating changelog for ${pkg.name} (${fromTag}...${toTag}): ${getErrorMessage(error)}`, { cause: error });
2429
2438
  }
2430
2439
  }
2431
2440
  function writeChangelogToFile({
@@ -2477,12 +2486,12 @@ async function githubIndependentMode({
2477
2486
  if (!config.tokens.github && !config.repo?.token) {
2478
2487
  throw new Error("No GitHub token specified. Set GITHUB_TOKEN or GH_TOKEN environment variable.");
2479
2488
  }
2480
- const packages = await getPackagesOrBumpedPackages({
2489
+ const packages = filterOutPrivatePackages(await getPackagesOrBumpedPackages({
2481
2490
  config,
2482
2491
  bumpResult,
2483
2492
  suffix,
2484
2493
  force
2485
- });
2494
+ }));
2486
2495
  logger.info(`Creating ${packages.length} GitHub release(s)`);
2487
2496
  const postedReleases = [];
2488
2497
  for (const pkg of packages) {
@@ -2727,12 +2736,12 @@ async function gitlabIndependentMode({
2727
2736
  force
2728
2737
  }) {
2729
2738
  logger.debug(`GitLab token: ${config.tokens.gitlab || config.repo?.token ? "\u2713 provided" : "\u2717 missing"}`);
2730
- const packages = await getPackagesOrBumpedPackages({
2739
+ const packages = filterOutPrivatePackages(await getPackagesOrBumpedPackages({
2731
2740
  config,
2732
2741
  bumpResult,
2733
2742
  suffix,
2734
2743
  force
2735
- });
2744
+ }));
2736
2745
  logger.info(`Creating ${packages.length} GitLab release(s) for independent packages`);
2737
2746
  logger.debug("Getting current branch...");
2738
2747
  const { stdout: currentBranch } = await execPromise("git rev-parse --abbrev-ref HEAD", {
@@ -3457,20 +3466,20 @@ ${preview}`);
3457
3466
  } catch (error) {
3458
3467
  if (error.code === "ERR_MODULE_NOT_FOUND" || error.message?.includes("@slack/web-api")) {
3459
3468
  logger.error("Slack Web API dependency not found. Please install it with: pnpm add @slack/web-api");
3460
- throw new Error("Missing dependency: @slack/web-api. Install it with: pnpm add @slack/web-api");
3469
+ throw new Error("Missing dependency: @slack/web-api. Install it with: pnpm add @slack/web-api", { cause: error });
3461
3470
  }
3462
3471
  logger.error("Failed to post message:", error.message || error);
3463
3472
  if (error.data) {
3464
3473
  logger.error("Slack API error:", error.data.error);
3465
3474
  switch (error.data.error) {
3466
3475
  case "channel_not_found":
3467
- throw new Error("Slack channel not found. Make sure the channel ID or name is correct.");
3476
+ throw new Error("Slack channel not found. Make sure the channel ID or name is correct.", { cause: error });
3468
3477
  case "not_in_channel":
3469
- throw new Error("Bot is not in the channel. Invite the bot to the channel first.");
3478
+ throw new Error("Bot is not in the channel. Invite the bot to the channel first.", { cause: error });
3470
3479
  case "invalid_auth":
3471
- throw new Error("Invalid Slack token. Check your credentials.");
3480
+ throw new Error("Invalid Slack token. Check your credentials.", { cause: error });
3472
3481
  case "missing_scope":
3473
- throw new Error('Missing required OAuth scope. The bot needs "chat:write" permission.');
3482
+ throw new Error('Missing required OAuth scope. The bot needs "chat:write" permission.', { cause: error });
3474
3483
  default:
3475
3484
  throw error;
3476
3485
  }
@@ -3580,7 +3589,7 @@ ${message}`);
3580
3589
  } catch (error) {
3581
3590
  if (error.code === "ERR_MODULE_NOT_FOUND" || error.message?.includes("twitter-api-v2")) {
3582
3591
  logger.error("Twitter API dependency not found. Please install it with: pnpm add twitter-api-v2");
3583
- throw new Error("Missing dependency: twitter-api-v2. Install it with: pnpm add twitter-api-v2");
3592
+ throw new Error("Missing dependency: twitter-api-v2. Install it with: pnpm add twitter-api-v2", { cause: error });
3584
3593
  }
3585
3594
  logger.error("Failed to post tweet:", error.message || error);
3586
3595
  throw error;
@@ -3825,6 +3834,15 @@ async function bumpCanaryMode({
3825
3834
  preid = "canary"
3826
3835
  }) {
3827
3836
  logger.debug("Starting bump in canary mode");
3837
+ if (config.monorepo?.versionMode === "independent") {
3838
+ const sha2 = getShortCommitSha(config.cwd);
3839
+ const packages2 = await getPackages({ config, suffix: void 0, force: false });
3840
+ if (packages2.length === 0) {
3841
+ logger.debug("No packages to bump");
3842
+ return { bumped: false };
3843
+ }
3844
+ return bumpCanaryIndependentMode({ config, dryRun, preid, sha: sha2, packages: packages2 });
3845
+ }
3828
3846
  const rootPackageBase = readPackageJson(config.cwd);
3829
3847
  if (!rootPackageBase) {
3830
3848
  throw new Error("Failed to read root package.json");
@@ -3904,6 +3922,53 @@ async function bumpCanaryMode({
3904
3922
  }))
3905
3923
  };
3906
3924
  }
3925
+ async function bumpCanaryIndependentMode({
3926
+ config,
3927
+ dryRun,
3928
+ preid,
3929
+ sha,
3930
+ packages
3931
+ }) {
3932
+ logger.debug("Starting canary bump in independent mode");
3933
+ const typesConfig = config.types;
3934
+ const packagesWithCanaryVersion = packages.map((pkg) => {
3935
+ const releaseType = determineSemverChange(pkg.commits, typesConfig);
3936
+ const canaryVersion = getCanaryVersion({
3937
+ currentVersion: pkg.version,
3938
+ releaseType,
3939
+ preid,
3940
+ sha
3941
+ });
3942
+ return {
3943
+ ...pkg,
3944
+ newVersion: canaryVersion
3945
+ };
3946
+ });
3947
+ if (!config.bump.yes) {
3948
+ await confirmBump({
3949
+ versionMode: "independent",
3950
+ config,
3951
+ packages: packagesWithCanaryVersion,
3952
+ force: false,
3953
+ dryRun
3954
+ });
3955
+ } else {
3956
+ for (const pkg of packagesWithCanaryVersion) {
3957
+ logger.info(`${pkg.name}: ${pkg.version} \u2192 ${pkg.newVersion} (canary)`);
3958
+ }
3959
+ }
3960
+ for (const pkg of packagesWithCanaryVersion) {
3961
+ writeVersion(pkg.path, pkg.newVersion, dryRun);
3962
+ }
3963
+ logger.info(`${dryRun ? "[dry-run] " : ""}${packagesWithCanaryVersion.length} package(s) bumped independently (canary)`);
3964
+ return {
3965
+ bumped: true,
3966
+ bumpedPackages: packagesWithCanaryVersion.map((pkg) => ({
3967
+ ...pkg,
3968
+ oldVersion: pkg.version
3969
+ }))
3970
+ };
3971
+ }
3907
3972
  async function bump(options = {}) {
3908
3973
  const config = await loadRelizyConfig({
3909
3974
  configFile: options.configName,
@@ -3916,6 +3981,7 @@ async function bump(options = {}) {
3916
3981
  preid: options.preid,
3917
3982
  dependencyTypes: options.dependencyTypes
3918
3983
  },
3984
+ monorepo: options.includePrivates !== void 0 ? { includePrivates: options.includePrivates } : void 0,
3919
3985
  logLevel: options.logLevel
3920
3986
  }
3921
3987
  });
@@ -3951,7 +4017,7 @@ async function bump(options = {}) {
3951
4017
  force,
3952
4018
  suffix: options.suffix
3953
4019
  };
3954
- if (config.monorepo?.versionMode === "unified" || !config.monorepo) {
4020
+ if (config.monorepo?.versionMode === "unified" || !config.monorepo?.versionMode) {
3955
4021
  result = await bumpUnifiedMode(payload);
3956
4022
  } else if (config.monorepo?.versionMode === "selective") {
3957
4023
  result = await bumpSelectiveMode(payload);
@@ -4088,6 +4154,7 @@ async function changelog(options = {}) {
4088
4154
  from: options.from,
4089
4155
  to: options.to,
4090
4156
  logLevel: options.logLevel,
4157
+ monorepo: options.includePrivates !== void 0 ? { includePrivates: options.includePrivates } : void 0,
4091
4158
  changelog: {
4092
4159
  rootChangelog: options.rootChangelog,
4093
4160
  formatCmd: options.formatCmd
@@ -4106,7 +4173,7 @@ async function changelog(options = {}) {
4106
4173
  suffix: options.suffix,
4107
4174
  force: options.force ?? false
4108
4175
  });
4109
- if (config.changelog?.rootChangelog && config.monorepo) {
4176
+ if (config.changelog?.rootChangelog && config.monorepo?.versionMode) {
4110
4177
  if (config.monorepo.versionMode === "independent") {
4111
4178
  await generateIndependentRootChangelog({
4112
4179
  packages,
@@ -4310,7 +4377,7 @@ function buildSuccessComment({
4310
4377
  rootVersion
4311
4378
  }) {
4312
4379
  const bumpResult = releaseContext?.bumpResult;
4313
- const bumpedPackages = bumpResult?.bumpedPackages ?? [];
4380
+ const bumpedPackages = filterOutPrivatePackages(bumpResult?.bumpedPackages ?? []);
4314
4381
  const version = bumpResult?.newVersion ?? rootVersion ?? "unknown";
4315
4382
  const tags = releaseContext?.tags ?? [];
4316
4383
  const distTag = config.publish?.tag;
@@ -4392,11 +4459,12 @@ async function prComment(options = {}) {
4392
4459
  throw new Error("Failed to read root package.json");
4393
4460
  }
4394
4461
  rootVersion = rootPackage.version;
4395
- const readPkgs = readPackages({
4462
+ const readPkgs = filterOutPrivatePackages(readPackages({
4396
4463
  cwd: config.cwd,
4397
4464
  patterns: config.monorepo?.packages,
4398
- ignorePackageNames: config.monorepo?.ignorePackageNames
4399
- });
4465
+ ignorePackageNames: config.monorepo?.ignorePackageNames,
4466
+ includePrivates: config.monorepo?.includePrivates
4467
+ }));
4400
4468
  packages = readPkgs.map((pkg) => ({ name: pkg.name, version: pkg.version }));
4401
4469
  }
4402
4470
  const body = buildCommentBody({
@@ -4602,12 +4670,16 @@ async function publish(options = {}) {
4602
4670
  throw new Error("Failed to read root package.json");
4603
4671
  }
4604
4672
  logger.start("Start publishing packages");
4605
- const packages = await getPackagesOrBumpedPackages({
4673
+ const discoveredPackages = await getPackagesOrBumpedPackages({
4606
4674
  config,
4607
4675
  bumpResult: options.bumpResult,
4608
4676
  suffix: options.suffix,
4609
4677
  force: options.force ?? false
4610
4678
  });
4679
+ const packages = filterOutPrivatePackages(discoveredPackages);
4680
+ if (discoveredPackages.length !== packages.length) {
4681
+ logger.debug(`Filtered out ${discoveredPackages.length - packages.length} private package(s) from publish`);
4682
+ }
4611
4683
  logger.debug(`Found ${packages.length} package(s)`);
4612
4684
  logger.debug("Building dependency graph and sorting...");
4613
4685
  const sortedPackages = topologicalSort(packages);
@@ -4713,9 +4785,8 @@ async function socialSafetyCheck({ config }) {
4713
4785
  }
4714
4786
  logger.info("Social config checked successfully");
4715
4787
  } catch (error) {
4716
- const errorMessage = error instanceof Error ? error.message : String(error);
4717
- logger.error("Error during social safety check:", errorMessage);
4718
- throw new Error(`Error during social safety check: ${errorMessage}`);
4788
+ logger.error("Error during social safety check:", getErrorMessage(error));
4789
+ throw new Error(`Error during social safety check: ${getErrorMessage(error)}`, { cause: error });
4719
4790
  }
4720
4791
  }
4721
4792
  async function handleTwitterPost({
@@ -4994,6 +5065,7 @@ function getReleaseConfig(options = {}) {
4994
5065
  social: options.social,
4995
5066
  prComment: options.prComment
4996
5067
  },
5068
+ monorepo: options.includePrivates !== void 0 ? { includePrivates: options.includePrivates } : void 0,
4997
5069
  safetyCheck: options.safetyCheck
4998
5070
  }
4999
5071
  });
@@ -5083,7 +5155,8 @@ async function release(options = {}) {
5083
5155
  clean: config.release.clean,
5084
5156
  configName: options.configName,
5085
5157
  suffix: options.suffix,
5086
- canary: isCanary
5158
+ canary: isCanary,
5159
+ includePrivates: options.includePrivates
5087
5160
  });
5088
5161
  if (!bumpResult.bumped) {
5089
5162
  logger.debug("No packages bumped");
@@ -5111,7 +5184,8 @@ async function release(options = {}) {
5111
5184
  logLevel: config.logLevel,
5112
5185
  configName: options.configName,
5113
5186
  force,
5114
- suffix: options.suffix
5187
+ suffix: options.suffix,
5188
+ includePrivates: options.includePrivates
5115
5189
  });
5116
5190
  } else {
5117
5191
  logger.info("Skipping changelog generation (--no-changelog)");
@@ -5283,4 +5357,4 @@ Git provider: ${provider}`);
5283
5357
  }
5284
5358
  }
5285
5359
 
5286
- 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, confirmBump as aA, getBumpedIndependentPackages as aB, shouldFilterPrereleaseTags as aC, extractVersionFromTag as aD, getCanaryVersion as aE, isTagVersionCompatibleWithCurrent as aF, 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, getPackagesOrBumpedPackages as al, isGraduatingToStableBetweenVersion as am, determineSemverChange as an, determineReleaseType as ao, writeVersion as ap, getPackageNewVersion as aq, updateLernaVersion as ar, extractVersionFromPackageTag as as, isPrerelease as at, isStableReleaseType as au, isPrereleaseReleaseType as av, isGraduating as aw, getPreid as ax, isChangedPreid as ay, getBumpedPackageIndependently 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 };
5360
+ 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, getBumpedPackageIndependently as aA, confirmBump as aB, getBumpedIndependentPackages as aC, shouldFilterPrereleaseTags as aD, extractVersionFromTag as aE, getCanaryVersion as aF, isTagVersionCompatibleWithCurrent as aG, 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, determineSemverChange as ao, determineReleaseType as ap, writeVersion as aq, getPackageNewVersion as ar, updateLernaVersion as as, extractVersionFromPackageTag as at, isPrerelease as au, isStableReleaseType as av, isPrereleaseReleaseType as aw, isGraduating as ax, getPreid as ay, isChangedPreid 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.2.2-beta.0",
4
+ "version": "1.2.2-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",
@@ -67,9 +67,9 @@
67
67
  }
68
68
  },
69
69
  "dependencies": {
70
- "@inquirer/prompts": "^8.3.0",
70
+ "@inquirer/prompts": "^8.3.2",
71
71
  "@maz-ui/node": "4.6.1",
72
- "@maz-ui/utils": "^4.7.4",
72
+ "@maz-ui/utils": "^4.7.6",
73
73
  "c12": "^3.3.3",
74
74
  "changelogen": "^0.6.2",
75
75
  "commander": "^14.0.3",
@@ -80,26 +80,26 @@
80
80
  "semver": "^7.7.4"
81
81
  },
82
82
  "devDependencies": {
83
- "@commitlint/cli": "^20.4.4",
84
- "@commitlint/config-conventional": "20.4.4",
85
- "@commitlint/cz-commitlint": "^20.4.4",
86
- "@commitlint/types": "^20.4.4",
87
- "@maz-ui/eslint-config": "^4.7.0",
83
+ "@commitlint/cli": "^20.5.0",
84
+ "@commitlint/config-conventional": "20.5.0",
85
+ "@commitlint/cz-commitlint": "^20.5.0",
86
+ "@commitlint/types": "^20.5.0",
87
+ "@maz-ui/eslint-config": "^4.8.0",
88
88
  "@slack/web-api": "7.15.0",
89
89
  "@types/node": "^25.5.0",
90
90
  "@types/semver": "^7.7.1",
91
- "@vitest/coverage-v8": "^4.1.0",
91
+ "@vitest/coverage-v8": "^4.1.1",
92
92
  "cross-env": "10.1.0",
93
- "eslint": "^9.39.2",
93
+ "eslint": "^10.1.0",
94
94
  "husky": "9.1.7",
95
95
  "jiti": "2.6.1",
96
96
  "lint-staged": "^16.4.0",
97
- "memfs": "^4.56.11",
97
+ "memfs": "^4.57.1",
98
98
  "tsx": "^4.21.0",
99
99
  "twitter-api-v2": "^1.29.0",
100
100
  "typescript": "^5.9.3",
101
101
  "unbuild": "^3.6.1",
102
- "vitest": "^4.1.0"
102
+ "vitest": "^4.1.1"
103
103
  },
104
104
  "lint-staged": {
105
105
  "*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [