contributionsIn
uses tcmts.cli.manifests.packagesIn, which uses tcmts.cli.config.configValue, which uses node:path
The merged contributions a release brings: whose merge is in its history and not the previous release's, and that changed something of the package's.
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import { diffNamespaces, stateOf } from "#codebase/tcmts/cli/diff"; import { owns, packagesIn } from "#codebase/tcmts/cli/manifests"; import { rowsAt } from "#codebase/tcmts/cli/releases"; import type { Plan } from "#codebase/tcmts/cli/releases"; import type { Contribution, NameRow } from "#codebase/tcmts/store"; export function contributionsIn(cb: Codebase, list: Contribution[], plan: Plan): Contribution[] { const seen = new Set<string>(); const touches = (c: Contribution) => { const [a, b] = [rowsAt(cb, c.mergedFrom!), rowsAt(cb, c.mergedAs!)]; const all = packagesIn(cb, b); const pkg = all.find((p) => p.name === plan.pkg.name) ?? plan.pkg; const mine = (rows: NameRow[]) => stateOf(rows.filter((r) => owns(pkg, all, r.path) || r.path === pkg.manifestPath)); const d = diffNamespaces(mine(a), mine(b), (h) => cb.store.getDef(h)!.ir); return Object.values(d).some((xs: unknown[]) => xs.length); }; return list .filter((c) => c.status === "merged" && c.mergedAs && c.mergedFrom && cb.store.hasCausal(c.mergedAs) && cb.store.hasCausal(c.mergedFrom)) .filter((c) => cb.store.isAncestor(c.mergedAs!, plan.head) && !(plan.prev && cb.store.isAncestor(c.mergedAs!, plan.prev.causal))) .filter((c) => !seen.has(c.mergedAs!) && (seen.add(c.mergedAs!), true)) .filter(touches) .sort((a, b) => a.id - b.id); }
uses
- tcmts.cli.codebase.Codebase
- tcmts.cli.diff.diffNamespaces
- tcmts.cli.diff.stateOf
- tcmts.cli.manifests.owns
- tcmts.cli.manifests.packagesIn
- tcmts.cli.releases.Plan
- tcmts.cli.releases.rowsAt
- tcmts.store.Contribution
- tcmts.store.NameRow