Skip to content

Commit 6efaeec

Browse files
committed
support for dolt diff
1 parent 482d5fe commit 6efaeec

24 files changed

+52
-74
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,7 @@ If you are upgrading from a version prior to 2.0.0, please note the changes to p
184184
## [2.3.0]
185185

186186
-- Added diff stats on commit click via the `getDiff` function.
187+
188+
## [2.3.1]
189+
190+
-- Add support for Dolt diff.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commit-graph",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"homepage": "https://liuliu-dev.github.io/CommitGraph/",
55
"author": "Liu Liu <[email protected]>",
66
"description": "A React component to visualize a commit graph.",
@@ -48,6 +48,7 @@
4848
"dependencies": {
4949
"@dolthub/react-hooks": "^0.1.7",
5050
"@dolthub/web-utils": "^0.1.5",
51+
"@rollup/plugin-typescript": "11.1.6",
5152
"classnames": "^2.3.2",
5253
"react": ">=18.0.0",
5354
"react-copy-to-clipboard": "^5.1.0",
@@ -61,7 +62,6 @@
6162
"@rollup/plugin-commonjs": "^28.0.0",
6263
"@rollup/plugin-node-resolve": "^15.2.3",
6364
"@rollup/plugin-terser": "^0.4.4",
64-
"@rollup/plugin-typescript": "^12.1.0",
6565
"@storybook/nextjs": "^8.0.0",
6666
"@storybook/react": "^8.0.0",
6767
"@types/react": "^18.2.57",

rollup.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import terser from "@rollup/plugin-terser";
66
import postcss from "rollup-plugin-postcss";
77
import peerDepsExternal from "rollup-plugin-peer-deps-external";
88

9-
const isProduction = process.env.NODE_ENV === "production";
10-
119
const packageJson = require("./package.json");
1210

1311
export default [

src/components/BranchLabel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import ReactPopup from "reactjs-popup";
33
import css from "./index.module.css";
4-
import { Branch } from "../../helpers/types";
4+
import { Branch } from "../../types";
55
import cx from "classnames";
66

77
type ItemProps = {

src/components/Branches/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { BranchPathType, CommitNode } from "../../helpers/types";
2+
import { BranchPathType, CommitNode } from "../../types";
33
import BranchPath from "./BranchPath";
44

55
type Props = {

src/components/CommitDetails/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useRef, useState } from "react";
2-
import { Branch, CommitNode, Diff } from "../../helpers/types";
2+
import { Branch, CommitNode, Diff } from "../../types";
33
import BranchLabel from "../BranchLabel";
44
import { excerpt } from "@dolthub/web-utils";
55
import css from "./index.module.css";
@@ -18,6 +18,7 @@ type Props = {
1818
fullSha?: boolean;
1919
clicked?: boolean;
2020
getDiff?: (base: string, head: string) => Promise<Diff | undefined>;
21+
forDolt?: boolean;
2122
};
2223

2324
export default function CommitDetails({
@@ -31,6 +32,7 @@ export default function CommitDetails({
3132
fullSha,
3233
clicked,
3334
getDiff,
35+
forDolt
3436
}: Props) {
3537
const date = dateFormatFn
3638
? dateFormatFn(commit.commitDate)
@@ -98,7 +100,7 @@ export default function CommitDetails({
98100
</div>
99101
{showDiff && clicked && !!getDiff && (
100102
<div className={css.diffSection} ref={diffRef}>
101-
<DiffSection commit={commit} getDiff={getDiff} />
103+
<DiffSection commit={commit} getDiff={getDiff} forDolt={forDolt}/>
102104
</div>
103105
)}
104106
</>

src/components/CommitDot/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { CommitNode } from "../../helpers/types";
2+
import { CommitNode } from "../../types";
33
import { convertColorToMatrixVariant } from "../../helpers/utils";
44
import { getCommitDotPosition } from "./utils";
55

src/components/CommitDot/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CommitNode } from "../../helpers/types";
1+
import { CommitNode } from "../../types";
22

33
export function getCommitDotPosition(
44
branchSpacing: number,

src/components/CommitGraph/WithInfiniteScroll.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CommitNode,
77
Diff,
88
GraphStyle,
9-
} from "../../helpers/types";
9+
} from "../../types";
1010
import InfiniteScroll from "react-infinite-scroller";
1111
import css from "./index.module.css";
1212

src/components/CommitGraph/computePosition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BranchPathType, CommitNode } from "../../helpers/types";
1+
import { BranchPathType, CommitNode } from "../../types";
22

33
function topologicalOrderCommits(
44
commits: CommitNode[],

0 commit comments

Comments
 (0)