Skip to content

Commit 7392a1a

Browse files
committed
chore(example-app): update project configuration and dependencies
- Modified package.json to update dependencies - Renamed vite.config.ts to vite.config.mjs for compatibility - Updated App.tsx and yarn.lock for new features
1 parent b0cf594 commit 7392a1a

File tree

4 files changed

+751
-563
lines changed

4 files changed

+751
-563
lines changed

example/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"license": "MIT",
66
"private": true,
77
"dependencies": {
8-
"@types/jest": "^29.5.0",
9-
"@types/node": "^18.15.9",
10-
"@types/react": "^18.0.29",
11-
"@types/react-dom": "^18.0.11",
8+
"@types/jest": "^29.5.14",
9+
"@types/node": "^22.10.2",
10+
"@types/react": "^19.0.2",
11+
"@types/react-dom": "^19.0.2",
1212
"prop-types": "^15.8.1",
1313
"react": "link:../node_modules/react",
1414
"react-dom": "link:../node_modules/react-dom",
1515
"react-editext": "link:..",
16-
"react-syntax-highlighter": "^15.5.0",
17-
"styled-components": "^5.3.9",
18-
"typescript": "^5.0.2"
16+
"react-syntax-highlighter": "^15.6.1",
17+
"styled-components": "^6.1.13",
18+
"typescript": "^5.7.2"
1919
},
2020
"scripts": {
2121
"dev": "vite",
@@ -31,11 +31,11 @@
3131
],
3232
"snyk": true,
3333
"devDependencies": {
34-
"@types/react-syntax-highlighter": "^15.5.6",
35-
"@types/styled-components": "^5.1.26",
36-
"@vitejs/plugin-react": "^3.1.0",
37-
"vite": "^4.2.1",
38-
"vite-plugin-checker": "^0.5.6",
39-
"vite-plugin-env-compatible": "^1.1.1"
34+
"@types/react-syntax-highlighter": "^15.5.13",
35+
"@types/styled-components": "^5.1.34",
36+
"@vitejs/plugin-react": "^4.3.4",
37+
"vite": "^6.0.6",
38+
"vite-plugin-checker": "^0.8.0",
39+
"vite-plugin-env-compatible": "^2.0.1"
4040
}
4141
}

example/src/App.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { ChangeEvent, useState } from 'react'
2-
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
1+
import React, { ChangeEvent, useState } from 'react'
2+
import { Prism, SyntaxHighlighterProps } from 'react-syntax-highlighter'
33
import EdiText, { InputProps } from 'react-editext'
44
import styled from 'styled-components'
55
import * as examples from './_examples'
66

7+
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/539
8+
const SyntaxHighlighter =
9+
Prism as typeof React.Component<SyntaxHighlighterProps>
10+
711
const StyledEdiText = styled(EdiText)`
812
button {
913
border-radius: 5px;
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import react from '@vitejs/plugin-react'
2-
import path from 'path'
2+
import { fileURLToPath } from 'url'
33
import { defineConfig } from 'vite'
44
import checker from 'vite-plugin-checker'
55
import envCompatible from 'vite-plugin-env-compatible'
6+
import path from 'node:path'
67

8+
const __filename = fileURLToPath(import.meta.url)
9+
const __dirname = path.dirname(__filename)
710
// https://vitejs.dev/config/
811
export default defineConfig(({ mode }) => {
912
return {
@@ -15,10 +18,10 @@ export default defineConfig(({ mode }) => {
1518
}),
1619
checker({
1720
overlay: false,
18-
typescript: true,
19-
eslint: {
20-
lintCommand: 'eslint "./src/**/*.{ts,tsx}"'
21-
}
21+
typescript: true
22+
// eslint: {
23+
// lintCommand: 'eslint "./src/**/*.{ts,tsx}"'
24+
// }
2225
})
2326
],
2427
resolve: {

0 commit comments

Comments
 (0)