Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Commit 538a900

Browse files
author
齐下无贰
committed
Merge branch 'kylin_dev'
2 parents be63143 + 47074e3 commit 538a900

21 files changed

Lines changed: 2436 additions & 1153 deletions

File tree

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"recommendations": [
33
"prisma.prisma",
4+
"esbenp.prettier-vscode",
45
],
56
}

electron-app/src/preload.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,5 @@ contextBridge.exposeInMainWorld('api', {
3131
setTheme: (theme: ThemeMode) => ipcRenderer.invoke('app:set-theme', theme),
3232
openFile: (options: OpenFileOptions) => ipcRenderer.invoke("sys:open-file", options),
3333
readFile: (path: string) => ipcRenderer.invoke("sys:read-file", path),
34-
3534
currentPlatform: () => ipcRenderer.invoke('sys:get-os')
3635
})
37-

react-app/craco.config.js

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,56 @@
11
// We have .ts file in node_modules/, but react won't load any .ts
22
// file other than those in src/, so we extend react's configuration,
33
// making it load *.ts file.
4+
const path = require("path");
5+
46
module.exports = {
5-
webpack: {
6-
configure: (webpackConfig) => ({
7-
...webpackConfig,
8-
module: {
9-
...webpackConfig.module,
10-
rules: webpackConfig.module.rules.map((rule) => {
11-
if (!rule.oneOf) return rule;
12-
return {
13-
...rule,
14-
oneOf: rule.oneOf.map((ruleObject) => {
15-
if (
16-
!new RegExp(ruleObject.test).test('.ts') ||
17-
!ruleObject.include
18-
)
19-
return ruleObject;
20-
return { ...ruleObject, include: undefined };
21-
}),
22-
};
23-
}),
7+
webpack: {
8+
configure: (webpackConfig) => ({
9+
...webpackConfig,
10+
module: {
11+
...webpackConfig.module,
12+
rules: webpackConfig.module.rules.map((rule) => {
13+
if (!rule.oneOf) return rule;
14+
return {
15+
...rule,
16+
oneOf: rule.oneOf.map((ruleObject) => {
17+
if (
18+
!new RegExp(ruleObject.test).test(".ts") ||
19+
!ruleObject.include
20+
)
21+
return ruleObject;
22+
return { ...ruleObject, include: undefined };
23+
}),
24+
};
25+
}),
26+
},
27+
resolve: {
28+
...webpackConfig.resolve,
29+
// 解决 Module not found
30+
// If you want to include a polyfill, you need to:
31+
// - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
32+
// - install 'path-browserify'
33+
// If you don't want to include a polyfill, you can use an empty module like this:
34+
// resolve.fallback: { "path": false }
35+
fallback: {
36+
...webpackConfig.resolve.fallback,
37+
path: require.resolve("path-browserify"),
38+
fs: require.resolve("fs"),
39+
// tls: false,
40+
// net: false,
41+
// zlib: false,
42+
// http: false,
43+
// https: false,
44+
// stream: false,
45+
// crypto: false,
2446
},
25-
}),
26-
},
27-
};
47+
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
48+
// https://blog.csdn.net/peter_hzq/article/details/120656880
49+
alias: {
50+
"@": path.resolve(__dirname, "src"),
51+
},
52+
// modules: [webpackPaths.srcPath, "node_modules"],
53+
},
54+
}),
55+
},
56+
};

react-app/package.json

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,6 @@
33
"version": "0.1.0",
44
"private": true,
55
"homepage": "./",
6-
"dependencies": {
7-
"@heroicons/react": "^2.0.18",
8-
"@privata/types": "file:../common-types",
9-
"@radix-ui/react-checkbox": "^1.0.4",
10-
"@radix-ui/react-dialog": "^1.0.4",
11-
"@radix-ui/react-popover": "^1.0.6",
12-
"@radix-ui/react-scroll-area": "^1.0.4",
13-
"@radix-ui/react-select": "^1.2.2",
14-
"@radix-ui/react-tabs": "^1.0.4",
15-
"@radix-ui/react-tooltip": "^1.0.6",
16-
"@tanstack/react-table": "^8.10.3",
17-
"@testing-library/jest-dom": "^5.14.1",
18-
"@testing-library/react": "^13.0.0",
19-
"@testing-library/user-event": "^13.2.1",
20-
"@types/react": "^18.0.0",
21-
"@types/react-dom": "^18.0.0",
22-
"axios": "^1.4.0",
23-
"framer-motion": "^10.12.18",
24-
"react": "^18.2.0",
25-
"react-dom": "^18.2.0",
26-
"react-router-dom": "^6.14.1",
27-
"react-scripts": "5.0.1",
28-
"web-vitals": "^2.1.0"
29-
},
306
"scripts": {
317
"start": "craco start",
328
"build": "craco build",
@@ -35,7 +11,8 @@
3511
"prisma-generate": "prisma generate",
3612
"prisma-migrate": "prisma migrate dev --name init",
3713
"prisma-db-push": "prisma db push",
38-
"jest-test": "jest"
14+
"jest-test": "jest",
15+
"npm-check-update": "npm-check --skip-unused -u"
3916
},
4017
"eslintConfig": {
4118
"extends": [
@@ -55,16 +32,44 @@
5532
"last 1 safari version"
5633
]
5734
},
35+
"prisma": {
36+
"schema": "src/api/db/prisma/schema.prisma"
37+
},
38+
"dependencies": {
39+
"@heroicons/react": "^2.0.18",
40+
"@prisma/client": "^5.5.2",
41+
"@privata/types": "file:../common-types",
42+
"@radix-ui/react-checkbox": "^1.0.4",
43+
"@radix-ui/react-dialog": "^1.0.4",
44+
"@radix-ui/react-popover": "^1.0.6",
45+
"@radix-ui/react-scroll-area": "^1.0.4",
46+
"@radix-ui/react-select": "^1.2.2",
47+
"@radix-ui/react-tabs": "^1.0.4",
48+
"@radix-ui/react-tooltip": "^1.0.6",
49+
"@tanstack/react-table": "^8.10.3",
50+
"@testing-library/jest-dom": "^5.14.1",
51+
"@testing-library/react": "^13.0.0",
52+
"@testing-library/user-event": "^13.2.1",
53+
"@types/react": "^18.0.0",
54+
"@types/react-dom": "^18.0.0",
55+
"axios": "^1.4.0",
56+
"framer-motion": "^10.12.18",
57+
"path-browserify": "^1.0.1",
58+
"react": "^18.2.0",
59+
"react-dom": "^18.2.0",
60+
"react-router-dom": "^6.14.1",
61+
"react-scripts": "5.0.1",
62+
"typescript": "^4.4.2",
63+
"web-vitals": "^2.1.0"
64+
},
5865
"devDependencies": {
5966
"@craco/craco": "^7.1.0",
60-
"@prisma/client": "^5.3.1",
61-
"@types/jest": "^27.0.1",
67+
"@types/jest": "^29.5.5",
6268
"@types/node": "^16.7.13",
6369
"jest": "^29.7.0",
64-
"prisma": "^5.3.1",
70+
"prisma": "^5.5.2",
6571
"tailwindcss": "^3.3.3",
6672
"ts-jest": "^29.1.1",
67-
"ts-node": "^10.9.1",
68-
"typescript": "^4.4.2"
73+
"ts-node": "^10.9.1"
6974
}
7075
}

0 commit comments

Comments
 (0)