relizy 1.0.0-beta.3 → 1.0.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 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 { a7 as isInCI, a8 as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, f as social, r as release } from './shared/relizy.DztEySZj.mjs';
8
+ import { a7 as isInCI, a8 as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, f as social, r as release } from './shared/relizy.DDnOGyKL.mjs';
9
9
  import 'changelogen';
10
10
  import 'fast-glob';
11
11
  import '@inquirer/prompts';
package/dist/index.d.mts CHANGED
@@ -1389,7 +1389,7 @@ declare function release(options?: Partial<ReleaseOptions>): Promise<void>;
1389
1389
 
1390
1390
  declare function socialSafetyCheck({ config }: {
1391
1391
  config: ResolvedRelizyConfig;
1392
- }): void;
1392
+ }): Promise<void>;
1393
1393
  declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
1394
1394
 
1395
1395
  export { bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getSlackToken, getTwitterCredentials, github, gitlab, hasLernaJson, isBumpedPackage, isChangedPreid, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, loadRelizyConfig, parseGitRemoteUrl, postReleaseToSlack, postReleaseToTwitter, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, readPackageJson, readPackages, release, resolveTags, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, topologicalSort, updateLernaVersion, writeChangelogToFile, writeVersion };
package/dist/index.d.ts CHANGED
@@ -1389,7 +1389,7 @@ declare function release(options?: Partial<ReleaseOptions>): Promise<void>;
1389
1389
 
1390
1390
  declare function socialSafetyCheck({ config }: {
1391
1391
  config: ResolvedRelizyConfig;
1392
- }): void;
1392
+ }): Promise<void>;
1393
1393
  declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
1394
1394
 
1395
1395
  export { bump, changelog, checkGitStatusIfDirty, confirmBump, createCommitAndTags, createGitlabRelease, defineConfig, detectGitProvider, detectPackageManager, determinePublishTag, determineReleaseType, determineSemverChange, executeBuildCmd, executeFormatCmd, executeHook, expandPackagesToBumpWithDependents, extractChangelogSummary, extractVersionFromPackageTag, extractVersionFromTag, fetchGitTags, formatChangelogForSlack, formatSlackMessage, formatTweetMessage, generateChangelog, getAuthCommand, getBumpedIndependentPackages, getBumpedPackageIndependently, getCIName, getCurrentGitBranch, getCurrentGitRef, getDefaultConfig, getDependentsOf, getFirstCommit, getGitStatus, getIndependentTag, getLastPackageTag, getLastRepoTag, getLastStableTag, getLastTag, getModifiedReleaseFilePatterns, getPackageCommits, getPackageDependencies, getPackageNewVersion, getPackages, getPackagesOrBumpedPackages, getPackagesToPublishInIndependentMode, getPackagesToPublishInSelectiveMode, getPreid, getReleaseUrl, getRootPackage, getSlackToken, getTwitterCredentials, github, gitlab, hasLernaJson, isBumpedPackage, isChangedPreid, isGraduating, isGraduatingToStableBetweenVersion, isInCI, isPrerelease, isPrereleaseReleaseType, isStableReleaseType, isTagVersionCompatibleWithCurrent, loadRelizyConfig, parseGitRemoteUrl, postReleaseToSlack, postReleaseToTwitter, providerRelease, providerReleaseSafetyCheck, publish, publishPackage, publishSafetyCheck, pushCommitAndTags, readPackageJson, readPackages, release, resolveTags, rollbackModifiedFiles, shouldFilterPrereleaseTags, social, socialSafetyCheck, topologicalSort, updateLernaVersion, writeChangelogToFile, writeVersion };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { b as bump, c as changelog, o as checkGitStatusIfDirty, ar as confirmBump, y as createCommitAndTags, F as createGitlabRelease, i as defineConfig, u as detectGitProvider, H as detectPackageManager, I as determinePublishTag, af as determineReleaseType, ae as determineSemverChange, aa as executeBuildCmd, a9 as executeFormatCmd, a6 as executeHook, m as expandPackagesToBumpWithDependents, X as extractChangelogSummary, aj as extractVersionFromPackageTag, au as extractVersionFromTag, q as fetchGitTags, U as formatChangelogForSlack, V as formatSlackMessage, a4 as formatTweetMessage, g as generateChangelog, L as getAuthCommand, as as getBumpedIndependentPackages, aq as getBumpedPackageIndependently, a8 as getCIName, C as getCurrentGitBranch, D as getCurrentGitRef, h as getDefaultConfig, k as getDependentsOf, B as getFirstCommit, n as getGitStatus, Z as getIndependentTag, a1 as getLastPackageTag, a0 as getLastRepoTag, _ as getLastStableTag, $ as getLastTag, x as getModifiedReleaseFilePatterns, R as getPackageCommits, j as getPackageDependencies, ah as getPackageNewVersion, Q as getPackages, ac as getPackagesOrBumpedPackages, K as getPackagesToPublishInIndependentMode, J as getPackagesToPublishInSelectiveMode, ao as getPreid, Y as getReleaseUrl, O as getRootPackage, T as getSlackToken, a3 as getTwitterCredentials, E as github, G as gitlab, S as hasLernaJson, ab as isBumpedPackage, ap as isChangedPreid, an as isGraduating, ad as isGraduatingToStableBetweenVersion, a7 as isInCI, ak as isPrerelease, am as isPrereleaseReleaseType, al as isStableReleaseType, av as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, v as parseGitRemoteUrl, W as postReleaseToSlack, a5 as postReleaseToTwitter, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, M as publishPackage, d as publishSafetyCheck, z as pushCommitAndTags, N as readPackageJson, P as readPackages, r as release, a2 as resolveTags, A as rollbackModifiedFiles, at as shouldFilterPrereleaseTags, f as social, s as socialSafetyCheck, t as topologicalSort, ai as updateLernaVersion, w as writeChangelogToFile, ag as writeVersion } from './shared/relizy.DztEySZj.mjs';
1
+ export { b as bump, c as changelog, o as checkGitStatusIfDirty, ar as confirmBump, y as createCommitAndTags, F as createGitlabRelease, i as defineConfig, u as detectGitProvider, H as detectPackageManager, I as determinePublishTag, af as determineReleaseType, ae as determineSemverChange, aa as executeBuildCmd, a9 as executeFormatCmd, a6 as executeHook, m as expandPackagesToBumpWithDependents, X as extractChangelogSummary, aj as extractVersionFromPackageTag, au as extractVersionFromTag, q as fetchGitTags, U as formatChangelogForSlack, V as formatSlackMessage, a4 as formatTweetMessage, g as generateChangelog, L as getAuthCommand, as as getBumpedIndependentPackages, aq as getBumpedPackageIndependently, a8 as getCIName, C as getCurrentGitBranch, D as getCurrentGitRef, h as getDefaultConfig, k as getDependentsOf, B as getFirstCommit, n as getGitStatus, Z as getIndependentTag, a1 as getLastPackageTag, a0 as getLastRepoTag, _ as getLastStableTag, $ as getLastTag, x as getModifiedReleaseFilePatterns, R as getPackageCommits, j as getPackageDependencies, ah as getPackageNewVersion, Q as getPackages, ac as getPackagesOrBumpedPackages, K as getPackagesToPublishInIndependentMode, J as getPackagesToPublishInSelectiveMode, ao as getPreid, Y as getReleaseUrl, O as getRootPackage, T as getSlackToken, a3 as getTwitterCredentials, E as github, G as gitlab, S as hasLernaJson, ab as isBumpedPackage, ap as isChangedPreid, an as isGraduating, ad as isGraduatingToStableBetweenVersion, a7 as isInCI, ak as isPrerelease, am as isPrereleaseReleaseType, al as isStableReleaseType, av as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, v as parseGitRemoteUrl, W as postReleaseToSlack, a5 as postReleaseToTwitter, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, M as publishPackage, d as publishSafetyCheck, z as pushCommitAndTags, N as readPackageJson, P as readPackages, r as release, a2 as resolveTags, A as rollbackModifiedFiles, at as shouldFilterPrereleaseTags, f as social, s as socialSafetyCheck, t as topologicalSort, ai as updateLernaVersion, w as writeChangelogToFile, ag as writeVersion } from './shared/relizy.DDnOGyKL.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:process';
4
4
  import 'node:fs';
@@ -3055,7 +3055,7 @@ function getTwitterCredentials({ socialCredentials, tokenCredentials }) {
3055
3055
  const accessToken = socialCredentials?.accessToken || tokenCredentials?.accessToken;
3056
3056
  const accessTokenSecret = socialCredentials?.accessTokenSecret || tokenCredentials?.accessTokenSecret;
3057
3057
  if (!apiKey || !apiKeySecret || !accessToken || !accessTokenSecret) {
3058
- logger.warn("Twitter is enabled but credentials are missing.");
3058
+ logger.error("Twitter is enabled but credentials are missing.");
3059
3059
  logger.log("Set the following environment variables or configure them in social.twitter.credentials or tokens.twitter:");
3060
3060
  if (!apiKey)
3061
3061
  logger.log(" - TWITTER_API_KEY or RELIZY_TWITTER_API_KEY");
@@ -3879,49 +3879,61 @@ async function publish(options = {}) {
3879
3879
  }
3880
3880
  }
3881
3881
 
3882
- function socialSafetyCheck({ config }) {
3883
- const socialMediaDisabled = !config.release.social && !config.social.twitter.enabled && !config.social.slack.enabled;
3884
- if (!config.safetyCheck || socialMediaDisabled) {
3885
- logger.debug("Safety check disabled or social disabled");
3886
- return;
3887
- }
3888
- logger.debug("Start checking social config");
3889
- const errors = {
3890
- twitter: false,
3891
- slack: false
3892
- };
3893
- const twitterConfig = config.social?.twitter;
3894
- if (twitterConfig?.enabled) {
3895
- const credentials = getTwitterCredentials({
3896
- socialCredentials: twitterConfig.credentials,
3897
- tokenCredentials: config.tokens?.twitter
3898
- });
3899
- if (!credentials) {
3900
- errors.twitter = true;
3882
+ async function socialSafetyCheck({ config }) {
3883
+ try {
3884
+ const socialMediaDisabled = !config.release.social && !config.social.twitter.enabled && !config.social.slack.enabled;
3885
+ if (!config.safetyCheck || socialMediaDisabled) {
3886
+ logger.debug("Safety check disabled or social disabled");
3887
+ return;
3901
3888
  }
3902
- }
3903
- const slackConfig = config.social?.slack;
3904
- if (slackConfig?.enabled) {
3905
- const token = getSlackToken({
3906
- socialCredentials: slackConfig.credentials,
3907
- tokenCredential: config.tokens?.slack
3908
- });
3909
- if (!token) {
3910
- logger.log("Slack is enabled but credentials are missing.");
3911
- logger.log("Set the following environment variables or configure them in social.slack.credentials or tokens.slack:");
3912
- logger.log(" - SLACK_TOKEN or RELIZY_SLACK_TOKEN");
3913
- errors.slack = true;
3889
+ logger.debug("Start checking social config");
3890
+ const twitterConfig = config.social?.twitter;
3891
+ if (twitterConfig?.enabled) {
3892
+ const credentials = getTwitterCredentials({
3893
+ socialCredentials: twitterConfig.credentials,
3894
+ tokenCredentials: config.tokens?.twitter
3895
+ });
3896
+ if (!credentials) {
3897
+ logger.fail("Twitter credentials not found");
3898
+ throw new Error("Twitter credentials not found");
3899
+ }
3900
+ try {
3901
+ await import('twitter-api-v2');
3902
+ } catch {
3903
+ logger.fail("twitter-api-v2 is not installed, please install it");
3904
+ throw new Error("twitter-api-v2 is not installed");
3905
+ }
3914
3906
  }
3915
- if (!slackConfig.channel) {
3916
- logger.warn("Slack is enabled but no channel is configured.");
3917
- logger.log('Set the channel in social.slack.channel (e.g., "#releases" or "C1234567890")');
3918
- errors.slack = true;
3907
+ const slackConfig = config.social?.slack;
3908
+ if (slackConfig?.enabled) {
3909
+ const token = getSlackToken({
3910
+ socialCredentials: slackConfig.credentials,
3911
+ tokenCredential: config.tokens?.slack
3912
+ });
3913
+ try {
3914
+ await import('@slack/web-api');
3915
+ } catch {
3916
+ logger.fail("@slack/web-api is not installed, please install it");
3917
+ throw new Error("@slack/web-api is not installed");
3918
+ }
3919
+ if (!token) {
3920
+ logger.fail("Slack is enabled but credentials are missing.");
3921
+ logger.log("Set the following environment variables or configure them in social.slack.credentials or tokens.slack:");
3922
+ logger.log(" - SLACK_TOKEN or RELIZY_SLACK_TOKEN");
3923
+ throw new Error("Slack credentials not found");
3924
+ }
3925
+ if (!slackConfig.channel) {
3926
+ logger.fail("Slack is enabled but no channel is configured.");
3927
+ logger.log('Set the channel in social.slack.channel (e.g., "#releases" or "C1234567890")');
3928
+ throw new Error("Slack channel not found");
3929
+ }
3919
3930
  }
3931
+ logger.info("Social config checked successfully");
3932
+ } catch (error) {
3933
+ const errorMessage = error instanceof Error ? error.message : String(error);
3934
+ logger.error("Error during social safety check:", errorMessage);
3935
+ throw new Error(`Error during social safety check: ${errorMessage}`);
3920
3936
  }
3921
- if (errors.twitter || errors.slack) {
3922
- throw new Error("Social config checked with errors");
3923
- }
3924
- logger.info("Social config checked successfully");
3925
3937
  }
3926
3938
  async function handleTwitterPost({
3927
3939
  config,
@@ -4076,7 +4088,7 @@ async function social(options = {}) {
4076
4088
  }
4077
4089
  });
4078
4090
  logger.debug(`Version mode: ${config.monorepo?.versionMode || "standalone"}`);
4079
- socialSafetyCheck({ config });
4091
+ await socialSafetyCheck({ config });
4080
4092
  if (!config.release.social && !config.social?.twitter?.enabled && !config.social?.slack?.enabled) {
4081
4093
  logger.warn("Social media posting is disabled in configuration.");
4082
4094
  logger.info("Enable it with release.social: true or social.twitter.enabled: true or social.slack.enabled: true");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.3",
4
+ "version": "1.0.0",
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",