Skip to content

Commit 8e74fe7

Browse files
update deps
1 parent 981421b commit 8e74fe7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2876
-3469
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@
2828
"@git-diff-view/react": "workspace:*",
2929
"@git-diff-view/vue": "workspace:*",
3030
"@git-diff-view/utils": "workspace:*",
31-
"@swc/core": "^1.7.40",
32-
"@types/lodash": "^4.17.13",
33-
"@types/node": "^22.8.5",
31+
"@swc/core": "^1.10.15",
32+
"@types/lodash": "^4.17.15",
33+
"@types/node": "^22.13.1",
3434
"@types/react": "^18.2.79",
3535
"@types/react-dom": "^18.2.25",
3636
"autoprefixer": "^10.4.20",
3737
"dts-bundle-generator": "^9.5.1",
3838
"eslint": "^8.57.0",
3939
"husky": "^8.0.2",
40-
"postcss": "^8.4.47",
40+
"postcss": "^8.5.1",
4141
"postcss-cli": "^11.0.0",
4242
"postcss-import": "^16.1.0",
43-
"postcss-prefix-selector": "^1.16.1",
44-
"prettier": "^3.3.3",
45-
"prettier-plugin-tailwindcss": "^0.6.8",
43+
"postcss-prefix-selector": "^2.1.0",
44+
"prettier": "^3.4.2",
45+
"prettier-plugin-tailwindcss": "^0.6.11",
4646
"project-tool": "https://github.com/MrWangJustToDo/project-tool.git",
4747
"rollup-plugin-postcss": "^4.0.2",
48-
"tailwindcss": "^3.4.14",
48+
"tailwindcss": "^3.4.17",
4949
"ts-node": "^10.9.2",
5050
"tslib": "^2.8.0",
5151
"typescript": "5.3.3"

packages/core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "@git-diff-view/core",
44
"author": "MrWangJustToDo",
55
"license": "MIT",
6-
"version": "0.0.25",
6+
"version": "0.0.26",
77
"main": "index.js",
88
"types": "index.d.ts",
99
"files": [
@@ -52,7 +52,7 @@
5252
"diff parse"
5353
],
5454
"dependencies": {
55-
"@git-diff-view/lowlight": "^0.0.25",
55+
"@git-diff-view/lowlight": "^0.0.26",
5656
"highlight.js": "^11.11.0",
5757
"lowlight": "^3.3.0",
5858
"fast-diff": "^1.3.0"

packages/core/src/diff-file-utils.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ export const getSplitContentLines = (diffFile: DiffFile): DiffSplitContentLineIt
6767

6868
const splitRightLine = diffFile.getSplitRightLine(index);
6969

70-
!splitLeftLine?.isHidden &&
71-
!splitRightLine?.isHidden &&
72-
splitLines.push({
73-
type: DiffFileLineType.content,
74-
index,
75-
lineNumber: index + 1,
76-
splitLine: { left: splitLeftLine, right: splitRightLine },
77-
});
70+
if (!splitLeftLine?.isHidden && !splitRightLine?.isHidden) {
71+
{
72+
splitLines.push({
73+
type: DiffFileLineType.content,
74+
index,
75+
lineNumber: index + 1,
76+
splitLine: { left: splitLeftLine, right: splitRightLine },
77+
});
78+
}
79+
}
7880
});
7981

8082
return splitLines;
@@ -106,8 +108,9 @@ export const getUnifiedContentLine = (diffFile: DiffFile): DiffUnifiedContentLin
106108
numIterator(unifiedLineLength, (index) => {
107109
const unifiedLine = diffFile.getUnifiedLine(index);
108110

109-
!unifiedLine.isHidden &&
111+
if (!unifiedLine.isHidden) {
110112
unifiedLines.push({ type: DiffFileLineType.content, index, lineNumber: index + 1, unifiedLine: unifiedLine });
113+
}
111114
});
112115

113116
return unifiedLines;

packages/core/src/diff-file.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,12 @@ export class DiffFile {
630630
if (this.#highlighterType === "class") return;
631631

632632
if (this.#composeByMerge && !this.#composeByFullMerge) {
633-
__DEV__ &&
633+
if (__DEV__) {
634634
console.error(
635635
`this instance can not do syntax because of the data missing, try to use '_getFullBundle' & '_mergeFullBundle' instead of 'getBundle' & 'mergeBundle'`
636636
);
637+
}
638+
637639
return;
638640
}
639641

@@ -1069,7 +1071,9 @@ export class DiffFile {
10691071
}
10701072
} else {
10711073
if (current.isLast) {
1072-
__DEV__ && console.error("the last hunk can not expand up!");
1074+
if (__DEV__) {
1075+
console.error("the last hunk can not expand up!");
1076+
}
10731077
return;
10741078
}
10751079
for (let i = current.splitInfo.endHiddenIndex - composeLen; i < current.splitInfo.endHiddenIndex; i++) {
@@ -1097,7 +1101,9 @@ export class DiffFile {
10971101
this.#splitHunksLines![current.splitInfo.endHiddenIndex] = current;
10981102
}
10991103

1100-
needTrigger && this.notifyAll();
1104+
if (needTrigger) {
1105+
this.notifyAll();
1106+
}
11011107
};
11021108

11031109
getUnifiedLine = (index: number) => {
@@ -1148,7 +1154,9 @@ export class DiffFile {
11481154
}
11491155
} else {
11501156
if (current.isLast) {
1151-
__DEV__ && console.error("the last hunk can not expand up!");
1157+
if (__DEV__) {
1158+
console.error("the last hunk can not expand up!");
1159+
}
11521160
return;
11531161
}
11541162
for (let i = current.unifiedInfo.endHiddenIndex - composeLen; i < current.unifiedInfo.endHiddenIndex; i++) {
@@ -1174,7 +1182,9 @@ export class DiffFile {
11741182
this.#unifiedHunksLines![current.unifiedInfo.endHiddenIndex] = current;
11751183
}
11761184

1177-
needTrigger && this.notifyAll();
1185+
if (needTrigger) {
1186+
this.notifyAll();
1187+
}
11781188
};
11791189

11801190
onAllExpand = (mode: "split" | "unified") => {
@@ -1455,7 +1465,7 @@ export class DiffFile {
14551465
_delClonedInstance = (instance: DiffFile) => {
14561466
const unsubscribe = this.#clonedInstance.get(instance);
14571467

1458-
unsubscribe && unsubscribe();
1468+
unsubscribe?.();
14591469

14601470
this.#clonedInstance.delete(instance);
14611471
};

packages/core/src/file.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,16 @@ export class File {
9595
const finalHighlighter = registerHighlighter || highlighter;
9696

9797
if (this.syntaxLength) {
98-
__DEV__ && console.error("current file already doSyntax before!");
98+
if (__DEV__) {
99+
console.error("current file already doSyntax before!");
100+
}
99101
return;
100102
}
101103

102104
if (this.rawLength > finalHighlighter.maxLineToIgnoreSyntax) {
103-
__DEV__ && console.warn(`ignore syntax for current file, because the rawLength is too long: ${this.rawLength}`);
105+
if (__DEV__) {
106+
console.warn(`ignore syntax for current file, because the rawLength is too long: ${this.rawLength}`);
107+
}
104108
return;
105109
}
106110

packages/file/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "@git-diff-view/file",
44
"author": "MrWangJustToDo",
55
"license": "MIT",
6-
"version": "0.0.25",
6+
"version": "0.0.26",
77
"main": "index.js",
88
"types": "index.d.ts",
99
"files": [
@@ -52,7 +52,7 @@
5252
"diff parse"
5353
],
5454
"dependencies": {
55-
"@git-diff-view/core": "^0.0.25",
55+
"@git-diff-view/core": "^0.0.26",
5656
"diff": "^7.0.0",
5757
"highlight.js": "^11.11.0",
5858
"lowlight": "^3.3.0",

packages/lowlight/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "@git-diff-view/lowlight",
44
"author": "MrWangJustToDo",
55
"license": "MIT",
6-
"version": "0.0.25",
6+
"version": "0.0.26",
77
"main": "index.js",
88
"types": "index.d.ts",
99
"files": [

packages/lowlight/src/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ Object.defineProperty(instance, "getAST", {
101101
let hasRegisteredLang = true;
102102

103103
if (!lowlight.registered(lang)) {
104-
__DEV__ && console.warn(`not support current lang: ${lang} yet`);
104+
if (__DEV__) {
105+
console.warn(`not support current lang: ${lang} yet`);
106+
}
105107
hasRegisteredLang = false;
106108
}
107109

@@ -111,10 +113,11 @@ Object.defineProperty(instance, "getAST", {
111113
item instanceof RegExp ? item.test(fileName) : fileName === item
112114
)
113115
) {
114-
__DEV__ &&
116+
if (__DEV__) {
115117
console.warn(
116118
`ignore syntax for current file, because the fileName is in the ignoreSyntaxHighlightList: ${fileName}`
117119
);
120+
}
118121
return;
119122
}
120123

packages/react/index.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -726,17 +726,17 @@ export type DiffViewProps_2<T> = Omit<DiffViewProps<T>, "data"> & {
726726
hunks: string[];
727727
};
728728
};
729-
declare function _DiffView<T>(props: DiffViewProps_1<T> & {
729+
declare function ReactDiffView<T>(props: DiffViewProps_1<T> & {
730730
ref?: ForwardedRef<{
731731
getDiffFileInstance: () => DiffFile;
732732
}>;
733-
}): ReactNode;
734-
declare function _DiffView<T>(props: DiffViewProps_2<T> & {
733+
}): JSX.Element;
734+
declare function ReactDiffView<T>(props: DiffViewProps_2<T> & {
735735
ref?: ForwardedRef<{
736736
getDiffFileInstance: () => DiffFile;
737737
}>;
738-
}): ReactNode;
739-
export declare const DiffView: typeof _DiffView;
738+
}): JSX.Element;
739+
export declare const DiffView: typeof ReactDiffView;
740740
export declare const version: string;
741741

742742
export {

packages/react/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "@git-diff-view/react",
44
"author": "MrWangJustToDo",
55
"license": "MIT",
6-
"version": "0.0.25",
6+
"version": "0.0.26",
77
"main": "index.js",
88
"types": "index.d.ts",
99
"files": [
@@ -66,7 +66,7 @@
6666
"react diff component"
6767
],
6868
"dependencies": {
69-
"@git-diff-view/core": "^0.0.25",
69+
"@git-diff-view/core": "^0.0.26",
7070
"@types/hast": "^3.0.0",
7171
"fast-diff": "^1.3.0",
7272
"highlight.js": "^11.11.0",
@@ -77,12 +77,12 @@
7777
"devDependencies": {
7878
"@types/use-sync-external-store": "^0.0.6",
7979
"autoprefixer": "^10.4.20",
80-
"postcss": "^8.4.47",
80+
"postcss": "^8.5.1",
8181
"react": "^18.0.0",
82-
"tailwindcss": "^3.4.14"
82+
"tailwindcss": "^3.4.17"
8383
},
8484
"peerDependencies": {
85-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
86-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
85+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
86+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
8787
}
8888
}

packages/react/src/components/DiffSplitContentLineNormal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { DiffContent } from "./DiffContent";
1616
import { useDiffViewContext } from "./DiffViewContext";
1717
import { useDiffWidgetContext } from "./DiffWidgetContext";
1818

19-
const _DiffSplitLine = ({
19+
const InternalDiffSplitLine = ({
2020
index,
2121
diffFile,
2222
lineNumber,
@@ -141,5 +141,5 @@ export const DiffSplitContentLine = ({
141141

142142
if (currentLine?.isHidden) return null;
143143

144-
return <_DiffSplitLine index={index} diffFile={diffFile} lineNumber={lineNumber} side={side} />;
144+
return <InternalDiffSplitLine index={index} diffFile={diffFile} lineNumber={lineNumber} side={side} />;
145145
};

packages/react/src/components/DiffSplitContentLineWrap.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ import { DiffContent } from "./DiffContent";
1616
import { useDiffViewContext } from "./DiffViewContext";
1717
import { useDiffWidgetContext } from "./DiffWidgetContext";
1818

19-
const _DiffSplitLine = ({ index, diffFile, lineNumber }: { index: number; diffFile: DiffFile; lineNumber: number }) => {
19+
const InternalDiffSplitLine = ({
20+
index,
21+
diffFile,
22+
lineNumber,
23+
}: {
24+
index: number;
25+
diffFile: DiffFile;
26+
lineNumber: number;
27+
}) => {
2028
const oldLine = diffFile.getSplitLeftLine(index);
2129

2230
const newLine = diffFile.getSplitRightLine(index);
@@ -203,5 +211,5 @@ export const DiffSplitContentLine = ({
203211

204212
if (oldLine?.isHidden && newLine?.isHidden) return null;
205213

206-
return <_DiffSplitLine index={index} diffFile={diffFile} lineNumber={lineNumber} />;
214+
return <InternalDiffSplitLine index={index} diffFile={diffFile} lineNumber={lineNumber} />;
207215
};

packages/react/src/components/DiffSplitExtendLineNormal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useDiffViewContext } from "./DiffViewContext";
99

1010
import type { DiffFile } from "@git-diff-view/core";
1111

12-
const _DiffSplitExtendLine = ({
12+
const InternalDiffSplitExtendLine = ({
1313
index,
1414
diffFile,
1515
oldLineExtend,
@@ -132,7 +132,7 @@ export const DiffSplitExtendLine = ({
132132
if (!currentIsShow) return null;
133133

134134
return (
135-
<_DiffSplitExtendLine
135+
<InternalDiffSplitExtendLine
136136
side={side}
137137
index={index}
138138
diffFile={diffFile}

packages/react/src/components/DiffSplitExtendLineWrap.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useDiffViewContext } from "./DiffViewContext";
77

88
import type { DiffFile } from "@git-diff-view/core";
99

10-
const _DiffSplitExtendLine = ({
10+
const InternalDiffSplitExtendLine = ({
1111
index,
1212
diffFile,
1313
lineNumber,
@@ -126,7 +126,7 @@ export const DiffSplitExtendLine = ({
126126
if (!currentIsShow) return null;
127127

128128
return (
129-
<_DiffSplitExtendLine
129+
<InternalDiffSplitExtendLine
130130
index={index}
131131
diffFile={diffFile}
132132
lineNumber={lineNumber}

0 commit comments

Comments
 (0)