@davmash/bygone 0.8.8 → 0.8.11

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.
@@ -2624,6 +2624,7 @@ __export(gitComparison_exports, {
2624
2624
  listBranchCommits: () => listBranchCommits,
2625
2625
  listChangedPaths: () => listChangedPaths,
2626
2626
  materializeBranchReviewTrees: () => materializeBranchReviewTrees,
2627
+ materializeGitTree: () => materializeGitTree,
2627
2628
  parseNameStatusZ: () => parseNameStatusZ,
2628
2629
  resolveBranchReviewRange: () => resolveBranchReviewRange,
2629
2630
  resolveReviewPathPair: () => resolveReviewPathPair
@@ -2764,6 +2765,15 @@ function materializeBranchReviewTrees(review, leftRoot, rightRoot) {
2764
2765
  }
2765
2766
  }
2766
2767
  }
2768
+ function materializeGitTree(repoRoot, relativeDir, targetRoot, commit = "HEAD") {
2769
+ for (const relativeFile of listGitBlobPaths(repoRoot, commit, relativeDir)) {
2770
+ writeMaterializedGitFile(
2771
+ targetRoot,
2772
+ relativeFile,
2773
+ readGitBlob(repoRoot, commit, relativeFile)
2774
+ );
2775
+ }
2776
+ }
2767
2777
  function resolveReviewPathPair(changedPaths, selectedPath) {
2768
2778
  const changedPath = changedPaths.find((candidate) => candidate.path === selectedPath || candidate.previousPath === selectedPath);
2769
2779
  if (!changedPath) {
@@ -2805,21 +2815,90 @@ function tryRunGit(runGit2, args, cwd) {
2805
2815
  }
2806
2816
  }
2807
2817
  function materializeGitPath(repoRoot, commit, relativePath, targetRoot) {
2808
- if (!relativePath) {
2818
+ if (!relativePath || !isGitBlobPath(repoRoot, commit, relativePath)) {
2809
2819
  return;
2810
2820
  }
2821
+ writeMaterializedGitFile(targetRoot, relativePath, readGitBlob(repoRoot, commit, relativePath));
2822
+ }
2823
+ function writeMaterializedGitFile(targetRoot, relativePath, content) {
2811
2824
  const resolvedRoot = path7.resolve(targetRoot);
2812
2825
  const targetFile = path7.resolve(resolvedRoot, relativePath);
2813
2826
  if (targetFile !== resolvedRoot && !targetFile.startsWith(`${resolvedRoot}${path7.sep}`)) {
2814
2827
  throw new Error(`Refusing to materialize path outside review root: ${relativePath}`);
2815
2828
  }
2816
- const content = (0, import_child_process3.execFileSync)("git", ["show", `${commit}:${relativePath}`], {
2829
+ fs6.mkdirSync(path7.dirname(targetFile), { recursive: true });
2830
+ fs6.writeFileSync(targetFile, content);
2831
+ }
2832
+ function listGitBlobPaths(repoRoot, commit, relativeDir) {
2833
+ if (commit === "INDEX") {
2834
+ const args2 = ["ls-files", "--stage", "-z", "--"];
2835
+ if (relativeDir) {
2836
+ args2.push(relativeDir);
2837
+ }
2838
+ return parseNulRecords(runGitText(repoRoot, args2)).flatMap((record) => {
2839
+ const parsed = parseIndexStageRecord(record);
2840
+ return parsed && parsed.mode !== GITLINK_MODE ? [parsed.path] : [];
2841
+ });
2842
+ }
2843
+ const args = ["ls-tree", "-r", "-z", commit];
2844
+ if (relativeDir) {
2845
+ args.push("--", relativeDir);
2846
+ }
2847
+ return parseNulRecords(runGitText(repoRoot, args)).flatMap((record) => {
2848
+ const parsed = parseLsTreeRecord(record);
2849
+ return parsed && parsed.type === "blob" ? [parsed.path] : [];
2850
+ });
2851
+ }
2852
+ function isGitBlobPath(repoRoot, commit, relativePath) {
2853
+ if (commit === "INDEX") {
2854
+ return listGitBlobPaths(repoRoot, commit, relativePath).includes(relativePath);
2855
+ }
2856
+ const parsed = parseLsTreeRecord(parseNulRecords(runGitText(repoRoot, ["ls-tree", "-z", commit, "--", relativePath]))[0] ?? "");
2857
+ return parsed?.type === "blob";
2858
+ }
2859
+ function parseNulRecords(output) {
2860
+ return output.split("\0").filter((record) => record.length > 0);
2861
+ }
2862
+ function parseLsTreeRecord(record) {
2863
+ const tab = record.indexOf(" ");
2864
+ if (tab === -1) {
2865
+ return void 0;
2866
+ }
2867
+ const type = record.slice(0, tab).split(" ")[1];
2868
+ const relativePath = record.slice(tab + 1);
2869
+ if (!type || !relativePath) {
2870
+ return void 0;
2871
+ }
2872
+ return { type, path: relativePath };
2873
+ }
2874
+ function parseIndexStageRecord(record) {
2875
+ const tab = record.indexOf(" ");
2876
+ if (tab === -1) {
2877
+ return void 0;
2878
+ }
2879
+ const mode = record.slice(0, tab).split(" ")[0];
2880
+ const relativePath = record.slice(tab + 1);
2881
+ if (!mode || !relativePath) {
2882
+ return void 0;
2883
+ }
2884
+ return { mode, path: relativePath };
2885
+ }
2886
+ function readGitBlob(repoRoot, commit, relativePath) {
2887
+ const spec = commit && commit !== "INDEX" ? `${commit}:${relativePath}` : `:${relativePath}`;
2888
+ return (0, import_child_process3.execFileSync)("git", ["show", spec], {
2817
2889
  cwd: repoRoot,
2890
+ encoding: "buffer",
2891
+ maxBuffer: readGitMaxBuffer(),
2892
+ stdio: ["ignore", "pipe", "pipe"]
2893
+ });
2894
+ }
2895
+ function runGitText(repoRoot, args) {
2896
+ return (0, import_child_process3.execFileSync)("git", [...args], {
2897
+ cwd: repoRoot,
2898
+ encoding: "utf8",
2818
2899
  maxBuffer: readGitMaxBuffer(),
2819
2900
  stdio: ["ignore", "pipe", "pipe"]
2820
2901
  });
2821
- fs6.mkdirSync(path7.dirname(targetFile), { recursive: true });
2822
- fs6.writeFileSync(targetFile, content);
2823
2902
  }
2824
2903
  function changeKindForStatus(code) {
2825
2904
  if (code === "A") {
@@ -2843,7 +2922,7 @@ function readGitMaxBuffer() {
2843
2922
  const parsed = Number.parseInt(process.env.BYGONE_GIT_MAX_BUFFER_BYTES ?? "", 10);
2844
2923
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_GIT_MAX_BUFFER_BYTES2;
2845
2924
  }
2846
- var import_child_process3, fs6, path7, DEFAULT_GIT_MAX_BUFFER_BYTES2;
2925
+ var import_child_process3, fs6, path7, DEFAULT_GIT_MAX_BUFFER_BYTES2, GITLINK_MODE;
2847
2926
  var init_gitComparison = __esm({
2848
2927
  "src/gitComparison.ts"() {
2849
2928
  "use strict";
@@ -2851,6 +2930,7 @@ var init_gitComparison = __esm({
2851
2930
  fs6 = __toESM(require("fs"));
2852
2931
  path7 = __toESM(require("path"));
2853
2932
  DEFAULT_GIT_MAX_BUFFER_BYTES2 = 64 * 1024 * 1024;
2933
+ GITLINK_MODE = "160000";
2854
2934
  }
2855
2935
  });
2856
2936
 
@@ -2886,6 +2966,12 @@ var require_navigationUtils = __commonJS({
2886
2966
  }
2887
2967
  return matches[0].index;
2888
2968
  }
2969
+ function findMultiPanelChangeIndex(changes, pairIndex, blockIndex) {
2970
+ if (!Array.isArray(changes) || !Number.isInteger(pairIndex) || !Number.isInteger(blockIndex)) {
2971
+ return -1;
2972
+ }
2973
+ return changes.findIndex((change) => change.pairIndex === pairIndex && change.blockIndex === blockIndex);
2974
+ }
2889
2975
  function buildBlockChanges(blocks, side) {
2890
2976
  if (!Array.isArray(blocks) || side !== "left" && side !== "right") {
2891
2977
  return [];
@@ -2957,6 +3043,7 @@ var require_navigationUtils = __commonJS({
2957
3043
  buildDirectoryNavigationState: buildDirectoryNavigationState2,
2958
3044
  containsModelLine,
2959
3045
  findChangeIndexAtLine,
3046
+ findMultiPanelChangeIndex,
2960
3047
  resolveFileNavigationAction
2961
3048
  };
2962
3049
  }
@@ -5198,7 +5285,7 @@ var require_changeTour = __commonJS({
5198
5285
  const stack = source.stack.map((entry) => ({
5199
5286
  id: entry.id,
5200
5287
  ref: entry.ref,
5201
- oid: runGitText(repoRoot, ["rev-parse", "--verify", `${entry.ref}^{commit}`]),
5288
+ oid: runGitText2(repoRoot, ["rev-parse", "--verify", `${entry.ref}^{commit}`]),
5202
5289
  label: entry.label || entry.ref
5203
5290
  }));
5204
5291
  const adjacentChanges = stack.slice(0, -1).map((entry, index) => parseNameStatusZ2((0, import_child_process4.execFileSync)("git", [
@@ -5302,7 +5389,7 @@ var require_changeTour = __commonJS({
5302
5389
  return false;
5303
5390
  }
5304
5391
  }
5305
- function runGitText(repoRoot, args) {
5392
+ function runGitText2(repoRoot, args) {
5306
5393
  return (0, import_child_process4.execFileSync)("git", args, {
5307
5394
  cwd: repoRoot,
5308
5395
  encoding: "utf8",
@@ -9210,7 +9297,7 @@ var require_package = __commonJS({
9210
9297
  displayName: "Bygone",
9211
9298
  desktopName: "com.davidmashburn.bygone.desktop",
9212
9299
  description: "See how change happened. Visual diff and file history for VS Code.",
9213
- version: "0.8.8",
9300
+ version: "0.8.11",
9214
9301
  author: "David Mashburn",
9215
9302
  license: "MIT",
9216
9303
  private: false,
@@ -9418,8 +9505,10 @@ var require_package = __commonJS({
9418
9505
  "bundle:check": "node ./scripts/check-bundle-size.mjs",
9419
9506
  "security:audit": "npm audit --audit-level=high",
9420
9507
  "dev:sync": "node ./scripts/dev-sync.mjs",
9508
+ reinstall: "node ./scripts/dev-sync.mjs --install-only",
9421
9509
  "release:check": "npm run security:audit && npm test && npm run bundle:check && npm run lint && npm run package:vsix && npm run package:npm && npm run package:npm:dry-run",
9422
9510
  "release:build": "node ./scripts/release.mjs",
9511
+ "release:publish:npm": "npm publish ./dist/npm-package --access public",
9423
9512
  "release:publish": "node ./scripts/release.mjs --publish",
9424
9513
  "release:verify-macos": "node ./scripts/verify-macos-signing.mjs --require-notarized",
9425
9514
  lint: "eslint . --max-warnings=0",
@@ -22440,7 +22529,7 @@ var { detectRipgrepCapability: detectRipgrepCapability2, startRepositorySearch:
22440
22529
  var { buildRepositoryReplacementPlan: buildRepositoryReplacementPlan2, applyRepositoryReplacementPlan: applyRepositoryReplacementPlan2, undoRepositoryReplacementPlan: undoRepositoryReplacementPlan2 } = (init_repositoryReplace(), __toCommonJS(repositoryReplace_exports));
22441
22530
  var { searchFileHistory: searchFileHistory2 } = (init_gitHistorySearch(), __toCommonJS(gitHistorySearch_exports));
22442
22531
  var { classifyAuthoredTourPaths: classifyAuthoredTourPaths2, discoverAuthoredTourDocument: discoverAuthoredTourDocument2 } = (init_tourDocument(), __toCommonJS(tourDocument_exports));
22443
- var { materializeBranchReviewTrees: materializeBranchReviewTrees2, resolveBranchReviewRange: resolveBranchReviewRange2, resolveReviewPathPair: resolveReviewPathPair2 } = (init_gitComparison(), __toCommonJS(gitComparison_exports));
22532
+ var { materializeBranchReviewTrees: materializeBranchReviewTrees2, materializeGitTree: materializeGitTree2, resolveBranchReviewRange: resolveBranchReviewRange2, resolveReviewPathPair: resolveReviewPathPair2 } = (init_gitComparison(), __toCommonJS(gitComparison_exports));
22444
22533
  var { buildDirectoryNavigationState } = require_navigationUtils();
22445
22534
  var { getMenuCapabilities } = require_menuUtils();
22446
22535
  var {
@@ -24297,14 +24386,14 @@ function resolveGitRefForDiff(repoRoot, ref) {
24297
24386
  }
24298
24387
  function materializeGitDiffSource(repoRoot, source, targetRoot) {
24299
24388
  if (source.kind === "index") {
24300
- materializeGitTree(repoRoot, "", targetRoot, "INDEX");
24389
+ materializeGitTree2(repoRoot, "", targetRoot, "INDEX");
24301
24390
  return;
24302
24391
  }
24303
24392
  if (source.kind === "worktree") {
24304
24393
  materializeWorkingTree(repoRoot, "", targetRoot);
24305
24394
  return;
24306
24395
  }
24307
- materializeGitTree(repoRoot, "", targetRoot, source.sha);
24396
+ materializeGitTree2(repoRoot, "", targetRoot, source.sha);
24308
24397
  }
24309
24398
  function getGitDiffSourceLabel(source) {
24310
24399
  if (source.label) {
@@ -24555,35 +24644,6 @@ function hasUnstagedDirectoryChanges(repoRoot, relativeDir) {
24555
24644
  const output = runGit(["status", "--porcelain", "--", relativeDir || "."], repoRoot);
24556
24645
  return output.split("\n").some((line) => line.length >= 2 && line[1] !== " ");
24557
24646
  }
24558
- function materializeGitTree(repoRoot, relativeDir, targetRoot, commit = "HEAD") {
24559
- let files;
24560
- if (commit === "INDEX") {
24561
- const lsArgs = ["ls-files", "-z", "--"];
24562
- if (relativeDir) {
24563
- lsArgs.push(relativeDir);
24564
- }
24565
- files = execFileSync4("git", lsArgs, {
24566
- cwd: repoRoot,
24567
- encoding: "utf8",
24568
- maxBuffer: GIT_MAX_BUFFER_BYTES2
24569
- }).split("\0").filter((filePath) => filePath.length > 0);
24570
- } else {
24571
- const lsArgs = ["ls-tree", "-r", "-z", "--name-only", commit];
24572
- if (relativeDir) {
24573
- lsArgs.push("--", relativeDir);
24574
- }
24575
- files = execFileSync4("git", lsArgs, {
24576
- cwd: repoRoot,
24577
- encoding: "utf8",
24578
- maxBuffer: GIT_MAX_BUFFER_BYTES2
24579
- }).split("\0").filter((filePath) => filePath.length > 0);
24580
- }
24581
- for (const relativeFile of files) {
24582
- const targetFile = path8.join(targetRoot, relativeFile);
24583
- fs7.mkdirSync(path8.dirname(targetFile), { recursive: true });
24584
- fs7.writeFileSync(targetFile, readGitBlob(repoRoot, commit === "INDEX" ? "" : commit, relativeFile));
24585
- }
24586
- }
24587
24647
  function materializeWorkingTree(repoRoot, relativeDir, targetRoot) {
24588
24648
  const lsArgs = ["ls-files", "-co", "-z", "--exclude-standard"];
24589
24649
  if (relativeDir) {
@@ -24733,7 +24793,8 @@ async function sendCurrentDirectoryHistoryEntry() {
24733
24793
  activePairIndex: pairs.length > 0 ? pairs.length - 1 : null,
24734
24794
  history: { ...history, fileName: relativePath },
24735
24795
  fileNavigation: buildDirectoryHistoryFileNavigationState(session.dirHistory, entry),
24736
- canReturnToDirectory: true
24796
+ canReturnToDirectory: true,
24797
+ revealFirstChangeInEachPanel: true
24737
24798
  });
24738
24799
  refreshSessionWindowTitle();
24739
24800
  if (launchArguments.kind === "smoke-directory-history") {
@@ -24870,14 +24931,14 @@ function ensureDirectoryHistoryEntryMaterialized(dirHistory, index) {
24870
24931
  const leftRoot = fs7.mkdtempSync(path8.join(os.tmpdir(), "bygone-dir-left-"));
24871
24932
  const rightRoot = fs7.mkdtempSync(path8.join(os.tmpdir(), "bygone-dir-right-"));
24872
24933
  if (entry.commit === "WORKTREE") {
24873
- materializeGitTree(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24934
+ materializeGitTree2(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24874
24935
  materializeWorkingTree(dirHistory.repoRoot, dirHistory.relativeDir, rightRoot);
24875
24936
  } else if (entry.commit === "INDEX") {
24876
- materializeGitTree(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24877
- materializeGitTree(dirHistory.repoRoot, dirHistory.relativeDir, rightRoot, "INDEX");
24937
+ materializeGitTree2(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24938
+ materializeGitTree2(dirHistory.repoRoot, dirHistory.relativeDir, rightRoot, "INDEX");
24878
24939
  } else {
24879
- materializeGitTree(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24880
- materializeGitTree(dirHistory.repoRoot, dirHistory.relativeDir, rightRoot, entry.commit);
24940
+ materializeGitTree2(dirHistory.repoRoot, dirHistory.relativeDir, leftRoot, entry.parentCommit);
24941
+ materializeGitTree2(dirHistory.repoRoot, dirHistory.relativeDir, rightRoot, entry.commit);
24881
24942
  }
24882
24943
  const leftDir = path8.join(leftRoot, dirHistory.relativeDir);
24883
24944
  const rightDir = path8.join(rightRoot, dirHistory.relativeDir);
@@ -25937,11 +25998,12 @@ async function sendCurrentMultiDiff() {
25937
25998
  canReturnToDirectory: Boolean(session.returnDirectory),
25938
25999
  directoryNavigation: buildDirectoryDrilldownNavigationState(),
25939
26000
  fileNavigation: buildStandaloneFileNavigationState(),
25940
- mutationEnabled: !isDirectoryDrilldown
26001
+ mutationEnabled: !isDirectoryDrilldown,
26002
+ revealFirstChangeInEachPanel: isDirectoryDrilldown
25941
26003
  });
25942
26004
  refreshSessionWindowTitle();
25943
26005
  if (mainWindow && !mainWindow.isDestroyed()) {
25944
- setTimeout(() => {
26006
+ const inspectMultiDiff = () => {
25945
26007
  void mainWindow.webContents.executeJavaScript(`(() => ({
25946
26008
  fileInfo: document.getElementById('file-info')?.textContent,
25947
26009
  panelCount: document.querySelectorAll('.multi-pane').length,
@@ -25955,6 +26017,11 @@ async function sendCurrentMultiDiff() {
25955
26017
  inlineAdjacentEdgeCount: document.querySelectorAll('.view-line span.bygone-paired-edge-left, .view-line span.bygone-one-sided-edge-left').length
25956
26018
  }))()`).then((snapshot) => {
25957
26019
  if (smokeTestMode) {
26020
+ const diffReady = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0;
26021
+ if (!diffReady) {
26022
+ setTimeout(inspectMultiDiff, 100);
26023
+ return;
26024
+ }
25958
26025
  finalizeSmokeTest(snapshot);
25959
26026
  return;
25960
26027
  }
@@ -25968,7 +26035,8 @@ async function sendCurrentMultiDiff() {
25968
26035
  app.exit(1);
25969
26036
  }
25970
26037
  });
25971
- }, 400);
26038
+ };
26039
+ setTimeout(inspectMultiDiff, smokeTestMode ? 100 : 400);
25972
26040
  }
25973
26041
  }
25974
26042
  async function sendCurrentSession() {
@@ -26054,10 +26122,15 @@ async function compareDirectoryHistoryTestFiles() {
26054
26122
  runGit(["init"], root);
26055
26123
  runGit(["config", "user.name", "Bygone Smoke Test"], root);
26056
26124
  runGit(["config", "user.email", "bygone-smoke@example.invalid"], root);
26057
- fs7.writeFileSync(filePath, "const alpha = 1;\nconst stable = true;\n", "utf8");
26125
+ const unchangedPrefix = Array.from({ length: 80 }, (_, index) => `const context${index} = true;`).join("\n");
26126
+ fs7.writeFileSync(filePath, `${unchangedPrefix}
26127
+ const alpha = 1;
26128
+ `, "utf8");
26058
26129
  runGit(["add", "history-smoke.js"], root);
26059
26130
  runGit(["commit", "-m", "initial"], root);
26060
- fs7.writeFileSync(filePath, "const alpha = 2;\nconst stable = false;\n", "utf8");
26131
+ fs7.writeFileSync(filePath, `${unchangedPrefix}
26132
+ const alpha = 2;
26133
+ `, "utf8");
26061
26134
  runGit(["add", "history-smoke.js"], root);
26062
26135
  runGit(["commit", "-m", "change history smoke fixture"], root);
26063
26136
  await openDirectoryHistory(root, false, { skipConfirm: true, source: { kind: "synthetic" } });
@@ -26072,9 +26145,11 @@ function pollDirectoryHistoryDrilldownSmoke() {
26072
26145
  changePosition: document.getElementById('change-position')?.textContent,
26073
26146
  panelPositions: [...document.querySelectorAll('.multi-pane-position')].map((element) => element.textContent),
26074
26147
  decoratedLineCount: document.querySelectorAll('.bygone-paired-line, .bygone-one-sided-line').length,
26148
+ visibleChangePaneCount: [...document.querySelectorAll('.multi-pane-content .view-lines')]
26149
+ .filter((element) => element.textContent.includes('alpha')).length,
26075
26150
  diffWorkerUrl: window.__BYGONE_HOST__?.diffWorkerUrl
26076
26151
  }))()`).then((snapshot) => {
26077
- const ready = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0;
26152
+ const ready = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && snapshot.visibleChangePaneCount === 2;
26078
26153
  if (ready) {
26079
26154
  finalizeSmokeTest(snapshot);
26080
26155
  return;
@@ -27406,12 +27481,6 @@ function parseGitHistoryRecords(logOutput) {
27406
27481
  };
27407
27482
  });
27408
27483
  }
27409
- function readGitBlob(repoRoot, commit, relativePath) {
27410
- return execFileSync4("git", ["show", `${commit}:${relativePath}`], {
27411
- cwd: repoRoot,
27412
- maxBuffer: GIT_MAX_BUFFER_BYTES2
27413
- });
27414
- }
27415
27484
  function getPathKind(filePath) {
27416
27485
  try {
27417
27486
  const stats = fs7.statSync(filePath);
@@ -27457,7 +27526,7 @@ function shellQuote(value) {
27457
27526
  function finalizeSmokeTest(snapshot) {
27458
27527
  clearTimeout(smokeTimeout);
27459
27528
  smokeTimeout = void 0;
27460
- const passed = Boolean(snapshot && (snapshot.fileInfo === "Comparing test-file-1.js and test-file-2.js" && snapshot.file1 === "test-file-1.js" && snapshot.file2 === "test-file-2.js" && /^1 \/ \d+$/.test(snapshot.changePosition) && snapshot.pairedLineCount > 0 && snapshot.oneSidedLineCount > 0 && snapshot.inlineHighlightCount > 0 && snapshot.activeDiffCount === 0 && isVisibleBackground(snapshot.pairedLineBackground) && isVisibleBackground(snapshot.inlineHighlightBackground) && snapshot.pairedLineBackground !== snapshot.inlineHighlightBackground || snapshot.fileInfo === `Comparing ${snapshot.panelCount} files` && snapshot.panelCount >= 2 && snapshot.gutterCount === snapshot.panelCount - 1 && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl) && snapshot.activeDiffCount === 0 && snapshot.adjacentEdgeCount === 0 && snapshot.inlineAdjacentEdgeCount === 0 || snapshot.directoryRailVisible === true && snapshot.directoryRailItemCount === 2 && snapshot.directoryReturnVisible === true && snapshot.directorySidebarToggleVisible === true && snapshot.directorySidebarToggleWorked === true && snapshot.nextFileEnabled === true || snapshot.directoryHistoryDrilldown === true && snapshot.fileInfo === "Comparing 2 files" && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl)));
27529
+ const passed = Boolean(snapshot && (snapshot.fileInfo === "Comparing test-file-1.js and test-file-2.js" && snapshot.file1 === "test-file-1.js" && snapshot.file2 === "test-file-2.js" && /^1 \/ \d+$/.test(snapshot.changePosition) && snapshot.pairedLineCount > 0 && snapshot.oneSidedLineCount > 0 && snapshot.inlineHighlightCount > 0 && snapshot.activeDiffCount === 0 && isVisibleBackground(snapshot.pairedLineBackground) && isVisibleBackground(snapshot.inlineHighlightBackground) && snapshot.pairedLineBackground !== snapshot.inlineHighlightBackground || snapshot.fileInfo === `Comparing ${snapshot.panelCount} files` && snapshot.panelCount >= 2 && snapshot.gutterCount === snapshot.panelCount - 1 && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl) && snapshot.activeDiffCount === 0 && snapshot.adjacentEdgeCount === 0 && snapshot.inlineAdjacentEdgeCount === 0 || snapshot.directoryRailVisible === true && snapshot.directoryRailItemCount === 2 && snapshot.directoryReturnVisible === true && snapshot.directorySidebarToggleVisible === true && snapshot.directorySidebarToggleWorked === true && snapshot.nextFileEnabled === true || snapshot.directoryHistoryDrilldown === true && snapshot.fileInfo === "Comparing 2 files" && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && snapshot.visibleChangePaneCount === 2 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl)));
27461
27530
  if (!passed) {
27462
27531
  console.error(`Bygone smoke test failed: unexpected diff DOM snapshot ${JSON.stringify(snapshot)}`);
27463
27532
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davmash/bygone",
3
- "version": "0.8.8",
3
+ "version": "0.8.11",
4
4
  "description": "See how change happened. Visual diff and file history.",
5
5
  "author": "David Mashburn",
6
6
  "license": "MIT",