Skip to content

Commit 7588c0a

Browse files
committed
chore(deps): update dependency tsbb to v4 & react to v18
1 parent 2952716 commit 7588c0a

File tree

8 files changed

+63
-30
lines changed

8 files changed

+63
-30
lines changed

package.json

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"prepare": "husky install && npm run build",
1010
"doc": "kkt build --app-src ./website",
1111
"start": "kkt start --app-src ./website",
12-
"watch": "tsbb watch",
13-
"build": "tsbb build",
12+
"watch": "tsbb watch src/*.tsx --use-babel",
13+
"build": "tsbb build src/*.tsx --use-babel",
1414
"bundle": "ncc build src/index.tsx --target web --filename run-web",
1515
"bundle:min": "ncc build src/index.tsx --target web --filename run-web --minify",
1616
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
@@ -52,26 +52,27 @@
5252
"react-dom": ">=16.9.0"
5353
},
5454
"devDependencies": {
55-
"@kkt/less-modules": "~7.1.1",
56-
"@kkt/ncc": "~1.0.8",
57-
"@kkt/raw-modules": "~7.1.1",
58-
"@kkt/scope-plugin-options": "~7.1.1",
59-
"@types/react": "~17.0.39",
60-
"@types/react-dom": "~17.0.11",
61-
"@types/react-test-renderer": "~17.0.1",
62-
"@uiw/react-github-corners": "~1.5.3",
63-
"@uiw/react-markdown-preview": "~3.5.0",
64-
"@uiw/react-split": "~5.8.7",
65-
"@uiw/react-textarea-code-editor": "~1.6.0",
66-
"husky": "~7.0.4",
67-
"kkt": "~7.1.5",
68-
"lint-staged": "~12.3.4",
69-
"prettier": "~2.5.1",
70-
"react": "~17.0.2",
71-
"react-dom": "~17.0.2",
72-
"react-router-dom": "~6.2.1",
73-
"react-test-renderer": "~17.0.2",
74-
"tsbb": "~3.7.0"
55+
"@kkt/less-modules": "^7.4.9",
56+
"@kkt/ncc": "^1.0.15",
57+
"@kkt/raw-modules": "^7.4.9",
58+
"@kkt/scope-plugin-options": "^7.4.9",
59+
"@types/react": "^18.0.34",
60+
"@types/react-dom": "^18.0.11",
61+
"@types/react-test-renderer": "^18.0.0",
62+
"@wcj/dark-mode": "^1.0.15",
63+
"@uiw/react-github-corners": "^1.5.15",
64+
"@uiw/react-markdown-preview": "^4.1.10",
65+
"@uiw/react-split": "^5.8.10",
66+
"@uiw/react-textarea-code-editor": "^2.1.1",
67+
"husky": "^8.0.3",
68+
"kkt": "^7.4.9",
69+
"lint-staged": "^13.2.1",
70+
"prettier": "^2.8.7",
71+
"react": "^18.2.0",
72+
"react-dom": "^18.2.0",
73+
"react-router-dom": "^6.10.0",
74+
"react-test-renderer": "^18.2.0",
75+
"tsbb": "^4.1.5"
7576
},
7677
"eslintConfig": {
7778
"extends": [

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<noscript>
2626
You need to enable JavaScript to run this app.
2727
</noscript>
28-
<div id="root"></div>
28+
<div id="root" class="w-tc-editor-var"></div>
2929
<!--
3030
This HTML file is a template.
3131
If you open it directly in the browser, you will see an empty page.

tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4+
"module": "esnext",
5+
"moduleResolution": "node",
46
"lib": ["dom", "dom.iterable", "esnext"],
57
"allowJs": true,
68
"skipLibCheck": true,
79
"esModuleInterop": true,
810
"allowSyntheticDefaultImports": true,
911
"strict": true,
1012
"forceConsistentCasingInFileNames": true,
11-
"module": "esnext",
12-
"moduleResolution": "node",
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,
1515
"declaration": true,
1616
"jsx": "react-jsx",
17+
"outDir": "cjs",
1718
"noFallthroughCasesInSwitch": true,
1819
"noEmit": true
1920
},
20-
"include": ["website", ".kktrc.ts"]
21+
"include": ["src"]
2122
}

website/App.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@ body {
1313
:before {
1414
box-sizing: inherit;
1515
}
16+
17+
[data-color-mode*='dark'] .w-tc-editor-var,
18+
body[data-color-mode*='dark'] {
19+
--color-header-border: #353535;
20+
}
21+
22+
[data-color-mode*='light'] .w-tc-editor-var,
23+
body[data-color-mode*='light'] {
24+
--color-header-border: #d5d5d5;
25+
}

website/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import ReactDOM from 'react-dom';
1+
import * as ReactDOMClient from 'react-dom/client';
22
import App from './App';
33

4-
ReactDOM.render(<App />, document.getElementById('root'));
4+
const container = document.getElementById('root');
5+
const root = ReactDOMClient.createRoot(container!);
6+
root.render(<App />);

website/pages/run/index.module.less

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.header {
22
height: 38px;
3-
border-bottom: 1px solid #d5d5d5;
3+
border-bottom: 1px solid var(--color-header-border);
44
display: flex;
55
justify-content: space-between;
66
align-items: center;
77
padding-left: 15px;
88
padding-right: 15px;
99
font-weight: bold;
10-
background-color: #f7f7f7;
10+
background-color: var(--color-canvas-subtle);
1111
}
1212

1313
.menu {
@@ -22,6 +22,9 @@
2222
> a + a {
2323
margin-left: 10px;
2424
}
25+
dark-mode {
26+
margin-left: 10px;
27+
}
2528
}
2629

2730
.editor {
@@ -37,3 +40,8 @@
3740
height: 100%;
3841
overflow: auto;
3942
}
43+
44+
:global(.w-split-vertical) > :global(.w-split-line-bar) div::after,
45+
:global(.w-split-horizontal) > :global(.w-split-line-bar) div::after {
46+
background-color: var(--color-header-border);
47+
}

website/pages/run/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
22
import { useLocation, useNavigate, Link } from 'react-router-dom';
33
import Split from '@uiw/react-split';
44
import CodeEditor from '@uiw/react-textarea-code-editor';
5+
import '@wcj/dark-mode';
56
import Tag from './Tag';
67
import RunWeb from '../../../';
78
import styles from './index.module.less';
@@ -67,6 +68,7 @@ export default function Run() {
6768
<Link to="/docs" state={query.toString() || ''}>
6869
Docs
6970
</Link>
71+
<dark-mode permanent />
7072
</div>
7173
</div>
7274
<Split style={{ width: '100%', height: 'calc(100vh - 39px)' }}>

website/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig",
3+
"include": ["../website", "../src"],
4+
"compilerOptions": {
5+
"baseUrl": ".",
6+
"emitDeclarationOnly": true,
7+
"noEmit": false
8+
}
9+
}

0 commit comments

Comments
 (0)