Skip to content

Commit 8a4e726

Browse files
committed
Upgrade dependencies
1 parent 92e51b6 commit 8a4e726

11 files changed

Lines changed: 1153 additions & 991 deletions

File tree

package.json

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,35 @@
1111
"format": "prettier --write '**/*.ts' '**/*.tsx' '**/*.css'"
1212
},
1313
"dependencies": {
14-
"react": "^18.3.1",
15-
"react-dom": "^18.3.1",
16-
"@monaco-editor/react": "^4.6.0",
1714
"@catppuccin/palette": "^1.7.1",
15+
"@monaco-editor/react": "^4.8.0-rc.3",
1816
"copy-to-clipboard": "^3.3.3",
1917
"history": "^5.3.0",
20-
"monaco-editor": "^0.52.0",
21-
"monaco-themes": "^0.4.4",
18+
"monaco-editor": "^0.55.1",
19+
"monaco-themes": "^0.4.8",
2220
"pako": "^2.1.0",
21+
"react": "^19.2.4",
2322
"react-device-detect": "^2.2.3",
24-
"styled-components": "^6.1.13",
25-
"whatwg-mimetype": "^3.0.0"
23+
"react-dom": "^19.2.4",
24+
"styled-components": "^6.3.11",
25+
"whatwg-mimetype": "^5.0.0"
2626
},
2727
"devDependencies": {
28-
"@eslint/js": "^9.17.0",
29-
"@types/react": "^18.3.18",
30-
"@types/react-dom": "^18.3.5",
31-
"@types/pako": "^2.0.3",
28+
"@eslint/js": "^10.0.1",
29+
"@types/node": "^25.3.0",
30+
"@types/pako": "^2.0.4",
31+
"@types/react": "^19.2.14",
32+
"@types/react-dom": "^19.2.3",
3233
"@types/whatwg-mimetype": "^3.0.2",
33-
"@vitejs/plugin-react-swc": "^3.5.0",
34-
"eslint": "^9.17.0",
35-
"eslint-plugin-react-hooks": "^5.0.0",
36-
"eslint-plugin-react-refresh": "^0.4.16",
37-
"globals": "^15.14.0",
38-
"typescript": "~5.6.2",
39-
"typescript-eslint": "^8.18.2",
40-
"vite": "^6.0.5",
41-
"prettier": "^3.4.2",
42-
"prettier-plugin-organize-imports": "^4.1.0"
34+
"@vitejs/plugin-react-swc": "^4.2.3",
35+
"eslint": "^10.0.1",
36+
"eslint-plugin-react-hooks": "^7.0.1",
37+
"eslint-plugin-react-refresh": "^0.5.2",
38+
"globals": "^17.3.0",
39+
"prettier": "^3.8.1",
40+
"prettier-plugin-organize-imports": "^4.3.0",
41+
"typescript": "~5.9.3",
42+
"typescript-eslint": "^8.56.1",
43+
"vite": "^7.3.1"
4344
}
4445
}

src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import About from './components/About.tsx';
44
import Editor from './components/Editor';
55
import usePreference from './hooks/usePreference.ts';
66
import themes, { Themes } from './style/themes.ts';
7-
import { loadFromBytebin } from './util/storage';
87
import { useQueryRouting } from './util/constants';
8+
import { loadFromBytebin } from './util/storage';
99

1010
const INITIAL = Symbol();
1111
const LOADING = Symbol();
@@ -33,6 +33,7 @@ export default function App() {
3333

3434
useEffect(() => {
3535
if (pasteId && state === INITIAL) {
36+
// eslint-disable-next-line react-hooks/set-state-in-effect
3637
setState(LOADING);
3738
setContent('Loading...');
3839

src/components/About.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ const AboutPanel = styled.div`
180180
span {
181181
color: ${props => props.theme.logo};
182182
}
183+
184+
a {
185+
color: ${props => props.theme.logo};
186+
}
183187
`;
184188

185189
const BannerContainer = styled.div`

src/components/Editor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default function Editor({
4848

4949
useEffect(() => {
5050
if (contentType) {
51+
// eslint-disable-next-line react-hooks/set-state-in-effect
5152
setLanguage(contentType);
5253
}
5354
}, [contentType]);
@@ -84,7 +85,7 @@ export default function Editor({
8485
fontSize={fontSize}
8586
readOnly={readOnly}
8687
wordWrap={wordWrap}
87-
resetFunction={resetFunction}
88+
resetFunctionRef={resetFunction}
8889
/>
8990
</>
9091
);

src/components/EditorControls.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { RefObject, useCallback, useEffect, useState } from 'react';
44
import styled from 'styled-components';
55

66
import themes, { Themes } from '../style/themes';
7+
import { useQueryRouting } from '../util/constants';
78
import { languages } from '../util/highlighting';
89
import { saveToBytebin } from '../util/storage';
9-
import { useQueryRouting } from '../util/constants';
1010
import Button from './Button';
1111
import { ResetFunction } from './Editor';
1212
import MenuButton from './MenuButton';
@@ -44,6 +44,7 @@ export default function EditorControls({
4444
const [recentlySaved, setRecentlySaved] = useState<boolean>(false);
4545

4646
useEffect(() => {
47+
// eslint-disable-next-line react-hooks/set-state-in-effect
4748
setRecentlySaved(false);
4849
}, [actualContent, language]);
4950

src/components/EditorTextArea.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ import Editor, {
55
OnMount,
66
} from '@monaco-editor/react';
77
import history from 'history/browser';
8-
import {
9-
MutableRefObject,
10-
RefObject,
11-
useCallback,
12-
useEffect,
13-
useRef,
14-
useState,
15-
} from 'react';
8+
import { RefObject, useCallback, useEffect, useRef, useState } from 'react';
169
import styled, { useTheme } from 'styled-components';
1710
import themes, { Theme } from '../style/themes';
1811

@@ -62,7 +55,7 @@ export interface EditorTextAreaProps {
6255
fontSize: number;
6356
readOnly: boolean;
6457
wordWrap: boolean;
65-
resetFunction: MutableRefObject<ResetFunction | null>;
58+
resetFunctionRef: RefObject<ResetFunction | null>;
6659
}
6760

6861
export default function EditorTextArea({
@@ -73,7 +66,7 @@ export default function EditorTextArea({
7366
fontSize,
7467
readOnly,
7568
wordWrap,
76-
resetFunction,
69+
resetFunctionRef,
7770
}: EditorTextAreaProps) {
7871
const [editor, setEditor] = useState<editor.IStandaloneCodeEditor>();
7972
const [monaco, setMonaco] = useState<Monaco>();
@@ -129,7 +122,7 @@ export default function EditorTextArea({
129122
setEditor(editor);
130123
setMonaco(monaco);
131124

132-
resetFunction.current = () => {
125+
resetFunctionRef.current = () => {
133126
editor.setValue('');
134127
editor.focus();
135128
};

src/components/MenuButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ const Menu = styled.ul`
132132
133133
> li {
134134
padding: 0em 1em 0.05em 1em;
135+
color: ${props => props.theme.primary};
135136
}
136137
137138
> li:hover {

src/style/themes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import type { editor } from 'monaco-editor';
22

33
import { CatppuccinFlavor, ColorFormat, flavors } from '@catppuccin/palette';
4+
5+
// @ts-expect-error Alias import added in vite.config.ts
46
import dracula from 'monaco-themes/themes/Dracula.json';
7+
// @ts-expect-error Alias import added in vite.config.ts
58
import monokai from 'monaco-themes/themes/Monokai.json';
9+
// @ts-expect-error Alias import added in vite.config.ts
610
import solarizedDark from 'monaco-themes/themes/Solarized-dark.json';
11+
// @ts-expect-error Alias import added in vite.config.ts
712
import solarizedLight from 'monaco-themes/themes/Solarized-light.json';
813

914
type Color = `#${string}`;
@@ -87,7 +92,7 @@ const themes: Themes = {
8792
secondary: '#022550',
8893
highlight: '#36368c',
8994
background: '#ffffff',
90-
logo: '#022550',
95+
logo: '#00a2ff',
9196
lightOrDark: 'light',
9297

9398
highlightedLine: {

src/util/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const bytebinUrl =
22
import.meta.env.VITE_BYTEBIN_URL || 'https://api.pastes.dev/';
33
export const postUrl = bytebinUrl + 'post';
4-
export const useQueryRouting =
4+
export const useQueryRouting =
55
import.meta.env.VITE_USE_QUERY_ROUTING === 'true';

vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import react from '@vitejs/plugin-react-swc';
2+
import { fileURLToPath } from 'node:url';
23
import { defineConfig } from 'vite';
34

45
// https://vite.dev/config/
56
export default defineConfig({
67
plugins: [react()],
8+
resolve: {
9+
alias: {
10+
'monaco-themes/themes': fileURLToPath(
11+
new URL('./node_modules/monaco-themes/themes', import.meta.url)
12+
),
13+
},
14+
},
715
});

0 commit comments

Comments
 (0)