@ucdjs/release-scripts 0.1.0-beta.44 → 0.1.0-beta.45
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 +42 -19
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1535,12 +1535,16 @@ function getPackagePublishOrder(graph, packagesToPublish) {
|
|
|
1535
1535
|
* @param directUpdates - Packages with direct code changes
|
|
1536
1536
|
* @returns All updates including dependent packages that need patch bumps
|
|
1537
1537
|
*/
|
|
1538
|
-
function createDependentUpdates(graph, workspacePackages, directUpdates) {
|
|
1538
|
+
function createDependentUpdates(graph, workspacePackages, directUpdates, excludedPackages = /* @__PURE__ */ new Set()) {
|
|
1539
1539
|
const allUpdates = [...directUpdates];
|
|
1540
1540
|
const directUpdateMap = new Map(directUpdates.map((u) => [u.package.name, u]));
|
|
1541
1541
|
const affectedPackages = getAllAffectedPackages(graph, new Set(directUpdates.map((u) => u.package.name)));
|
|
1542
1542
|
for (const pkgName of affectedPackages) {
|
|
1543
1543
|
logger.verbose(`Processing affected package: ${pkgName}`);
|
|
1544
|
+
if (excludedPackages.has(pkgName)) {
|
|
1545
|
+
logger.verbose(`Skipping ${pkgName}, explicitly excluded from dependent bumps`);
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1544
1548
|
if (directUpdateMap.has(pkgName)) {
|
|
1545
1549
|
logger.verbose(`Skipping ${pkgName}, already has a direct update`);
|
|
1546
1550
|
continue;
|
|
@@ -1604,6 +1608,7 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1604
1608
|
const versionUpdates = [];
|
|
1605
1609
|
const processedPackages = /* @__PURE__ */ new Set();
|
|
1606
1610
|
const newOverrides = { ...initialOverrides };
|
|
1611
|
+
const excludedPackages = /* @__PURE__ */ new Set();
|
|
1607
1612
|
const bumpRanks = {
|
|
1608
1613
|
major: 3,
|
|
1609
1614
|
minor: 2,
|
|
@@ -1624,10 +1629,6 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1624
1629
|
const override = newOverrides[pkgName];
|
|
1625
1630
|
const effectiveBump = override?.type || determinedBump;
|
|
1626
1631
|
const canPrompt = !isCI && showPrompt;
|
|
1627
|
-
if (override?.type === "none" && override.version === pkg.version) {
|
|
1628
|
-
delete newOverrides[pkgName];
|
|
1629
|
-
logger.verbose(`Removed stale "none" override for ${pkgName}`);
|
|
1630
|
-
}
|
|
1631
1632
|
if (effectiveBump === "none" && !canPrompt) continue;
|
|
1632
1633
|
let newVersion = override?.version || getNextVersion(pkg.version, effectiveBump);
|
|
1633
1634
|
let finalBumpType = effectiveBump;
|
|
@@ -1641,10 +1642,24 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1641
1642
|
const userBump = calculateBumpType(pkg.version, selectedVersion);
|
|
1642
1643
|
finalBumpType = userBump;
|
|
1643
1644
|
if (selectedVersion === pkg.version) {
|
|
1644
|
-
|
|
1645
|
+
excludedPackages.add(pkgName);
|
|
1646
|
+
if (determinedBump !== "none") {
|
|
1647
|
+
newOverrides[pkgName] = {
|
|
1648
|
+
type: "none",
|
|
1649
|
+
version: pkg.version
|
|
1650
|
+
};
|
|
1651
|
+
logger.info(`Version override recorded for ${pkgName}: ${determinedBump} → none`);
|
|
1652
|
+
} else if (newOverrides[pkgName]) {
|
|
1645
1653
|
delete newOverrides[pkgName];
|
|
1646
1654
|
logger.info(`Version override removed for ${pkgName}.`);
|
|
1647
1655
|
}
|
|
1656
|
+
versionUpdates.push({
|
|
1657
|
+
package: pkg,
|
|
1658
|
+
currentVersion: pkg.version,
|
|
1659
|
+
newVersion: pkg.version,
|
|
1660
|
+
bumpType: "none",
|
|
1661
|
+
hasDirectChanges: allCommitsForPackage.length > 0
|
|
1662
|
+
});
|
|
1648
1663
|
continue;
|
|
1649
1664
|
}
|
|
1650
1665
|
if (bumpRanks[userBump] < bumpRanks[determinedBump]) {
|
|
@@ -1674,20 +1689,23 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1674
1689
|
logger.item("No direct commits found");
|
|
1675
1690
|
const newVersion = await selectVersionPrompt(workspaceRoot, pkg, pkg.version, pkg.version);
|
|
1676
1691
|
if (newVersion === null) break;
|
|
1677
|
-
if (newVersion
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
package: pkg,
|
|
1681
|
-
currentVersion: pkg.version,
|
|
1682
|
-
newVersion,
|
|
1683
|
-
bumpType,
|
|
1684
|
-
hasDirectChanges: false
|
|
1685
|
-
});
|
|
1692
|
+
if (newVersion === pkg.version) {
|
|
1693
|
+
excludedPackages.add(pkg.name);
|
|
1694
|
+
continue;
|
|
1686
1695
|
}
|
|
1696
|
+
const bumpType = calculateBumpType(pkg.version, newVersion);
|
|
1697
|
+
versionUpdates.push({
|
|
1698
|
+
package: pkg,
|
|
1699
|
+
currentVersion: pkg.version,
|
|
1700
|
+
newVersion,
|
|
1701
|
+
bumpType,
|
|
1702
|
+
hasDirectChanges: false
|
|
1703
|
+
});
|
|
1687
1704
|
}
|
|
1688
1705
|
return {
|
|
1689
1706
|
updates: versionUpdates,
|
|
1690
|
-
overrides: newOverrides
|
|
1707
|
+
overrides: newOverrides,
|
|
1708
|
+
excludedPackages
|
|
1691
1709
|
};
|
|
1692
1710
|
}
|
|
1693
1711
|
/**
|
|
@@ -1695,7 +1713,7 @@ async function calculateVersionUpdates({ workspacePackages, packageCommits, work
|
|
|
1695
1713
|
* Returns both the updates and a function to apply them
|
|
1696
1714
|
*/
|
|
1697
1715
|
async function calculateAndPrepareVersionUpdates({ workspacePackages, packageCommits, workspaceRoot, showPrompt, globalCommitsPerPackage, overrides }) {
|
|
1698
|
-
const { updates: directUpdates, overrides: newOverrides } = await calculateVersionUpdates({
|
|
1716
|
+
const { updates: directUpdates, overrides: newOverrides, excludedPackages: promptExcludedPackages } = await calculateVersionUpdates({
|
|
1699
1717
|
workspacePackages,
|
|
1700
1718
|
packageCommits,
|
|
1701
1719
|
workspaceRoot,
|
|
@@ -1703,7 +1721,9 @@ async function calculateAndPrepareVersionUpdates({ workspacePackages, packageCom
|
|
|
1703
1721
|
globalCommitsPerPackage,
|
|
1704
1722
|
overrides
|
|
1705
1723
|
});
|
|
1706
|
-
const
|
|
1724
|
+
const graph = buildPackageDependencyGraph(workspacePackages);
|
|
1725
|
+
const overrideExcludedPackages = new Set(Object.entries(newOverrides).filter(([, override]) => override.type === "none").map(([pkgName]) => pkgName));
|
|
1726
|
+
const allUpdates = createDependentUpdates(graph, workspacePackages, directUpdates, new Set([...overrideExcludedPackages, ...promptExcludedPackages]));
|
|
1707
1727
|
const applyUpdates = async () => {
|
|
1708
1728
|
await Promise.all(allUpdates.map(async (update) => {
|
|
1709
1729
|
const depUpdates = getDependencyUpdates(update.package, allUpdates);
|
|
@@ -1910,7 +1930,10 @@ async function prepareWorkflow(options) {
|
|
|
1910
1930
|
if (allUpdates.filter((u) => u.hasDirectChanges).length === 0) logger.warn("No packages have changes requiring a release");
|
|
1911
1931
|
logger.section("🔄 Version Updates");
|
|
1912
1932
|
logger.item(`Updating ${allUpdates.length} packages (including dependents)`);
|
|
1913
|
-
for (const update of allUpdates)
|
|
1933
|
+
for (const update of allUpdates) {
|
|
1934
|
+
const suffix = update.currentVersion === update.newVersion ? farver.dim(" (as-is)") : "";
|
|
1935
|
+
logger.item(`${update.package.name}: ${update.currentVersion} → ${update.newVersion}${suffix}`);
|
|
1936
|
+
}
|
|
1914
1937
|
await applyUpdates();
|
|
1915
1938
|
if (options.changelog?.enabled) {
|
|
1916
1939
|
logger.step("Updating changelogs");
|