@ucdjs/release-scripts 0.1.0-beta.56 → 0.1.0-beta.57
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/index.mjs +43 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -466,7 +466,6 @@ const DEFAULT_CHANGELOG_TEMPLATE = dedent`
|
|
|
466
466
|
<% } else { -%>
|
|
467
467
|
## <%= it.version %> (<%= it.date %>)
|
|
468
468
|
<% } %>
|
|
469
|
-
|
|
470
469
|
<% let hasCommits = false; %>
|
|
471
470
|
|
|
472
471
|
<% it.groups.forEach((group) => { %>
|
|
@@ -483,10 +482,9 @@ const DEFAULT_CHANGELOG_TEMPLATE = dedent`
|
|
|
483
482
|
<% }); %>
|
|
484
483
|
|
|
485
484
|
<% if (!hasCommits) { %>
|
|
485
|
+
*No significant changes*
|
|
486
486
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
* No significant commits in this release.
|
|
487
|
+
##### [View changes on GitHub](<%= it.compareUrl %>)
|
|
490
488
|
<% } %>
|
|
491
489
|
`;
|
|
492
490
|
const DEFAULT_TYPES = {
|
|
@@ -1366,6 +1364,23 @@ async function selectVersionPrompt(workspaceRoot, pkg, currentVersion, suggested
|
|
|
1366
1364
|
if (prereleaseVersion) return prereleaseVersion;
|
|
1367
1365
|
return getNextVersion(pkg.version, answers.version);
|
|
1368
1366
|
}
|
|
1367
|
+
async function confirmOverridePrompt(pkg, overrideVersion) {
|
|
1368
|
+
const response = await prompts({
|
|
1369
|
+
type: "select",
|
|
1370
|
+
name: "choice",
|
|
1371
|
+
message: `${pkg.name}: use override version ${farver.bold(overrideVersion)}?`,
|
|
1372
|
+
choices: [{
|
|
1373
|
+
title: "use override",
|
|
1374
|
+
value: "use"
|
|
1375
|
+
}, {
|
|
1376
|
+
title: "pick another version",
|
|
1377
|
+
value: "pick"
|
|
1378
|
+
}],
|
|
1379
|
+
initial: 0
|
|
1380
|
+
});
|
|
1381
|
+
if (!response.choice) return null;
|
|
1382
|
+
return response.choice;
|
|
1383
|
+
}
|
|
1369
1384
|
|
|
1370
1385
|
//#endregion
|
|
1371
1386
|
//#region src/core/workspace.ts
|
|
@@ -1893,16 +1908,33 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1893
1908
|
const effectiveBump = override?.type || determinedBump;
|
|
1894
1909
|
const canPrompt = !isCI && showPrompt;
|
|
1895
1910
|
if (effectiveBump === "none" && !canPrompt) continue;
|
|
1896
|
-
|
|
1911
|
+
const autoVersion = getNextVersion(pkg.version, determinedBump);
|
|
1912
|
+
let newVersion = override?.version || autoVersion;
|
|
1897
1913
|
let finalBumpType = effectiveBump;
|
|
1898
1914
|
if (canPrompt) {
|
|
1899
1915
|
logger.clearScreen();
|
|
1900
1916
|
logger.section(`📝 Commits for ${farver.cyan(pkg.name)}`);
|
|
1901
1917
|
formatCommitsForDisplay(allCommitsForPackage).split("\n").forEach((line) => logger.item(line));
|
|
1902
1918
|
logger.emptyLine();
|
|
1919
|
+
if (override) {
|
|
1920
|
+
const overrideChoice = await confirmOverridePrompt(pkg, override.version);
|
|
1921
|
+
if (overrideChoice === null) continue;
|
|
1922
|
+
if (overrideChoice === "use") {
|
|
1923
|
+
versionUpdates.push({
|
|
1924
|
+
package: pkg,
|
|
1925
|
+
currentVersion: pkg.version,
|
|
1926
|
+
newVersion: override.version,
|
|
1927
|
+
bumpType: override.type,
|
|
1928
|
+
hasDirectChanges: allCommitsForPackage.length > 0,
|
|
1929
|
+
changeKind: "manual"
|
|
1930
|
+
});
|
|
1931
|
+
continue;
|
|
1932
|
+
}
|
|
1933
|
+
newVersion = autoVersion;
|
|
1934
|
+
}
|
|
1903
1935
|
const selectedVersion = await selectVersionPrompt(workspaceRoot, pkg, pkg.version, newVersion, {
|
|
1904
1936
|
defaultChoice: override ? "suggested" : "auto",
|
|
1905
|
-
suggestedHint: override ? "
|
|
1937
|
+
suggestedHint: override ? "auto" : void 0
|
|
1906
1938
|
});
|
|
1907
1939
|
if (selectedVersion === null) continue;
|
|
1908
1940
|
const userBump = calculateBumpType(pkg.version, selectedVersion);
|
|
@@ -2070,10 +2102,12 @@ async function calculateUpdates(options) {
|
|
|
2070
2102
|
overrides
|
|
2071
2103
|
}));
|
|
2072
2104
|
} catch (error) {
|
|
2105
|
+
const formatted = formatUnknownError(error);
|
|
2073
2106
|
return err({
|
|
2074
2107
|
type: "git",
|
|
2075
2108
|
operation: "calculateUpdates",
|
|
2076
|
-
message:
|
|
2109
|
+
message: formatted.message,
|
|
2110
|
+
stderr: formatted.stderr
|
|
2077
2111
|
});
|
|
2078
2112
|
}
|
|
2079
2113
|
}
|
|
@@ -2429,6 +2463,8 @@ async function getReleaseBodyFromChangelog(workspaceRoot, packageName, packagePa
|
|
|
2429
2463
|
"",
|
|
2430
2464
|
`Expected version ${version} in ${changelogPath}.`
|
|
2431
2465
|
].join("\n");
|
|
2466
|
+
const lines = entry.content.trim().split("\n");
|
|
2467
|
+
if (lines[0]?.trim().startsWith("## ")) return lines.slice(1).join("\n").trim();
|
|
2432
2468
|
return entry.content.trim();
|
|
2433
2469
|
} catch {
|
|
2434
2470
|
logger.verbose(`Could not read changelog entry for ${version} at ${changelogPath}`);
|