@varlock/bumpy 1.6.0 → 1.7.1
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/{add-u3h5BH8e.mjs → add-CEOjsSPY.mjs} +44 -85
- package/dist/{ai-C66IfTzs.mjs → ai-Bbe56gBt.mjs} +2 -2
- package/dist/{apply-release-plan-DNpoi7cS.mjs → apply-release-plan-CAx8E9MJ.mjs} +3 -3
- package/dist/{bump-file-CoaSxqne.mjs → bump-file-4cnuDyfW.mjs} +110 -6
- package/dist/{changelog-_gBjowzN.mjs → changelog-BubwrZfr.mjs} +3 -3
- package/dist/{changelog-github-B_e9JWku.mjs → changelog-github-BAUnp3ic.mjs} +2 -2
- package/dist/{check-B3M2S2wx.mjs → check-w-edwiNw.mjs} +9 -6
- package/dist/{ci-h8s-soA6.mjs → ci-Di_Tur0k.mjs} +102 -17
- package/dist/{ci-setup-DWxrdSK6.mjs → ci-setup-DKjyiF2-.mjs} +4 -4
- package/dist/{clack-CJT1JFFa.mjs → clack-W95rXis0.mjs} +6 -127
- package/dist/cli.mjs +20 -16
- package/dist/{config-D13G4-R8.mjs → config-BcmlSJJd.mjs} +2 -2
- package/dist/{fs-DnDogVn-.mjs → fs-CBXKZhoU.mjs} +1 -1
- package/dist/{generate-CxKXOBNP.mjs → generate-DU27B8co.mjs} +7 -8
- package/dist/{git-ukq7VTuZ.mjs → git-nTR-JccX.mjs} +1 -1
- package/dist/index.mjs +6 -9
- package/dist/{init-CUIw0jg8.mjs → init-Cs6amsw5.mjs} +14 -6
- package/dist/{logger-C2dEe5Su.mjs → logger-BgksGFuf.mjs} +3 -1
- package/dist/{package-manager-CClZtIHP.mjs → package-manager-BQPwXwu5.mjs} +1 -1
- package/dist/{publish-CXJ0Ggkq.mjs → publish-BJ-Cs0TR.mjs} +75 -13
- package/dist/{publish-pipeline-C1slMaJV.mjs → publish-pipeline-BsxtJ3-A.mjs} +6 -6
- package/dist/{semver-DfQyVLM_.mjs → release-plan-iZvGo-SB.mjs} +312 -2
- package/dist/{shell-u3bYGxNy.mjs → shell-C8KgKnMQ.mjs} +1 -1
- package/dist/{status-lS56U6F_.mjs → status-CpGvpJBm.mjs} +8 -10
- package/dist/{version-BjjnO2ii.mjs → version-nJ0vhPWw.mjs} +8 -10
- package/package.json +1 -1
- package/dist/dep-graph-E-9-eQ2J.mjs +0 -64
- package/dist/release-plan-C1Lz9rl_.mjs +0 -249
- package/dist/workspace-Yt7qwsML.mjs +0 -109
- /package/dist/{commit-message-3e4KhzFV.mjs → commit-message-CSWVKPJ-.mjs} +0 -0
- /package/dist/{names-CBy7d8K_.mjs → names-COooXAFg.mjs} +0 -0
|
@@ -1,4 +1,69 @@
|
|
|
1
|
-
import { i as __commonJSMin,
|
|
1
|
+
import { i as __commonJSMin, s as __toESM } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { c as maxBump, n as DEFAULT_BUMP_RULES, o as bumpLevel, s as hasCascade } from "./types-BX4pfmKh.mjs";
|
|
3
|
+
import { s as matchGlob } from "./config-BcmlSJJd.mjs";
|
|
4
|
+
//#region src/core/dep-graph.ts
|
|
5
|
+
var DependencyGraph = class {
|
|
6
|
+
/** Map from package name → packages that depend on it */
|
|
7
|
+
dependents = /* @__PURE__ */ new Map();
|
|
8
|
+
/** Set of all internal package names */
|
|
9
|
+
internalPackages;
|
|
10
|
+
constructor(packages) {
|
|
11
|
+
this.internalPackages = new Set(packages.keys());
|
|
12
|
+
this.build(packages);
|
|
13
|
+
}
|
|
14
|
+
build(packages) {
|
|
15
|
+
for (const [name, pkg] of packages) {
|
|
16
|
+
const depTypes = [
|
|
17
|
+
["dependencies", pkg.dependencies],
|
|
18
|
+
["devDependencies", pkg.devDependencies],
|
|
19
|
+
["peerDependencies", pkg.peerDependencies],
|
|
20
|
+
["optionalDependencies", pkg.optionalDependencies]
|
|
21
|
+
];
|
|
22
|
+
for (const [depType, deps] of depTypes) for (const [depName, versionRange] of Object.entries(deps)) {
|
|
23
|
+
if (!this.internalPackages.has(depName)) continue;
|
|
24
|
+
if (!this.dependents.has(depName)) this.dependents.set(depName, []);
|
|
25
|
+
this.dependents.get(depName).push({
|
|
26
|
+
name,
|
|
27
|
+
depType,
|
|
28
|
+
versionRange
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Get all packages that depend on the given package */
|
|
34
|
+
getDependents(pkgName) {
|
|
35
|
+
return this.dependents.get(pkgName) || [];
|
|
36
|
+
}
|
|
37
|
+
/** Check if a package is an internal workspace package */
|
|
38
|
+
isInternal(pkgName) {
|
|
39
|
+
return this.internalPackages.has(pkgName);
|
|
40
|
+
}
|
|
41
|
+
/** Get all internal package names */
|
|
42
|
+
allPackages() {
|
|
43
|
+
return [...this.internalPackages];
|
|
44
|
+
}
|
|
45
|
+
/** Topological sort — returns packages in dependency order (deps first) */
|
|
46
|
+
topologicalSort(packages) {
|
|
47
|
+
const visited = /* @__PURE__ */ new Set();
|
|
48
|
+
const result = [];
|
|
49
|
+
const visit = (name) => {
|
|
50
|
+
if (visited.has(name)) return;
|
|
51
|
+
visited.add(name);
|
|
52
|
+
const pkg = packages.get(name);
|
|
53
|
+
if (!pkg) return;
|
|
54
|
+
for (const deps of [
|
|
55
|
+
pkg.dependencies,
|
|
56
|
+
pkg.devDependencies,
|
|
57
|
+
pkg.peerDependencies,
|
|
58
|
+
pkg.optionalDependencies
|
|
59
|
+
]) for (const depName of Object.keys(deps)) if (this.internalPackages.has(depName)) visit(depName);
|
|
60
|
+
result.push(name);
|
|
61
|
+
};
|
|
62
|
+
for (const name of this.internalPackages) visit(name);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
2
67
|
//#region ../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/constants.js
|
|
3
68
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
69
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
@@ -1367,4 +1432,249 @@ function stripProtocol(range) {
|
|
|
1367
1432
|
return range.replace(/^workspace:/, "");
|
|
1368
1433
|
}
|
|
1369
1434
|
//#endregion
|
|
1370
|
-
|
|
1435
|
+
//#region src/core/release-plan.ts
|
|
1436
|
+
/**
|
|
1437
|
+
* Build a release plan from pending bump files, the dependency graph, and config.
|
|
1438
|
+
* This is the core algorithm of bumpy.
|
|
1439
|
+
*
|
|
1440
|
+
* The propagation loop runs three phases until stable:
|
|
1441
|
+
* Phase A — fix out-of-range dependencies (always runs)
|
|
1442
|
+
* Phase B — enforce fixed/linked group constraints
|
|
1443
|
+
* Phase C — apply cascades and proactive propagation rules
|
|
1444
|
+
*/
|
|
1445
|
+
function assembleReleasePlan(bumpFiles, packages, depGraph, config) {
|
|
1446
|
+
if (bumpFiles.length === 0) return {
|
|
1447
|
+
bumpFiles: [],
|
|
1448
|
+
releases: [],
|
|
1449
|
+
warnings: []
|
|
1450
|
+
};
|
|
1451
|
+
const planned = /* @__PURE__ */ new Map();
|
|
1452
|
+
const warnings = [];
|
|
1453
|
+
const cascadeOverrides = /* @__PURE__ */ new Map();
|
|
1454
|
+
for (const bf of bumpFiles) for (const release of bf.releases) {
|
|
1455
|
+
if (!packages.has(release.name)) continue;
|
|
1456
|
+
const bump = release.type;
|
|
1457
|
+
if (bump === "none") continue;
|
|
1458
|
+
const existing = planned.get(release.name);
|
|
1459
|
+
if (existing) {
|
|
1460
|
+
existing.type = maxBump(existing.type, bump);
|
|
1461
|
+
existing.bumpFiles.add(bf.id);
|
|
1462
|
+
} else planned.set(release.name, {
|
|
1463
|
+
type: bump,
|
|
1464
|
+
isDependencyBump: false,
|
|
1465
|
+
isCascadeBump: false,
|
|
1466
|
+
isGroupBump: false,
|
|
1467
|
+
bumpFiles: new Set([bf.id]),
|
|
1468
|
+
bumpSources: /* @__PURE__ */ new Map()
|
|
1469
|
+
});
|
|
1470
|
+
if (hasCascade(release)) {
|
|
1471
|
+
if (!cascadeOverrides.has(release.name)) cascadeOverrides.set(release.name, /* @__PURE__ */ new Map());
|
|
1472
|
+
const overrides = cascadeOverrides.get(release.name);
|
|
1473
|
+
for (const [pattern, bumpType] of Object.entries(release.cascade)) {
|
|
1474
|
+
const existing = overrides.get(pattern);
|
|
1475
|
+
overrides.set(pattern, maxBump(existing, bumpType));
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
let changed = true;
|
|
1480
|
+
let iterations = 0;
|
|
1481
|
+
const MAX_ITERATIONS = 100;
|
|
1482
|
+
while (changed && iterations < MAX_ITERATIONS) {
|
|
1483
|
+
changed = false;
|
|
1484
|
+
iterations++;
|
|
1485
|
+
for (const [pkgName, bump] of planned) {
|
|
1486
|
+
const pkg = packages.get(pkgName);
|
|
1487
|
+
const newVersion = bumpVersion(pkg.version, bump.type);
|
|
1488
|
+
const dependents = depGraph.getDependents(pkgName);
|
|
1489
|
+
for (const dep of dependents) {
|
|
1490
|
+
if (dep.depType === "devDependencies") continue;
|
|
1491
|
+
const currentVersion = pkg.version;
|
|
1492
|
+
if (satisfies(newVersion, dep.versionRange, currentVersion)) continue;
|
|
1493
|
+
let depBump;
|
|
1494
|
+
if (dep.depType === "peerDependencies") depBump = bump.type;
|
|
1495
|
+
else depBump = "patch";
|
|
1496
|
+
if (dep.depType === "peerDependencies" && depBump !== "patch" && bump.type !== "major") {
|
|
1497
|
+
let resolvedRange = dep.versionRange.replace(/^workspace:/, "");
|
|
1498
|
+
if (resolvedRange === "^" || resolvedRange === "~") resolvedRange = `${resolvedRange}${pkg.version}`;
|
|
1499
|
+
if (/^\^0(\.|$)/.test(resolvedRange)) warnings.push(`${dep.name} gets a ${depBump} bump because ${pkgName}@${newVersion} is out of range for its peer dep "${dep.versionRange}" (resolves to ${resolvedRange}). npm treats ^ on 0.x as minor-breaking. Consider using >=0.x ranges for pre-1.0 peer deps.`);
|
|
1500
|
+
}
|
|
1501
|
+
if (applyBump(planned, dep.name, depBump, true, false, pkgName)) changed = true;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
for (const group of config.fixed) {
|
|
1505
|
+
let groupBump;
|
|
1506
|
+
const groupSources = [];
|
|
1507
|
+
for (const nameOrGlob of group) for (const [name, bump] of planned) if (matchGlob(name, nameOrGlob)) {
|
|
1508
|
+
if (!groupBump || bumpLevel(bump.type) > bumpLevel(groupBump)) {
|
|
1509
|
+
groupBump = bump.type;
|
|
1510
|
+
groupSources.length = 0;
|
|
1511
|
+
groupSources.push(name);
|
|
1512
|
+
} else if (bump.type === groupBump) groupSources.push(name);
|
|
1513
|
+
}
|
|
1514
|
+
if (!groupBump) continue;
|
|
1515
|
+
for (const nameOrGlob of group) for (const [name] of packages) {
|
|
1516
|
+
if (!matchGlob(name, nameOrGlob)) continue;
|
|
1517
|
+
const existing = planned.get(name);
|
|
1518
|
+
if (existing) {
|
|
1519
|
+
const newType = maxBump(existing.type, groupBump);
|
|
1520
|
+
if (newType !== existing.type) {
|
|
1521
|
+
existing.type = newType;
|
|
1522
|
+
existing.isGroupBump = true;
|
|
1523
|
+
for (const src of groupSources) if (src !== name) existing.bumpSources.set(src, groupBump);
|
|
1524
|
+
changed = true;
|
|
1525
|
+
}
|
|
1526
|
+
} else {
|
|
1527
|
+
planned.set(name, {
|
|
1528
|
+
type: groupBump,
|
|
1529
|
+
isDependencyBump: false,
|
|
1530
|
+
isCascadeBump: false,
|
|
1531
|
+
isGroupBump: true,
|
|
1532
|
+
bumpFiles: /* @__PURE__ */ new Set(),
|
|
1533
|
+
bumpSources: new Map(groupSources.filter((s) => s !== name).map((s) => [s, groupBump]))
|
|
1534
|
+
});
|
|
1535
|
+
changed = true;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
for (const group of config.linked) {
|
|
1540
|
+
let groupBump;
|
|
1541
|
+
const groupSources = [];
|
|
1542
|
+
for (const nameOrGlob of group) for (const [name, bump] of planned) if (matchGlob(name, nameOrGlob)) {
|
|
1543
|
+
if (!groupBump || bumpLevel(bump.type) > bumpLevel(groupBump)) {
|
|
1544
|
+
groupBump = bump.type;
|
|
1545
|
+
groupSources.length = 0;
|
|
1546
|
+
groupSources.push(name);
|
|
1547
|
+
} else if (bump.type === groupBump) groupSources.push(name);
|
|
1548
|
+
}
|
|
1549
|
+
if (!groupBump) continue;
|
|
1550
|
+
for (const nameOrGlob of group) for (const [name] of packages) {
|
|
1551
|
+
if (!matchGlob(name, nameOrGlob)) continue;
|
|
1552
|
+
const existing = planned.get(name);
|
|
1553
|
+
if (!existing) continue;
|
|
1554
|
+
const newType = maxBump(existing.type, groupBump);
|
|
1555
|
+
if (newType !== existing.type) {
|
|
1556
|
+
existing.type = newType;
|
|
1557
|
+
existing.isGroupBump = true;
|
|
1558
|
+
for (const src of groupSources) if (src !== name) existing.bumpSources.set(src, groupBump);
|
|
1559
|
+
changed = true;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
if (config.updateInternalDependencies !== "out-of-range") for (const [pkgName, bump] of planned) {
|
|
1564
|
+
if (config.updateInternalDependencies === "minor" && bumpLevel(bump.type) < bumpLevel("minor")) continue;
|
|
1565
|
+
const bfOverrides = cascadeOverrides.get(pkgName);
|
|
1566
|
+
if (bfOverrides) for (const [pattern, cascadeBumpType] of bfOverrides) for (const [targetName] of packages) {
|
|
1567
|
+
if (!matchGlob(targetName, pattern)) continue;
|
|
1568
|
+
if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
|
|
1569
|
+
}
|
|
1570
|
+
const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
|
|
1571
|
+
if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
|
|
1572
|
+
if (!shouldTrigger(bump.type, rule.trigger)) continue;
|
|
1573
|
+
const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
1574
|
+
for (const [targetName] of packages) {
|
|
1575
|
+
if (!matchGlob(targetName, pattern)) continue;
|
|
1576
|
+
if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
const dependents = depGraph.getDependents(pkgName);
|
|
1580
|
+
for (const dep of dependents) {
|
|
1581
|
+
const rule = resolveRule(dep.name, dep.depType, packages, config);
|
|
1582
|
+
if (!rule) continue;
|
|
1583
|
+
if (!shouldTrigger(bump.type, rule.trigger)) continue;
|
|
1584
|
+
const depBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
1585
|
+
if (applyBump(planned, dep.name, depBump, true, false, pkgName)) changed = true;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
else for (const [pkgName, bump] of planned) {
|
|
1589
|
+
const bfOverrides = cascadeOverrides.get(pkgName);
|
|
1590
|
+
if (bfOverrides) for (const [pattern, cascadeBumpType] of bfOverrides) for (const [targetName] of packages) {
|
|
1591
|
+
if (!matchGlob(targetName, pattern)) continue;
|
|
1592
|
+
if (applyBump(planned, targetName, cascadeBumpType, false, true, pkgName)) changed = true;
|
|
1593
|
+
}
|
|
1594
|
+
const cascadeTo = packages.get(pkgName)?.bumpy?.cascadeTo;
|
|
1595
|
+
if (cascadeTo) for (const [pattern, rule] of Object.entries(cascadeTo)) {
|
|
1596
|
+
if (!shouldTrigger(bump.type, rule.trigger)) continue;
|
|
1597
|
+
const cascadeBump = rule.bumpAs === "match" ? bump.type : rule.bumpAs;
|
|
1598
|
+
for (const [targetName] of packages) {
|
|
1599
|
+
if (!matchGlob(targetName, pattern)) continue;
|
|
1600
|
+
if (applyBump(planned, targetName, cascadeBump, false, true, pkgName)) changed = true;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
const releases = [];
|
|
1606
|
+
for (const [name, bump] of planned) {
|
|
1607
|
+
const pkg = packages.get(name);
|
|
1608
|
+
if (!pkg) continue;
|
|
1609
|
+
const newVersion = bumpVersion(pkg.version, bump.type);
|
|
1610
|
+
releases.push({
|
|
1611
|
+
name,
|
|
1612
|
+
type: bump.type,
|
|
1613
|
+
oldVersion: pkg.version,
|
|
1614
|
+
newVersion,
|
|
1615
|
+
bumpFiles: [...bump.bumpFiles],
|
|
1616
|
+
isDependencyBump: bump.isDependencyBump,
|
|
1617
|
+
isCascadeBump: bump.isCascadeBump,
|
|
1618
|
+
isGroupBump: bump.isGroupBump,
|
|
1619
|
+
bumpSources: [...bump.bumpSources].map(([srcName, contributedType]) => {
|
|
1620
|
+
const srcBump = planned.get(srcName);
|
|
1621
|
+
const srcPkg = packages.get(srcName);
|
|
1622
|
+
return {
|
|
1623
|
+
name: srcName,
|
|
1624
|
+
newVersion: srcPkg && srcBump ? bumpVersion(srcPkg.version, srcBump.type) : "unknown",
|
|
1625
|
+
bumpType: contributedType
|
|
1626
|
+
};
|
|
1627
|
+
})
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
releases.sort((a, b) => a.name.localeCompare(b.name));
|
|
1631
|
+
for (const [name, pkg] of packages) for (const [depName, range] of Object.entries(pkg.peerDependencies)) if (range === "workspace:*" && packages.has(depName)) warnings.push(`${name} has peer dep "${depName}": "workspace:*" — this will be published as a fixed range which may not match your intent. Consider using "workspace:^" instead.`);
|
|
1632
|
+
return {
|
|
1633
|
+
bumpFiles,
|
|
1634
|
+
releases,
|
|
1635
|
+
warnings
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
/** Apply a bump to a package, upgrading if already planned. Returns true if anything changed. */
|
|
1639
|
+
function applyBump(planned, name, type, isDependencyBump, isCascadeBump, sourcePackageName) {
|
|
1640
|
+
const existing = planned.get(name);
|
|
1641
|
+
if (existing) {
|
|
1642
|
+
const newType = maxBump(existing.type, type);
|
|
1643
|
+
if (newType === existing.type) return false;
|
|
1644
|
+
existing.type = newType;
|
|
1645
|
+
if (isDependencyBump) existing.isDependencyBump = true;
|
|
1646
|
+
if (isCascadeBump) existing.isCascadeBump = true;
|
|
1647
|
+
existing.bumpSources.set(sourcePackageName, type);
|
|
1648
|
+
return true;
|
|
1649
|
+
}
|
|
1650
|
+
planned.set(name, {
|
|
1651
|
+
type,
|
|
1652
|
+
isDependencyBump,
|
|
1653
|
+
isCascadeBump,
|
|
1654
|
+
isGroupBump: false,
|
|
1655
|
+
bumpFiles: /* @__PURE__ */ new Set(),
|
|
1656
|
+
bumpSources: new Map([[sourcePackageName, type]])
|
|
1657
|
+
});
|
|
1658
|
+
return true;
|
|
1659
|
+
}
|
|
1660
|
+
/** Check if a bump level meets the trigger threshold */
|
|
1661
|
+
function shouldTrigger(bumpType, trigger) {
|
|
1662
|
+
return bumpLevel(bumpType) >= bumpLevel(trigger);
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Resolve the dependency bump rule for a specific dependent + dep type.
|
|
1666
|
+
* Priority: per-package depType rules > global depType rules > defaults
|
|
1667
|
+
* Returns false if the rule is disabled.
|
|
1668
|
+
*/
|
|
1669
|
+
function resolveRule(dependentName, depType, packages, config) {
|
|
1670
|
+
const dependent = packages.get(dependentName);
|
|
1671
|
+
if (dependent?.bumpy?.dependencyBumpRules && depType in dependent.bumpy.dependencyBumpRules) return dependent.bumpy.dependencyBumpRules[depType];
|
|
1672
|
+
if (depType in config.dependencyBumpRules) return config.dependencyBumpRules[depType];
|
|
1673
|
+
const defaultRule = DEFAULT_BUMP_RULES[depType];
|
|
1674
|
+
return defaultRule !== void 0 ? defaultRule : {
|
|
1675
|
+
trigger: "patch",
|
|
1676
|
+
bumpAs: "patch"
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
//#endregion
|
|
1680
|
+
export { DependencyGraph as a, stripProtocol as i, bumpVersion as n, satisfies as r, assembleReleasePlan as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __exportAll } from "./logger-
|
|
1
|
+
import { a as __exportAll } from "./logger-BgksGFuf.mjs";
|
|
2
2
|
import { exec, execFile, execFileSync, execSync } from "node:child_process";
|
|
3
3
|
//#region src/utils/shell.ts
|
|
4
4
|
var shell_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { n as log, t as colorize } from "./logger-
|
|
2
|
-
import { a as loadConfig } from "./config-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as assembleReleasePlan } from "./release-plan-C1Lz9rl_.mjs";
|
|
7
|
-
import { i as getCurrentBranch, r as getChangedFiles } from "./git-ukq7VTuZ.mjs";
|
|
1
|
+
import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { a as loadConfig } from "./config-BcmlSJJd.mjs";
|
|
3
|
+
import { a as discoverPackages, r as readBumpFiles, t as filterBranchBumpFiles } from "./bump-file-4cnuDyfW.mjs";
|
|
4
|
+
import { a as DependencyGraph, t as assembleReleasePlan } from "./release-plan-iZvGo-SB.mjs";
|
|
5
|
+
import { i as getCurrentBranch, r as getChangedFiles } from "./git-nTR-JccX.mjs";
|
|
8
6
|
//#region src/commands/status.ts
|
|
9
7
|
async function statusCommand(rootDir, opts) {
|
|
10
8
|
const config = await loadConfig(rootDir);
|
|
@@ -31,7 +29,7 @@ async function statusCommand(rootDir, opts) {
|
|
|
31
29
|
releases = releases.filter((r) => types.includes(r.type));
|
|
32
30
|
}
|
|
33
31
|
if (opts.filter) {
|
|
34
|
-
const { matchGlob } = await import("./config-
|
|
32
|
+
const { matchGlob } = await import("./config-BcmlSJJd.mjs").then((n) => n.t);
|
|
35
33
|
const patterns = opts.filter.split(",").map((p) => p.trim());
|
|
36
34
|
releases = releases.filter((r) => patterns.some((p) => matchGlob(r.name, p)));
|
|
37
35
|
}
|
|
@@ -123,8 +121,8 @@ function getPublishTargets(pkg, pkgConfig, _config) {
|
|
|
123
121
|
if (!pkg) return [];
|
|
124
122
|
if (pkg.private && !pkgConfig.publishCommand) return [];
|
|
125
123
|
const targets = [];
|
|
126
|
-
if (pkgConfig.publishCommand) targets.push("custom");
|
|
127
|
-
if (!pkgConfig.publishCommand && !pkgConfig.skipNpmPublish) targets.push("npm");
|
|
124
|
+
if (pkgConfig.publishCommand) targets.push({ type: "custom" });
|
|
125
|
+
if (!pkgConfig.publishCommand && !pkgConfig.skipNpmPublish) targets.push({ type: "npm" });
|
|
128
126
|
return targets;
|
|
129
127
|
}
|
|
130
128
|
//#endregion
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { n as log, t as colorize } from "./logger-
|
|
2
|
-
import { a as loadConfig } from "./config-
|
|
3
|
-
import { n as detectWorkspaces } from "./package-manager-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as runArgs, s as tryRunArgs } from "./shell-
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as applyReleasePlan } from "./apply-release-plan-DNpoi7cS.mjs";
|
|
10
|
-
import { t as resolveCommitMessage } from "./commit-message-3e4KhzFV.mjs";
|
|
1
|
+
import { n as log, t as colorize } from "./logger-BgksGFuf.mjs";
|
|
2
|
+
import { a as loadConfig } from "./config-BcmlSJJd.mjs";
|
|
3
|
+
import { n as detectWorkspaces } from "./package-manager-BQPwXwu5.mjs";
|
|
4
|
+
import { a as discoverPackages, r as readBumpFiles } from "./bump-file-4cnuDyfW.mjs";
|
|
5
|
+
import { a as DependencyGraph, t as assembleReleasePlan } from "./release-plan-iZvGo-SB.mjs";
|
|
6
|
+
import { n as runArgs, s as tryRunArgs } from "./shell-C8KgKnMQ.mjs";
|
|
7
|
+
import { t as applyReleasePlan } from "./apply-release-plan-CAx8E9MJ.mjs";
|
|
8
|
+
import { t as resolveCommitMessage } from "./commit-message-CSWVKPJ-.mjs";
|
|
11
9
|
//#region src/commands/version.ts
|
|
12
10
|
async function versionCommand(rootDir, opts = {}) {
|
|
13
11
|
const config = await loadConfig(rootDir);
|
package/package.json
CHANGED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region src/core/dep-graph.ts
|
|
2
|
-
var DependencyGraph = class {
|
|
3
|
-
/** Map from package name → packages that depend on it */
|
|
4
|
-
dependents = /* @__PURE__ */ new Map();
|
|
5
|
-
/** Set of all internal package names */
|
|
6
|
-
internalPackages;
|
|
7
|
-
constructor(packages) {
|
|
8
|
-
this.internalPackages = new Set(packages.keys());
|
|
9
|
-
this.build(packages);
|
|
10
|
-
}
|
|
11
|
-
build(packages) {
|
|
12
|
-
for (const [name, pkg] of packages) {
|
|
13
|
-
const depTypes = [
|
|
14
|
-
["dependencies", pkg.dependencies],
|
|
15
|
-
["devDependencies", pkg.devDependencies],
|
|
16
|
-
["peerDependencies", pkg.peerDependencies],
|
|
17
|
-
["optionalDependencies", pkg.optionalDependencies]
|
|
18
|
-
];
|
|
19
|
-
for (const [depType, deps] of depTypes) for (const [depName, versionRange] of Object.entries(deps)) {
|
|
20
|
-
if (!this.internalPackages.has(depName)) continue;
|
|
21
|
-
if (!this.dependents.has(depName)) this.dependents.set(depName, []);
|
|
22
|
-
this.dependents.get(depName).push({
|
|
23
|
-
name,
|
|
24
|
-
depType,
|
|
25
|
-
versionRange
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/** Get all packages that depend on the given package */
|
|
31
|
-
getDependents(pkgName) {
|
|
32
|
-
return this.dependents.get(pkgName) || [];
|
|
33
|
-
}
|
|
34
|
-
/** Check if a package is an internal workspace package */
|
|
35
|
-
isInternal(pkgName) {
|
|
36
|
-
return this.internalPackages.has(pkgName);
|
|
37
|
-
}
|
|
38
|
-
/** Get all internal package names */
|
|
39
|
-
allPackages() {
|
|
40
|
-
return [...this.internalPackages];
|
|
41
|
-
}
|
|
42
|
-
/** Topological sort — returns packages in dependency order (deps first) */
|
|
43
|
-
topologicalSort(packages) {
|
|
44
|
-
const visited = /* @__PURE__ */ new Set();
|
|
45
|
-
const result = [];
|
|
46
|
-
const visit = (name) => {
|
|
47
|
-
if (visited.has(name)) return;
|
|
48
|
-
visited.add(name);
|
|
49
|
-
const pkg = packages.get(name);
|
|
50
|
-
if (!pkg) return;
|
|
51
|
-
for (const deps of [
|
|
52
|
-
pkg.dependencies,
|
|
53
|
-
pkg.devDependencies,
|
|
54
|
-
pkg.peerDependencies,
|
|
55
|
-
pkg.optionalDependencies
|
|
56
|
-
]) for (const depName of Object.keys(deps)) if (this.internalPackages.has(depName)) visit(depName);
|
|
57
|
-
result.push(name);
|
|
58
|
-
};
|
|
59
|
-
for (const name of this.internalPackages) visit(name);
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//#endregion
|
|
64
|
-
export { DependencyGraph as t };
|