Skip to content

Commit

Permalink
Merge pull request #8 from jsxiaosi/feature/vite5-beta
Browse files Browse the repository at this point in the history
Feature/vite5 beta
  • Loading branch information
jsxiaosi authored Nov 20, 2023
2 parents 5e9e8b6 + 7c47f0b commit 48e85f0
Show file tree
Hide file tree
Showing 80 changed files with 3,726 additions and 3,035 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"syler.sass-indented",
"esbenp.prettier-vscode",
"lokalise.i18n-ally",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"donjayamanne.githistory"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"files.associations": {
"tailwind.css": "tailwindcss"
},
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"eslint.validate": ["json", "javascript", "typescript", "typescriptreact", "javascriptreact"],
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"i18n-ally.localesPaths": ["src/locales/modules"],
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": ["vue"],
Expand Down
1 change: 1 addition & 0 deletions README.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Supports modern browsers, not Internet Explorer

- [vue-vben-admin](https://github.com/anncwb/vue-vben-admin)
- [vue-pure-admin](https://github.com/xiaoxian521/vue-pure-admin)
- [vue-office](https://github.com/501351981/vue-office)

## maintainers

Expand Down
14 changes: 0 additions & 14 deletions build/vite/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ export function createViteCSS(): CSSOptions {
javascriptEnabled: true,
},
},
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule: { name: string; remove: () => void }) => {
if (atRule.name === 'charset') {
atRule.remove();
}
},
},
},
],
},
};
return viteCSS;
}
4 changes: 2 additions & 2 deletions build/vite/plugin/buildOuteInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export function viteBuildOuteInfo(): Plugin {
// 该插件在 plugin-vue 插件之前执行,这样就可以直接解析到原模板文件
enforce: 'post',
transformIndexHtml: {
enforce: 'post',
transform: () => {},
order: 'post',
handler: () => {},
},

configResolved(resolvedConfig) {
Expand Down
19 changes: 7 additions & 12 deletions build/vite/plugin/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
* Mock plugin for development and production.
* https://github.com/anncwb/vite-plugin-mock
*/
import { viteMockServe } from 'vite-plugin-mock';
import { vitePluginFakeServer } from 'vite-plugin-fake-server';

export function configMockPlugin(isBuild: boolean) {
return viteMockServe({
ignore: /^\_/,
mockPath: 'mock',
localEnabled: !isBuild,
prodEnabled: isBuild,
injectCode: `
import { setupProdMockServer } from '../mock/_createProductionServer';
setupProdMockServer();
`,
export function configMockPlugin() {
return vitePluginFakeServer({
logger: false,
include: 'mock',
infixName: false,
enableProd: true,
});
}
File renamed without changes.
15 changes: 0 additions & 15 deletions mock/_createProductionServer.ts

This file was deleted.

6 changes: 3 additions & 3 deletions mock/demo/account.ts → mock/account.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MockMethod, Recordable } from 'vite-plugin-mock';
import { defineFakeRoute } from 'vite-plugin-fake-server/client';

const userInfo = {
name: '爱喝蜂蜜绿的小斯斯',
Expand All @@ -22,7 +22,7 @@ const userInfo2 = {
role: 'test',
};

export default [
export default defineFakeRoute([
{
url: '/mock_api/login',
timeout: 1000,
Expand Down Expand Up @@ -68,7 +68,7 @@ export default [
return userInfo;
},
},
] as MockMethod[];
]);

function genID(length: number) {
return Number(Math.random().toString().substr(3, length) + Date.now()).toString(36);
Expand Down
6 changes: 3 additions & 3 deletions mock/demo/route.ts → mock/route.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MockMethod, Recordable } from 'vite-plugin-mock';
import { defineFakeRoute } from 'vite-plugin-fake-server/client';

const power = [
{
Expand Down Expand Up @@ -178,7 +178,7 @@ const testPermissionRouter = [

// permissionRouter

export default [
export default defineFakeRoute([
{
url: '/mock_api/getRoute',
timeout: 0,
Expand Down Expand Up @@ -206,4 +206,4 @@ export default [
}
},
},
] as MockMethod[];
]);
132 changes: 74 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vue-xs-admin",
"version": "1.9.1",
"type": "module",
"version": "2.0.0",
"packageManager": "[email protected]",
"author": {
"name": "小斯斯",
Expand All @@ -9,11 +10,11 @@
},
"license": "MIT",
"engines": {
"node": ">=16",
"node": ">=18",
"pnpm": ">=8.1.0"
},
"scripts": {
"dev": "vite",
"dev": "vite dev",
"build": "vite build",
"staging": "vite build --mode staging",
"serve": "vite preview",
Expand All @@ -29,7 +30,7 @@
"test:br": "http-server dist --cors --brotli -c-1",
"lint:eslint": "eslint \"{src,mock,build}/**/*.{vue,ts,js,tsx,jsx}\" package.json --fix",
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,css,scss,vue,ts,tsx,jsx,html,md}\"",
"lint:stylelint": "stylelint --fix scss \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:stylelint": "stylelint \"**/*.{vue,css,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
"lint:pretty": "pretty-quick --staged",
"lint:staged": "lint-staged",
"cz": "czg",
Expand All @@ -39,103 +40,118 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.1.0",
"@intlify/unplugin-vue-i18n": "^1.0.1",
"@jsxiaosi/utils": "^0.0.17",
"@logicflow/core": "^1.2.12",
"@logicflow/extension": "^1.2.13",
"@vueuse/core": "^10.4.1",
"axios": "^1.5.0",
"dayjs": "^1.11.9",
"docx-preview": "^0.1.18",
"@intlify/unplugin-vue-i18n": "^1.5.0",
"@jsxiaosi/utils": "^0.0.18",
"@logicflow/core": "^1.2.17",
"@logicflow/extension": "^1.2.18",
"@vueuse/core": "^10.6.1",
"axios": "^1.6.2",
"commitlint": "18.4.2",
"dayjs": "^1.11.10",
"docx-preview": "^0.1.20",
"echarts": "^5.4.3",
"element-plus": "^2.4.1",
"element-plus": "^2.4.2",
"es6-promise": "^4.2.8",
"i18next": "^23.5.0",
"html2pdf.js": "^0.10.1",
"i18next": "^23.7.6",
"intro.js": "^7.2.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"marked": "^8.0.1",
"marked": "^10.0.0",
"mitt": "^3.0.1",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path": "^0.12.7",
"pinia": "^2.1.6",
"pinia": "^2.1.7",
"qs": "^6.11.2",
"sortablejs": "^1.15.0",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0",
"vue-pdf-embed": "^1.1.6",
"vue-router": "^4.2.4",
"vue": "^3.3.8",
"vue-i18n": "^9.7.0",
"vue-pdf-embed": "^1.2.1",
"vue-router": "^4.2.5",
"vue-types": "^5.1.1",
"vuex": "^4.1.0",
"wangeditor": "^4.7.15"
},
"devDependencies": {
"@esbuild-kit/cjs-loader": "^2.4.2",
"@jsxiaosi/commitlint-config": "^0.0.17",
"@jsxiaosi/eslint-config-prettier": "^0.0.17",
"@jsxiaosi/eslint-config-vue": "^0.0.17",
"@types/core-js": "^2.5.6",
"@types/intro.js": "^5.1.1",
"@types/lodash-es": "^4.17.9",
"@types/marked": "^5.0.1",
"@esbuild-kit/cjs-loader": "^2.4.4",
"@jsxiaosi/commitlint-config": "^0.0.20",
"@jsxiaosi/eslint-config-prettier": "^0.0.20",
"@jsxiaosi/eslint-config-vue": "^0.0.20",
"@types/core-js": "^2.5.8",
"@types/intro.js": "^5.1.4",
"@types/lodash-es": "^4.17.11",
"@types/marked": "^5.0.2",
"@types/mockjs": "^1.0.10",
"@types/node": "*",
"@types/nprogress": "^0.2.0",
"@types/qs": "^6.9.8",
"@types/sortablejs": "^1.15.2",
"@vitejs/plugin-vue": "^4.3.4",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/test-utils": "^2.4.1",
"autoprefixer": "^10.4.15",
"conventional-changelog-cli": "^4.0.0",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.10",
"@types/sortablejs": "^1.15.5",
"@vitejs/plugin-vue": "^4.5.0",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/test-utils": "^2.4.2",
"autoprefixer": "^10.4.16",
"conventional-changelog-cli": "^4.1.0",
"cross-env": "^7.0.3",
"czg": "^1.7.1",
"echarts-wordcloud": "^2.1.0",
"eslint": "^8.48.0",
"eslint-plugin-jsonc": "^2.9.0",
"eslint": "^8.54.0",
"eslint-plugin-jsonc": "^2.10.0",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"kolorist": "^1.8.0",
"lint-staged": "^14.0.1",
"postcss": "^8.4.29",
"lint-staged": "^15.1.0",
"postcss": "^8.4.31",
"postcss-html": "^1.5.0",
"postcss-import": "^15.1.0",
"postcss-scss": "^4.0.7",
"postcss-scss": "^4.0.9",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"rollup-plugin-visualizer": "^5.9.2",
"sass": "^1.66.1",
"stylelint": "^15.10.3",
"stylelint-config-recess-order": "^4.3.0",
"sass": "^1.69.5",
"stylelint": "^15.11.0",
"stylelint-config-property-sort-order-smacss": "^9.1.0",
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-recommended-scss": "^13.1.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.1.0",
"stylelint-order": "^6.0.3",
"stylelint-scss": "^5.1.0",
"stylelint-scss": "^5.3.1",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2",
"unplugin-element-plus": "^0.8.0",
"vite": "^4.4.9",
"vite": "^5.0.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-fake-server": "^2.0.0",
"vite-plugin-imagemin": "^0.6.1",
"vite-plugin-inspect": "^0.7.38",
"vite-plugin-linter": "^2.0.5",
"vite-plugin-mock": "2.9.6",
"vite-plugin-pwa": "^0.16.4",
"vite-plugin-inspect": "^0.7.42",
"vite-plugin-linter": "^2.0.7",
"vite-plugin-pwa": "^0.17.0",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vitest": "^0.34.3",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.10",
"vitest": "^0.34.6",
"vue-eslint-parser": "^9.3.2",
"vue-tsc": "^1.8.22",
"xlsx": "^0.18.5"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"rollup",
"source-map-*",
"stable",
"uuid",
"urix"
"rollup"
]
},
"allowedDeprecatedVersions": {
"sourcemap-codec": "*",
"w3c-hr-time": "*",
"stable": "*",
"source-map-resolve": "*",
"source-map-url": "*",
"resolve-url": "*",
"rollup-plugin-terser": "*",
"urix": "*",
"uuid": "*"
}
},
"resolutions": {
Expand Down
Loading

0 comments on commit 48e85f0

Please sign in to comment.