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 +21 -0
- package/README.md +1 -1
- package/dist/index-node.mjs +48 -46
- package/dist/index-node.mjs.map +1 -1
- package/package.json +16 -17
- package/src/commands/version.ts +27 -14
- package/src/missing-types.d.ts +10 -6
- package/src/utils/conventionalChangelogUtils.test.ts +761 -0
- package/src/utils/conventionalChangelogUtils.ts +40 -48
- package/vitest.config.js +9 -0
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
package/dist/index-node.mjs
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
result
|
|
209
|
-
|
|
210
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
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) {
|