yarn-version 8.3.1 → 8.5.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/CHANGELOG.md CHANGED
@@ -3,6 +3,27 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.5.0](https://github.com/christophehurpeau/pob/compare/yarn-version@8.4.0...yarn-version@8.5.0) (2025-10-27)
7
+
8
+ ### Features
9
+
10
+ * **deps:** update dependency nightingale to v17 ([#2612](https://github.com/christophehurpeau/pob/issues/2612))
11
+
12
+ ### Bug Fixes
13
+
14
+ * **deps:** update dependency @npmcli/map-workspaces to v5.0.1 ([#2606](https://github.com/christophehurpeau/pob/issues/2606))
15
+ * **deps:** update dependency commander to v14.0.2 ([#2607](https://github.com/christophehurpeau/pob/issues/2607))
16
+
17
+ ## [8.4.0](https://github.com/christophehurpeau/pob/compare/yarn-version@8.3.1...yarn-version@8.4.0) (2025-10-26)
18
+
19
+ ### Features
20
+
21
+ * update conventional-changelog and bypass conventional-changelog-core
22
+ * update deps
23
+
24
+ Version bump for dependency: @pob/rollup-esbuild
25
+
26
+
6
27
  ## [8.3.1](https://github.com/christophehurpeau/pob/compare/yarn-version@8.3.0...yarn-version@8.3.1) (2025-10-12)
7
28
 
8
29
  Note: no notable changes
package/README.md CHANGED
@@ -47,7 +47,7 @@ jobs:
47
47
  - name: Enable Corepack
48
48
  run: corepack enable
49
49
 
50
- - uses: actions/setup-node@v5
50
+ - uses: actions/setup-node@v6
51
51
  with:
52
52
  node-version: 24
53
53
 
@@ -4,8 +4,7 @@ import path from 'node:path';
4
4
  import { ConventionalGitClient } from '@conventional-changelog/git-client';
5
5
  import { addConfig, ConsoleHandler, Logger, Level } from 'nightingale';
6
6
  import semver, { satisfies } from 'semver';
7
- import { text } from 'node:stream/consumers';
8
- import conventionalChangelogCore from 'conventional-changelog-core';
7
+ import { writeChangelogString } from 'conventional-changelog-writer';
9
8
  import { loadPreset } from 'conventional-changelog-preset-loader';
10
9
  import childProcess from 'node:child_process';
11
10
  import { Octokit } from '@octokit/rest';
@@ -203,51 +202,42 @@ const recommendBump = async (commits, config) => {
203
202
  if (!whatBump) {
204
203
  throw new Error("whatBump method is missing in config");
205
204
  }
206
- let result = { ...await whatBump(commits) };
207
- if (result.level != null) {
208
- result.releaseType = versions[result.level];
209
- } else if (result == null) {
210
- result = {};
211
- }
212
- return result;
205
+ const result = { ...await whatBump(commits) };
206
+ return {
207
+ ...result,
208
+ releaseType: result.level != null ? versions[result.level] : void 0
209
+ };
213
210
  };
214
- const generateChangelog = (workspace, pkg, config, newTag, {
215
- previousTag = "",
216
- verbose = false,
217
- tagPrefix = "v",
218
- path = "",
219
- lernaPackage
220
- } = {}) => {
211
+ const generateChangelog = (workspace, pkg, config, previousTag, newTag, commits, date) => {
221
212
  if (!newTag) {
222
213
  throw new Error(`Missing new tag for package "${pkg.name ?? ""}"`);
223
214
  }
224
- const stream = conventionalChangelogCore(
215
+ const originUrl = typeof pkg.repository === "string" ? pkg.repository : pkg.repository?.url;
216
+ const match = originUrl && typeof originUrl === "string" && /^(?:git@|https?:\/\/)(?:([^./:]+(?:\.com)?)[/:])?([^/:]+)\/([^./:]+)(?:.git)?/.exec(
217
+ originUrl
218
+ );
219
+ const [, gitHost, gitAccount, repoName] = match || [
220
+ void 0,
221
+ void 0,
222
+ void 0,
223
+ void 0
224
+ ];
225
+ return writeChangelogString(
226
+ commits ?? [],
225
227
  {
226
- cwd: workspace.cwd,
227
- config,
228
- pkg,
229
- path,
230
- append: !!previousTag,
231
- releaseCount: !previousTag ? 0 : 1,
232
- skipUnstable: true,
233
- lernaPackage,
234
- tagPrefix,
235
- verbose,
228
+ // @ts-expect-error - missing types
236
229
  previousTag,
237
- currentTag: newTag
238
- },
239
- {
240
- version: pkg.version,
241
230
  currentTag: newTag,
242
- previousTag
231
+ linkCompare: previousTag != null,
232
+ version: pkg.version,
233
+ host: gitHost ? `https://${gitHost}` : void 0,
234
+ owner: gitAccount,
235
+ repository: repoName,
236
+ date
243
237
  },
244
- // @ts-expect-error -- path is required to filter commits by path. It does not work if it is only provided in options.
245
- {
246
- from: previousTag,
247
- path
248
- }
238
+ // @ts-expect-error - missing types
239
+ config.writer
249
240
  );
250
- return text(stream);
251
241
  };
252
242
 
253
243
  const loadConventionalCommitConfig = async (rootWorkspace, preset) => {
@@ -530,6 +520,12 @@ ${oldContent}`
530
520
  );
531
521
  };
532
522
 
523
+ const todayInYYYYMMDD = () => {
524
+ const dateFormatter = Intl.DateTimeFormat("sv-SE", {
525
+ timeZone: "UTC"
526
+ });
527
+ return dateFormatter.format(/* @__PURE__ */ new Date());
528
+ };
533
529
  const versionCommandAction = async (options, { nightingaleHandler = new ConsoleHandler(Level.INFO) } = {}) => {
534
530
  if (options.json) {
535
531
  process.env.NIGHTINGALE_CONSOLE_FORMATTER = "json";
@@ -917,19 +913,25 @@ There are uncommitted changes in the git repository. Please commit or stash them
917
913
  workspace,
918
914
  { newTag, hasChanged, bumpReason, bumpForDependenciesReasons }
919
915
  ]) => {
920
- const workspaceRelativePath = rootWorkspace === workspace ? void 0 : path.relative(rootWorkspace.cwd, workspace.cwd);
916
+ const commits = commitsByWorkspace?.get(workspace);
921
917
  let changelog = await generateChangelog(
922
918
  rootWorkspace,
923
919
  workspace.pkg,
924
920
  conventionalCommitConfig,
921
+ previousTagByWorkspace.get(workspace) || null,
925
922
  isMonorepoVersionIndependent ? newTag : rootNewTag,
926
- {
927
- path: workspaceRelativePath,
928
- previousTag: previousTagByWorkspace.get(workspace) || void 0,
929
- verbose: options.verbose,
930
- tagPrefix: options.tagVersionPrefix,
931
- lernaPackage: rootWorkspace === workspace ? void 0 : getWorkspaceName(workspace)
932
- }
923
+ commits,
924
+ todayInYYYYMMDD()
925
+ // {
926
+ // path: workspaceRelativePath,
927
+ // previousTag: previousTagByWorkspace.get(workspace) || undefined,
928
+ // verbose: options.verbose,
929
+ // tagPrefix: options.tagVersionPrefix,
930
+ // lernaPackage:
931
+ // rootWorkspace === workspace
932
+ // ? undefined
933
+ // : getWorkspaceName(workspace),
934
+ // },
933
935
  );
934
936
  if (bumpForDependenciesReasons && workspace !== rootWorkspace) {
935
937
  if (bumpForDependenciesReasons.length > 0) {