@davmash/bygone 0.7.1 → 0.8.3
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/CHANGELOG.md +28 -1
- package/README.md +31 -10
- package/bin/bygone.js +10 -3
- package/cli/commandSpec.js +14 -5
- package/cli/completions.js +7 -7
- package/cli/tour.js +2 -2
- package/cli/tourFile.js +66 -4
- package/cli/workingDirectory.js +19 -0
- package/completions/_bygone +6 -5
- package/completions/bygone +3 -3
- package/completions/bygone.fish +3 -2
- package/docs/change-explanation-plan.md +1 -1
- package/docs/change-tour-format.md +42 -5
- package/docs/explore.md +66 -0
- package/docs/generating-change-tours.md +13 -5
- package/docs/present.md +41 -0
- package/docs/product-surface.md +124 -0
- package/docs/repository-search-prototype.md +67 -0
- package/docs/search.md +56 -0
- package/examples/deconstructed-diff.bygone +49 -0
- package/examples/stacked-diff.bygone +55 -0
- package/media/diff.worker.js +5 -0
- package/media/webview.css +1 -1
- package/media/webview.js +250 -188
- package/out/changeTour.js +37 -22
- package/out/standalone-main.js +2265 -1073
- package/out/tourCoverage.js +37 -22
- package/package.json +4 -3
- package/skills/pr-tour-guide/SKILL.md +238 -0
- package/standalone/index.html +7 -7
- package/web/index.html +21 -8
- package/web/presenter.css +117 -28
- package/web/web-host.js +6 -4
- /package/examples/{bygone-history.bygone.yaml → bygone-history.bygone} +0 -0
package/out/changeTour.js
CHANGED
|
@@ -1515,7 +1515,11 @@ function applySource(source, defaultScenes, repoRoot) {
|
|
|
1515
1515
|
continue;
|
|
1516
1516
|
}
|
|
1517
1517
|
if (authoredScene.kind === "stacked-diff") {
|
|
1518
|
-
const stackedScene = buildStackedScene(
|
|
1518
|
+
const stackedScene = buildStackedScene(
|
|
1519
|
+
repoRoot,
|
|
1520
|
+
authoredScene,
|
|
1521
|
+
[...available.keys()]
|
|
1522
|
+
);
|
|
1519
1523
|
scenes.push(stackedScene);
|
|
1520
1524
|
sceneIds.push(stackedScene.id);
|
|
1521
1525
|
continue;
|
|
@@ -1623,8 +1627,7 @@ function buildDeconstructedManifestScene(repoRoot, source, baseRef, targetRef) {
|
|
|
1623
1627
|
}))
|
|
1624
1628
|
};
|
|
1625
1629
|
}
|
|
1626
|
-
function buildStackedScene(repoRoot, source) {
|
|
1627
|
-
var _a;
|
|
1630
|
+
function buildStackedScene(repoRoot, source, availableFilePaths) {
|
|
1628
1631
|
const stack = source.stack.map((entry) => ({
|
|
1629
1632
|
id: entry.id,
|
|
1630
1633
|
ref: entry.ref,
|
|
@@ -1644,15 +1647,18 @@ function buildStackedScene(repoRoot, source) {
|
|
|
1644
1647
|
maxBuffer: 16 * 1024 * 1024,
|
|
1645
1648
|
stdio: ["ignore", "pipe", "pipe"]
|
|
1646
1649
|
})));
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
}
|
|
1650
|
+
const filePaths = [.../* @__PURE__ */ new Set([
|
|
1651
|
+
...availableFilePaths,
|
|
1652
|
+
...source.files || [],
|
|
1653
|
+
...source.steps.map((step) => step.file)
|
|
1654
|
+
])].sort();
|
|
1653
1655
|
if (filePaths.length === 0) throw new Error(`Stacked scene ${source.id} has no changed files.`);
|
|
1656
|
+
const requiredFilePaths = /* @__PURE__ */ new Set([
|
|
1657
|
+
...source.files || [],
|
|
1658
|
+
...source.steps.map((step) => step.file)
|
|
1659
|
+
]);
|
|
1654
1660
|
let totalContentBytes = 0;
|
|
1655
|
-
const files = filePaths.
|
|
1661
|
+
const files = filePaths.flatMap((filePath) => {
|
|
1656
1662
|
const aliases = /* @__PURE__ */ new Set([filePath]);
|
|
1657
1663
|
for (const changes of adjacentChanges) {
|
|
1658
1664
|
for (const change of changes) {
|
|
@@ -1662,26 +1668,35 @@ function buildStackedScene(repoRoot, source) {
|
|
|
1662
1668
|
}
|
|
1663
1669
|
}
|
|
1664
1670
|
}
|
|
1665
|
-
|
|
1671
|
+
let fileContentBytes = 0;
|
|
1672
|
+
const panels = [];
|
|
1673
|
+
for (const entry of stack) {
|
|
1666
1674
|
const resolvedPath = [...aliases].find((candidate) => gitBlobExists(repoRoot, entry.oid, candidate));
|
|
1667
1675
|
if (!resolvedPath) {
|
|
1668
|
-
|
|
1676
|
+
panels.push({ id: entry.id, label: `${entry.label} / ${filePath} (missing)`, content: "", exists: false });
|
|
1677
|
+
continue;
|
|
1669
1678
|
}
|
|
1670
1679
|
const content = readGitText2(repoRoot, entry.oid, resolvedPath, DEFAULT_MAX_TOUR_FILE_BYTES, DEFAULT_MAX_TOUR_LINE_BYTES);
|
|
1671
|
-
if (content.kind !== "text")
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1680
|
+
if (content.kind !== "text") {
|
|
1681
|
+
if (requiredFilePaths.has(filePath)) {
|
|
1682
|
+
throw new Error(`Stacked tour file is binary or too large: ${resolvedPath}`);
|
|
1683
|
+
}
|
|
1684
|
+
return [];
|
|
1675
1685
|
}
|
|
1676
|
-
|
|
1686
|
+
fileContentBytes += Buffer.byteLength(content.content);
|
|
1687
|
+
panels.push({
|
|
1677
1688
|
id: entry.id,
|
|
1678
1689
|
label: `${entry.label} / ${resolvedPath}`,
|
|
1679
1690
|
path: resolvedPath,
|
|
1680
1691
|
content: content.content,
|
|
1681
1692
|
exists: true
|
|
1682
|
-
};
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
totalContentBytes += fileContentBytes;
|
|
1696
|
+
if (totalContentBytes > DEFAULT_MAX_STACK_CONTENT_BYTES) {
|
|
1697
|
+
throw new Error(`Stacked tour content exceeds ${DEFAULT_MAX_STACK_CONTENT_BYTES} bytes.`);
|
|
1698
|
+
}
|
|
1699
|
+
return [{ path: filePath, panels }];
|
|
1685
1700
|
});
|
|
1686
1701
|
const stackIds = stack.map((entry) => entry.id);
|
|
1687
1702
|
return {
|
|
@@ -1695,7 +1710,7 @@ function buildStackedScene(repoRoot, source) {
|
|
|
1695
1710
|
stack,
|
|
1696
1711
|
files,
|
|
1697
1712
|
steps: source.steps.map((step) => {
|
|
1698
|
-
var
|
|
1713
|
+
var _a, _b;
|
|
1699
1714
|
return {
|
|
1700
1715
|
id: step.id,
|
|
1701
1716
|
title: step.title,
|
|
@@ -1703,7 +1718,7 @@ function buildStackedScene(repoRoot, source) {
|
|
|
1703
1718
|
file: step.file,
|
|
1704
1719
|
pairIndex: stackIds.indexOf(step.pair[0]),
|
|
1705
1720
|
side: step.side || "right",
|
|
1706
|
-
startLine: (
|
|
1721
|
+
startLine: (_a = step.lines) == null ? void 0 : _a[0],
|
|
1707
1722
|
endLine: (_b = step.lines) == null ? void 0 : _b[1]
|
|
1708
1723
|
};
|
|
1709
1724
|
})
|