@ucdjs/release-scripts 0.1.0-beta.21 → 0.1.0-beta.23
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 +16 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1289,6 +1289,10 @@ async function selectVersionPrompt(workspaceRoot, pkg, currentVersion, suggested
|
|
|
1289
1289
|
value: "suggested",
|
|
1290
1290
|
title: `suggested ${farver.bold(suggestedVersion)}`
|
|
1291
1291
|
},
|
|
1292
|
+
{
|
|
1293
|
+
value: "as-is",
|
|
1294
|
+
title: `as-is ${farver.dim("(keep current version)")}`
|
|
1295
|
+
},
|
|
1292
1296
|
{
|
|
1293
1297
|
value: "custom",
|
|
1294
1298
|
title: "custom"
|
|
@@ -1311,7 +1315,8 @@ async function selectVersionPrompt(workspaceRoot, pkg, currentVersion, suggested
|
|
|
1311
1315
|
else if (answers.version === "custom") {
|
|
1312
1316
|
if (!answers.custom) return null;
|
|
1313
1317
|
return answers.custom;
|
|
1314
|
-
} else
|
|
1318
|
+
} else if (answers.version === "as-is") return currentVersion;
|
|
1319
|
+
else return getNextVersion(pkg.version, answers.version);
|
|
1315
1320
|
}
|
|
1316
1321
|
|
|
1317
1322
|
//#endregion
|
|
@@ -1453,8 +1458,12 @@ async function normalizeReleaseOptions(options) {
|
|
|
1453
1458
|
if (!defaultBranch) exitWithError("Could not determine default branch", "Please specify the default branch in options");
|
|
1454
1459
|
}
|
|
1455
1460
|
if (defaultBranch === releaseBranch) exitWithError(`Default branch and release branch cannot be the same: "${defaultBranch}"`, "Specify different branches for default and release");
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1461
|
+
const localBranchExists = await doesBranchExist(defaultBranch, normalized.workspaceRoot);
|
|
1462
|
+
const remoteBranchExists = await doesBranchExist(`origin/${defaultBranch}`, normalized.workspaceRoot);
|
|
1463
|
+
if (!localBranchExists && !remoteBranchExists) {
|
|
1464
|
+
const availableBranches = await getAvailableBranches(normalized.workspaceRoot);
|
|
1465
|
+
exitWithError(`Default branch "${defaultBranch}" does not exist in the repository`, `Couldn't find it locally or on the remote 'origin'.\nAvailable local branches: ${availableBranches.join(", ")}`);
|
|
1466
|
+
}
|
|
1458
1467
|
logger.verbose(`Using default branch: ${farver.green(defaultBranch)}`);
|
|
1459
1468
|
return {
|
|
1460
1469
|
...normalized,
|
|
@@ -1688,7 +1697,7 @@ async function verify(options) {
|
|
|
1688
1697
|
logger.info(`Found release PR #${releasePr.number}. Verifying against default branch "${defaultBranch}"...`);
|
|
1689
1698
|
const originalBranch = await getCurrentBranch(workspaceRoot);
|
|
1690
1699
|
if (originalBranch !== defaultBranch) await checkoutBranch(defaultBranch, workspaceRoot);
|
|
1691
|
-
const overridesPath =
|
|
1700
|
+
const overridesPath = ucdjsReleaseOverridesPath;
|
|
1692
1701
|
let existingOverrides = {};
|
|
1693
1702
|
try {
|
|
1694
1703
|
const overridesContent = await readFileFromGit(workspaceRoot, releasePr.head.sha, overridesPath);
|
|
@@ -1712,7 +1721,7 @@ async function verify(options) {
|
|
|
1712
1721
|
const expectedVersionMap = new Map(expectedUpdates.map((u) => [u.package.name, u.newVersion]));
|
|
1713
1722
|
const prVersionMap = /* @__PURE__ */ new Map();
|
|
1714
1723
|
for (const pkg of mainPackages) {
|
|
1715
|
-
const pkgJsonPath = join(pkg.path
|
|
1724
|
+
const pkgJsonPath = relative(workspaceRoot, join(pkg.path, "package.json"));
|
|
1716
1725
|
const pkgJsonContent = await readFileFromGit(workspaceRoot, releasePr.head.sha, pkgJsonPath);
|
|
1717
1726
|
if (pkgJsonContent) {
|
|
1718
1727
|
const pkgJson = JSON.parse(pkgJsonContent);
|
|
@@ -1746,7 +1755,8 @@ async function verify(options) {
|
|
|
1746
1755
|
sha: releasePr.head.sha,
|
|
1747
1756
|
state: "success",
|
|
1748
1757
|
context: statusContext,
|
|
1749
|
-
description: "Release PR is up to date."
|
|
1758
|
+
description: "Release PR is up to date.",
|
|
1759
|
+
targetUrl: `https://github.com/${normalizedOptions.owner}/${normalizedOptions.repo}/pull/${releasePr.number}`
|
|
1750
1760
|
});
|
|
1751
1761
|
logger.success("Verification successful. Commit status set to 'success'.");
|
|
1752
1762
|
}
|