Skip to content

Commit c89e688

Browse files
authored
chore: separate package.json for client and server (#94)
* bump lean4monaco * npm audit fix * separate client and server * fix eslint * fix tests * fix tsc build * add windows test * fix test setup
1 parent 9972be7 commit c89e688

File tree

12 files changed

+240
-154
lines changed

12 files changed

+240
-154
lines changed

Projects/MathlibDemo/lake-manifest.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "leanprover-community",
8-
"rev": "63710499c7ac0bd4ab1977494d82e3017ac59edf",
8+
"rev": "55aa437fb40b168305405301f173cf0cb2adfe94",
99
"name": "mathlib",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": "master",
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "leanprover-community",
18-
"rev": "b3dd6c3ebc0a71685e86bea9223be39ea4c299fb",
18+
"rev": "e84e3e16aea6b72cc5d311ca1bb25caad417e162",
1919
"name": "plausible",
2020
"manifestFile": "lake-manifest.json",
2121
"inputRev": "main",
@@ -25,7 +25,7 @@
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "leanprover-community",
28-
"rev": "5ce7f0a355f522a952a3d678d696bd563bb4fd28",
28+
"rev": "c5d5b8fe6e5158def25cd28eb94e4141ad97c843",
2929
"name": "LeanSearchClient",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",
@@ -35,7 +35,7 @@
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "leanprover-community",
38-
"rev": "cff9dd30f2c161b9efd7c657cafed1f967645890",
38+
"rev": "f207d9fcf0cef00ba79962a33ef156061914d9c7",
3939
"name": "importGraph",
4040
"manifestFile": "lake-manifest.json",
4141
"inputRev": "main",
@@ -45,17 +45,17 @@
4545
"type": "git",
4646
"subDir": null,
4747
"scope": "leanprover-community",
48-
"rev": "ef8377f31b5535430b6753a974d685b0019d0681",
48+
"rev": "2e58165a9dcdca9837b666528f974299ee1a51cc",
4949
"name": "proofwidgets",
5050
"manifestFile": "lake-manifest.json",
51-
"inputRev": "v0.0.84",
51+
"inputRev": "v0.0.92",
5252
"inherited": true,
5353
"configFile": "lakefile.lean"},
5454
{"url": "https://github.com/leanprover-community/aesop",
5555
"type": "git",
5656
"subDir": null,
5757
"scope": "leanprover-community",
58-
"rev": "fa78cf032194308a950a264ed87b422a2a7c1c6c",
58+
"rev": "c3361708f266893de5d1769192b60d4b1831f2bb",
5959
"name": "aesop",
6060
"manifestFile": "lake-manifest.json",
6161
"inputRev": "master",
@@ -65,7 +65,7 @@
6565
"type": "git",
6666
"subDir": null,
6767
"scope": "leanprover-community",
68-
"rev": "8920dcbb96a4e8bf641fc399ac9c0888e4a6be72",
68+
"rev": "221e8088e3a066b8676dc471ff10638cf1c10835",
6969
"name": "Qq",
7070
"manifestFile": "lake-manifest.json",
7171
"inputRev": "master",
@@ -75,7 +75,7 @@
7575
"type": "git",
7676
"subDir": null,
7777
"scope": "leanprover-community",
78-
"rev": "2e16f91af2a97975e5d2fac906494cd6c17ba255",
78+
"rev": "87f6314ff2cc922489cd73cd0fbc2252f39aa153",
7979
"name": "batteries",
8080
"manifestFile": "lake-manifest.json",
8181
"inputRev": "main",
@@ -85,10 +85,10 @@
8585
"type": "git",
8686
"subDir": null,
8787
"scope": "leanprover",
88-
"rev": "726b98c53e2da249c1de768fbbbb5e67bc9cef60",
88+
"rev": "3de531c1135f5e3a01f3ac04830996fda476b28e",
8989
"name": "Cli",
9090
"manifestFile": "lake-manifest.json",
91-
"inputRev": "v4.27.0-rc1",
91+
"inputRev": "v4.29.0-rc6",
9292
"inherited": true,
9393
"configFile": "lakefile.toml"}],
9494
"name": "MathlibDemo",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.27.0-rc1
1+
leanprover/lean4:v4.29.0-rc6

index.html renamed to client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
<!-- </p> -->
2121
</noscript>
2222
</div>
23-
<script type="module" src="client/src/index.tsx"></script>
23+
<script type="module" src="src/index.tsx"></script>
2424
</body>
2525
</html>

client/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "leanweb-client",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"dev": "NODE_ENV=development vite --host",
7+
"build": "tsc -b && NODE_ENV=production vite build"
8+
},
9+
"dependencies": {
10+
"@emotion/react": "^11.14.0",
11+
"@emotion/styled": "^11.14.1",
12+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
13+
"@fortawesome/react-fontawesome": "^3.1.1",
14+
"@mui/material": "^7.3.5",
15+
"@tailwindcss/vite": "^4.1.18",
16+
"@tanstack/query-core": "^5.90.14",
17+
"@uiw/react-codemirror": "^4.25.3",
18+
"file-saver": "^2.0.5",
19+
"jotai-location": "^0.6.2",
20+
"jotai-react": "^0.0.0",
21+
"jotai-tanstack-query": "^0.11.0",
22+
"jotai": "^2.16.1",
23+
"lean4monaco": "^1.1.8",
24+
"lz-string": "^1.5.0",
25+
"react-dom": "^19.2.0",
26+
"react-split": "^2.0.14",
27+
"react": "^19.2.0",
28+
"tailwindcss": "^4.1.18",
29+
"vscode-ws-jsonrpc": "^3.5.0"
30+
},
31+
"devDependencies": {
32+
"@codingame/esbuild-import-meta-url-plugin": "^1.0.3",
33+
"@types/file-saver": "^2.0.7",
34+
"@types/react-dom": "^19.2.3",
35+
"@types/react": "^19.2.7",
36+
"@vitejs/plugin-react-swc": "^4.2.2",
37+
"typescript": "^5.9.3",
38+
"vite-plugin-node-polyfills": "0.24.0",
39+
"vite-plugin-static-copy": "^3.1.4",
40+
"vite-plugin-svgr": "^4.5.0",
41+
"vite": "^7.2.4"
42+
}
43+
}

tsconfig.json renamed to client/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"outDir": "./client/dist/",
3+
"outDir": "dist",
44
"target": "ES2023",
55
"useDefineForClassFields": true,
66
"lib": ["ES2023", "DOM", "DOM.Iterable"],
@@ -24,6 +24,6 @@
2424
/* Performance */
2525
"skipLibCheck": true
2626
},
27-
"include": ["client/src", "eslint.config.js"],
28-
"exclude": ["server", "node_modules"]
27+
"include": ["src"],
28+
"exclude": ["node_modules"]
2929
}

vite.config.ts renamed to client/vite.config.ts

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import path from "node:path";
2-
31
import importMetaUrlPlugin from "@codingame/esbuild-import-meta-url-plugin";
42
import tailwindcss from "@tailwindcss/vite";
53
import react from "@vitejs/plugin-react-swc";
@@ -16,12 +14,11 @@ export default defineConfig({
1614
// @ts-ignore // TODO
1715
plugins: [importMetaUrlPlugin],
1816
},
19-
exclude: ["Projects"],
17+
// exclude: ["Projects"],
2018
},
2119
build: {
22-
// Relative to the root
2320
// Note: This has to match the path in `server/index.mjs` and in `tsconfig.json`
24-
outDir: "client/dist",
21+
outDir: "dist",
2522
},
2623
plugins: [
2724
react(),
@@ -44,36 +41,19 @@ export default defineConfig({
4441
targets: [
4542
{
4643
src: [
47-
normalizePath(
48-
path.resolve(
49-
__dirname,
50-
"./node_modules/@leanprover/infoview/dist/*",
51-
),
52-
),
53-
normalizePath(
54-
path.resolve(
55-
__dirname,
56-
"./node_modules/lean4monaco/dist/webview/webview.js",
57-
),
58-
),
44+
"../node_modules/@leanprover/infoview/dist/*",
45+
"../node_modules/lean4monaco/dist/webview/webview.js",
5946
],
6047
dest: "infoview",
6148
},
6249
{
63-
src: [
64-
normalizePath(
65-
path.resolve(
66-
__dirname,
67-
"./node_modules/@leanprover/infoview/dist/codicon.ttf",
68-
),
69-
),
70-
],
50+
src: ["../node_modules/@leanprover/infoview/dist/codicon.ttf"],
7151
dest: "assets",
7252
},
7353
],
7454
}),
7555
],
76-
publicDir: "client/public/",
56+
publicDir: "public",
7757
base: "/", // setting this to `/leanweb/` means the server is now accessible at `localhost:3000/leanweb`
7858
server: {
7959
port: 3000,
@@ -91,8 +71,6 @@ export default defineConfig({
9171
},
9272
},
9373
resolve: {
94-
alias: {
95-
path: "path-browserify",
96-
},
74+
alias: {},
9775
},
9876
});

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export default defineConfig({
1616
});
1717
},
1818
},
19+
allowCypressEnv: false,
1920
});

eslint.config.js renamed to eslint.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default [
1414
ignores: ["dist", "node_modules"],
1515
},
1616
{
17-
files: ["client/src/**/*.{ts,tsx}"],
17+
files: ["client/src/**/*.{ts,tsx}", "server/**/*.{ts,tsx,mjs,cjs,js}"],
1818
...js.configs.recommended,
1919
languageOptions: {
2020
parser: tsParser,
@@ -52,8 +52,13 @@ export default [
5252
],
5353
"simple-import-sort/imports": "warn",
5454
"simple-import-sort/exports": "warn",
55-
56-
"@typescript-eslint/no-unused-vars": "off",
55+
"@typescript-eslint/no-unused-vars": [
56+
"warn",
57+
{
58+
varsIgnorePattern: "^_",
59+
argsIgnorePattern: "^_",
60+
},
61+
],
5762
},
5863
},
5964

0 commit comments

Comments
 (0)