Skip to content

Commit 48e85f0

Browse files
authored
Merge pull request #8 from jsxiaosi/feature/vite5-beta
Feature/vite5 beta
2 parents 5e9e8b6 + 7c47f0b commit 48e85f0

Some content is hidden

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

80 files changed

+3726
-3035
lines changed
File renamed without changes.

.vscode/extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"syler.sass-indented",
77
"esbenp.prettier-vscode",
88
"lokalise.i18n-ally",
9-
"dbaeumer.vscode-eslint"
9+
"dbaeumer.vscode-eslint",
10+
"donjayamanne.githistory"
1011
]
1112
}

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
"source.fixAll.eslint": true,
44
"source.fixAll.stylelint": true
55
},
6+
"files.associations": {
7+
"tailwind.css": "tailwindcss"
8+
},
9+
"css.validate": false,
10+
"less.validate": false,
11+
"scss.validate": false,
612
"eslint.validate": ["json", "javascript", "typescript", "typescriptreact", "javascriptreact"],
13+
"stylelint.enable": true,
14+
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
715
"i18n-ally.localesPaths": ["src/locales/modules"],
816
"i18n-ally.displayLanguage": "zh-CN",
917
"i18n-ally.enabledFrameworks": ["vue"],

README.EN.md

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Supports modern browsers, not Internet Explorer
202202

203203
- [vue-vben-admin](https://github.com/anncwb/vue-vben-admin)
204204
- [vue-pure-admin](https://github.com/xiaoxian521/vue-pure-admin)
205+
- [vue-office](https://github.com/501351981/vue-office)
205206

206207
## maintainers
207208

build/vite/css.ts

-14
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ export function createViteCSS(): CSSOptions {
1313
javascriptEnabled: true,
1414
},
1515
},
16-
postcss: {
17-
plugins: [
18-
{
19-
postcssPlugin: 'internal:charset-removal',
20-
AtRule: {
21-
charset: (atRule: { name: string; remove: () => void }) => {
22-
if (atRule.name === 'charset') {
23-
atRule.remove();
24-
}
25-
},
26-
},
27-
},
28-
],
29-
},
3016
};
3117
return viteCSS;
3218
}

build/vite/plugin/buildOuteInfo.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export function viteBuildOuteInfo(): Plugin {
5656
// 该插件在 plugin-vue 插件之前执行,这样就可以直接解析到原模板文件
5757
enforce: 'post',
5858
transformIndexHtml: {
59-
enforce: 'post',
60-
transform: () => {},
59+
order: 'post',
60+
handler: () => {},
6161
},
6262

6363
configResolved(resolvedConfig) {

build/vite/plugin/mock.ts

+7-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
* Mock plugin for development and production.
33
* https://github.com/anncwb/vite-plugin-mock
44
*/
5-
import { viteMockServe } from 'vite-plugin-mock';
5+
import { vitePluginFakeServer } from 'vite-plugin-fake-server';
66

7-
export function configMockPlugin(isBuild: boolean) {
8-
return viteMockServe({
9-
ignore: /^\_/,
10-
mockPath: 'mock',
11-
localEnabled: !isBuild,
12-
prodEnabled: isBuild,
13-
injectCode: `
14-
import { setupProdMockServer } from '../mock/_createProductionServer';
15-
16-
setupProdMockServer();
17-
`,
7+
export function configMockPlugin() {
8+
return vitePluginFakeServer({
9+
logger: false,
10+
include: 'mock',
11+
infixName: false,
12+
enableProd: true,
1813
});
1914
}
File renamed without changes.

mock/_createProductionServer.ts

-15
This file was deleted.

mock/demo/account.ts renamed to mock/account.mock.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MockMethod, Recordable } from 'vite-plugin-mock';
1+
import { defineFakeRoute } from 'vite-plugin-fake-server/client';
22

33
const userInfo = {
44
name: '爱喝蜂蜜绿的小斯斯',
@@ -22,7 +22,7 @@ const userInfo2 = {
2222
role: 'test',
2323
};
2424

25-
export default [
25+
export default defineFakeRoute([
2626
{
2727
url: '/mock_api/login',
2828
timeout: 1000,
@@ -68,7 +68,7 @@ export default [
6868
return userInfo;
6969
},
7070
},
71-
] as MockMethod[];
71+
]);
7272

7373
function genID(length: number) {
7474
return Number(Math.random().toString().substr(3, length) + Date.now()).toString(36);

mock/demo/route.ts renamed to mock/route.mock.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MockMethod, Recordable } from 'vite-plugin-mock';
1+
import { defineFakeRoute } from 'vite-plugin-fake-server/client';
22

33
const power = [
44
{
@@ -178,7 +178,7 @@ const testPermissionRouter = [
178178

179179
// permissionRouter
180180

181-
export default [
181+
export default defineFakeRoute([
182182
{
183183
url: '/mock_api/getRoute',
184184
timeout: 0,
@@ -206,4 +206,4 @@ export default [
206206
}
207207
},
208208
},
209-
] as MockMethod[];
209+
]);

package.json

+74-58
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "vue-xs-admin",
3-
"version": "1.9.1",
3+
"type": "module",
4+
"version": "2.0.0",
45
"packageManager": "[email protected]",
56
"author": {
67
"name": "小斯斯",
@@ -9,11 +10,11 @@
910
},
1011
"license": "MIT",
1112
"engines": {
12-
"node": ">=16",
13+
"node": ">=18",
1314
"pnpm": ">=8.1.0"
1415
},
1516
"scripts": {
16-
"dev": "vite",
17+
"dev": "vite dev",
1718
"build": "vite build",
1819
"staging": "vite build --mode staging",
1920
"serve": "vite preview",
@@ -29,7 +30,7 @@
2930
"test:br": "http-server dist --cors --brotli -c-1",
3031
"lint:eslint": "eslint \"{src,mock,build}/**/*.{vue,ts,js,tsx,jsx}\" package.json --fix",
3132
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,css,scss,vue,ts,tsx,jsx,html,md}\"",
32-
"lint:stylelint": "stylelint --fix scss \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
33+
"lint:stylelint": "stylelint \"**/*.{vue,css,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
3334
"lint:pretty": "pretty-quick --staged",
3435
"lint:staged": "lint-staged",
3536
"cz": "czg",
@@ -39,103 +40,118 @@
3940
},
4041
"dependencies": {
4142
"@element-plus/icons-vue": "^2.1.0",
42-
"@intlify/unplugin-vue-i18n": "^1.0.1",
43-
"@jsxiaosi/utils": "^0.0.17",
44-
"@logicflow/core": "^1.2.12",
45-
"@logicflow/extension": "^1.2.13",
46-
"@vueuse/core": "^10.4.1",
47-
"axios": "^1.5.0",
48-
"dayjs": "^1.11.9",
49-
"docx-preview": "^0.1.18",
43+
"@intlify/unplugin-vue-i18n": "^1.5.0",
44+
"@jsxiaosi/utils": "^0.0.18",
45+
"@logicflow/core": "^1.2.17",
46+
"@logicflow/extension": "^1.2.18",
47+
"@vueuse/core": "^10.6.1",
48+
"axios": "^1.6.2",
49+
"commitlint": "18.4.2",
50+
"dayjs": "^1.11.10",
51+
"docx-preview": "^0.1.20",
5052
"echarts": "^5.4.3",
51-
"element-plus": "^2.4.1",
53+
"element-plus": "^2.4.2",
5254
"es6-promise": "^4.2.8",
53-
"i18next": "^23.5.0",
55+
"html2pdf.js": "^0.10.1",
56+
"i18next": "^23.7.6",
5457
"intro.js": "^7.2.0",
5558
"lodash": "^4.17.21",
5659
"lodash-es": "^4.17.21",
57-
"marked": "^8.0.1",
60+
"marked": "^10.0.0",
5861
"mitt": "^3.0.1",
5962
"mockjs": "^1.1.0",
6063
"nprogress": "^0.2.0",
6164
"path": "^0.12.7",
62-
"pinia": "^2.1.6",
65+
"pinia": "^2.1.7",
6366
"qs": "^6.11.2",
6467
"sortablejs": "^1.15.0",
65-
"vue": "^3.3.4",
66-
"vue-i18n": "^9.3.0",
67-
"vue-pdf-embed": "^1.1.6",
68-
"vue-router": "^4.2.4",
68+
"vue": "^3.3.8",
69+
"vue-i18n": "^9.7.0",
70+
"vue-pdf-embed": "^1.2.1",
71+
"vue-router": "^4.2.5",
6972
"vue-types": "^5.1.1",
7073
"vuex": "^4.1.0",
7174
"wangeditor": "^4.7.15"
7275
},
7376
"devDependencies": {
74-
"@esbuild-kit/cjs-loader": "^2.4.2",
75-
"@jsxiaosi/commitlint-config": "^0.0.17",
76-
"@jsxiaosi/eslint-config-prettier": "^0.0.17",
77-
"@jsxiaosi/eslint-config-vue": "^0.0.17",
78-
"@types/core-js": "^2.5.6",
79-
"@types/intro.js": "^5.1.1",
80-
"@types/lodash-es": "^4.17.9",
81-
"@types/marked": "^5.0.1",
77+
"@esbuild-kit/cjs-loader": "^2.4.4",
78+
"@jsxiaosi/commitlint-config": "^0.0.20",
79+
"@jsxiaosi/eslint-config-prettier": "^0.0.20",
80+
"@jsxiaosi/eslint-config-vue": "^0.0.20",
81+
"@types/core-js": "^2.5.8",
82+
"@types/intro.js": "^5.1.4",
83+
"@types/lodash-es": "^4.17.11",
84+
"@types/marked": "^5.0.2",
85+
"@types/mockjs": "^1.0.10",
8286
"@types/node": "*",
83-
"@types/nprogress": "^0.2.0",
84-
"@types/qs": "^6.9.8",
85-
"@types/sortablejs": "^1.15.2",
86-
"@vitejs/plugin-vue": "^4.3.4",
87-
"@vitejs/plugin-vue-jsx": "^3.0.2",
88-
"@vue/test-utils": "^2.4.1",
89-
"autoprefixer": "^10.4.15",
90-
"conventional-changelog-cli": "^4.0.0",
87+
"@types/nprogress": "^0.2.3",
88+
"@types/qs": "^6.9.10",
89+
"@types/sortablejs": "^1.15.5",
90+
"@vitejs/plugin-vue": "^4.5.0",
91+
"@vitejs/plugin-vue-jsx": "^3.1.0",
92+
"@vue/test-utils": "^2.4.2",
93+
"autoprefixer": "^10.4.16",
94+
"conventional-changelog-cli": "^4.1.0",
9195
"cross-env": "^7.0.3",
9296
"czg": "^1.7.1",
9397
"echarts-wordcloud": "^2.1.0",
94-
"eslint": "^8.48.0",
95-
"eslint-plugin-jsonc": "^2.9.0",
98+
"eslint": "^8.54.0",
99+
"eslint-plugin-jsonc": "^2.10.0",
96100
"http-server": "^14.1.1",
97101
"husky": "^8.0.3",
98102
"jsdom": "^22.1.0",
99103
"kolorist": "^1.8.0",
100-
"lint-staged": "^14.0.1",
101-
"postcss": "^8.4.29",
104+
"lint-staged": "^15.1.0",
105+
"postcss": "^8.4.31",
102106
"postcss-html": "^1.5.0",
103107
"postcss-import": "^15.1.0",
104-
"postcss-scss": "^4.0.7",
108+
"postcss-scss": "^4.0.9",
105109
"prettier": "^2.8.8",
106110
"pretty-quick": "^3.1.3",
107111
"rollup-plugin-visualizer": "^5.9.2",
108-
"sass": "^1.66.1",
109-
"stylelint": "^15.10.3",
110-
"stylelint-config-recess-order": "^4.3.0",
112+
"sass": "^1.69.5",
113+
"stylelint": "^15.11.0",
114+
"stylelint-config-property-sort-order-smacss": "^9.1.0",
115+
"stylelint-config-recommended": "^13.0.0",
116+
"stylelint-config-recommended-scss": "^13.1.0",
117+
"stylelint-config-recommended-vue": "^1.5.0",
111118
"stylelint-config-standard": "^34.0.0",
119+
"stylelint-config-standard-scss": "^11.1.0",
112120
"stylelint-order": "^6.0.3",
113-
"stylelint-scss": "^5.1.0",
121+
"stylelint-scss": "^5.3.1",
122+
"tailwindcss": "^3.3.5",
114123
"typescript": "^5.2.2",
115124
"unplugin-element-plus": "^0.8.0",
116-
"vite": "^4.4.9",
125+
"vite": "^5.0.0",
117126
"vite-plugin-compression": "^0.5.1",
127+
"vite-plugin-fake-server": "^2.0.0",
118128
"vite-plugin-imagemin": "^0.6.1",
119-
"vite-plugin-inspect": "^0.7.38",
120-
"vite-plugin-linter": "^2.0.5",
121-
"vite-plugin-mock": "2.9.6",
122-
"vite-plugin-pwa": "^0.16.4",
129+
"vite-plugin-inspect": "^0.7.42",
130+
"vite-plugin-linter": "^2.0.7",
131+
"vite-plugin-pwa": "^0.17.0",
123132
"vite-plugin-style-import": "^2.0.0",
124133
"vite-plugin-svg-icons": "^2.0.1",
125-
"vitest": "^0.34.3",
126-
"vue-eslint-parser": "^9.3.1",
127-
"vue-tsc": "^1.8.10",
134+
"vitest": "^0.34.6",
135+
"vue-eslint-parser": "^9.3.2",
136+
"vue-tsc": "^1.8.22",
128137
"xlsx": "^0.18.5"
129138
},
130139
"pnpm": {
131140
"peerDependencyRules": {
132141
"ignoreMissing": [
133-
"rollup",
134-
"source-map-*",
135-
"stable",
136-
"uuid",
137-
"urix"
142+
"rollup"
138143
]
144+
},
145+
"allowedDeprecatedVersions": {
146+
"sourcemap-codec": "*",
147+
"w3c-hr-time": "*",
148+
"stable": "*",
149+
"source-map-resolve": "*",
150+
"source-map-url": "*",
151+
"resolve-url": "*",
152+
"rollup-plugin-terser": "*",
153+
"urix": "*",
154+
"uuid": "*"
139155
}
140156
},
141157
"resolutions": {

0 commit comments

Comments
 (0)