relizy 0.2.5 → 0.2.6-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 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 { W as isInCI, X as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, r as release } from './shared/relizy.CU6Hj4K0.mjs';
8
+ import { W as isInCI, X as getCIName, b as bump, c as changelog, e as publish, a as providerRelease, r as release } from './shared/relizy.DAGRGqEb.mjs';
9
9
  import 'changelogen';
10
10
  import 'fast-glob';
11
11
  import '@inquirer/prompts';
package/dist/index.d.mts CHANGED
@@ -281,7 +281,7 @@ declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force
281
281
  }): Promise<PackageBase[]>;
282
282
 
283
283
  declare function isGraduatingToStableBetweenVersion(version: string, newVersion: string): boolean;
284
- declare function determineSemverChange(commits: GitCommit[], types: RelizyConfig['types']): 'major' | 'minor' | 'patch' | undefined;
284
+ declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>): 'major' | 'minor' | 'patch' | undefined;
285
285
  declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
286
286
  currentVersion: string;
287
287
  commits?: GitCommit[];
@@ -853,7 +853,7 @@ type HookConfig = {
853
853
  * @see https://louismazel.github.io/relizy/config/overview
854
854
  */
855
855
  interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templates' | 'publish' | 'types'>> {
856
- types: Record<string, {
856
+ types?: Record<string, {
857
857
  title: string;
858
858
  semver?: SemverBumpType;
859
859
  } | false>;
package/dist/index.d.ts CHANGED
@@ -281,7 +281,7 @@ declare function getPackagesOrBumpedPackages({ config, bumpResult, suffix, force
281
281
  }): Promise<PackageBase[]>;
282
282
 
283
283
  declare function isGraduatingToStableBetweenVersion(version: string, newVersion: string): boolean;
284
- declare function determineSemverChange(commits: GitCommit[], types: RelizyConfig['types']): 'major' | 'minor' | 'patch' | undefined;
284
+ declare function determineSemverChange(commits: GitCommit[], types: NonNullable<RelizyConfig['types']>): 'major' | 'minor' | 'patch' | undefined;
285
285
  declare function determineReleaseType({ currentVersion, commits, releaseType, preid, types, force, }: {
286
286
  currentVersion: string;
287
287
  commits?: GitCommit[];
@@ -853,7 +853,7 @@ type HookConfig = {
853
853
  * @see https://louismazel.github.io/relizy/config/overview
854
854
  */
855
855
  interface RelizyConfig extends Partial<Omit<ChangelogConfig$1, 'output' | 'templates' | 'publish' | 'types'>> {
856
- types: Record<string, {
856
+ types?: Record<string, {
857
857
  title: string;
858
858
  semver?: SemverBumpType;
859
859
  } | false>;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { b as bump, c as changelog, n as checkGitStatusIfDirty, ae as confirmBump, u as createCommitAndTags, B as createGitlabRelease, h as defineConfig, q as detectGitProvider, D as detectPackageManager, E as determinePublishTag, a2 as determineReleaseType, a1 as determineSemverChange, Z as executeBuildCmd, Y as executeFormatCmd, V as executeHook, k as expandPackagesToBumpWithDependents, a6 as extractVersionFromPackageTag, o as fetchGitTags, g as generateChangelog, H as getAuthCommand, af as getBumpedIndependentPackages, ad as getBumpedPackageIndependently, X as getCIName, y as getCurrentGitBranch, z as getCurrentGitRef, f as getDefaultConfig, j as getDependentsOf, x as getFirstCommit, m as getGitStatus, P as getIndependentTag, T as getLastPackageTag, S as getLastRepoTag, Q as getLastStableTag, R as getLastTag, N as getPackageCommits, i as getPackageDependencies, a4 as getPackageNewVersion, M as getPackages, $ as getPackagesOrBumpedPackages, G as getPackagesToPublishInIndependentMode, F as getPackagesToPublishInSelectiveMode, ab as getPreid, K as getRootPackage, A as github, C as gitlab, O as hasLernaJson, _ as isBumpedPackage, ac as isChangedPreid, aa as isGraduating, a0 as isGraduatingToStableBetweenVersion, W as isInCI, a7 as isPrerelease, a9 as isPrereleaseReleaseType, a8 as isStableReleaseType, l as loadRelizyConfig, s as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, I as publishPackage, d as publishSafetyCheck, v as pushCommitAndTags, J as readPackageJson, L as readPackages, r as release, U as resolveTags, t as topologicalSort, a5 as updateLernaVersion, w as writeChangelogToFile, a3 as writeVersion } from './shared/relizy.CU6Hj4K0.mjs';
1
+ export { b as bump, c as changelog, n as checkGitStatusIfDirty, ae as confirmBump, u as createCommitAndTags, B as createGitlabRelease, h as defineConfig, q as detectGitProvider, D as detectPackageManager, E as determinePublishTag, a2 as determineReleaseType, a1 as determineSemverChange, Z as executeBuildCmd, Y as executeFormatCmd, V as executeHook, k as expandPackagesToBumpWithDependents, a6 as extractVersionFromPackageTag, o as fetchGitTags, g as generateChangelog, H as getAuthCommand, af as getBumpedIndependentPackages, ad as getBumpedPackageIndependently, X as getCIName, y as getCurrentGitBranch, z as getCurrentGitRef, f as getDefaultConfig, j as getDependentsOf, x as getFirstCommit, m as getGitStatus, P as getIndependentTag, T as getLastPackageTag, S as getLastRepoTag, Q as getLastStableTag, R as getLastTag, N as getPackageCommits, i as getPackageDependencies, a4 as getPackageNewVersion, M as getPackages, $ as getPackagesOrBumpedPackages, G as getPackagesToPublishInIndependentMode, F as getPackagesToPublishInSelectiveMode, ab as getPreid, K as getRootPackage, A as github, C as gitlab, O as hasLernaJson, _ as isBumpedPackage, ac as isChangedPreid, aa as isGraduating, a0 as isGraduatingToStableBetweenVersion, W as isInCI, a7 as isPrerelease, a9 as isPrereleaseReleaseType, a8 as isStableReleaseType, l as loadRelizyConfig, s as parseGitRemoteUrl, a as providerRelease, p as providerReleaseSafetyCheck, e as publish, I as publishPackage, d as publishSafetyCheck, v as pushCommitAndTags, J as readPackageJson, L as readPackages, r as release, U as resolveTags, t as topologicalSort, a5 as updateLernaVersion, w as writeChangelogToFile, a3 as writeVersion } from './shared/relizy.DAGRGqEb.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:fs';
4
4
  import 'node:path';
@@ -573,7 +573,7 @@ async function executeBuildCmd({
573
573
  });
574
574
  logger.info("Build completed");
575
575
  } else {
576
- logger.log("[dry-run] exec build command: ", config.publish.buildCmd);
576
+ logger.info("[dry-run] exec build command: ", config.publish.buildCmd);
577
577
  }
578
578
  } else {
579
579
  logger.debug("No build command specified");
@@ -2347,7 +2347,8 @@ function getCommandArgs({
2347
2347
  tag,
2348
2348
  config,
2349
2349
  otp,
2350
- type
2350
+ type,
2351
+ dryRun
2351
2352
  }) {
2352
2353
  const args = type === "publish" ? ["publish", "--tag", tag] : ["whoami"];
2353
2354
  const registry = config.publish.registry;
@@ -2387,6 +2388,9 @@ function getCommandArgs({
2387
2388
  } else if (packageManager === "npm") {
2388
2389
  args.push("--yes");
2389
2390
  }
2391
+ if (dryRun) {
2392
+ args.push("--dry-run");
2393
+ }
2390
2394
  return args;
2391
2395
  }
2392
2396
  function isOtpError(error) {
@@ -2432,22 +2436,24 @@ async function executePublishCommand({
2432
2436
  pkg,
2433
2437
  config,
2434
2438
  tag,
2435
- dryRun
2439
+ dryRun,
2440
+ packageManager
2436
2441
  }) {
2437
2442
  logger.info(`${dryRun ? "[dry-run] " : ""}Publishing ${packageNameAndVersion} with tag "${tag}"`);
2438
- if (!dryRun) {
2439
- const { stdout } = await execPromise(command, {
2440
- noStderr: true,
2441
- noStdout: true,
2442
- noSuccess: true,
2443
- logLevel: config.logLevel,
2444
- cwd: pkg.path
2445
- });
2446
- if (stdout) {
2447
- logger.debug(stdout);
2448
- }
2443
+ const dryRunPublish = dryRun && packageManager !== "npm" && packageManager !== "yarn";
2444
+ if (dryRunPublish) {
2445
+ logger.info(`${dryRun ? "[dry-run] " : ""}Skipping actual publish for ${packageNameAndVersion}`);
2446
+ return;
2449
2447
  }
2450
- logger.info(`${dryRun ? "[dry-run] " : ""}Published ${packageNameAndVersion}`);
2448
+ const { stdout, stderr } = await execPromise(command, {
2449
+ noStderr: true,
2450
+ noStdout: true,
2451
+ noSuccess: true,
2452
+ logLevel: config.logLevel,
2453
+ cwd: pkg.path
2454
+ });
2455
+ logger.debug("Publish stdout:", stdout);
2456
+ logger.debug("Publish stderr:", stderr);
2451
2457
  }
2452
2458
  function getAuthCommand({
2453
2459
  packageManager,
@@ -2467,13 +2473,15 @@ function getPublishCommand({
2467
2473
  packageManager,
2468
2474
  tag,
2469
2475
  config,
2470
- otp
2476
+ otp,
2477
+ dryRun
2471
2478
  }) {
2472
2479
  const args = getCommandArgs({
2473
2480
  packageManager,
2474
2481
  tag,
2475
2482
  config,
2476
2483
  otp,
2484
+ dryRun,
2477
2485
  type: "publish"
2478
2486
  });
2479
2487
  const baseCommand = packageManager === "yarn" && isYarnBerry() ? "yarn npm" : packageManager;
@@ -2496,12 +2504,14 @@ async function publishPackage({
2496
2504
  packageManager,
2497
2505
  tag,
2498
2506
  config,
2499
- otp: dynamicOtp
2507
+ otp: dynamicOtp,
2508
+ dryRun
2500
2509
  });
2501
2510
  process.chdir(pkg.path);
2502
2511
  await executePublishCommand({
2503
2512
  command,
2504
2513
  packageNameAndVersion,
2514
+ packageManager,
2505
2515
  pkg,
2506
2516
  config,
2507
2517
  dryRun,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.2.6-beta.0",
5
5
  "packageManager": "pnpm@10.22.0",
6
6
  "description": "Changelogen adapter for monorepo management with unified and independent versioning",
7
7
  "author": "Louis Mazel <me@loicmazuel.com>",
@@ -43,8 +43,8 @@
43
43
  "main": "./dist/index.mjs",
44
44
  "types": "./dist/index.d.ts",
45
45
  "bin": {
46
- "relizy": "./bin/relizy.mjs",
47
- "rly": "./bin/relizy.mjs"
46
+ "relizy": "bin/relizy.mjs",
47
+ "rly": "bin/relizy.mjs"
48
48
  },
49
49
  "files": [
50
50
  "LICENSE",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "scripts": {
59
59
  "preinstall": "npx only-allow pnpm",
60
- "prepare": "npx husky",
60
+ "postinstall": "npx husky",
61
61
  "build": "unbuild",
62
62
  "dev": "unbuild --stub",
63
63
  "relizy": "node bin/relizy.mjs",