Skip to content

Commit 23aa832

Browse files
committed
fix: fix several type issues and update packages
1 parent 17c51e6 commit 23aa832

18 files changed

+2876
-2396
lines changed

.github/workflows/release.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414
- name: Setup Node.js
15-
uses: actions/setup-node@v3
15+
uses: actions/setup-node@v4
1616
with:
1717
node-version: 'lts/*'
18-
- uses: pnpm/action-setup@v2.2.4
18+
- uses: pnpm/action-setup@v4
1919
with:
2020
version: latest
2121
- name: Install dependencies
@@ -29,14 +29,14 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
3535
- name: Setup Node.js
36-
uses: actions/setup-node@v3
36+
uses: actions/setup-node@v4
3737
with:
3838
node-version: 'lts/*'
39-
- uses: pnpm/action-setup@v2.2.4
39+
- uses: pnpm/action-setup@v4
4040
with:
4141
version: latest
4242
- name: Install dependencies
@@ -47,4 +47,4 @@ jobs:
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
4949
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50-
run: pnpm dlx semantic-release
50+
run: pnpm semantic-release

.travis.yml

-13
This file was deleted.

biome.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"formatter": {
3+
"indentStyle": "space",
4+
"indentWidth": 2
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"a11y": {
10+
"useKeyWithClickEvents": "off"
11+
}
12+
}
13+
}
14+
}

examples/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5-
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
5+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css" integrity="sha512-rt/SrQ4UNIaGfDyEXZtNcyWvQeOq0QLygHluFQcSjaGB04IxWhal71tKuzP6K8eYXYB6vJV4pHkXcmFGGQ1/0w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
66
<title>React Diff Viewer</title>
77
<meta name="author" content="Bart Riepe" />
88
<meta name="description" content="A simple and beautiful text diff viewer for React" />
@@ -18,8 +18,8 @@
1818
</head>
1919
<body>
2020
<div id="app"></div>
21-
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.min.js"></script>
22-
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/components/prism-json.min.js"></script>
21+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js" integrity="sha512-7Z9J3l1+EYfeaPKcGXu3MS/7T+w19WtKQY/n+xzmw4hZhJ9tyYmcUS+4QqAlzhicE5LAfMQSF3iFTK9bQdTxXg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
22+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-json.min.js" integrity="sha512-QXFMVAusM85vUYDaNgcYeU3rzSlc+bTV4JvkfJhjxSHlQEo+ig53BtnGkvFTiNJh8D+wv6uWAQ2vJaVmxe8d3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
2323
<script type="module" src="./src/index.tsx"></script>
2424
</body>
2525
</html>

examples/src/index.ejs

-40
This file was deleted.

examples/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class Example extends Component<{}, ExampleState> {
7575
};
7676

7777
public render(): JSX.Element {
78-
let oldValue: string | object = ''
79-
let newValue: string | object = '';
78+
let oldValue: string | Record<string, unknown> = ''
79+
let newValue: string | Record<string, unknown> = '';
8080
if (this.state.dataType === 'json') {
8181
oldValue = oldJson
8282
newValue = newJson

package.json

+29-21
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"Pranesh Ravi<[email protected]>",
2020
"Bart Riepe <[email protected]>"
2121
],
22+
"type": "module",
23+
"exports": {
24+
".": {
25+
"types": "./lib/cjs/src/index.d.ts",
26+
"import": "./lib/esm/src/index.js",
27+
"require": "./lib/cjs/src/index.js"
28+
}
29+
},
2230
"main": "lib/cjs/src/index",
2331
"module": "lib/esm/src/index",
2432
"typings": "lib/cjs/src/index",
@@ -28,43 +36,43 @@
2836
"publish:examples": "NODE_ENV=production pnpm run build:examples && gh-pages -d examples/dist -r $GITHUB_REPO_URL",
2937
"publish:examples:local": "NODE_ENV=production pnpm run build:examples && gh-pages -d examples/dist",
3038
"start:examples": "vite examples",
39+
"dev": "vite dev examples",
3140
"test": "vitest",
32-
"lint": "biome lint src/ test/",
33-
"lint:fix": "biome lint --apply-unsafe src/ test/",
34-
"prettier": "prettier --write ."
41+
"check": "biome check src/ test/",
42+
"check:fix": "biome check --write --unsafe src/ test/"
3543
},
3644
"dependencies": {
37-
"@emotion/css": "^11.11.2",
38-
"classnames": "^2.3.2",
45+
"@emotion/css": "^11.13.5",
46+
"@emotion/react": "^11.14.0",
47+
"classnames": "^2.5.1",
3948
"diff": "^5.2.0",
4049
"memoize-one": "^6.0.0"
4150
},
4251
"devDependencies": {
43-
"@biomejs/biome": "^1.5.3",
52+
"@biomejs/biome": "^1.9.4",
4453
"@semantic-release/changelog": "6.0.1",
4554
"@semantic-release/git": "10.0.1",
4655
"@testing-library/react": "^13.4.0",
47-
"@types/diff": "^5.0.6",
48-
"@types/memoize-one": "^5.1.2",
49-
"@types/node": "^20.11.17",
50-
"@types/react": "^18.2.55",
51-
"@types/react-dom": "^18.2.19",
56+
"@types/diff": "^5.2.3",
57+
"@types/node": "^20.17.16",
58+
"@types/react": "^18.3.18",
59+
"@types/react-dom": "^18.3.5",
5260
"gh-pages": "^5.0.0",
53-
"happy-dom": "^13.3.8",
54-
"react": "^18.2.0",
55-
"react-dom": "^18.2.0",
56-
"sass": "^1.70.0",
57-
"semantic-release": "^19.0.5",
58-
"ts-node": "^10.9.1",
59-
"typescript": "^5.2.2",
60-
"vite": "^5.1.1",
61-
"vitest": "^1.2.2"
61+
"happy-dom": "^13.10.1",
62+
"react": "^18.3.1",
63+
"react-dom": "^18.3.1",
64+
"sass": "^1.83.4",
65+
"semantic-release": "^24.2.1",
66+
"ts-node": "^10.9.2",
67+
"typescript": "^5.7.3",
68+
"vite": "^5.4.14",
69+
"vitest": "^3.0.4"
6270
},
6371
"peerDependencies": {
6472
"react": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
6573
"react-dom": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
6674
},
6775
"engines": {
68-
"node": ">= 8"
76+
"node": ">= 16"
6977
}
7078
}

0 commit comments

Comments
 (0)