relizy 0.2.5-beta.5 → 0.2.5-beta.7
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 +3 -2
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{relizy.Ymqkl0CI.mjs → relizy.D5HbMqu_.mjs} +31 -22
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import process from 'node:process';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { printBanner, logger } from '@maz-ui/node';
|
|
7
7
|
import { Command } from 'commander';
|
|
8
|
-
import { U as isInCI, V as getCIName, b as bump, c as changelog, d as publish, a as providerRelease, r as release } from './shared/relizy.
|
|
8
|
+
import { U as isInCI, V as getCIName, b as bump, c as changelog, d as publish, a as providerRelease, r as release } from './shared/relizy.D5HbMqu_.mjs';
|
|
9
9
|
import 'node:child_process';
|
|
10
10
|
import '@maz-ui/utils';
|
|
11
11
|
import 'c12';
|
|
@@ -130,7 +130,7 @@ program.command("provider-release").description("Publish release to git provider
|
|
|
130
130
|
process.exit(1);
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
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-changelog", "Skip changelog generation files").option("--provider <provider>", "Git provider (github or gitlab)").option("--yes", "Skip confirmation prompt about bumping packages").action(async (options) => {
|
|
133
|
+
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("--yes", "Skip confirmation prompt about bumping packages").action(async (options) => {
|
|
134
134
|
try {
|
|
135
135
|
await release({
|
|
136
136
|
type: getReleaseType(options),
|
|
@@ -143,6 +143,7 @@ program.command("release").description("Complete release workflow (bump + change
|
|
|
143
143
|
push: hasCliFlag("--no-push") || hasCliFlag("--no-commit") ? false : void 0,
|
|
144
144
|
publish: hasCliFlag("--no-publish") ? false : void 0,
|
|
145
145
|
providerRelease: hasCliFlag("--no-provider-release") ? false : void 0,
|
|
146
|
+
gitTag: hasCliFlag("--no-git-tag") ? false : void 0,
|
|
146
147
|
noVerify: hasCliFlag("--no-verify") ? true : void 0,
|
|
147
148
|
clean: hasCliFlag("--no-clean") ? false : void 0,
|
|
148
149
|
registry: options.registry,
|
package/dist/index.d.mts
CHANGED
|
@@ -115,7 +115,8 @@ declare function createCommitAndTags({ config, noVerify, bumpedPackages, newVers
|
|
|
115
115
|
dryRun?: boolean;
|
|
116
116
|
logLevel: LogLevel;
|
|
117
117
|
}): Promise<string[]>;
|
|
118
|
-
declare function pushCommitAndTags({ dryRun, logLevel, cwd }: {
|
|
118
|
+
declare function pushCommitAndTags({ config, dryRun, logLevel, cwd }: {
|
|
119
|
+
config: ResolvedRelizyConfig;
|
|
119
120
|
dryRun: boolean;
|
|
120
121
|
logLevel?: LogLevel;
|
|
121
122
|
cwd: string;
|
|
@@ -720,6 +721,11 @@ interface ReleaseConfig {
|
|
|
720
721
|
* @default false
|
|
721
722
|
*/
|
|
722
723
|
clean?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* Create tag
|
|
726
|
+
* @default true
|
|
727
|
+
*/
|
|
728
|
+
gitTag?: boolean;
|
|
723
729
|
}
|
|
724
730
|
interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, PublishConfig {
|
|
725
731
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -115,7 +115,8 @@ declare function createCommitAndTags({ config, noVerify, bumpedPackages, newVers
|
|
|
115
115
|
dryRun?: boolean;
|
|
116
116
|
logLevel: LogLevel;
|
|
117
117
|
}): Promise<string[]>;
|
|
118
|
-
declare function pushCommitAndTags({ dryRun, logLevel, cwd }: {
|
|
118
|
+
declare function pushCommitAndTags({ config, dryRun, logLevel, cwd }: {
|
|
119
|
+
config: ResolvedRelizyConfig;
|
|
119
120
|
dryRun: boolean;
|
|
120
121
|
logLevel?: LogLevel;
|
|
121
122
|
cwd: string;
|
|
@@ -720,6 +721,11 @@ interface ReleaseConfig {
|
|
|
720
721
|
* @default false
|
|
721
722
|
*/
|
|
722
723
|
clean?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* Create tag
|
|
726
|
+
* @default true
|
|
727
|
+
*/
|
|
728
|
+
gitTag?: boolean;
|
|
723
729
|
}
|
|
724
730
|
interface ReleaseOptions extends ReleaseConfig, BumpConfig, ChangelogConfig, PublishConfig {
|
|
725
731
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as bump, c as changelog, m as checkGitStatusIfDirty, aa as confirmBump, s as createCommitAndTags, A as createGitlabRelease, f as defineConfig, o as detectGitProvider, C as detectPackageManager, D as determinePublishTag, _ as determineReleaseType, Z as determineSemverChange, X as executeBuildCmd, W as executeFormatCmd, T as executeHook, j as expandPackagesToBumpWithDependents, a2 as extractVersionFromPackageTag, n as fetchGitTags, g as generateChangelog, ab as getBumpedIndependentPackages, a9 as getBumpedPackageIndependently, V as getCIName, x as getCurrentGitBranch, y as getCurrentGitRef, e as getDefaultConfig, i as getDependentsOf, v as getFirstCommit, k as getGitStatus, N as getIndependentTag, R as getLastPackageTag, Q as getLastRepoTag, O as getLastStableTag, P as getLastTag, L as getPackageCommits, h as getPackageDependencies, a0 as getPackageNewVersion, K as getPackages, F as getPackagesToPublishInIndependentMode, E as getPackagesToPublishInSelectiveMode, a7 as getPreid, I as getRootPackage, z as github, B as gitlab, M as hasLernaJson, Y as isBumpedPackage, a8 as isChangedPreid, a6 as isGraduating, U as isInCI, a3 as isPrerelease, a5 as isPrereleaseReleaseType, a4 as isStableReleaseType, l as loadRelizyConfig, q as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, d as publish, G as publishPackage, u as pushCommitAndTags, H as readPackageJson, J as readPackages, r as release, S as resolveTags, t as topologicalSort, a1 as updateLernaVersion, w as writeChangelogToFile, $ as writeVersion } from './shared/relizy.
|
|
1
|
+
export { b as bump, c as changelog, m as checkGitStatusIfDirty, aa as confirmBump, s as createCommitAndTags, A as createGitlabRelease, f as defineConfig, o as detectGitProvider, C as detectPackageManager, D as determinePublishTag, _ as determineReleaseType, Z as determineSemverChange, X as executeBuildCmd, W as executeFormatCmd, T as executeHook, j as expandPackagesToBumpWithDependents, a2 as extractVersionFromPackageTag, n as fetchGitTags, g as generateChangelog, ab as getBumpedIndependentPackages, a9 as getBumpedPackageIndependently, V as getCIName, x as getCurrentGitBranch, y as getCurrentGitRef, e as getDefaultConfig, i as getDependentsOf, v as getFirstCommit, k as getGitStatus, N as getIndependentTag, R as getLastPackageTag, Q as getLastRepoTag, O as getLastStableTag, P as getLastTag, L as getPackageCommits, h as getPackageDependencies, a0 as getPackageNewVersion, K as getPackages, F as getPackagesToPublishInIndependentMode, E as getPackagesToPublishInSelectiveMode, a7 as getPreid, I as getRootPackage, z as github, B as gitlab, M as hasLernaJson, Y as isBumpedPackage, a8 as isChangedPreid, a6 as isGraduating, U as isInCI, a3 as isPrerelease, a5 as isPrereleaseReleaseType, a4 as isStableReleaseType, l as loadRelizyConfig, q as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, d as publish, G as publishPackage, u as pushCommitAndTags, H as readPackageJson, J as readPackages, r as release, S as resolveTags, t as topologicalSort, a1 as updateLernaVersion, w as writeChangelogToFile, $ as writeVersion } from './shared/relizy.D5HbMqu_.mjs';
|
|
2
2
|
import '@maz-ui/node';
|
|
3
3
|
import 'node:process';
|
|
4
4
|
import 'node:child_process';
|
|
@@ -275,7 +275,7 @@ async function createCommitAndTags({
|
|
|
275
275
|
const signTags = internalConfig.signTags ? "-s" : "";
|
|
276
276
|
logger.debug(`Sign tags: ${internalConfig.signTags}`);
|
|
277
277
|
const createdTags = [];
|
|
278
|
-
if (internalConfig.monorepo?.versionMode === "independent" && bumpedPackages && bumpedPackages.length > 0) {
|
|
278
|
+
if (internalConfig.monorepo?.versionMode === "independent" && bumpedPackages && bumpedPackages.length > 0 && internalConfig.release.gitTag) {
|
|
279
279
|
logger.debug(`Creating ${bumpedPackages.length} independent package tags`);
|
|
280
280
|
for (const pkg of bumpedPackages) {
|
|
281
281
|
if (!pkg.newVersion) {
|
|
@@ -304,7 +304,7 @@ async function createCommitAndTags({
|
|
|
304
304
|
createdTags.push(tagName);
|
|
305
305
|
}
|
|
306
306
|
logger.success(`Created ${createdTags.length} tags for independent packages, ${createdTags.join(", ")}`);
|
|
307
|
-
} else {
|
|
307
|
+
} else if (internalConfig.release.gitTag) {
|
|
308
308
|
const tagName = internalConfig.templates.tagBody?.replaceAll("{{newVersion}}", newVersion);
|
|
309
309
|
const tagMessage = internalConfig.templates?.tagMessage?.replaceAll("{{newVersion}}", newVersion) || tagName;
|
|
310
310
|
if (dryRun) {
|
|
@@ -337,13 +337,14 @@ async function createCommitAndTags({
|
|
|
337
337
|
throw error;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
async function pushCommitAndTags({ dryRun, logLevel, cwd }) {
|
|
340
|
+
async function pushCommitAndTags({ config, dryRun, logLevel, cwd }) {
|
|
341
341
|
logger.start("Start push changes and tags");
|
|
342
|
+
const command = config.release.gitTag ? "git push --follow-tags" : "git push";
|
|
342
343
|
if (dryRun) {
|
|
343
|
-
logger.info(
|
|
344
|
+
logger.info(`[dry-run] ${command}`);
|
|
344
345
|
} else {
|
|
345
|
-
logger.debug(
|
|
346
|
-
await execPromise(
|
|
346
|
+
logger.debug(`Executing: ${command}`);
|
|
347
|
+
await execPromise(command, { noStderr: true, noStdout: true, logLevel, cwd });
|
|
347
348
|
}
|
|
348
349
|
logger.success("Pushing changes and tags completed!");
|
|
349
350
|
}
|
|
@@ -435,21 +436,23 @@ async function generateMarkDown({
|
|
|
435
436
|
_authors.set(name, { email: /* @__PURE__ */ new Set([commit.author.email]), name });
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
for (const data of [...meta.email, meta.name]) {
|
|
445
|
-
const { user } = await fetch$1(`https://ungh.cc/users/find/${data}`).then((r) => r.json()).catch(() => ({ user: null }));
|
|
446
|
-
if (user) {
|
|
447
|
-
meta.github = user.username;
|
|
448
|
-
break;
|
|
439
|
+
if (updatedConfig.repo?.provider === "github") {
|
|
440
|
+
await Promise.all(
|
|
441
|
+
[..._authors.keys()].map(async (authorName) => {
|
|
442
|
+
const meta = _authors.get(authorName);
|
|
443
|
+
if (!meta) {
|
|
444
|
+
return;
|
|
449
445
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
446
|
+
for (const data of [...meta.email, meta.name]) {
|
|
447
|
+
const { user } = await fetch$1(`https://ungh.cc/users/find/${data}`).then((r) => r.json()).catch(() => ({ user: null }));
|
|
448
|
+
if (user) {
|
|
449
|
+
meta.github = user.username;
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
);
|
|
455
|
+
}
|
|
453
456
|
const authors = [..._authors.entries()].map((e) => ({
|
|
454
457
|
name: e[0],
|
|
455
458
|
...e[1]
|
|
@@ -3119,7 +3122,8 @@ function getReleaseConfig(options = {}) {
|
|
|
3119
3122
|
publish: options.publish,
|
|
3120
3123
|
noVerify: options.noVerify,
|
|
3121
3124
|
providerRelease: options.providerRelease,
|
|
3122
|
-
clean: options.clean
|
|
3125
|
+
clean: options.clean,
|
|
3126
|
+
gitTag: options.gitTag
|
|
3123
3127
|
},
|
|
3124
3128
|
safetyCheck: options.safetyCheck
|
|
3125
3129
|
}
|
|
@@ -3196,7 +3200,12 @@ async function release(options = {}) {
|
|
|
3196
3200
|
if (config.release.push && config.release.commit) {
|
|
3197
3201
|
await executeHook("before:push", config, dryRun);
|
|
3198
3202
|
try {
|
|
3199
|
-
await pushCommitAndTags({
|
|
3203
|
+
await pushCommitAndTags({
|
|
3204
|
+
config,
|
|
3205
|
+
dryRun,
|
|
3206
|
+
logLevel: config.logLevel,
|
|
3207
|
+
cwd: config.cwd
|
|
3208
|
+
});
|
|
3200
3209
|
await executeHook("success:push", config, dryRun);
|
|
3201
3210
|
} catch (error) {
|
|
3202
3211
|
await executeHook("error:push", config, dryRun);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relizy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.5-beta.
|
|
4
|
+
"version": "0.2.5-beta.7",
|
|
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",
|