From 545ef5b0ddf63c8a6bdb77e582ee00530b49ce7b Mon Sep 17 00:00:00 2001 From: Nex Zhu <4370605+NexZhu@users.noreply.github.com> Date: Mon, 27 Dec 2021 19:07:17 +0800 Subject: [PATCH] feat: add unplugin-auto-imports --- .eslintrc.js | 1 + .fes.js | 18 ++ package-lock.json | 496 +++++++++++++++++++++++++++++++++++- package.json | 7 +- src/pages/index.vue | 1 - src/types/auto-imports.d.ts | 53 ++++ 6 files changed, 570 insertions(+), 6 deletions(-) create mode 100644 src/types/auto-imports.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 0fc66ef..0661224 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,7 @@ module.exports = { project: 'tsconfig.json', }, rules: { + 'no-undef': 'off', // Turn off for `unplugin-auto-import` 'vue/multi-word-component-names': 'off', }, overrides: [ diff --git a/.fes.js b/.fes.js index 8e0fd2e..485e37b 100644 --- a/.fes.js +++ b/.fes.js @@ -1,6 +1,7 @@ // .fes.js 只负责管理编译时配置,只能使用plain Object import ESLintPlugin from 'eslint-webpack-plugin' import StylelintPlugin from 'stylelint-webpack-plugin' +import AutoImportPlugin from 'unplugin-auto-import/webpack' export default { publicPath: './', @@ -43,5 +44,22 @@ export default { extensions: ['css', 'scss', 'vue', 'tsx'], }, ]) + config.plugin('auto-import').use( + AutoImportPlugin({ + dts: './src/types/auto-imports.d.ts', + include: [ + /src\/.+\.[tj]sx?$/, // .ts, .tsx, .js, .jsx + /src\/.+\.vue$/, + /src\/.+\.vue\?vue/, // .vue + /src\/.+\.md$/, // .md + ], + // global imports to register + imports: [ + // presets + 'vue', + 'vue-router', + ], + }), + ) }, } diff --git a/package-lock.json b/package-lock.json index ab9ef1d..2e0bae4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@daotl/prettier-config": "^0.1.2", "@daotl/tsconfig": "^0.0.4", "@fesjs/plugin-sass": "^2.0.0", + "@fesjs/plugin-windicss": "^2.0.4", "@vue/compiler-sfc": "^3.2.26", "cross-env": "^7.0.3", "eslint-webpack-plugin": "^3.1.1", @@ -33,7 +34,8 @@ "stylelint-config-recommended-scss": "^5.0.2", "stylelint-config-recommended-vue": "^1.1.0", "stylelint-webpack-plugin": "^3.1.0", - "typescript": "^4.5.4" + "typescript": "^4.5.4", + "unplugin-auto-import": "^0.5.5" } }, "node_modules/@ant-design/colors": { @@ -64,6 +66,18 @@ "version": "4.14.169", "license": "MIT" }, + "node_modules/@antfu/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@antfu/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-UU8TLr/EoXdg7OjMp0h9oDoIAVr+Z/oW9cpOxQQyrsz6Qzd2ms/1CdWx8fl2OQdFpxGmq5Vc4TwfLHId6nAZjA==", + "dev": true, + "dependencies": { + "@types/throttle-debounce": "^2.1.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.0", "license": "MIT", @@ -1896,6 +1910,34 @@ "@fesjs/fes": "^2.0.0" } }, + "node_modules/@fesjs/plugin-windicss": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@fesjs/plugin-windicss/-/plugin-windicss-2.0.4.tgz", + "integrity": "sha512-Dxb/Sa1t48QmWeOBqtwySc79JhrDfhIj4k+IoVz5fbV8WW71Ab4sSAhmmm/d03wW/vtW920RJ9HUNcDtF6/jsg==", + "dev": true, + "dependencies": { + "qs": "^6.10.2", + "windicss-webpack-plugin": "^1.6.0" + }, + "peerDependencies": { + "vue": "^3.0.5" + } + }, + "node_modules/@fesjs/plugin-windicss/node_modules/qs": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.2.tgz", + "integrity": "sha512-mSIdjzqznWgfd4pMii7sHtaYF8rx8861hBO80SraY5GT0XQibWZWJSid0avzHGkDIZLImux2S5mXO0Hfct2QCw==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@fesjs/preset-built-in": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/@fesjs/preset-built-in/-/preset-built-in-2.0.10.tgz", @@ -2173,6 +2215,19 @@ "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==" }, + "node_modules/@rollup/pluginutils": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", + "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/@sideway/address": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", @@ -2391,6 +2446,12 @@ "node": ">=0.10.0" } }, + "node_modules/@types/throttle-debounce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz", + "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.8.0", "dev": true, @@ -2833,6 +2894,38 @@ "@xtuc/long": "4.2.2" } }, + "node_modules/@windicss/config": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@windicss/config/-/config-1.6.1.tgz", + "integrity": "sha512-E4FKtWdYl5HwFknBQ+Z2JIF58TZiR4/ZiP8B30sfRxNlG6clh4agn5MJqTb4ER0MLkDb30Hugl2tGun0AQNbFw==", + "dev": true, + "dependencies": { + "debug": "^4.3.3", + "jiti": "^1.12.9", + "windicss": "^3.4.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@windicss/plugin-utils": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-1.6.1.tgz", + "integrity": "sha512-hFQY27bOr9SSpekIvSwBpIX25nR4cwrU5/1kJFqCwAzqyazvd7U9c/iI1E2sTEQOkPbpTTJkY2Act21Q70oSDQ==", + "dev": true, + "dependencies": { + "@antfu/utils": "^0.3.0", + "@windicss/config": "1.6.1", + "debug": "^4.3.3", + "fast-glob": "^3.2.7", + "magic-string": "^0.25.7", + "micromatch": "^4.0.4", + "windicss": "^3.4.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "license": "BSD-3-Clause" @@ -3598,6 +3691,30 @@ "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==" }, + "node_modules/builtins": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-4.0.0.tgz", + "integrity": "sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/bytes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", @@ -7288,6 +7405,19 @@ "node": ">=4" } }, + "node_modules/import-meta-resolve": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz", + "integrity": "sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==", + "dev": true, + "dependencies": { + "builtins": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "dev": true, @@ -7665,6 +7795,15 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jiti": { + "version": "1.12.9", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.12.9.tgz", + "integrity": "sha512-TdcJywkQtcwLxogc4rSMAi479G2eDPzfW0fLySks7TPhgZZ4s/tM6stnzayIh3gS/db3zExWJyUx4cNWrwAmoQ==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, "node_modules/jju": { "version": "1.4.0", "dev": true, @@ -8150,6 +8289,21 @@ "json5": "lib/cli.js" } }, + "node_modules/local-pkg": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.0.tgz", + "integrity": "sha512-2XBWjO/v63JeR1HPzLJxdTVRQDB84Av2p2KtBA5ahvpyLUPubcAU6iXlAJrONcY7aSqgJhXxElAnKtnYsRolPQ==", + "dev": true, + "dependencies": { + "mlly": "^0.2.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -8637,6 +8791,15 @@ "node": ">=10" } }, + "node_modules/mlly": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-0.2.10.tgz", + "integrity": "sha512-xfyW6c2QBGArtctzNnTV5leOKX8nOMz2simeubtXofdsdSJFSNw+Ncvrs8kxcN3pBrQLXuYBHNFV6NgZ5Ryf4A==", + "dev": true, + "dependencies": { + "import-meta-resolve": "^1.1.1" + } + }, "node_modules/mockjs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz", @@ -11170,6 +11333,20 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", @@ -12631,6 +12808,59 @@ "node": ">= 0.8" } }, + "node_modules/unplugin": { + "version": "0.2.21", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-0.2.21.tgz", + "integrity": "sha512-IJ15/L5XbhnV7J09Zjk0FT5HEkBjkXucWAXQWRsmEtUxmmxwh23yavrmDbCF6ZPxWiVB28+wnKIHePTRRpQPbQ==", + "dev": true, + "dependencies": { + "webpack-virtual-modules": "^0.4.3" + }, + "peerDependencies": { + "rollup": "^2.50.0", + "vite": "^2.3.0", + "webpack": "4 || 5" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "vite": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/unplugin-auto-import": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.5.5.tgz", + "integrity": "sha512-PAP/6WdqWtGhlQBvlVZ7qmhHbLcTYSsARtFSbY/jaUx/SaQkRT7SvronHIKEvx4bPmS+l4erQ9gQKSBBPzvUnQ==", + "dev": true, + "dependencies": { + "@antfu/utils": "^0.3.0", + "@rollup/pluginutils": "^4.1.2", + "local-pkg": "^0.4.0", + "magic-string": "^0.25.7", + "resolve": "^1.20.0", + "unplugin": "^0.2.21" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vueuse/core": "*" + }, + "peerDependenciesMeta": { + "@vueuse/core": { + "optional": true + } + } + }, "node_modules/unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -13777,6 +14007,12 @@ "node": ">=0.10.0" } }, + "node_modules/webpack-virtual-modules": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz", + "integrity": "sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==", + "dev": true + }, "node_modules/webpack/node_modules/acorn-import-assertions": { "version": "1.8.0", "license": "MIT", @@ -13928,6 +14164,58 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "node_modules/windicss": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/windicss/-/windicss-3.4.0.tgz", + "integrity": "sha512-X+9Y1/FPxX253Xo4Hk/qfVuvoAxgKx686Z6yHxmBFMH7wRCPdRO42na9k/yEnrW6EqCFJP/GcMIHn3QENaE42g==", + "dev": true, + "bin": { + "windicss": "cli/index.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/windicss-webpack-plugin": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/windicss-webpack-plugin/-/windicss-webpack-plugin-1.6.2.tgz", + "integrity": "sha512-1NhvBVmClIgxnC6C50RlqdpL9klF4g1JwJAoDNCdY0fO6o5GP6hO+E3xGCWI38l4Ij36JQZ4/CxFKWjdixXFBQ==", + "dev": true, + "dependencies": { + "@windicss/plugin-utils": "^1.6.1", + "debug": "^4.3.3", + "loader-utils": "^2.0.0", + "lodash": "^4.17.21", + "magic-string": "^0.25.7", + "upath": "^2.0.1", + "webpack-virtual-modules": "^0.4.3", + "windicss": "^3.4.0" + } + }, + "node_modules/windicss-webpack-plugin/node_modules/loader-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/windicss-webpack-plugin/node_modules/upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "dev": true, @@ -14098,6 +14386,15 @@ } } }, + "@antfu/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@antfu/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-UU8TLr/EoXdg7OjMp0h9oDoIAVr+Z/oW9cpOxQQyrsz6Qzd2ms/1CdWx8fl2OQdFpxGmq5Vc4TwfLHId6nAZjA==", + "dev": true, + "requires": { + "@types/throttle-debounce": "^2.1.0" + } + }, "@babel/code-frame": { "version": "7.16.0", "requires": { @@ -15310,6 +15607,27 @@ "sass-loader": "^11.0.1" } }, + "@fesjs/plugin-windicss": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@fesjs/plugin-windicss/-/plugin-windicss-2.0.4.tgz", + "integrity": "sha512-Dxb/Sa1t48QmWeOBqtwySc79JhrDfhIj4k+IoVz5fbV8WW71Ab4sSAhmmm/d03wW/vtW920RJ9HUNcDtF6/jsg==", + "dev": true, + "requires": { + "qs": "^6.10.2", + "windicss-webpack-plugin": "^1.6.0" + }, + "dependencies": { + "qs": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.2.tgz", + "integrity": "sha512-mSIdjzqznWgfd4pMii7sHtaYF8rx8861hBO80SraY5GT0XQibWZWJSid0avzHGkDIZLImux2S5mXO0Hfct2QCw==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + } + } + }, "@fesjs/preset-built-in": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/@fesjs/preset-built-in/-/preset-built-in-2.0.10.tgz", @@ -15518,6 +15836,16 @@ "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==" }, + "@rollup/pluginutils": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", + "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", + "dev": true, + "requires": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + } + }, "@sideway/address": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", @@ -15697,6 +16025,12 @@ } } }, + "@types/throttle-debounce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz", + "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { "version": "5.8.0", "dev": true, @@ -16007,6 +16341,32 @@ "@xtuc/long": "4.2.2" } }, + "@windicss/config": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@windicss/config/-/config-1.6.1.tgz", + "integrity": "sha512-E4FKtWdYl5HwFknBQ+Z2JIF58TZiR4/ZiP8B30sfRxNlG6clh4agn5MJqTb4ER0MLkDb30Hugl2tGun0AQNbFw==", + "dev": true, + "requires": { + "debug": "^4.3.3", + "jiti": "^1.12.9", + "windicss": "^3.4.0" + } + }, + "@windicss/plugin-utils": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@windicss/plugin-utils/-/plugin-utils-1.6.1.tgz", + "integrity": "sha512-hFQY27bOr9SSpekIvSwBpIX25nR4cwrU5/1kJFqCwAzqyazvd7U9c/iI1E2sTEQOkPbpTTJkY2Act21Q70oSDQ==", + "dev": true, + "requires": { + "@antfu/utils": "^0.3.0", + "@windicss/config": "1.6.1", + "debug": "^4.3.3", + "fast-glob": "^3.2.7", + "magic-string": "^0.25.7", + "micromatch": "^4.0.4", + "windicss": "^3.4.0" + } + }, "@xtuc/ieee754": { "version": "1.2.0" }, @@ -16556,6 +16916,26 @@ "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==" }, + "builtins": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-4.0.0.tgz", + "integrity": "sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw==", + "dev": true, + "requires": { + "semver": "^7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "bytes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", @@ -19185,6 +19565,15 @@ } } }, + "import-meta-resolve": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz", + "integrity": "sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==", + "dev": true, + "requires": { + "builtins": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "dev": true @@ -19444,6 +19833,12 @@ } } }, + "jiti": { + "version": "1.12.9", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.12.9.tgz", + "integrity": "sha512-TdcJywkQtcwLxogc4rSMAi479G2eDPzfW0fLySks7TPhgZZ4s/tM6stnzayIh3gS/db3zExWJyUx4cNWrwAmoQ==", + "dev": true + }, "jju": { "version": "1.4.0", "dev": true @@ -19789,6 +20184,15 @@ } } }, + "local-pkg": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.0.tgz", + "integrity": "sha512-2XBWjO/v63JeR1HPzLJxdTVRQDB84Av2p2KtBA5ahvpyLUPubcAU6iXlAJrONcY7aSqgJhXxElAnKtnYsRolPQ==", + "dev": true, + "requires": { + "mlly": "^0.2.2" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -20139,6 +20543,15 @@ "mkdirp": { "version": "1.0.4" }, + "mlly": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-0.2.10.tgz", + "integrity": "sha512-xfyW6c2QBGArtctzNnTV5leOKX8nOMz2simeubtXofdsdSJFSNw+Ncvrs8kxcN3pBrQLXuYBHNFV6NgZ5Ryf4A==", + "dev": true, + "requires": { + "import-meta-resolve": "^1.1.1" + } + }, "mockjs": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz", @@ -21901,6 +22314,17 @@ "version": "3.0.0", "dev": true }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "signal-exit": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", @@ -22979,6 +23403,29 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "unplugin": { + "version": "0.2.21", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-0.2.21.tgz", + "integrity": "sha512-IJ15/L5XbhnV7J09Zjk0FT5HEkBjkXucWAXQWRsmEtUxmmxwh23yavrmDbCF6ZPxWiVB28+wnKIHePTRRpQPbQ==", + "dev": true, + "requires": { + "webpack-virtual-modules": "^0.4.3" + } + }, + "unplugin-auto-import": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.5.5.tgz", + "integrity": "sha512-PAP/6WdqWtGhlQBvlVZ7qmhHbLcTYSsARtFSbY/jaUx/SaQkRT7SvronHIKEvx4bPmS+l4erQ9gQKSBBPzvUnQ==", + "dev": true, + "requires": { + "@antfu/utils": "^0.3.0", + "@rollup/pluginutils": "^4.1.2", + "local-pkg": "^0.4.0", + "magic-string": "^0.25.7", + "resolve": "^1.20.0", + "unplugin": "^0.2.21" + } + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -23876,6 +24323,12 @@ } } }, + "webpack-virtual-modules": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz", + "integrity": "sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==", + "dev": true + }, "webpackbar": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-5.0.2.tgz", @@ -23959,6 +24412,47 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "windicss": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/windicss/-/windicss-3.4.0.tgz", + "integrity": "sha512-X+9Y1/FPxX253Xo4Hk/qfVuvoAxgKx686Z6yHxmBFMH7wRCPdRO42na9k/yEnrW6EqCFJP/GcMIHn3QENaE42g==", + "dev": true + }, + "windicss-webpack-plugin": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/windicss-webpack-plugin/-/windicss-webpack-plugin-1.6.2.tgz", + "integrity": "sha512-1NhvBVmClIgxnC6C50RlqdpL9klF4g1JwJAoDNCdY0fO6o5GP6hO+E3xGCWI38l4Ij36JQZ4/CxFKWjdixXFBQ==", + "dev": true, + "requires": { + "@windicss/plugin-utils": "^1.6.1", + "debug": "^4.3.3", + "loader-utils": "^2.0.0", + "lodash": "^4.17.21", + "magic-string": "^0.25.7", + "upath": "^2.0.1", + "webpack-virtual-modules": "^0.4.3", + "windicss": "^3.4.0" + }, + "dependencies": { + "loader-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "upath": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", + "dev": true + } + } + }, "word-wrap": { "version": "1.2.3", "dev": true diff --git a/package.json b/package.json index 46a59b7..57cd298 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@daotl/prettier-config": "^0.1.2", "@daotl/tsconfig": "^0.0.4", "@fesjs/plugin-sass": "^2.0.0", + "@fesjs/plugin-windicss": "^2.0.4", "@vue/compiler-sfc": "^3.2.26", "cross-env": "^7.0.3", "eslint-webpack-plugin": "^3.1.1", @@ -53,7 +54,8 @@ "stylelint-config-recommended-scss": "^5.0.2", "stylelint-config-recommended-vue": "^1.1.0", "stylelint-webpack-plugin": "^3.1.0", - "typescript": "^4.5.4" + "typescript": "^4.5.4", + "unplugin-auto-import": "^0.5.5" }, "dependencies": { "@fesjs/fes": "^2.0.11", @@ -63,8 +65,5 @@ "@fesjs/plugin-model": "^2.0.3", "ant-design-vue": "^2.2.0", "vue": "^3.2.6" - }, - "lint-staged": { - "*.css": "stylelint --fix" } } diff --git a/src/pages/index.vue b/src/pages/index.vue index 1f0cc65..262dd19 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -14,7 +14,6 @@