relizy 0.2.6-beta.1 → 0.2.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 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.0hvTBrgT.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.6FWq4lmP.mjs';
9
9
  import 'changelogen';
10
10
  import 'fast-glob';
11
11
  import '@inquirer/prompts';
@@ -79,7 +79,8 @@ program.command("bump").description("Bump package versions").option("--major", "
79
79
  suffix: options.suffix,
80
80
  configName: program.opts().config
81
81
  });
82
- } catch {
82
+ } catch (error) {
83
+ logger.error("Failed to bump packages -", error);
83
84
  process.exit(1);
84
85
  }
85
86
  });
@@ -94,7 +95,8 @@ program.command("changelog").description("Generate changelogs for all packages")
94
95
  logLevel: program.opts().logLevel,
95
96
  configName: program.opts().config
96
97
  });
97
- } catch {
98
+ } catch (error) {
99
+ logger.error("Failed to generate changelog -", error);
98
100
  process.exit(1);
99
101
  }
100
102
  });
@@ -111,7 +113,8 @@ program.command("publish").description("Publish packages to registry").option("-
111
113
  logLevel: program.opts().logLevel,
112
114
  configName: program.opts().config
113
115
  });
114
- } catch {
116
+ } catch (error) {
117
+ logger.error("Failed to publish packages -", error);
115
118
  process.exit(1);
116
119
  }
117
120
  });
@@ -127,7 +130,8 @@ program.command("provider-release").description("Publish release to git provider
127
130
  configName: program.opts().config,
128
131
  safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0
129
132
  });
130
- } catch {
133
+ } catch (error) {
134
+ logger.error("Failed to publish release -", error);
131
135
  process.exit(1);
132
136
  }
133
137
  });
@@ -163,7 +167,8 @@ program.command("release").description("Complete release workflow (bump + change
163
167
  configName: program.opts().config,
164
168
  safetyCheck: hasCliFlag("--no-safety-check") ? false : void 0
165
169
  });
166
- } catch {
170
+ } catch (error) {
171
+ logger.error("Failed to release -", error);
167
172
  process.exit(1);
168
173
  }
169
174
  });
package/dist/index.d.mts CHANGED
@@ -57,7 +57,7 @@ declare function getDefaultConfig(): {
57
57
  declare function loadRelizyConfig(options?: {
58
58
  baseConfig?: ResolvedRelizyConfig;
59
59
  overrides?: DeepPartial<RelizyConfig>;
60
- configName?: string;
60
+ configFile?: string;
61
61
  }): Promise<ResolvedRelizyConfig>;
62
62
  type ResolvedConfig = RelizyConfig & ReturnType<typeof getDefaultConfig>;
63
63
  type ResolvedRelizyConfig = ResolvedConfig & {
@@ -638,8 +638,7 @@ interface ProviderReleaseOptions {
638
638
  }
639
639
  type PublishConfig = ChangelogConfig$1['publish'] & {
640
640
  /**
641
- * Package manager (e.g. `pnpm` or `npm`)
642
- * @values `pnpm`, `npm`, `yarn`, `bun`
641
+ * Package manager (e.g. `pnpm`, `npm`, `yarn` or `bun`)
643
642
  */
644
643
  packageManager?: PackageManager;
645
644
  /**
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ declare function getDefaultConfig(): {
57
57
  declare function loadRelizyConfig(options?: {
58
58
  baseConfig?: ResolvedRelizyConfig;
59
59
  overrides?: DeepPartial<RelizyConfig>;
60
- configName?: string;
60
+ configFile?: string;
61
61
  }): Promise<ResolvedRelizyConfig>;
62
62
  type ResolvedConfig = RelizyConfig & ReturnType<typeof getDefaultConfig>;
63
63
  type ResolvedRelizyConfig = ResolvedConfig & {
@@ -638,8 +638,7 @@ interface ProviderReleaseOptions {
638
638
  }
639
639
  type PublishConfig = ChangelogConfig$1['publish'] & {
640
640
  /**
641
- * Package manager (e.g. `pnpm` or `npm`)
642
- * @values `pnpm`, `npm`, `yarn`, `bun`
641
+ * Package manager (e.g. `pnpm`, `npm`, `yarn` or `bun`)
643
642
  */
644
643
  packageManager?: PackageManager;
645
644
  /**
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.0hvTBrgT.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.6FWq4lmP.mjs';
2
2
  import '@maz-ui/node';
3
3
  import 'node:fs';
4
4
  import 'node:path';
@@ -402,6 +402,23 @@ function isAllowedCommit({
402
402
  }
403
403
  return false;
404
404
  }
405
+ function isCommitOfTrackedPackages({
406
+ commit,
407
+ config
408
+ }) {
409
+ if (!config.monorepo?.packages?.length) {
410
+ return true;
411
+ }
412
+ const packages = readPackages({
413
+ cwd: config.cwd,
414
+ patterns: config.monorepo.packages,
415
+ ignorePackageNames: config.monorepo?.ignorePackageNames
416
+ });
417
+ return packages.some((pkg) => {
418
+ const path = relative(config.cwd, pkg.path);
419
+ return commit.body.includes(path);
420
+ });
421
+ }
405
422
  async function getPackageCommits({
406
423
  pkg,
407
424
  from,
@@ -428,13 +445,14 @@ async function getPackageCommits({
428
445
  if (!isAllowedCommit({ commit, type, changelog })) {
429
446
  return false;
430
447
  }
431
- if (pkg.path === changelogConfig.cwd || pkg.name === rootPackage.name) {
448
+ const isTracked = isCommitOfTrackedPackages({ commit, config });
449
+ if ((pkg.path === changelogConfig.cwd || pkg.name === rootPackage.name) && isTracked) {
432
450
  return true;
433
451
  }
434
452
  const packageRelativePath = relative(changelogConfig.cwd, pkg.path);
435
453
  const scopeMatches = commit.scope === pkg.name;
436
454
  const bodyContainsPath = commit.body.includes(packageRelativePath);
437
- return scopeMatches || bodyContainsPath;
455
+ return (scopeMatches || bodyContainsPath) && isTracked;
438
456
  });
439
457
  logger.debug(`Found ${commits.length} commit(s) for ${pkg.name} from ${from} to ${to}`);
440
458
  if (commits.length > 0) {
@@ -1159,21 +1177,22 @@ async function resolveConfig(config, cwd) {
1159
1177
  }
1160
1178
  async function loadRelizyConfig(options) {
1161
1179
  const cwd = options?.overrides?.cwd ?? process$1.cwd();
1162
- const configName = options?.configName ?? "relizy";
1163
1180
  await setupDotenv({ cwd });
1181
+ const configFile = options?.configFile ?? "relizy";
1164
1182
  const defaultConfig = getDefaultConfig();
1165
1183
  const overridesConfig = defu(options?.overrides, options?.baseConfig);
1166
1184
  const results = await loadConfig({
1185
+ dotenv: true,
1167
1186
  cwd,
1168
- name: configName,
1187
+ name: configFile,
1169
1188
  packageJson: true,
1170
1189
  defaults: defaultConfig,
1171
1190
  overrides: overridesConfig
1172
1191
  });
1173
- if (!results._configFile) {
1174
- logger.debug(`No config file found with name "${configName}" - using standalone mode`);
1175
- if (options?.configName) {
1176
- logger.error(`No config file found with name "${configName}"`);
1192
+ if (typeof results._configFile !== "string") {
1193
+ logger.debug(`No config file found with name "${configFile}"`);
1194
+ if (options?.configFile) {
1195
+ logger.error(`No config file found with name "${configFile}"`);
1177
1196
  process$1.exit(1);
1178
1197
  }
1179
1198
  }
@@ -1324,7 +1343,7 @@ async function github(options) {
1324
1343
  const dryRun = options.dryRun ?? false;
1325
1344
  logger.debug(`Dry run: ${dryRun}`);
1326
1345
  const config = await loadRelizyConfig({
1327
- configName: options.configName,
1346
+ configFile: options.configName,
1328
1347
  baseConfig: options.config,
1329
1348
  overrides: {
1330
1349
  from: options.from,
@@ -1568,7 +1587,7 @@ async function gitlab(options = {}) {
1568
1587
  const dryRun = options.dryRun ?? false;
1569
1588
  logger.debug(`Dry run: ${dryRun}`);
1570
1589
  const config = await loadRelizyConfig({
1571
- configName: options.configName,
1590
+ configFile: options.configName,
1572
1591
  baseConfig: options.config,
1573
1592
  overrides: {
1574
1593
  from: options.from,
@@ -2768,7 +2787,7 @@ async function bumpIndependentMode({
2768
2787
  }
2769
2788
  async function bump(options = {}) {
2770
2789
  const config = await loadRelizyConfig({
2771
- configName: options.configName,
2790
+ configFile: options.configName,
2772
2791
  baseConfig: options.config,
2773
2792
  overrides: {
2774
2793
  bump: {
@@ -2926,7 +2945,7 @@ async function generateSimpleRootChangelog({
2926
2945
  }
2927
2946
  async function changelog(options = {}) {
2928
2947
  const config = await loadRelizyConfig({
2929
- configName: options.configName,
2948
+ configFile: options.configName,
2930
2949
  baseConfig: options.config,
2931
2950
  overrides: {
2932
2951
  from: options.from,
@@ -3041,7 +3060,7 @@ function providerReleaseSafetyCheck({ config, provider }) {
3041
3060
  }
3042
3061
  async function providerRelease(options = {}) {
3043
3062
  const config = await loadRelizyConfig({
3044
- configName: options.configName,
3063
+ configFile: options.configName,
3045
3064
  baseConfig: options.config,
3046
3065
  overrides: {
3047
3066
  from: options.from,
@@ -3138,7 +3157,7 @@ async function publishSafetyCheck({ config }) {
3138
3157
  }
3139
3158
  async function publish(options = {}) {
3140
3159
  const config = await loadRelizyConfig({
3141
- configName: options.configName,
3160
+ configFile: options.configName,
3142
3161
  baseConfig: options.config,
3143
3162
  overrides: {
3144
3163
  publish: {
@@ -3234,7 +3253,7 @@ async function publish(options = {}) {
3234
3253
 
3235
3254
  function getReleaseConfig(options = {}) {
3236
3255
  return loadRelizyConfig({
3237
- configName: options.configName,
3256
+ configFile: options.configName,
3238
3257
  overrides: {
3239
3258
  logLevel: options.logLevel,
3240
3259
  from: options.from,
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "relizy",
3
3
  "type": "module",
4
- "version": "0.2.6-beta.1",
5
- "packageManager": "pnpm@10.22.0",
4
+ "version": "0.2.7",
6
5
  "description": "Changelogen adapter for monorepo management with unified and independent versioning",
7
6
  "author": "Louis Mazel <me@loicmazuel.com>",
8
7
  "license": "MIT",
@@ -55,26 +54,11 @@
55
54
  "engines": {
56
55
  "node": ">=20.0.0"
57
56
  },
58
- "scripts": {
59
- "preinstall": "npx only-allow pnpm",
60
- "postinstall": "npx husky",
61
- "build": "unbuild",
62
- "dev": "unbuild --stub",
63
- "relizy": "node bin/relizy.mjs",
64
- "rly": "node bin/relizy.mjs",
65
- "typecheck": "tsc --noEmit --skipLibCheck",
66
- "lint": "cross-env NODE_ENV=production eslint .",
67
- "lint:fix": "pnpm lint --fix",
68
- "test:unit": "vitest run",
69
- "test:unit:watch": "vitest watch",
70
- "test:unit:coverage": "vitest run --coverage",
71
- "pre-commit": "lint-staged"
72
- },
73
57
  "dependencies": {
74
- "@inquirer/prompts": "^8.0.1",
75
- "@maz-ui/node": "4.3.2-beta.1",
58
+ "@inquirer/prompts": "^8.1.0",
59
+ "@maz-ui/node": "4.3.2",
76
60
  "@maz-ui/utils": "^4.3.0",
77
- "c12": "^3.3.2",
61
+ "c12": "^3.3.3",
78
62
  "changelogen": "^0.6.2",
79
63
  "commander": "^14.0.2",
80
64
  "convert-gitmoji": "^0.1.5",
@@ -84,27 +68,42 @@
84
68
  "semver": "^7.7.2"
85
69
  },
86
70
  "devDependencies": {
87
- "@commitlint/cli": "^20.1.0",
88
- "@commitlint/config-conventional": "^20.0.0",
89
- "@commitlint/cz-commitlint": "^20.1.0",
90
- "@commitlint/types": "^20.0.0",
91
- "@maz-ui/eslint-config": "4.3.2-beta.1",
92
- "@types/node": "^24.10.1",
71
+ "@commitlint/cli": "^20.2.0",
72
+ "@commitlint/config-conventional": "^20.2.0",
73
+ "@commitlint/cz-commitlint": "^20.2.0",
74
+ "@commitlint/types": "^20.2.0",
75
+ "@maz-ui/eslint-config": "4.3.2",
76
+ "@types/node": "^25.0.3",
93
77
  "@types/semver": "^7.7.1",
94
- "@vitest/coverage-v8": "^4.0.10",
78
+ "@vitest/coverage-v8": "^4.0.16",
95
79
  "cross-env": "^10.1.0",
96
- "eslint": "^9.39.1",
80
+ "eslint": "^9.39.2",
97
81
  "husky": "^9.1.7",
98
82
  "jiti": "^2.6.1",
99
- "lint-staged": "^16.2.6",
100
- "memfs": "^4.51.0",
83
+ "lint-staged": "^16.2.7",
84
+ "memfs": "^4.51.1",
101
85
  "typescript": "^5.9.3",
102
86
  "unbuild": "^3.6.1",
103
- "vitest": "^4.0.10"
87
+ "vitest": "^4.0.16"
104
88
  },
105
89
  "lint-staged": {
106
90
  "*.{js,jsx,ts,tsx,mjs,mts,cjs,md,yml,json}": [
107
91
  "eslint --fix"
108
92
  ]
93
+ },
94
+ "scripts": {
95
+ "preinstall": "npx only-allow pnpm",
96
+ "postinstall": "npx husky",
97
+ "build": "unbuild",
98
+ "dev": "unbuild --stub",
99
+ "relizy": "node bin/relizy.mjs",
100
+ "rly": "node bin/relizy.mjs",
101
+ "typecheck": "tsc --noEmit --skipLibCheck",
102
+ "lint": "cross-env NODE_ENV=production eslint .",
103
+ "lint:fix": "pnpm lint --fix",
104
+ "test:unit": "vitest run",
105
+ "test:unit:watch": "vitest watch",
106
+ "test:unit:coverage": "vitest run --coverage",
107
+ "pre-commit": "lint-staged"
109
108
  }
110
- }
109
+ }