Skip to content

Commit 24373a5

Browse files
improve build step
1 parent fbdcab5 commit 24373a5

File tree

13 files changed

+78
-66
lines changed

13 files changed

+78
-66
lines changed

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@
5252
"diff parse"
5353
],
5454
"dependencies": {
55+
"@git-diff-view/lowlight": "^0.0.14",
56+
"highlight.js": "^11.9.0",
5557
"lowlight": "^3.1.0"
5658
},
5759
"devDependencies": {
58-
"@git-diff-view/lowlight": "latest",
5960
"@types/hast": "^3.0.0"
6061
}
6162
}

packages/core/src/diff-file.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,13 @@ export class DiffFile {
396396
_newLength: Number(newNumLength),
397397
};
398398

399-
if (__DEV__ && typedI.isFirst && typedI.hunkInfo.oldStartIndex !== typedI.hunkInfo.newStartIndex) {
399+
if (
400+
__DEV__ &&
401+
typedI.isFirst &&
402+
typedI.hunkInfo.oldStartIndex &&
403+
typedI.hunkInfo.newStartIndex &&
404+
typedI.hunkInfo.oldStartIndex !== typedI.hunkInfo.newStartIndex
405+
) {
400406
console.warn("the first hunk should start with the same line number");
401407
}
402408

packages/file/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
"diff parse"
5353
],
5454
"dependencies": {
55+
"@git-diff-view/core": "v0.0.14",
5556
"diff": "^5.2.0",
57+
"highlight.js": "^11.9.0",
5658
"lowlight": "^3.1.0"
5759
},
5860
"devDependencies": {
59-
"@git-diff-view/core": "latest",
60-
"@git-diff-view/lowlight": "latest",
6161
"@types/diff": "^5.0.9",
6262
"@types/hast": "^3.0.0"
6363
}

packages/lowlight/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@
5252
"virtual dom highlight"
5353
],
5454
"dependencies": {
55+
"@types/hast": "^3.0.0",
5556
"highlight.js": "^11.9.0",
5657
"lowlight": "^3.1.0"
57-
},
58-
"devDependencies": {
59-
"@types/hast": "^3.0.0"
6058
}
6159
}

packages/react/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@
6060
"react diff component"
6161
],
6262
"dependencies": {
63+
"@git-diff-view/core": "v0.0.14",
6364
"@types/hast": "^3.0.0",
6465
"highlight.js": "^11.9.0",
6566
"lowlight": "^3.1.0",
6667
"reactivity-store": "^0.3.2",
6768
"use-sync-external-store": "^1.2.0"
6869
},
6970
"devDependencies": {
70-
"@git-diff-view/core": "latest",
7171
"@types/use-sync-external-store": "^0.0.3",
7272
"autoprefixer": "^10.4.19",
7373
"postcss": "^8.4.38",
@@ -76,13 +76,7 @@
7676
"tailwindcss": "^3.4.3"
7777
},
7878
"peerDependencies": {
79-
"@git-diff-view/core": "latest",
8079
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
8180
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
82-
},
83-
"peerDependenciesMeta": {
84-
"@git-diff-view/core": {
85-
"optional": true
86-
}
8781
}
8882
}

packages/react/src/components/DiffSplitViewNormal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { getSplitContentLines, type DiffFile } from "@git-diff-view/core";
33
import { Fragment, memo, useCallback, useEffect, useRef } from "react";
44
import * as React from "react";
5-
import { useSyncExternalStore } from "use-sync-external-store/shim";
5+
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
66

77
import { useDiffViewContext } from "..";
88
import { useTextWidth } from "../hooks/useTextWidth";

packages/react/src/components/DiffSplitViewWrap.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { Fragment, memo, useCallback, useMemo } from "react";
33
import * as React from "react";
44
import { flushSync } from "react-dom";
55
import { createStore, ref } from "reactivity-store";
6-
import { useSyncExternalStore } from "use-sync-external-store/shim";
6+
// SEE https://github.com/facebook/react/pull/25231
7+
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
78

89
import { useDiffViewContext, SplitSide, diffFontSizeName } from "..";
910
import { useTextWidth } from "../hooks/useTextWidth";

packages/react/src/components/DiffUnifiedView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getUnifiedContentLine } from "@git-diff-view/core";
33
import * as React from "react";
44
import { Fragment, memo, useEffect, useMemo, useCallback } from "react";
55
import { createStore, ref } from "reactivity-store";
6-
import { useSyncExternalStore } from "use-sync-external-store/shim";
6+
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
77

88
import { diffFontSizeName, useDiffViewContext, type SplitSide } from "..";
99
import { useTextWidth } from "../hooks/useTextWidth";

packages/vue/package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"types": "index.d.ts",
1010
"files": [
1111
"dist",
12-
"index.js",
12+
"index.cjs",
1313
"index.d.ts"
1414
],
1515
"repository": {
@@ -24,7 +24,7 @@
2424
"homepage": "https://github.com/MrWangJustToDo/git-diff-view",
2525
"exports": {
2626
".": {
27-
"require": "./index.js",
27+
"require": "./index.cjs",
2828
"types": "./index.d.ts",
2929
"import": "./dist/vue-git-diff-view.mjs"
3030
},
@@ -49,12 +49,12 @@
4949
"vue diff component"
5050
],
5151
"dependencies": {
52+
"@git-diff-view/core": "v0.0.14",
5253
"@types/hast": "^3.0.0",
5354
"highlight.js": "^11.9.0",
5455
"lowlight": "^3.1.0"
5556
},
5657
"devDependencies": {
57-
"@git-diff-view/core": "latest",
5858
"@rollup/plugin-typescript": "^11.1.6",
5959
"@vitejs/plugin-vue": "^5.0.4",
6060
"@vitejs/plugin-vue-jsx": "^3.1.0",
@@ -68,12 +68,6 @@
6868
"vue-tsc": "^1.8.27"
6969
},
7070
"peerDependencies": {
71-
"@git-diff-view/core": "latest",
7271
"vue": "^3"
73-
},
74-
"peerDependenciesMeta": {
75-
"@git-diff-view/core": {
76-
"optional": true
77-
}
7872
}
7973
}

0 commit comments

Comments
 (0)