relizy 1.0.1 → 1.0.2-beta.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 +2 -2
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +2 -2
- package/dist/shared/{relizy.DrY7TMl7.mjs → relizy.BzwlpXnI.mjs} +68 -48
- package/package.json +13 -13
package/dist/cli.mjs
CHANGED
|
@@ -5,13 +5,13 @@ 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 { a8 as isInCI, a9 as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, f as social, r as release } from './shared/relizy.BzwlpXnI.mjs';
|
|
9
|
+
import 'node:child_process';
|
|
9
10
|
import 'changelogen';
|
|
10
11
|
import 'fast-glob';
|
|
11
12
|
import '@inquirer/prompts';
|
|
12
13
|
import '@maz-ui/utils';
|
|
13
14
|
import 'semver';
|
|
14
|
-
import 'node:child_process';
|
|
15
15
|
import 'c12';
|
|
16
16
|
import 'defu';
|
|
17
17
|
import 'convert-gitmoji';
|
package/dist/index.d.mts
CHANGED
|
@@ -299,14 +299,13 @@ declare function getLastTag({ logLevel, cwd }: {
|
|
|
299
299
|
}): Promise<string>;
|
|
300
300
|
declare function getLastRepoTag(options?: {
|
|
301
301
|
onlyStable?: boolean;
|
|
302
|
-
|
|
302
|
+
pkg?: ReadPackage;
|
|
303
303
|
logLevel?: LogLevel;
|
|
304
304
|
cwd?: string;
|
|
305
305
|
}): Promise<string | null>;
|
|
306
|
-
declare function getLastPackageTag({
|
|
307
|
-
|
|
306
|
+
declare function getLastPackageTag({ pkg, onlyStable, logLevel, cwd, }: {
|
|
307
|
+
pkg: ReadPackage;
|
|
308
308
|
onlyStable?: boolean;
|
|
309
|
-
currentVersion?: string;
|
|
310
309
|
logLevel?: LogLevel;
|
|
311
310
|
cwd?: string;
|
|
312
311
|
}): Promise<string | null>;
|
|
@@ -315,6 +314,13 @@ interface ResolvedTags {
|
|
|
315
314
|
from: string;
|
|
316
315
|
to: string;
|
|
317
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* Special marker indicating this is a new package with no previous tags.
|
|
319
|
+
* When this marker is returned as the "from" tag, getPackageCommits should
|
|
320
|
+
* return an empty array instead of analyzing all commits from the beginning
|
|
321
|
+
* of the repository (which would cause ENOBUFS errors on large repos).
|
|
322
|
+
*/
|
|
323
|
+
declare const NEW_PACKAGE_MARKER: "__NEW_PACKAGE__";
|
|
318
324
|
declare function resolveTags<S extends Step, NewVersion = S extends 'bump' ? undefined : string>({ config, step, pkg, newVersion, }: {
|
|
319
325
|
config: ResolvedRelizyConfig;
|
|
320
326
|
step: S;
|
|
@@ -1397,5 +1403,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1397
1403
|
}): Promise<void>;
|
|
1398
1404
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1399
1405
|
|
|
1400
|
-
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 };
|
|
1406
|
+
export { NEW_PACKAGE_MARKER, 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 };
|
|
1401
1407
|
export type { BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, PackageBase, PackageManager, PostedRelease, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, ReadPackage, ReleaseConfig, 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
|
@@ -299,14 +299,13 @@ declare function getLastTag({ logLevel, cwd }: {
|
|
|
299
299
|
}): Promise<string>;
|
|
300
300
|
declare function getLastRepoTag(options?: {
|
|
301
301
|
onlyStable?: boolean;
|
|
302
|
-
|
|
302
|
+
pkg?: ReadPackage;
|
|
303
303
|
logLevel?: LogLevel;
|
|
304
304
|
cwd?: string;
|
|
305
305
|
}): Promise<string | null>;
|
|
306
|
-
declare function getLastPackageTag({
|
|
307
|
-
|
|
306
|
+
declare function getLastPackageTag({ pkg, onlyStable, logLevel, cwd, }: {
|
|
307
|
+
pkg: ReadPackage;
|
|
308
308
|
onlyStable?: boolean;
|
|
309
|
-
currentVersion?: string;
|
|
310
309
|
logLevel?: LogLevel;
|
|
311
310
|
cwd?: string;
|
|
312
311
|
}): Promise<string | null>;
|
|
@@ -315,6 +314,13 @@ interface ResolvedTags {
|
|
|
315
314
|
from: string;
|
|
316
315
|
to: string;
|
|
317
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* Special marker indicating this is a new package with no previous tags.
|
|
319
|
+
* When this marker is returned as the "from" tag, getPackageCommits should
|
|
320
|
+
* return an empty array instead of analyzing all commits from the beginning
|
|
321
|
+
* of the repository (which would cause ENOBUFS errors on large repos).
|
|
322
|
+
*/
|
|
323
|
+
declare const NEW_PACKAGE_MARKER: "__NEW_PACKAGE__";
|
|
318
324
|
declare function resolveTags<S extends Step, NewVersion = S extends 'bump' ? undefined : string>({ config, step, pkg, newVersion, }: {
|
|
319
325
|
config: ResolvedRelizyConfig;
|
|
320
326
|
step: S;
|
|
@@ -1397,5 +1403,5 @@ declare function socialSafetyCheck({ config }: {
|
|
|
1397
1403
|
}): Promise<void>;
|
|
1398
1404
|
declare function social(options?: Partial<SocialOptions>): Promise<SocialResult>;
|
|
1399
1405
|
|
|
1400
|
-
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 };
|
|
1406
|
+
export { NEW_PACKAGE_MARKER, 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 };
|
|
1401
1407
|
export type { BumpConfig, BumpOptions, BumpResult, BumpResultFalsy, BumpResultTruthy, ChangelogConfig, ChangelogOptions, ConfigType, GitProvider, GitlabRelease, GitlabReleaseResponse, HookConfig, HookStep, HookType, MonorepoConfig, PackageBase, PackageManager, PostedRelease, ProviderReleaseOptions, ProviderReleaseResult, PublishConfig, PublishOptions, PublishResponse, ReadPackage, ReleaseConfig, 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,6 +1,7 @@
|
|
|
1
|
-
export { b as bump, c as changelog, o as checkGitStatusIfDirty,
|
|
1
|
+
export { a2 as NEW_PACKAGE_MARKER, b as bump, c as changelog, o as checkGitStatusIfDirty, as as confirmBump, y as createCommitAndTags, F as createGitlabRelease, i as defineConfig, u as detectGitProvider, H as detectPackageManager, I as determinePublishTag, ag as determineReleaseType, af as determineSemverChange, ab as executeBuildCmd, aa as executeFormatCmd, a7 as executeHook, m as expandPackagesToBumpWithDependents, X as extractChangelogSummary, ak as extractVersionFromPackageTag, av as extractVersionFromTag, q as fetchGitTags, U as formatChangelogForSlack, V as formatSlackMessage, a5 as formatTweetMessage, g as generateChangelog, L as getAuthCommand, at as getBumpedIndependentPackages, ar as getBumpedPackageIndependently, a9 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, ai as getPackageNewVersion, Q as getPackages, ad as getPackagesOrBumpedPackages, K as getPackagesToPublishInIndependentMode, J as getPackagesToPublishInSelectiveMode, ap as getPreid, Y as getReleaseUrl, O as getRootPackage, T as getSlackToken, a4 as getTwitterCredentials, E as github, G as gitlab, S as hasLernaJson, ac as isBumpedPackage, aq as isChangedPreid, ao as isGraduating, ae as isGraduatingToStableBetweenVersion, a8 as isInCI, al as isPrerelease, an as isPrereleaseReleaseType, am as isStableReleaseType, aw as isTagVersionCompatibleWithCurrent, l as loadRelizyConfig, v as parseGitRemoteUrl, W as postReleaseToSlack, a6 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, a3 as resolveTags, A as rollbackModifiedFiles, au as shouldFilterPrereleaseTags, f as social, s as socialSafetyCheck, t as topologicalSort, aj as updateLernaVersion, w as writeChangelogToFile, ah as writeVersion } from './shared/relizy.BzwlpXnI.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:process';
|
|
4
|
+
import 'node:child_process';
|
|
4
5
|
import 'node:fs';
|
|
5
6
|
import 'node:path';
|
|
6
7
|
import 'changelogen';
|
|
@@ -8,7 +9,6 @@ import 'fast-glob';
|
|
|
8
9
|
import '@inquirer/prompts';
|
|
9
10
|
import '@maz-ui/utils';
|
|
10
11
|
import 'semver';
|
|
11
|
-
import 'node:child_process';
|
|
12
12
|
import 'c12';
|
|
13
13
|
import 'defu';
|
|
14
14
|
import 'convert-gitmoji';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { logger, execPromise } from '@maz-ui/node';
|
|
2
2
|
import process$1 from 'node:process';
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
3
4
|
import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import path, { join, relative } from 'node:path';
|
|
5
6
|
import { getGitDiff, parseCommits, formatCompareChanges, formatReference, resolveRepoConfig, getRepoConfig, createGithubRelease } from 'changelogen';
|
|
@@ -7,7 +8,6 @@ import fastGlob from 'fast-glob';
|
|
|
7
8
|
import { confirm, input } from '@inquirer/prompts';
|
|
8
9
|
import { upperFirst, formatJson } from '@maz-ui/utils';
|
|
9
10
|
import * as semver from 'semver';
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
11
|
import { setupDotenv, loadConfig } from 'c12';
|
|
12
12
|
import { defu } from 'defu';
|
|
13
13
|
import { convert } from 'convert-gitmoji';
|
|
@@ -131,6 +131,23 @@ function topologicalSort(packages) {
|
|
|
131
131
|
return sorted;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
function getFirstPackageCommitHash(packagePath, cwd) {
|
|
135
|
+
const relativePath = relative(cwd, packagePath);
|
|
136
|
+
try {
|
|
137
|
+
const result = execSync(
|
|
138
|
+
`git log --reverse --format="%H" -- "${relativePath}" | head -1`,
|
|
139
|
+
{ cwd, encoding: "utf8" }
|
|
140
|
+
);
|
|
141
|
+
const hash = result.trim();
|
|
142
|
+
if (hash) {
|
|
143
|
+
logger.debug(`First commit for package at ${relativePath}: ${hash.slice(0, 8)}`);
|
|
144
|
+
return hash;
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
} catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
134
151
|
function readPackageJson(packagePath) {
|
|
135
152
|
const packageJsonPath = join(packagePath, "package.json");
|
|
136
153
|
if (!existsSync(packageJsonPath)) {
|
|
@@ -427,12 +444,23 @@ async function getPackageCommits({
|
|
|
427
444
|
changelog
|
|
428
445
|
}) {
|
|
429
446
|
logger.debug(`Analyzing commits for ${pkg.name} since ${from} to ${to}`);
|
|
447
|
+
let actualFrom = from;
|
|
448
|
+
if (from === NEW_PACKAGE_MARKER) {
|
|
449
|
+
const firstPackageCommit = getFirstPackageCommitHash(pkg.path, config.cwd);
|
|
450
|
+
if (firstPackageCommit) {
|
|
451
|
+
logger.debug(`${pkg.name} is a new package, using first package commit: ${firstPackageCommit.slice(0, 8)}`);
|
|
452
|
+
actualFrom = `${firstPackageCommit}^`;
|
|
453
|
+
} else {
|
|
454
|
+
logger.debug(`${pkg.name} has no commits yet, returning empty`);
|
|
455
|
+
return [];
|
|
456
|
+
}
|
|
457
|
+
}
|
|
430
458
|
const changelogConfig = {
|
|
431
459
|
...config,
|
|
432
|
-
from,
|
|
460
|
+
from: actualFrom,
|
|
433
461
|
to
|
|
434
462
|
};
|
|
435
|
-
const rawCommits = await getGitDiff(
|
|
463
|
+
const rawCommits = await getGitDiff(actualFrom, to, changelogConfig.cwd);
|
|
436
464
|
const allCommits = parseCommits(rawCommits, changelogConfig);
|
|
437
465
|
const hasBreakingChanges = allCommits.some((commit) => commit.isBreaking);
|
|
438
466
|
logger.debug(`Has breaking changes: ${hasBreakingChanges}`);
|
|
@@ -1630,12 +1658,11 @@ async function getAllRecentPackageTags({
|
|
|
1630
1658
|
}
|
|
1631
1659
|
function filterCompatibleTags({
|
|
1632
1660
|
tags,
|
|
1633
|
-
|
|
1634
|
-
onlyStable
|
|
1635
|
-
packageName
|
|
1661
|
+
pkg,
|
|
1662
|
+
onlyStable
|
|
1636
1663
|
}) {
|
|
1637
1664
|
const filtered = tags.filter((tag) => {
|
|
1638
|
-
const tagVersion = extractVersionFromTag(tag,
|
|
1665
|
+
const tagVersion = extractVersionFromTag(tag, pkg.name);
|
|
1639
1666
|
if (!tagVersion) {
|
|
1640
1667
|
logger.debug(`Skipping tag ${tag}: cannot extract version`);
|
|
1641
1668
|
return false;
|
|
@@ -1644,8 +1671,8 @@ function filterCompatibleTags({
|
|
|
1644
1671
|
logger.debug(`Skipping tag ${tag}: prerelease version ${tagVersion} (onlyStable=${onlyStable})`);
|
|
1645
1672
|
return false;
|
|
1646
1673
|
}
|
|
1647
|
-
if (!isTagVersionCompatibleWithCurrent(tagVersion,
|
|
1648
|
-
logger.debug(`Skipping tag ${tag}: version ${tagVersion} has higher major than current ${
|
|
1674
|
+
if (!isTagVersionCompatibleWithCurrent(tagVersion, pkg.version)) {
|
|
1675
|
+
logger.debug(`Skipping tag ${tag}: version ${tagVersion} has higher major than current ${pkg.version}`);
|
|
1649
1676
|
return false;
|
|
1650
1677
|
}
|
|
1651
1678
|
logger.debug(`Tag ${tag} with version ${tagVersion} is compatible`);
|
|
@@ -1655,9 +1682,9 @@ function filterCompatibleTags({
|
|
|
1655
1682
|
return filtered;
|
|
1656
1683
|
}
|
|
1657
1684
|
function getLastRepoTag(options) {
|
|
1658
|
-
if (options?.
|
|
1685
|
+
if (options?.pkg) {
|
|
1659
1686
|
return getLastRepoTagWithFiltering({
|
|
1660
|
-
|
|
1687
|
+
pkg: options.pkg,
|
|
1661
1688
|
onlyStable: options.onlyStable ?? false,
|
|
1662
1689
|
logLevel: options.logLevel,
|
|
1663
1690
|
cwd: options.cwd
|
|
@@ -1669,23 +1696,23 @@ function getLastRepoTag(options) {
|
|
|
1669
1696
|
return getLastTag({ logLevel: options?.logLevel, cwd: options?.cwd });
|
|
1670
1697
|
}
|
|
1671
1698
|
async function getLastRepoTagWithFiltering({
|
|
1672
|
-
|
|
1699
|
+
pkg,
|
|
1673
1700
|
onlyStable,
|
|
1674
1701
|
logLevel,
|
|
1675
1702
|
cwd
|
|
1676
1703
|
}) {
|
|
1677
1704
|
const recentTags = await getAllRecentRepoTags({ limit: 50, logLevel, cwd });
|
|
1678
1705
|
if (recentTags.length === 0) {
|
|
1679
|
-
logger.
|
|
1706
|
+
logger.info("No tags found in repository");
|
|
1680
1707
|
return null;
|
|
1681
1708
|
}
|
|
1682
1709
|
const compatibleTags = filterCompatibleTags({
|
|
1683
1710
|
tags: recentTags,
|
|
1684
|
-
|
|
1711
|
+
pkg,
|
|
1685
1712
|
onlyStable
|
|
1686
1713
|
});
|
|
1687
1714
|
if (compatibleTags.length === 0) {
|
|
1688
|
-
logger.
|
|
1715
|
+
logger.info(`No compatible tags found for version ${pkg.version}`);
|
|
1689
1716
|
return null;
|
|
1690
1717
|
}
|
|
1691
1718
|
const lastTag = compatibleTags[0];
|
|
@@ -1693,23 +1720,21 @@ async function getLastRepoTagWithFiltering({
|
|
|
1693
1720
|
return lastTag;
|
|
1694
1721
|
}
|
|
1695
1722
|
async function getLastPackageTag({
|
|
1696
|
-
|
|
1723
|
+
pkg,
|
|
1697
1724
|
onlyStable,
|
|
1698
|
-
currentVersion,
|
|
1699
1725
|
logLevel,
|
|
1700
1726
|
cwd
|
|
1701
1727
|
}) {
|
|
1702
|
-
if (
|
|
1728
|
+
if (pkg.version) {
|
|
1703
1729
|
return getLastPackageTagWithFiltering({
|
|
1704
|
-
|
|
1705
|
-
currentVersion,
|
|
1730
|
+
pkg,
|
|
1706
1731
|
onlyStable: onlyStable ?? false,
|
|
1707
1732
|
logLevel,
|
|
1708
1733
|
cwd
|
|
1709
1734
|
});
|
|
1710
1735
|
}
|
|
1711
1736
|
try {
|
|
1712
|
-
const escapedPackageName =
|
|
1737
|
+
const escapedPackageName = pkg.name.replace(/[@/]/g, "\\$&");
|
|
1713
1738
|
let grepPattern;
|
|
1714
1739
|
if (onlyStable) {
|
|
1715
1740
|
grepPattern = `^${escapedPackageName}@[0-9]+\\.[0-9]+\\.[0-9]+$`;
|
|
@@ -1733,67 +1758,65 @@ async function getLastPackageTag({
|
|
|
1733
1758
|
}
|
|
1734
1759
|
}
|
|
1735
1760
|
async function getLastPackageTagWithFiltering({
|
|
1736
|
-
|
|
1737
|
-
currentVersion,
|
|
1761
|
+
pkg,
|
|
1738
1762
|
onlyStable,
|
|
1739
1763
|
logLevel,
|
|
1740
1764
|
cwd
|
|
1741
1765
|
}) {
|
|
1742
1766
|
const recentTags = await getAllRecentPackageTags({
|
|
1743
|
-
packageName,
|
|
1767
|
+
packageName: pkg.name,
|
|
1744
1768
|
limit: 50,
|
|
1745
1769
|
logLevel,
|
|
1746
1770
|
cwd
|
|
1747
1771
|
});
|
|
1748
1772
|
if (recentTags.length === 0) {
|
|
1749
|
-
logger.
|
|
1773
|
+
logger.info(`No tags found for package ${pkg.name}`);
|
|
1750
1774
|
return null;
|
|
1751
1775
|
}
|
|
1752
1776
|
const compatibleTags = filterCompatibleTags({
|
|
1753
1777
|
tags: recentTags,
|
|
1754
|
-
|
|
1755
|
-
onlyStable
|
|
1756
|
-
packageName
|
|
1778
|
+
pkg,
|
|
1779
|
+
onlyStable
|
|
1757
1780
|
});
|
|
1758
1781
|
if (compatibleTags.length === 0) {
|
|
1759
|
-
logger.
|
|
1782
|
+
logger.info(`No compatible tags found for package ${pkg.name} with version ${pkg.version}`);
|
|
1760
1783
|
return null;
|
|
1761
1784
|
}
|
|
1762
1785
|
const lastTag = compatibleTags[0];
|
|
1763
|
-
logger.debug(`Last compatible package tag for ${
|
|
1786
|
+
logger.debug(`Last compatible package tag for ${pkg.name}: ${lastTag}`);
|
|
1764
1787
|
return lastTag;
|
|
1765
1788
|
}
|
|
1789
|
+
const NEW_PACKAGE_MARKER = "__NEW_PACKAGE__";
|
|
1766
1790
|
async function resolveFromTagIndependent({
|
|
1767
1791
|
cwd,
|
|
1768
|
-
|
|
1769
|
-
currentVersion,
|
|
1792
|
+
pkg,
|
|
1770
1793
|
graduating,
|
|
1771
1794
|
logLevel
|
|
1772
1795
|
}) {
|
|
1773
|
-
const filterPrereleases = shouldFilterPrereleaseTags(
|
|
1796
|
+
const filterPrereleases = shouldFilterPrereleaseTags(pkg.version, graduating);
|
|
1774
1797
|
const onlyStable = graduating || filterPrereleases;
|
|
1775
1798
|
const lastPackageTag = await getLastPackageTag({
|
|
1776
|
-
|
|
1777
|
-
currentVersion,
|
|
1799
|
+
pkg,
|
|
1778
1800
|
onlyStable,
|
|
1779
1801
|
logLevel,
|
|
1780
1802
|
cwd
|
|
1781
1803
|
});
|
|
1782
1804
|
if (!lastPackageTag) {
|
|
1783
|
-
|
|
1805
|
+
logger.debug(`No tag found for package ${pkg.name}, marking as new package`);
|
|
1806
|
+
return NEW_PACKAGE_MARKER;
|
|
1784
1807
|
}
|
|
1785
1808
|
return lastPackageTag;
|
|
1786
1809
|
}
|
|
1787
1810
|
async function resolveFromTagUnified({
|
|
1788
1811
|
config,
|
|
1789
|
-
|
|
1812
|
+
pkg,
|
|
1790
1813
|
graduating,
|
|
1791
1814
|
logLevel
|
|
1792
1815
|
}) {
|
|
1793
|
-
const filterPrereleases = shouldFilterPrereleaseTags(
|
|
1816
|
+
const filterPrereleases = shouldFilterPrereleaseTags(pkg.version, graduating);
|
|
1794
1817
|
const onlyStable = graduating || filterPrereleases;
|
|
1795
1818
|
const from = await getLastRepoTag({
|
|
1796
|
-
|
|
1819
|
+
pkg,
|
|
1797
1820
|
onlyStable,
|
|
1798
1821
|
logLevel,
|
|
1799
1822
|
cwd: config.cwd
|
|
@@ -1804,27 +1827,25 @@ async function resolveFromTag({
|
|
|
1804
1827
|
config,
|
|
1805
1828
|
versionMode,
|
|
1806
1829
|
step,
|
|
1807
|
-
|
|
1808
|
-
currentVersion,
|
|
1830
|
+
pkg,
|
|
1809
1831
|
graduating,
|
|
1810
1832
|
logLevel
|
|
1811
1833
|
}) {
|
|
1812
1834
|
let from;
|
|
1813
1835
|
if (versionMode === "independent") {
|
|
1814
|
-
if (!
|
|
1836
|
+
if (!pkg.name) {
|
|
1815
1837
|
throw new Error("Package name is required for independent version mode");
|
|
1816
1838
|
}
|
|
1817
1839
|
from = await resolveFromTagIndependent({
|
|
1818
1840
|
cwd: config.cwd,
|
|
1819
|
-
|
|
1820
|
-
currentVersion,
|
|
1841
|
+
pkg,
|
|
1821
1842
|
graduating,
|
|
1822
1843
|
logLevel
|
|
1823
1844
|
});
|
|
1824
1845
|
} else {
|
|
1825
1846
|
from = await resolveFromTagUnified({
|
|
1826
1847
|
config,
|
|
1827
|
-
|
|
1848
|
+
pkg,
|
|
1828
1849
|
graduating,
|
|
1829
1850
|
logLevel
|
|
1830
1851
|
});
|
|
@@ -1872,8 +1893,7 @@ async function resolveTags({
|
|
|
1872
1893
|
config,
|
|
1873
1894
|
versionMode,
|
|
1874
1895
|
step,
|
|
1875
|
-
|
|
1876
|
-
currentVersion: pkg.version,
|
|
1896
|
+
pkg,
|
|
1877
1897
|
graduating,
|
|
1878
1898
|
logLevel
|
|
1879
1899
|
});
|
|
@@ -4416,4 +4436,4 @@ Git provider: ${provider}`);
|
|
|
4416
4436
|
}
|
|
4417
4437
|
}
|
|
4418
4438
|
|
|
4419
|
-
export { getLastTag as $, rollbackModifiedFiles as A, getFirstCommit as B, getCurrentGitBranch as C, getCurrentGitRef as D, github as E, createGitlabRelease as F, gitlab as G, detectPackageManager as H, determinePublishTag as I, getPackagesToPublishInSelectiveMode as J, getPackagesToPublishInIndependentMode as K, getAuthCommand as L, publishPackage as M, readPackageJson as N, getRootPackage as O, readPackages as P, getPackages as Q, getPackageCommits as R, hasLernaJson as S, getSlackToken as T, formatChangelogForSlack as U, formatSlackMessage as V, postReleaseToSlack as W, extractChangelogSummary as X, getReleaseUrl as Y, getIndependentTag as Z, getLastStableTag as _, providerRelease as a, getLastRepoTag as a0, getLastPackageTag as a1,
|
|
4439
|
+
export { getLastTag as $, rollbackModifiedFiles as A, getFirstCommit as B, getCurrentGitBranch as C, getCurrentGitRef as D, github as E, createGitlabRelease as F, gitlab as G, detectPackageManager as H, determinePublishTag as I, getPackagesToPublishInSelectiveMode as J, getPackagesToPublishInIndependentMode as K, getAuthCommand as L, publishPackage as M, readPackageJson as N, getRootPackage as O, readPackages as P, getPackages as Q, getPackageCommits as R, hasLernaJson as S, getSlackToken as T, formatChangelogForSlack as U, formatSlackMessage as V, postReleaseToSlack as W, extractChangelogSummary as X, getReleaseUrl as Y, getIndependentTag as Z, getLastStableTag as _, providerRelease as a, getLastRepoTag as a0, getLastPackageTag as a1, NEW_PACKAGE_MARKER as a2, resolveTags as a3, getTwitterCredentials as a4, formatTweetMessage as a5, postReleaseToTwitter as a6, executeHook as a7, isInCI as a8, getCIName as a9, executeFormatCmd as aa, executeBuildCmd as ab, isBumpedPackage as ac, getPackagesOrBumpedPackages as ad, isGraduatingToStableBetweenVersion as ae, determineSemverChange as af, determineReleaseType as ag, writeVersion as ah, getPackageNewVersion as ai, updateLernaVersion as aj, extractVersionFromPackageTag as ak, isPrerelease as al, isStableReleaseType as am, isPrereleaseReleaseType as an, isGraduating as ao, getPreid as ap, isChangedPreid as aq, getBumpedPackageIndependently as ar, confirmBump as as, getBumpedIndependentPackages as at, shouldFilterPrereleaseTags as au, extractVersionFromTag as av, isTagVersionCompatibleWithCurrent as aw, bump as b, changelog as c, publishSafetyCheck as d, publish as e, social as f, generateChangelog as g, getDefaultConfig as h, defineConfig as i, getPackageDependencies as j, getDependentsOf as k, loadRelizyConfig as l, expandPackagesToBumpWithDependents as m, getGitStatus as n, checkGitStatusIfDirty as o, providerReleaseSafetyCheck as p, fetchGitTags as q, release as r, socialSafetyCheck as s, topologicalSort as t, detectGitProvider as u, parseGitRemoteUrl as v, writeChangelogToFile as w, getModifiedReleaseFilePatterns as x, createCommitAndTags as y, pushCommitAndTags as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relizy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2-beta.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",
|
|
@@ -68,37 +68,37 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@inquirer/prompts": "^8.2.0",
|
|
71
|
-
"@maz-ui/node": "4.
|
|
71
|
+
"@maz-ui/node": "4.4.0",
|
|
72
72
|
"@maz-ui/utils": "^4.3.0",
|
|
73
73
|
"c12": "^3.3.3",
|
|
74
74
|
"changelogen": "^0.6.2",
|
|
75
|
-
"commander": "^14.0.
|
|
75
|
+
"commander": "^14.0.3",
|
|
76
76
|
"convert-gitmoji": "^0.1.5",
|
|
77
77
|
"defu": "^6.1.4",
|
|
78
78
|
"fast-glob": "^3.3.2",
|
|
79
79
|
"node-fetch-native": "^1.6.7",
|
|
80
|
-
"semver": "^7.7.
|
|
80
|
+
"semver": "^7.7.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@commitlint/cli": "^20.
|
|
84
|
-
"@commitlint/config-conventional": "^20.
|
|
85
|
-
"@commitlint/cz-commitlint": "^20.
|
|
86
|
-
"@commitlint/types": "^20.
|
|
87
|
-
"@maz-ui/eslint-config": "4.
|
|
83
|
+
"@commitlint/cli": "^20.4.1",
|
|
84
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
85
|
+
"@commitlint/cz-commitlint": "^20.4.1",
|
|
86
|
+
"@commitlint/types": "^20.4.0",
|
|
87
|
+
"@maz-ui/eslint-config": "^4.6.0",
|
|
88
88
|
"@slack/web-api": "^7.12.0",
|
|
89
|
-
"@types/node": "^25.
|
|
89
|
+
"@types/node": "^25.2.2",
|
|
90
90
|
"@types/semver": "^7.7.1",
|
|
91
|
-
"@vitest/coverage-v8": "^4.0.
|
|
91
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
92
92
|
"cross-env": "^10.1.0",
|
|
93
93
|
"eslint": "^9.39.2",
|
|
94
94
|
"husky": "^9.1.7",
|
|
95
95
|
"jiti": "^2.6.1",
|
|
96
96
|
"lint-staged": "^16.2.7",
|
|
97
|
-
"memfs": "^4.56.
|
|
97
|
+
"memfs": "^4.56.10",
|
|
98
98
|
"twitter-api-v2": "^1.29.0",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
100
|
"unbuild": "^3.6.1",
|
|
101
|
-
"vitest": "^4.0.
|
|
101
|
+
"vitest": "^4.0.18"
|
|
102
102
|
},
|
|
103
103
|
"lint-staged": {
|
|
104
104
|
"*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [
|