Skip to content

Commit c30a6ff

Browse files
committed
use latest docusaurus
1 parent ae5c8c2 commit c30a6ff

File tree

15 files changed

+6117
-8091
lines changed

15 files changed

+6117
-8091
lines changed

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "docusaurus-live-brython",
3+
"image": "mcr.microsoft.com/devcontainers/typescript-node:24-bookworm",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"pomdtr.excalidraw-editor",
8+
"zhuangtongfa.Material-theme",
9+
"mhutchie.git-graph",
10+
"esbenp.prettier-vscode",
11+
"dbaeumer.vscode-eslint",
12+
"unifiedjs.vscode-mdx",
13+
"motivesoft.vscode-uuid-generator",
14+
"lukas-tr.materialdesignicons-intellisense"
15+
],
16+
"settings": {
17+
"workbench.colorTheme": "One Dark Pro",
18+
"extensions.ignoreRecommendations": true,
19+
"git.autofetch": true,
20+
"editor.tabSize": 4,
21+
"[mdx]": {
22+
"editor.defaultFormatter": "unifiedjs.vscode-mdx"
23+
}
24+
}
25+
}
26+
},
27+
"remoteEnv": {
28+
"OFFLINE_API": "true"
29+
},
30+
"postStartCommand": "yarn install",
31+
"forwardPorts": [3000],
32+
"features": {
33+
"ghcr.io/devcontainers/features/node:1": {
34+
"version": "24.12"
35+
}
36+
},
37+
"runArgs": ["--network=host"]
38+
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ yarn link docusaurus-live-brython
117117

118118
Then start the website
119119
```sh
120+
# in root
121+
yarn run watch
122+
# in website/
120123
yarn run start
121124
```
122125

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docusaurus-live-brython",
3-
"version": "3.0.0-beta.28",
3+
"version": "3.0.1",
44
"description": "Docusaurus live code block component for python.",
55
"publishConfig": {
66
"access": "public"
@@ -132,8 +132,8 @@
132132
"typescript": "^5.4.5"
133133
},
134134
"peerDependencies": {
135-
"react": "^18.0.0",
136-
"react-dom": "^18.0.0"
135+
"react": ">=18.0.0",
136+
"react-dom": ">=18.0.0"
137137
},
138138
"engines": {
139139
"node": ">=18"

src/options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export type ThemeOptions = {
4747
export type Options = Partial<ThemeOptions>;
4848

4949
export const DEFAULT_OPTIONS: ThemeOptions = {
50-
brythonSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython.min.js',
51-
brythonStdlibSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython_stdlib.js',
50+
brythonSrc: 'https://cdn.jsdelivr.net/npm/brython@3.14/brython.min.js',
51+
brythonStdlibSrc: 'https://cdn.jsdelivr.net/npm/brython@3.14/brython_stdlib.js',
5252
libDir: '/bry-libs/',
5353
skipCopyAssetsToLibDir: false,
5454
syncMaxOnceEvery: 1000

src/theme/CodeBlock/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ const extractMetaProps = (props: { metastring?: string }): MetaProps => {
3434
value === 'true'
3535
? true
3636
: value === 'false'
37-
? false
38-
: !Number.isNaN(Number(value))
39-
? Number(value)
40-
: value || true;
37+
? false
38+
: !Number.isNaN(Number(value))
39+
? Number(value)
40+
: value || true;
4141
acc[key] = val;
4242
return acc;
4343
},
4444
{} as { [key: string]: number | string | boolean }
4545
);
4646
};
4747

48-
export default function CodeBlockWrapper(props: Props): JSX.Element {
48+
export default function CodeBlockWrapper(props: Props): React.ReactNode {
4949
const metaProps = extractMetaProps(props);
5050
const langMatch = ((props.className || '') as string).match(/language-(?<lang>\w*)/);
5151
let lang = langMatch?.groups?.lang?.toLocaleLowerCase() ?? '';

src/theme/CodeEditor/Editor/Result/Graphics/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { useStore, useScript } from '@theme/CodeEditor/hooks';
77
import Button from '@theme/CodeEditor/Button';
88
import clsx from 'clsx';
99
export interface Props {
10-
controls?: JSX.Element;
11-
main?: JSX.Element;
10+
controls?: React.ReactNode;
11+
main?: React.ReactNode;
1212
}
1313
const Graphics = (props: Props) => {
1414
const store = useStore();

src/typings.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ declare module '@theme/Details' {
77
readonly children: ReactNode;
88
[key: string]: any;
99
}
10-
export default function Details(props: Props): JSX.Element;
10+
export default function Details(props: Props): React.ReactNode;
1111
}

website/docusaurus.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const config: Config = {
1010
url: 'https://lebalz.github.io',
1111
baseUrl: BASE_URL,
1212
onBrokenLinks: 'throw',
13-
onBrokenMarkdownLinks: 'warn',
1413
favicon: 'img/favicon.ico',
1514
organizationName: 'lebalz', // Usually your GitHub org/user name.
1615
projectName: 'docusaurus-live-brython', // Usually your repo name.
@@ -20,9 +19,15 @@ const config: Config = {
2019
locales: ['en', 'zh-Hant']
2120
},
2221
future: {
22+
v4: true,
2323
experimental_faster: true,
2424
experimental_router: 'browser',
2525
},
26+
markdown: {
27+
hooks: {
28+
onBrokenMarkdownLinks: 'warn',
29+
}
30+
},
2631
themeConfig: {
2732
navbar: {
2833
title: 'Live Brython',

website/package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^3.6.3",
18-
"@docusaurus/faster": "^3.6.3",
19-
"@docusaurus/preset-classic": "^3.6.3",
20-
"@docusaurus/tsconfig": "^3.6.3",
17+
"@docusaurus/core": "^3.9.2",
18+
"@docusaurus/faster": "^3.9.2",
19+
"@docusaurus/preset-classic": "^3.9.2",
20+
"@docusaurus/tsconfig": "^3.9.2",
2121
"@mdx-js/react": "3.0.1",
2222
"clsx": "^2.1.1",
2323
"docusaurus-live-brython": "link:../lib/",
@@ -39,9 +39,12 @@
3939
]
4040
},
4141
"devDependencies": {
42-
"@docusaurus/module-type-aliases": "^3.6.3",
43-
"@docusaurus/types": "^3.6.3",
42+
"@docusaurus/module-type-aliases": "^3.9.2",
43+
"@docusaurus/types": "^3.9.2",
4444
"@types/react": "^18.3.1",
4545
"typescript": "^5.2.2"
46+
},
47+
"resolutions": {
48+
"@rspack/core": "1.6.5"
4649
}
4750
}

website/src/components/BrowserWindow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function BrowserWindow({
2525
url = 'http://localhost:3000',
2626
style,
2727
bodyStyle
28-
}: Props): JSX.Element {
28+
}: Props): React.ReactNode {
2929
return (
3030
<div className={styles.browserWindow} style={{ ...style, minHeight }}>
3131
<div className={styles.browserWindowHeader}>

0 commit comments

Comments
 (0)