Skip to content

Commit e31a179

Browse files
authored
Merge pull request #6318 from logto-io/gao-use-vite-for-console
refactor(console): use vite
2 parents 98dbead + 6c1f428 commit e31a179

File tree

482 files changed

+2026
-1547
lines changed

Some content is hidden

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

482 files changed

+2026
-1547
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"@types/pg": "^8.6.6",
3232
"husky": "^9.0.0",
3333
"pg": "^8.8.0",
34-
"typescript": "^5.0.0"
34+
"typescript": "^5.0.0",
35+
"vite": "^5.3.4"
3536
},
3637
"engines": {
3738
"node": "^20.9.0",

packages/console/.eslintrc.cjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,17 @@ module.exports = {
4949
],
5050
},
5151
},
52+
{
53+
files: ['*.config.js', '*.config.ts', '*.d.ts'],
54+
rules: {
55+
'import/no-unused-modules': 'off',
56+
},
57+
},
58+
{
59+
files: ['*.d.ts'],
60+
rules: {
61+
'import/no-unassigned-import': 'off',
62+
},
63+
},
5264
],
5365
};

packages/console/.parcelrc

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

packages/console/.parcelrc.arm64

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

packages/console/src/index.html renamed to packages/console/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<body>
1111
<noscript>You need to enable JavaScript to run this app.</noscript>
1212
<div id="app"></div>
13-
<script type="module" src="index.tsx"></script>
13+
<script type="module" src="src/index.tsx"></script>
1414
</body>
1515

1616
</html>

packages/console/package.json

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"prepack": "pnpm generate",
1515
"generate": "./generate.sh",
1616
"precommit": "lint-staged",
17-
"start": "parcel src/index.html",
18-
"dev": "cross-env PORT=5002 parcel src/index.html --public-url ${CONSOLE_PUBLIC_URL:-/console} --no-cache --hmr-port 6002",
17+
"start": "vite",
18+
"dev": "vite",
1919
"check": "tsc --noEmit",
20-
"build": "pnpm generate && pnpm check && rm -rf dist && parcel build src/index.html --no-autoinstall --no-cache --public-url ${CONSOLE_PUBLIC_URL:-/console}",
20+
"build": "pnpm generate && pnpm check && vite build",
2121
"lint": "eslint --ext .ts --ext .tsx src",
2222
"lint:report": "pnpm lint --format json --output-file report.json",
2323
"stylelint": "stylelint \"src/**/*.scss\"",
@@ -39,12 +39,8 @@
3939
"@logto/shared": "workspace:^3.1.1",
4040
"@mdx-js/mdx": "^3.0.1",
4141
"@mdx-js/react": "^3.0.1",
42+
"@mdx-js/rollup": "^3.0.1",
4243
"@monaco-editor/react": "^4.6.0",
43-
"@parcel/compressor-brotli": "2.9.3",
44-
"@parcel/compressor-gzip": "2.9.3",
45-
"@parcel/core": "2.9.3",
46-
"@parcel/transformer-sass": "2.9.3",
47-
"@parcel/transformer-svg-react": "2.9.3",
4844
"@silverhand/eslint-config": "6.0.1",
4945
"@silverhand/eslint-config-react": "6.0.2",
5046
"@silverhand/essentials": "^2.9.1",
@@ -63,20 +59,19 @@
6359
"@types/react-helmet": "^6.1.6",
6460
"@types/react-modal": "^3.13.1",
6561
"@types/react-syntax-highlighter": "^15.5.1",
62+
"@vitejs/plugin-react": "^4.3.1",
6663
"@withtyped/client": "^0.8.7",
67-
"buffer": "^6.0.0",
6864
"classnames": "^2.3.1",
6965
"clean-deep": "^3.4.0",
70-
"cross-env": "^7.0.3",
71-
"csstype": "^3.0.11",
7266
"date-fns": "^2.29.3",
7367
"dayjs": "^1.10.5",
7468
"debug": "^4.3.4",
7569
"deep-object-diff": "^1.1.9",
7670
"deepmerge": "^4.2.2",
7771
"dnd-core": "^16.0.0",
72+
"dotenv": "^16.4.5",
7873
"eslint": "^8.56.0",
79-
"history": "^5.3.0",
74+
"find-up": "^7.0.0",
8075
"i18next": "^22.4.15",
8176
"i18next-browser-languagedetector": "^8.0.0",
8277
"identity-obj-proxy": "^3.0.0",
@@ -92,11 +87,9 @@
9287
"nanoid": "^5.0.1",
9388
"overlayscrollbars": "^2.0.2",
9489
"overlayscrollbars-react": "^0.5.0",
95-
"parcel": "2.9.3",
96-
"postcss": "^8.4.31",
90+
"postcss": "^8.4.39",
9791
"postcss-modules": "^4.3.0",
9892
"prettier": "^3.0.0",
99-
"process": "^0.11.10",
10093
"prop-types": "^15.8.1",
10194
"property-information": "^6.2.0",
10295
"react": "^18.3.1",
@@ -114,35 +107,25 @@
114107
"react-markdown": "^9.0.0",
115108
"react-modal": "^3.15.1",
116109
"react-paginate": "^8.1.3",
117-
"react-router-dom": "^6.10.0",
110+
"react-router-dom": "^6.25.1",
118111
"react-syntax-highlighter": "^15.5.0",
119112
"react-timer-hook": "^3.0.5",
120113
"recharts": "^2.1.13",
121114
"rehype-mdx-code-props": "^3.0.1",
122115
"remark-gfm": "^4.0.0",
123116
"stylelint": "^15.0.0",
124117
"swr": "^2.2.0",
125-
"ts-node": "^10.9.2",
126-
"tslib": "^2.4.1",
127118
"typescript": "^5.5.3",
119+
"vite": "^5.3.4",
120+
"vite-plugin-compression": "^0.5.1",
121+
"vite-plugin-prebundle": "^0.0.4",
122+
"vite-plugin-svgr": "^4.2.0",
128123
"zod": "^3.23.8",
129124
"zod-to-ts": "^1.2.0"
130125
},
131126
"engines": {
132127
"node": "^20.9.0"
133128
},
134-
"//": "https://github.com/parcel-bundler/parcel/issues/7636",
135-
"targets": {
136-
"default": {
137-
"engines": {
138-
"browsers": "defaults"
139-
}
140-
}
141-
},
142-
"alias": {
143-
"@/*": "./src/$1",
144-
"@cloud/*": "./src/cloud/$1"
145-
},
146129
"stylelint": {
147130
"extends": "@silverhand/eslint-config-react/.stylelintrc"
148131
},

packages/console/parcel-transformer-mdx2.js

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

0 commit comments

Comments
 (0)