Skip to content

Commit 713c4ee

Browse files
new ts version
1 parent 858bc13 commit 713c4ee

File tree

209 files changed

+2328
-4457
lines changed

Some content is hidden

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

209 files changed

+2328
-4457
lines changed

.env

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
DEV_HOST=localhost
33
DEV_PORT=9000
44
WDS_PORT=9001
5-
PUBLIC_DEV_API_HOST=localhost:9000
5+
PUBLIC_DEV_API_HOST=http://localhost:9000
66
# prod env
77
PROD_PORT=5000
88
PROD_HOST=localhost
9-
PUBLIC_PROD_API_HOST=localhost:5000
9+
PUBLIC_PROD_API_HOST=http://localhost:5000
1010
# feature
11-
CRYPTO_KEY=ad$cr3efW89ypg
1211
SSR=true
1312
MIDDLEWARE=false
1413
ANIMATE_ROUTER=false
1514
# entry
1615
SERVER_ENTRY=./src/server/entry.ts
17-
CLIENT_ENTRY=./src/client/entry.tsx
16+
CLIENT_ENTRY=./src/app/client/entry.tsx

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ yarn-error.log*
3333
# vercel
3434
.vercel
3535

36-
/cache
36+
.eslintcache

global.d.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ declare global {
77
const __MIDDLEWARE__: boolean;
88
const __ANIMATE_ROUTER__: boolean;
99
const __BUILD_TIME__: string;
10-
const __UI__: "chakra";
1110

1211
interface Window {
13-
__cache: unknown;
14-
__request: unknown;
15-
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: any;
1612
__INITIAL_PROPS_SSR__: { [key: string]: any };
1713
__PRELOAD_STORE_STATE__: { [key: string]: any };
1814
__ENV__: {
@@ -23,9 +19,7 @@ declare global {
2319
isMIDDLEWARE: boolean;
2420
isDEVELOPMENT: boolean;
2521
isANIMATE_ROUTER: boolean;
26-
CRYPTO_KEY: string;
2722
PUBLIC_API_HOST: string;
28-
UI: "chakra";
2923
};
3024
}
3125

@@ -37,11 +31,10 @@ declare global {
3731
WDS_PORT: string;
3832
PROD_PORT: string;
3933
SSR: string;
40-
UI: "chakra";
34+
CSR: string;
4135
STATIC_GENERATE: "true" | "false";
4236
PUBLIC_DEV_API_HOST: string;
4337
PUBLIC_PROD_API_HOST: string;
44-
CRYPTO_KEY: string;
4538
SERVER_ENTRY: string;
4639
CLIENT_ENTRY: string;
4740
MIDDLEWARE: string;

package.json

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,40 @@
11
{
22
"name": "react-ssr",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"author": "mrwang",
55
"license": "MIT",
66
"scripts": {
7-
"dev": "./script/start-dev",
8-
"dev:inspect": "node --inspect ./script/start-dev",
9-
"dev:csr": "cross-env CSR=true ./script/start-dev",
10-
"dev:static": "cross-env STATIC_GENERATE=true ./script/start-dev",
11-
"dev:dynamic": "cross-env CSR=true MIDDLEWARE=true ./script/start-dev",
12-
"build": "./script/start-prod",
13-
"build:static": "./script/start-static",
14-
"build:csr": "cross-env CSR=true ./script/start-prod",
7+
"dev": "ts-node -r tsconfig-paths/register --project tsconfig.build.json src/build/scripts/start-dev",
8+
"build": "ts-node -r tsconfig-paths/register --project tsconfig.build.json src/build/scripts/start-prod",
159
"lint": "eslint --cache --ext ts,tsx .",
1610
"lint:fix": "yarn run lint --fix",
1711
"start": "cross-env NODE_ENV=production node ./dist/server/app",
1812
"test": "jest"
1913
},
2014
"dependencies": {
2115
"@chakra-ui/react": "^2.2.1",
16+
"@emotion/cache": "^11.9.3",
2217
"@emotion/react": "^11.9.3",
2318
"@emotion/server": "^11.4.0",
2419
"@emotion/styled": "^11.9.3",
20+
"@reduxjs/toolkit": "^1.8.3",
2521
"axios": "^0.27.2",
26-
"chalk": "4",
27-
"compression": "^1.7.4",
2822
"cookie-parser": "^1.4.6",
29-
"cors": "^2.8.5",
3023
"dotenv": "^16.0.0",
3124
"express": "^4.18.1",
32-
"express-session": "^1.17.3",
3325
"framer-motion": "^6.3.16",
34-
"immer": "^9.0.15",
3526
"js-cookie": "^3.0.1",
36-
"lodash": "^4.17.21",
37-
"multer": "^1.4.4",
38-
"pretty-error": "^4.0.0",
27+
"lodash-es": "^4.17.21",
28+
"pino": "^8.3.0",
29+
"pino-pretty": "^8.1.0",
3930
"react": "^18.2.0",
4031
"react-dom": "^18.2.0",
4132
"react-helmet-async": "^1.3.0",
4233
"react-intl": "^6.0.4",
4334
"react-redux": "^8.0.2",
4435
"react-router": "^6.3.0",
4536
"react-router-dom": "^6.3.0",
46-
"redux": "^4.2.0",
47-
"redux-saga": "^1.1.3",
48-
"redux-thunk": "^2.4.1",
49-
"spark-md5": "^3.0.1",
50-
"webpack": "^5.73.0",
51-
"zustand": "^3.7.2"
37+
"redux": "^4.2.0"
5238
},
5339
"devDependencies": {
5440
"@babel/cli": "^7.18.6",
@@ -67,6 +53,7 @@
6753
"@babel/preset-typescript": "^7.18.6",
6854
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
6955
"@swc/core": "^1.2.207",
56+
"@swc/helpers": "^0.4.3",
7057
"@types/compression": "^1.7.2",
7158
"@types/cookie-parser": "^1.4.3",
7259
"@types/cors": "^2.8.12",
@@ -112,12 +99,16 @@
11299
"postcss-loader": "^7.0.0",
113100
"prettier": "^2.7.0",
114101
"react-refresh": "^0.14.0",
102+
"regenerator-runtime": "^0.13.9",
115103
"sass": "^1.53.0",
116104
"sass-loader": "^13.0.2",
117105
"style-loader": "^3.3.1",
118106
"swc-loader": "^0.2.3",
119107
"thread-loader": "^3.0.4",
108+
"ts-node": "^10.9.1",
109+
"tsconfig-paths": "^4.0.0",
120110
"typescript": "^4.7.4",
111+
"webpack": "^5.74.0",
121112
"webpack-bundle-analyzer": "^4.5.0",
122113
"webpack-cli": "^4.10.0",
123114
"webpack-dev-middleware": "^5.3.3",

script/compiler.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

script/dev-entry.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

script/free-port.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

script/generate.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

script/prod-entry.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

script/start-dev

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)