relizy 1.5.0-beta.0 → 1.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +4 -4
- package/dist/index.d.mts +41 -6
- package/dist/index.d.ts +41 -6
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.Bpfgbc-1.mjs → relizy.B0MWtDvR.mjs} +103 -35
- package/package.json +2 -2
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 { ar as isInCI, R as getCIName, e as bump, g as changelog, aG as publish, aE as providerRelease, aY as social, aD as prComment, aP as release } from './shared/relizy.B0MWtDvR.mjs';
|
|
9
9
|
import 'node:child_process';
|
|
10
10
|
import '@maz-ui/utils/helpers/formatJson';
|
|
11
11
|
import 'c12';
|
|
@@ -21,10 +21,10 @@ import 'convert-gitmoji';
|
|
|
21
21
|
import 'node-fetch-native';
|
|
22
22
|
|
|
23
23
|
const hasSilentFlag = process.argv.includes("--log-level") && process.argv.includes("silent");
|
|
24
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
25
|
-
const __dirname = dirname(__filename);
|
|
24
|
+
const __filename$1 = fileURLToPath(import.meta.url);
|
|
25
|
+
const __dirname$1 = dirname(__filename$1);
|
|
26
26
|
const packageJson = JSON.parse(
|
|
27
|
-
readFileSync(join(__dirname, "../package.json"), "utf-8")
|
|
27
|
+
readFileSync(join(__dirname$1, "../package.json"), "utf-8")
|
|
28
28
|
);
|
|
29
29
|
const version = packageJson.version;
|
|
30
30
|
if (!hasSilentFlag) {
|
package/dist/index.d.mts
CHANGED
|
@@ -347,6 +347,12 @@ declare function getPackagesToPublishInIndependentMode(sortedPackages: PackageBa
|
|
|
347
347
|
* list to publish isn't known yet - prefer `resolveRegistryTargetsForPackages`
|
|
348
348
|
* once it is, so a registry scoped to packages outside this release doesn't
|
|
349
349
|
* needlessly block it.
|
|
350
|
+
*
|
|
351
|
+
* When no default `registry` is configured but explicit `registries` are, the
|
|
352
|
+
* legacy target degrades to an empty URL that would target the ambient
|
|
353
|
+
* `.npmrc` registry with no managed auth. It is a phantom in that case and is
|
|
354
|
+
* excluded, so a config that lists every registry explicitly does not
|
|
355
|
+
* authenticate against a bogus empty registry.
|
|
350
356
|
*/
|
|
351
357
|
declare function resolveAllConfiguredRegistryTargets(config: ResolvedRelizyConfig): RegistryTarget[];
|
|
352
358
|
/**
|
|
@@ -355,9 +361,15 @@ declare function resolveAllConfiguredRegistryTargets(config: ResolvedRelizyConfi
|
|
|
355
361
|
* `packageFilter` (mirrored to all packages) or whose `packageFilter` glob
|
|
356
362
|
* patterns match the package name.
|
|
357
363
|
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* registries instead of mirroring on top of the default one
|
|
364
|
+
* The legacy/default registry is skipped for this package when either:
|
|
365
|
+
* - an applicable entry is marked `exclusive` - the package is published only
|
|
366
|
+
* to the matching registries instead of mirroring on top of the default one;
|
|
367
|
+
* - no default `registry` is configured yet the package already has at least
|
|
368
|
+
* one applicable explicit registry. Without a default, the legacy target
|
|
369
|
+
* degrades to an empty URL that would publish to the ambient `.npmrc`
|
|
370
|
+
* registry with no managed auth, so it is a phantom once real targets exist.
|
|
371
|
+
* When nothing else covers the package, the empty legacy target is kept as
|
|
372
|
+
* the historical `.npmrc` fallback.
|
|
361
373
|
*/
|
|
362
374
|
declare function resolveRegistryTargetsForPackage(pkg: PackageBase, config: ResolvedRelizyConfig): RegistryTarget[];
|
|
363
375
|
/**
|
|
@@ -368,6 +380,27 @@ declare function resolveRegistryTargetsForPackage(pkg: PackageBase, config: Reso
|
|
|
368
380
|
* scoped to packages that are not part of this release does not block it.
|
|
369
381
|
*/
|
|
370
382
|
declare function resolveRegistryTargetsForPackages(packages: PackageBase[], config: ResolvedRelizyConfig): RegistryTarget[];
|
|
383
|
+
/**
|
|
384
|
+
* Run `fn` with the registry target's auth token and scope registry
|
|
385
|
+
* temporarily written to the project `.npmrc` (at `config.cwd`), then restore
|
|
386
|
+
* the original file - or remove it if it did not exist - ALWAYS, even on
|
|
387
|
+
* failure.
|
|
388
|
+
*
|
|
389
|
+
* This is the version-proof replacement for passing rc-options as CLI flags:
|
|
390
|
+
* the `.npmrc` contract is stable across npm/pnpm/bun and every version, so we
|
|
391
|
+
* never depend on the CLI argument parser (which pnpm changed in v10+). Only
|
|
392
|
+
* the keys relizy manages are overridden; every other line already in the
|
|
393
|
+
* user's `.npmrc` is preserved untouched. When there is nothing to inject (no
|
|
394
|
+
* token/scope, or a package manager that does not read `.npmrc` such as yarn),
|
|
395
|
+
* the `.npmrc` is left as-is and `fn` runs against the user's own config.
|
|
396
|
+
*/
|
|
397
|
+
declare function withRegistryNpmrc<T>({ config, registryTarget, packageName, packageManager, fn, }: {
|
|
398
|
+
config: ResolvedRelizyConfig;
|
|
399
|
+
registryTarget: RegistryTarget;
|
|
400
|
+
packageName?: string;
|
|
401
|
+
packageManager: PackageManager;
|
|
402
|
+
fn: () => Promise<T>;
|
|
403
|
+
}): Promise<T>;
|
|
371
404
|
declare function getAuthCommand({ packageManager, config, otp, registryTarget, }: {
|
|
372
405
|
packageManager: PackageManager;
|
|
373
406
|
config: ResolvedRelizyConfig;
|
|
@@ -1248,7 +1281,8 @@ interface RegistryTarget {
|
|
|
1248
1281
|
*/
|
|
1249
1282
|
registry: string;
|
|
1250
1283
|
/**
|
|
1251
|
-
* Registry token -
|
|
1284
|
+
* Registry token - supported for npm, pnpm and bun (injected via `.npmrc`).
|
|
1285
|
+
* Yarn is not supported (it uses `.yarnrc.yml`); configure its auth yourself.
|
|
1252
1286
|
*/
|
|
1253
1287
|
token?: string;
|
|
1254
1288
|
/**
|
|
@@ -1309,7 +1343,8 @@ type PublishConfig = ChangelogConfig$1['publish'] & {
|
|
|
1309
1343
|
*/
|
|
1310
1344
|
buildCmd?: string;
|
|
1311
1345
|
/**
|
|
1312
|
-
* NPM token (e.g. `123456`) -
|
|
1346
|
+
* NPM token (e.g. `123456`) - supported for npm, pnpm and bun (injected via
|
|
1347
|
+
* `.npmrc`). Yarn is not supported (it uses `.yarnrc.yml`).
|
|
1313
1348
|
*/
|
|
1314
1349
|
token?: string;
|
|
1315
1350
|
/**
|
|
@@ -2091,5 +2126,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2091
2126
|
}): Promise<void>;
|
|
2092
2127
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2093
2128
|
|
|
2094
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, 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, 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, updateLernaVersion, writeChangelogToFile, writeVersion };
|
|
2129
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, 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, 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, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2095
2130
|
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
|
@@ -347,6 +347,12 @@ declare function getPackagesToPublishInIndependentMode(sortedPackages: PackageBa
|
|
|
347
347
|
* list to publish isn't known yet - prefer `resolveRegistryTargetsForPackages`
|
|
348
348
|
* once it is, so a registry scoped to packages outside this release doesn't
|
|
349
349
|
* needlessly block it.
|
|
350
|
+
*
|
|
351
|
+
* When no default `registry` is configured but explicit `registries` are, the
|
|
352
|
+
* legacy target degrades to an empty URL that would target the ambient
|
|
353
|
+
* `.npmrc` registry with no managed auth. It is a phantom in that case and is
|
|
354
|
+
* excluded, so a config that lists every registry explicitly does not
|
|
355
|
+
* authenticate against a bogus empty registry.
|
|
350
356
|
*/
|
|
351
357
|
declare function resolveAllConfiguredRegistryTargets(config: ResolvedRelizyConfig): RegistryTarget[];
|
|
352
358
|
/**
|
|
@@ -355,9 +361,15 @@ declare function resolveAllConfiguredRegistryTargets(config: ResolvedRelizyConfi
|
|
|
355
361
|
* `packageFilter` (mirrored to all packages) or whose `packageFilter` glob
|
|
356
362
|
* patterns match the package name.
|
|
357
363
|
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* registries instead of mirroring on top of the default one
|
|
364
|
+
* The legacy/default registry is skipped for this package when either:
|
|
365
|
+
* - an applicable entry is marked `exclusive` - the package is published only
|
|
366
|
+
* to the matching registries instead of mirroring on top of the default one;
|
|
367
|
+
* - no default `registry` is configured yet the package already has at least
|
|
368
|
+
* one applicable explicit registry. Without a default, the legacy target
|
|
369
|
+
* degrades to an empty URL that would publish to the ambient `.npmrc`
|
|
370
|
+
* registry with no managed auth, so it is a phantom once real targets exist.
|
|
371
|
+
* When nothing else covers the package, the empty legacy target is kept as
|
|
372
|
+
* the historical `.npmrc` fallback.
|
|
361
373
|
*/
|
|
362
374
|
declare function resolveRegistryTargetsForPackage(pkg: PackageBase, config: ResolvedRelizyConfig): RegistryTarget[];
|
|
363
375
|
/**
|
|
@@ -368,6 +380,27 @@ declare function resolveRegistryTargetsForPackage(pkg: PackageBase, config: Reso
|
|
|
368
380
|
* scoped to packages that are not part of this release does not block it.
|
|
369
381
|
*/
|
|
370
382
|
declare function resolveRegistryTargetsForPackages(packages: PackageBase[], config: ResolvedRelizyConfig): RegistryTarget[];
|
|
383
|
+
/**
|
|
384
|
+
* Run `fn` with the registry target's auth token and scope registry
|
|
385
|
+
* temporarily written to the project `.npmrc` (at `config.cwd`), then restore
|
|
386
|
+
* the original file - or remove it if it did not exist - ALWAYS, even on
|
|
387
|
+
* failure.
|
|
388
|
+
*
|
|
389
|
+
* This is the version-proof replacement for passing rc-options as CLI flags:
|
|
390
|
+
* the `.npmrc` contract is stable across npm/pnpm/bun and every version, so we
|
|
391
|
+
* never depend on the CLI argument parser (which pnpm changed in v10+). Only
|
|
392
|
+
* the keys relizy manages are overridden; every other line already in the
|
|
393
|
+
* user's `.npmrc` is preserved untouched. When there is nothing to inject (no
|
|
394
|
+
* token/scope, or a package manager that does not read `.npmrc` such as yarn),
|
|
395
|
+
* the `.npmrc` is left as-is and `fn` runs against the user's own config.
|
|
396
|
+
*/
|
|
397
|
+
declare function withRegistryNpmrc<T>({ config, registryTarget, packageName, packageManager, fn, }: {
|
|
398
|
+
config: ResolvedRelizyConfig;
|
|
399
|
+
registryTarget: RegistryTarget;
|
|
400
|
+
packageName?: string;
|
|
401
|
+
packageManager: PackageManager;
|
|
402
|
+
fn: () => Promise<T>;
|
|
403
|
+
}): Promise<T>;
|
|
371
404
|
declare function getAuthCommand({ packageManager, config, otp, registryTarget, }: {
|
|
372
405
|
packageManager: PackageManager;
|
|
373
406
|
config: ResolvedRelizyConfig;
|
|
@@ -1248,7 +1281,8 @@ interface RegistryTarget {
|
|
|
1248
1281
|
*/
|
|
1249
1282
|
registry: string;
|
|
1250
1283
|
/**
|
|
1251
|
-
* Registry token -
|
|
1284
|
+
* Registry token - supported for npm, pnpm and bun (injected via `.npmrc`).
|
|
1285
|
+
* Yarn is not supported (it uses `.yarnrc.yml`); configure its auth yourself.
|
|
1252
1286
|
*/
|
|
1253
1287
|
token?: string;
|
|
1254
1288
|
/**
|
|
@@ -1309,7 +1343,8 @@ type PublishConfig = ChangelogConfig$1['publish'] & {
|
|
|
1309
1343
|
*/
|
|
1310
1344
|
buildCmd?: string;
|
|
1311
1345
|
/**
|
|
1312
|
-
* NPM token (e.g. `123456`) -
|
|
1346
|
+
* NPM token (e.g. `123456`) - supported for npm, pnpm and bun (injected via
|
|
1347
|
+
* `.npmrc`). Yarn is not supported (it uses `.yarnrc.yml`).
|
|
1313
1348
|
*/
|
|
1314
1349
|
token?: string;
|
|
1315
1350
|
/**
|
|
@@ -2091,5 +2126,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
2091
2126
|
}): Promise<void>;
|
|
2092
2127
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
2093
2128
|
|
|
2094
|
-
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, 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, 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, updateLernaVersion, writeChangelogToFile, writeVersion };
|
|
2129
|
+
export { NEW_PACKAGE_MARKER, PR_COMMENT_MARKER, buildChangelogBody, buildCommentBody, buildCompareLink, buildContributors, 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, 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, updateLernaVersion, withRegistryNpmrc, writeChangelogToFile, writeVersion };
|
|
2095
2130
|
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 {
|
|
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 bump, f as capReleaseTypeForZeroMajor, g as changelog, h as checkGitStatusIfDirty, i as collectContributorNames, j as collectPackageBumps, k as confirmBump, l as createCommitAndTags, m as createGitlabRelease, n as defineConfig, o as detectGitProvider, p as detectPackageManager, q as detectPullRequest, r as determinePublishTag, s as determineReleaseType, t as determineSemverChange, u as executeBuildCmd, v as executeFormatCmd, w as executeHook, x as expandPackagesToBumpWithDependents, y as extractChangelogSummary, z as extractVersionFromPackageTag, A as extractVersionFromTag, B as fetchGitTags, C as filterOutPrivatePackages, D as findGitHubPR, E as findGitLabMR, F as findReachableCommitBySubject, G as formatChangelogForSlack, H as formatPackagesForSlack, I as formatSlackMessage, J as formatTweetMessage, K as generateChangelog, L as generateMarkDown, M as getAuthCommand, O as getBumpedIndependentPackages, Q as getBumpedPackageIndependently, R as getCIName, S as getCanaryVersion, T as getCommitSubject, U as getCurrentGitBranch, V as getCurrentGitRef, W as getDefaultConfig, X as getDependentsOf, Y as getFirstCommit, Z as getGitStatus, _ as getIndependentTag, $ as getLastPackageTag, a0 as getLastRepoTag, a1 as getLastStableTag, a2 as getLastTag, a3 as getModifiedReleaseFilePatterns, a4 as getNpmRegistry, a5 as getPackageCommits, a6 as getPackageDependencies, a7 as getPackageNewVersion, a8 as getPackages, a9 as getPackagesOrBumpedPackages, aa as getPackagesToPublishInIndependentMode, ab as getPackagesToPublishInSelectiveMode, ac as getPreid, ad as getReleaseUrl, ae as getRootPackage, af as getShortCommitSha, ag as getSlackToken, ah as getSlackWebhookUrl, ai as getTwitterCredentials, aj as github, ak as gitlab, al as hasLernaJson, am as isAncestor, an as isBumpedPackage, ao as isChangedPreid, ap as isGraduating, aq as isGraduatingToStableBetweenVersion, ar as isInCI, as as isPrerelease, at as isPrereleaseReleaseType, au as isStableReleaseType, av as isTagVersionCompatibleWithCurrent, aw as loadRelizyConfig, ax as mergeTypes, ay as parseChangelogMarkdown, az as parseGitRemoteUrl, aA as postPrComment, aB as postReleaseToSlack, aC as postReleaseToTwitter, aD as prComment, aE as providerRelease, aF as providerReleaseSafetyCheck, aG as publish, aH as publishPackage, aI as publishSafetyCheck, aJ as pushCommitAndTags, aK as pushTagForce, aL as readPackageJson, aM as readPackages, aN as reconcileFromTag, aO as redactSecrets, aP as release, aQ as resetRewrittenTagCache, aR as resolveAllConfiguredRegistryTargets, aS as resolveRegistryTargetsForPackage, aT as resolveRegistryTargetsForPackages, aU as resolveTags, aV as retagAnnotatedLocal, aW as rollbackModifiedFiles, aX as shouldFilterPrereleaseTags, aY as social, aZ as socialSafetyCheck, a_ as tagExists, a$ as topologicalSort, b0 as updateLernaVersion, b1 as withRegistryNpmrc, b2 as writeChangelogToFile, b3 as writeVersion } from './shared/relizy.B0MWtDvR.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:child_process';
|
|
4
4
|
import 'node:process';
|
|
@@ -5,7 +5,7 @@ import { formatJson } from '@maz-ui/utils/helpers/formatJson';
|
|
|
5
5
|
import { setupDotenv, loadConfig } from 'c12';
|
|
6
6
|
import { getGitDiff, parseCommits, resolveRepoConfig, getRepoConfig, formatCompareChanges, formatReference, createGithubRelease } from 'changelogen';
|
|
7
7
|
import { defu } from 'defu';
|
|
8
|
-
import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { existsSync, readFileSync, statSync, writeFileSync, rmSync } from 'node:fs';
|
|
9
9
|
import path, { join, relative, sep } from 'node:path';
|
|
10
10
|
import { select, confirm, input } from '@inquirer/prompts';
|
|
11
11
|
import micromatch from 'micromatch';
|
|
@@ -1937,7 +1937,11 @@ function dedupRegistryTargets(targets) {
|
|
|
1937
1937
|
function resolveAllConfiguredRegistryTargets(config) {
|
|
1938
1938
|
const legacyTarget = buildLegacyRegistryTarget(config);
|
|
1939
1939
|
const explicitTargets = config.publish.registries ?? [];
|
|
1940
|
-
|
|
1940
|
+
const skipEmptyDefault = !config.publish.registry && explicitTargets.length > 0;
|
|
1941
|
+
return dedupRegistryTargets([
|
|
1942
|
+
...skipEmptyDefault ? [] : [legacyTarget],
|
|
1943
|
+
...explicitTargets
|
|
1944
|
+
]);
|
|
1941
1945
|
}
|
|
1942
1946
|
function resolveRegistryTargetsForPackage(pkg, config) {
|
|
1943
1947
|
const legacyTarget = buildLegacyRegistryTarget(config);
|
|
@@ -1945,9 +1949,10 @@ function resolveRegistryTargetsForPackage(pkg, config) {
|
|
|
1945
1949
|
const applicableTargets = explicitTargets.filter(
|
|
1946
1950
|
(target) => !target.packageFilter?.length || micromatch.isMatch(pkg.name, target.packageFilter)
|
|
1947
1951
|
);
|
|
1948
|
-
const
|
|
1952
|
+
const skipForExclusive = applicableTargets.some((target) => target.exclusive);
|
|
1953
|
+
const skipEmptyDefault = !config.publish.registry && applicableTargets.length > 0;
|
|
1949
1954
|
return dedupRegistryTargets([
|
|
1950
|
-
...
|
|
1955
|
+
...skipForExclusive || skipEmptyDefault ? [] : [legacyTarget],
|
|
1951
1956
|
...applicableTargets
|
|
1952
1957
|
]);
|
|
1953
1958
|
}
|
|
@@ -1955,6 +1960,71 @@ function resolveRegistryTargetsForPackages(packages, config) {
|
|
|
1955
1960
|
const allTargets = packages.flatMap((pkg) => resolveRegistryTargetsForPackage(pkg, config));
|
|
1956
1961
|
return dedupRegistryTargets(allTargets);
|
|
1957
1962
|
}
|
|
1963
|
+
function readsNpmrc(packageManager) {
|
|
1964
|
+
return packageManager === "npm" || packageManager === "pnpm" || packageManager === "bun";
|
|
1965
|
+
}
|
|
1966
|
+
function getPackageScope(packageName) {
|
|
1967
|
+
if (!packageName?.startsWith("@") || !packageName.includes("/")) {
|
|
1968
|
+
return void 0;
|
|
1969
|
+
}
|
|
1970
|
+
return packageName.slice(0, packageName.indexOf("/"));
|
|
1971
|
+
}
|
|
1972
|
+
function buildNpmrcEntries({
|
|
1973
|
+
registryTarget,
|
|
1974
|
+
scope,
|
|
1975
|
+
packageManager
|
|
1976
|
+
}) {
|
|
1977
|
+
const { registry, token } = registryTarget;
|
|
1978
|
+
const entries = [];
|
|
1979
|
+
if (registry && scope) {
|
|
1980
|
+
entries.push({ key: `${scope}:registry`, line: `${scope}:registry=${registry}` });
|
|
1981
|
+
}
|
|
1982
|
+
if (token) {
|
|
1983
|
+
if (!registry) {
|
|
1984
|
+
logger.warn("Publish token provided but no registry specified");
|
|
1985
|
+
} else if (!readsNpmrc(packageManager)) {
|
|
1986
|
+
logger.warn("Publish token only supported for npm, pnpm and bun");
|
|
1987
|
+
} else {
|
|
1988
|
+
const url = new URL(registry);
|
|
1989
|
+
const authKey = `//${url.host}${url.pathname}:_authToken`;
|
|
1990
|
+
entries.push({ key: authKey, line: `${authKey}=${token}` });
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
return entries;
|
|
1994
|
+
}
|
|
1995
|
+
async function withRegistryNpmrc({
|
|
1996
|
+
config,
|
|
1997
|
+
registryTarget,
|
|
1998
|
+
packageName,
|
|
1999
|
+
packageManager,
|
|
2000
|
+
fn
|
|
2001
|
+
}) {
|
|
2002
|
+
const scope = getPackageScope(packageName);
|
|
2003
|
+
const entries = buildNpmrcEntries({ registryTarget, scope, packageManager });
|
|
2004
|
+
if (entries.length === 0) {
|
|
2005
|
+
return fn();
|
|
2006
|
+
}
|
|
2007
|
+
const npmrcPath = join(config.cwd, ".npmrc");
|
|
2008
|
+
const existed = existsSync(npmrcPath);
|
|
2009
|
+
const original = existed ? readFileSync(npmrcPath, "utf8") : "";
|
|
2010
|
+
const managedKeys = new Set(entries.map((entry) => entry.key));
|
|
2011
|
+
const preservedLines = original.split("\n").filter((line) => {
|
|
2012
|
+
const key = line.split("=")[0]?.trim();
|
|
2013
|
+
return !key || !managedKeys.has(key);
|
|
2014
|
+
});
|
|
2015
|
+
const nextContent = `${[...preservedLines, ...entries.map((entry) => entry.line)].filter(Boolean).join("\n")}
|
|
2016
|
+
`;
|
|
2017
|
+
try {
|
|
2018
|
+
writeFileSync(npmrcPath, nextContent);
|
|
2019
|
+
return await fn();
|
|
2020
|
+
} finally {
|
|
2021
|
+
if (existed) {
|
|
2022
|
+
writeFileSync(npmrcPath, original);
|
|
2023
|
+
} else {
|
|
2024
|
+
rmSync(npmrcPath, { force: true });
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
1958
2028
|
function getCommandArgs({
|
|
1959
2029
|
packageManager,
|
|
1960
2030
|
tag,
|
|
@@ -1968,19 +2038,6 @@ function getCommandArgs({
|
|
|
1968
2038
|
if (registry) {
|
|
1969
2039
|
args.push("--registry", registry);
|
|
1970
2040
|
}
|
|
1971
|
-
const isPnpmOrNpm = packageManager === "pnpm" || packageManager === "npm";
|
|
1972
|
-
const publishToken = registryTarget.token;
|
|
1973
|
-
if (publishToken) {
|
|
1974
|
-
if (!registry) {
|
|
1975
|
-
logger.warn("Publish token provided but no registry specified");
|
|
1976
|
-
} else if (!isPnpmOrNpm) {
|
|
1977
|
-
logger.warn("Publish token only supported for pnpm and npm");
|
|
1978
|
-
} else {
|
|
1979
|
-
const registryUrl = new URL(registry);
|
|
1980
|
-
const authTokenKey = `--//${registryUrl.host}${registryUrl.pathname}:_authToken=${publishToken}`;
|
|
1981
|
-
args.push(authTokenKey);
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
2041
|
const finalOtp = otp ?? sessionOtpByRegistry.get(normalizeRegistryKey(registry)) ?? registryTarget.otp;
|
|
1985
2042
|
if (finalOtp) {
|
|
1986
2043
|
args.push("--otp", finalOtp);
|
|
@@ -2120,7 +2177,7 @@ async function publishToRegistryTarget({
|
|
|
2120
2177
|
packageNameAndVersion,
|
|
2121
2178
|
registryLabel
|
|
2122
2179
|
}) {
|
|
2123
|
-
const tag = determinePublishTag(pkg.newVersion || pkg.version, registryTarget.tag);
|
|
2180
|
+
const tag = determinePublishTag(pkg.newVersion || pkg.version, registryTarget.tag ?? config.publish.tag);
|
|
2124
2181
|
let dynamicOtp;
|
|
2125
2182
|
const maxAttempts = 2;
|
|
2126
2183
|
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
@@ -2133,15 +2190,21 @@ async function publishToRegistryTarget({
|
|
|
2133
2190
|
dryRun
|
|
2134
2191
|
});
|
|
2135
2192
|
process.chdir(pkg.path);
|
|
2136
|
-
await
|
|
2137
|
-
command,
|
|
2138
|
-
packageNameAndVersion,
|
|
2139
|
-
packageManager,
|
|
2140
|
-
pkg,
|
|
2193
|
+
await withRegistryNpmrc({
|
|
2141
2194
|
config,
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2195
|
+
registryTarget,
|
|
2196
|
+
packageName: pkg.name,
|
|
2197
|
+
packageManager,
|
|
2198
|
+
fn: () => executePublishCommand({
|
|
2199
|
+
command,
|
|
2200
|
+
packageNameAndVersion,
|
|
2201
|
+
packageManager,
|
|
2202
|
+
pkg,
|
|
2203
|
+
config,
|
|
2204
|
+
dryRun,
|
|
2205
|
+
tag,
|
|
2206
|
+
registryLabel
|
|
2207
|
+
})
|
|
2145
2208
|
});
|
|
2146
2209
|
const registryKey = normalizeRegistryKey(registryTarget.registry);
|
|
2147
2210
|
if (dynamicOtp && !sessionOtpByRegistry.has(registryKey)) {
|
|
@@ -5681,14 +5744,19 @@ async function checkRegistryAuth({
|
|
|
5681
5744
|
}, patienceDelay);
|
|
5682
5745
|
try {
|
|
5683
5746
|
logger.info(`Authenticating to package registry${registryLabel}...`);
|
|
5684
|
-
await
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5747
|
+
await withRegistryNpmrc({
|
|
5748
|
+
config,
|
|
5749
|
+
registryTarget,
|
|
5750
|
+
packageManager: config.publish.packageManager,
|
|
5751
|
+
fn: () => execPromise(authCommand, {
|
|
5752
|
+
cwd: config.cwd,
|
|
5753
|
+
timeout: timeoutMs,
|
|
5754
|
+
noStdout: true,
|
|
5755
|
+
noStderr: true,
|
|
5756
|
+
noSuccess: true,
|
|
5757
|
+
noError: true,
|
|
5758
|
+
logLevel: config.logLevel
|
|
5759
|
+
})
|
|
5692
5760
|
});
|
|
5693
5761
|
logger.info(`Successfully authenticated to package registry${registryLabel}`);
|
|
5694
5762
|
} catch (error) {
|
|
@@ -6627,4 +6695,4 @@ Git provider: ${provider}`);
|
|
|
6627
6695
|
}
|
|
6628
6696
|
}
|
|
6629
6697
|
|
|
6630
|
-
export {
|
|
6698
|
+
export { getLastPackageTag as $, extractVersionFromTag as A, fetchGitTags as B, filterOutPrivatePackages as C, findGitHubPR as D, findGitLabMR as E, findReachableCommitBySubject as F, formatChangelogForSlack as G, formatPackagesForSlack as H, formatSlackMessage as I, formatTweetMessage as J, generateChangelog as K, generateMarkDown as L, getAuthCommand as M, NEW_PACKAGE_MARKER as N, getBumpedIndependentPackages as O, PR_COMMENT_MARKER as P, getBumpedPackageIndependently as Q, getCIName as R, getCanaryVersion as S, getCommitSubject as T, getCurrentGitBranch as U, getCurrentGitRef as V, getDefaultConfig as W, getDependentsOf as X, getFirstCommit as Y, getGitStatus as Z, getIndependentTag as _, buildCommentBody as a, topologicalSort as a$, getLastRepoTag as a0, getLastStableTag as a1, getLastTag as a2, getModifiedReleaseFilePatterns as a3, getNpmRegistry as a4, getPackageCommits as a5, getPackageDependencies as a6, getPackageNewVersion as a7, getPackages as a8, getPackagesOrBumpedPackages as a9, postPrComment as aA, postReleaseToSlack as aB, postReleaseToTwitter as aC, prComment as aD, providerRelease as aE, providerReleaseSafetyCheck as aF, publish as aG, publishPackage as aH, publishSafetyCheck as aI, pushCommitAndTags as aJ, pushTagForce as aK, readPackageJson as aL, readPackages as aM, reconcileFromTag as aN, redactSecrets as aO, release as aP, resetRewrittenTagCache as aQ, resolveAllConfiguredRegistryTargets as aR, resolveRegistryTargetsForPackage as aS, resolveRegistryTargetsForPackages as aT, resolveTags as aU, retagAnnotatedLocal as aV, rollbackModifiedFiles as aW, shouldFilterPrereleaseTags as aX, social as aY, socialSafetyCheck as aZ, tagExists as a_, getPackagesToPublishInIndependentMode as aa, getPackagesToPublishInSelectiveMode as ab, getPreid as ac, getReleaseUrl as ad, getRootPackage as ae, getShortCommitSha as af, getSlackToken as ag, getSlackWebhookUrl as ah, getTwitterCredentials as ai, github as aj, gitlab as ak, hasLernaJson as al, isAncestor as am, isBumpedPackage as an, isChangedPreid as ao, isGraduating as ap, isGraduatingToStableBetweenVersion as aq, isInCI as ar, isPrerelease as as, isPrereleaseReleaseType as at, isStableReleaseType as au, isTagVersionCompatibleWithCurrent as av, loadRelizyConfig as aw, mergeTypes as ax, parseChangelogMarkdown as ay, parseGitRemoteUrl as az, buildChangelogBody as b, updateLernaVersion as b0, withRegistryNpmrc as b1, writeChangelogToFile as b2, writeVersion as b3, buildCompareLink as c, buildContributors as d, bump as e, capReleaseTypeForZeroMajor as f, changelog as g, checkGitStatusIfDirty as h, collectContributorNames as i, collectPackageBumps as j, confirmBump as k, createCommitAndTags as l, createGitlabRelease as m, defineConfig as n, detectGitProvider as o, detectPackageManager as p, detectPullRequest as q, determinePublishTag as r, determineReleaseType as s, determineSemverChange as t, executeBuildCmd as u, executeFormatCmd as v, executeHook as w, expandPackagesToBumpWithDependents as x, extractChangelogSummary as y, extractVersionFromPackageTag as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relizy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.0-beta.
|
|
4
|
+
"version": "1.5.0-beta.2",
|
|
5
5
|
"description": "Changelogen adapter for monorepo management with unified and independent versioning",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@commitlint/config-conventional": "21.2.2",
|
|
90
90
|
"@commitlint/cz-commitlint": "^21.2.2",
|
|
91
91
|
"@commitlint/types": "^21.2.0",
|
|
92
|
-
"@maz-ui/eslint-config": "5.0.0-beta.
|
|
92
|
+
"@maz-ui/eslint-config": "5.0.0-beta.43",
|
|
93
93
|
"@slack/web-api": "7.16.0",
|
|
94
94
|
"@types/micromatch": "^4.0.10",
|
|
95
95
|
"@types/node": "^25.9.2",
|