Skip to content

Commit ac68ee0

Browse files
committed
refactor: migrate to React
1 parent 30f5c2b commit ac68ee0

File tree

127 files changed

+7419
-15056
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+7419
-15056
lines changed

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules
22
dist
33
generated-parser
4-
pnpm-lcok.yaml
4+
pnpm-lcok.yaml

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
import eslintConfigPrettier from "eslint-config-prettier/flat";
7+
8+
export default tseslint.config(
9+
{ ignores: ["dist"] },
10+
{
11+
extends: [
12+
js.configs.recommended,
13+
...tseslint.configs.recommended,
14+
eslintConfigPrettier,
15+
],
16+
files: ["**/*.{ts,tsx}"],
17+
languageOptions: {
18+
ecmaVersion: 2020,
19+
globals: globals.browser,
20+
},
21+
plugins: {
22+
"react-hooks": reactHooks,
23+
"react-refresh": reactRefresh,
24+
},
25+
rules: {
26+
...reactHooks.configs.recommended.rules,
27+
"react-refresh/only-export-components": [
28+
"warn",
29+
{ allowConstantExport: true },
30+
],
31+
"@typescript-eslint/no-unsafe-function-type": "off",
32+
"@typescript-eslint/no-explicit-any": "off",
33+
},
34+
},
35+
);

index.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!doctype html>
2-
<html>
2+
<html lang="en">
33
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
47
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
58
<link
69
rel="preload stylesheet"
@@ -16,9 +19,6 @@
1619
/* font-family: "Kalam", serif;*/
1720
/*}*/
1821
</style>
19-
<meta charset="utf-8" />
20-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
21-
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
2222
<link
2323
rel="stylesheet"
2424
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css"
@@ -34,11 +34,14 @@
3434
/>
3535
<title>ZenUML Core Demo</title>
3636
<style>
37+
body {
38+
margin: 0;
39+
}
3740
.CodeMirror {
3841
/* Set height, width, borders, and global font properties here */
3942
font-family: monospace;
4043
font-size: 13px;
41-
height: 1000px;
44+
height: 100vh;
4245
}
4346

4447
.zenuml .CodeMirror .CodeMirror-cursor {
@@ -63,14 +66,7 @@
6366
}
6467
</style>
6568
</head>
66-
6769
<body>
68-
<noscript>
69-
<strong
70-
>We're sorry but vue-sequence doesn't work properly without JavaScript
71-
enabled. Please enable it to continue.</strong
72-
>
73-
</noscript>
7470
<div class="m-1 grid grid-cols-6" id="diagram1">
7571
<div class="col-span-2">
7672
<textarea
@@ -122,6 +118,6 @@
122118
editor.setValue(savedCode);
123119
}
124120
</script>
125-
<script type="module" src="./src/main.ts"></script>
121+
<script type="module" src="/src/main.tsx"></script>
126122
</body>
127123
</html>

package.json

Lines changed: 56 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"antlr:clear": "rm -rf src/generated-parser/*",
2626
"antlr:lexer": "java -Duser.dir=$(pwd)/src/g4 -cp $(pwd)/antlr/antlr-4.11.1-complete.jar org.antlr.v4.Tool -o ./src/generated-parser -Dlanguage=JavaScript sequenceLexer.g4",
2727
"antlr:parser": "java -Duser.dir=$(pwd)/src/g4 -cp $(pwd)/antlr/antlr-4.11.1-complete.jar org.antlr.v4.Tool -o ./src/generated-parser -Dlanguage=JavaScript sequenceParser.g4",
28-
"eslint": "eslint --fix --ext .js,.ts,.vue src",
28+
"eslint": "eslint --fix --ext .js,.ts,.tsx,.jsx src",
2929
"prettier": "prettier --write --ignore-unknown \"src/**/*.{js,ts,vue,json,htm,html}\"",
3030
"git:branch:clean:gone": "git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d",
3131
"git:branch:clean:merged": "git branch --merged|egrep -v \"(\\*|master|main|dev|skip_branch_name)\" | xargs git branch -d",
@@ -39,87 +39,70 @@
3939
"types": "./types/index.d.ts",
4040
"lint-staged": {
4141
"**/*": "prettier --write --ignore-unknown",
42-
"*.{js,ts,vue,json,htm,html}": "eslint --fix"
42+
"*.{js,ts,tsx,jsx,json,htm,html}": "eslint --fix"
43+
},
44+
"packageManager": "[email protected]",
45+
"engines": {
46+
"node": ">=20"
47+
},
48+
"postcss": {
49+
"plugins": {
50+
"tailwindcss": {},
51+
"autoprefixer": {}
52+
}
4353
},
4454
"dependencies": {
45-
"@headlessui-float/vue": "^0.14.0",
46-
"@headlessui/tailwindcss": "^0.2.0",
47-
"@headlessui/vue": "^1.7.16",
48-
"@types/assert": "^1.5.6",
49-
"@types/ramda": "^0.28.20",
50-
"@vue/compat": "^3.2.45",
55+
"@headlessui-float/react": "^0.15.0",
56+
"@headlessui/react": "^2.2.1",
57+
"@headlessui/tailwindcss": "^0.2.2",
5158
"antlr4": "~4.11.0",
52-
"color-string": "^1.5.5",
53-
"dom-to-image-more": "^2.13.0",
54-
"dompurify": "^3.1.5",
55-
"file-saver": "^2.0.5",
59+
"class-variance-authority": "^0.7.1",
60+
"clsx": "^2.1.1",
61+
"color-string": "^2.0.1",
62+
"dompurify": "^3.2.5",
5663
"highlight.js": "^10.7.3",
57-
"html-to-image": "^1.11.3",
58-
"lodash": "^4.17.21",
59-
"marked": "^4.0.10",
64+
"html-to-image": "^1.11.13",
65+
"immer": "^10.1.1",
66+
"jotai": "^2.12.2",
67+
"marked": "^4.3.0",
6068
"pino": "^8.8.0",
61-
"postcss": "^8.4.31",
69+
"radash": "^12.1.0",
6270
"ramda": "^0.28.0",
63-
"tailwindcss": "^3.4.17",
64-
"vue": "^3.2.45",
65-
"vuex": "^4.1.0"
71+
"react": "^19.0.0",
72+
"react-dom": "^19.0.0",
73+
"tailwind-merge": "^3.1.0",
74+
"tailwindcss": "^3.4.17"
6675
},
6776
"devDependencies": {
68-
"@babel/eslint-parser": "^7.19.1",
69-
"@babel/preset-env": "^7.20.2",
77+
"@eslint/js": "^9.21.0",
7078
"@types/antlr4": "~4.11.2",
71-
"@types/color-string": "^1.5.2",
72-
"@types/jest": "^29.5.14",
79+
"@types/color-string": "^1.5.5",
80+
"@types/highlight.js": "10",
7381
"@types/jsdom": "^21.1.7",
74-
"@types/lodash": "^4.14.191",
75-
"@types/node": "latest",
76-
"@typescript-eslint/eslint-plugin": "^6.7.4",
77-
"@typescript-eslint/parser": "^6.7.4",
78-
"@vitejs/plugin-vue": "^4.0.0",
79-
"@vitest/coverage-v8": "^2.1.5",
80-
"@vue/compiler-dom": "^3.3.8",
81-
"@vue/compiler-sfc": "^3.2.45",
82-
"@vue/test-utils": "^2.2.7",
83-
"autoprefixer": "^10.4.13",
84-
"concurrently": "^7.6.0",
85-
"cypress": "^10.11.0",
86-
"cypress-plugin-snapshots": "^1.4.4",
87-
"eslint": "^8.30.0",
88-
"eslint-config-prettier": "^9.0.0",
89-
"eslint-plugin-html": "^7.1.0",
90-
"eslint-plugin-prettier": "^5.0.0",
91-
"eslint-plugin-vue": "^9.17.0",
92-
"global-jsdom": "^8.6.0",
93-
"husky": "^8.0.3",
94-
"jsdom": "^20.0.3",
95-
"less": "^4.1.3",
96-
"less-loader": "^11.1.3",
97-
"lint-staged": "^14.0.1",
98-
"prettier": "^3.0.3",
99-
"regenerator-runtime": "^0.13.11",
100-
"sass": "^1.57.0",
101-
"svg-url-loader": "^6.0.0",
102-
"terser-webpack-plugin": "^3.1.0",
103-
"ts-node": "^10.9.1",
104-
"typescript": "^5.6.3",
105-
"vite": "^4.5.6",
106-
"vite-plugin-css-injected-by-js": "^2.2.0",
107-
"vite-svg-loader": "^4.0.0",
108-
"vitest": "^2.1.5"
109-
},
110-
"postcss": {
111-
"plugins": {
112-
"tailwindcss": {},
113-
"autoprefixer": {}
114-
}
115-
},
116-
"browserslist": [
117-
"last 2 years"
118-
],
119-
"engines": {
120-
"node": ">=12.0.0"
121-
},
122-
"volta": {
123-
"node": "18.12.1"
82+
"@types/marked": "^4.3.2",
83+
"@types/node": "^22.14.0",
84+
"@types/ramda": "^0.28.20",
85+
"@types/react": "^19.0.10",
86+
"@types/react-dom": "^19.0.4",
87+
"@vitejs/plugin-react": "^4.3.4",
88+
"autoprefixer": "^10.4.21",
89+
"eslint": "^9.21.0",
90+
"eslint-config-prettier": "^10.1.1",
91+
"eslint-plugin-react-hooks": "^5.1.0",
92+
"eslint-plugin-react-refresh": "^0.4.19",
93+
"globals": "^15.15.0",
94+
"husky": "^9.1.7",
95+
"jsdom": "^26.1.0",
96+
"less": "^4.3.0",
97+
"lint-staged": "^15.5.1",
98+
"postcss": "^8.5.3",
99+
"prettier": "3.5.3",
100+
"sass": "^1.86.3",
101+
"typescript": "~5.7.2",
102+
"typescript-eslint": "^8.24.1",
103+
"vite": "^6.2.0",
104+
"vite-plugin-css-injected-by-js": "^3.5.2",
105+
"vite-svg-loader": "^5.1.0",
106+
"vitest": "^3.1.1"
124107
}
125108
}

0 commit comments

Comments
 (0)