From 43219d9cba3f879c923bfce15c29895bd9f2270e Mon Sep 17 00:00:00 2001 From: mater Date: Fri, 3 Jan 2025 14:10:47 +0800 Subject: [PATCH 1/3] fix: docs --- docs-vuepress/.vuepress/config.js | 127 +------------------------- docs-vuepress/.vuepress/enhanceApp.js | 5 - package.json | 19 +--- 3 files changed, 4 insertions(+), 147 deletions(-) diff --git a/docs-vuepress/.vuepress/config.js b/docs-vuepress/.vuepress/config.js index c4714e9bf..796588e02 100644 --- a/docs-vuepress/.vuepress/config.js +++ b/docs-vuepress/.vuepress/config.js @@ -1,107 +1,4 @@ const { headerPlugin } = require('./headerMdPlugin') -const { presetUno } = require('unocss') -const UnoCSS = require('@unocss/webpack').default - -const unocss = { - '/unocss': [ - { - title: 'General', - children: [ - '/unocss/utilities/general/colors', - '/unocss/utilities/general/typography', - '/unocss/utilities/general/svg', - '/unocss/utilities/general/variants', - ], - }, - { - title: 'Accessibility', - children: [ - '/unocss/utilities/accessibility/screen-readers' - ], - }, - { - title: 'Animations', - children: [ - '/unocss/utilities/animations/animation', - '/unocss/utilities/animations/transforms', - '/unocss/utilities/animations/transitions' - ], - }, - { - title: 'Backgrounds', - children: [ - '/unocss/utilities/backgrounds/background', - '/unocss/utilities/backgrounds/gradients', - '/unocss/utilities/backgrounds/background-blend-mode' - ], - }, - { - title: 'Behaviors', - children: [ - '/unocss/utilities/behaviors/box-decoration-break', - '/unocss/utilities/behaviors/image-rendering', - '/unocss/utilities/behaviors/listings', - '/unocss/utilities/behaviors/overflow', - '/unocss/utilities/behaviors/overscroll-behavior', - '/unocss/utilities/behaviors/placeholder', - ], - }, - { - title: 'Borders', - children: [ - '/unocss/utilities/borders/border', - '/unocss/utilities/borders/divider', - '/unocss/utilities/borders/outline', - '/unocss/utilities/borders/ring', - ], - }, - { - title: 'Effects', - children: [ - '/unocss/utilities/effects/box-shadow', - '/unocss/utilities/effects/opacity', - '/unocss/utilities/effects/mix-blend-mode', - ], - }, - { - title: 'Filters', - children: [ - '/unocss/utilities/filters/filter', - '/unocss/utilities/filters/backdrop-filter', - ], - }, - { - title: 'Interactivity', - children: [ - '/unocss/utilities/interactivity/accent-color', - '/unocss/utilities/interactivity/appearance', - '/unocss/utilities/interactivity/cursor', - '/unocss/utilities/interactivity/caret', - '/unocss/utilities/interactivity/pointer-events', - '/unocss/utilities/interactivity/resize', - '/unocss/utilities/interactivity/scroll-behavior', - '/unocss/utilities/interactivity/touch-action', - '/unocss/utilities/interactivity/user-select', - '/unocss/utilities/interactivity/will-change', - ], - }, - { - title: 'Layout', - children: [ - // { title: 'Aspect Ratio', link: '/unocss/utilities/layout/aspect-ratio' }, - '/unocss/utilities/layout/columns', - '/unocss/utilities/layout/container', - '/unocss/utilities/layout/display', - '/unocss/utilities/layout/flexbox', - '/unocss/utilities/layout/grid', - '/unocss/utilities/layout/positioning', - '/unocss/utilities/layout/sizing', - '/unocss/utilities/layout/spacing', - '/unocss/utilities/layout/tables', - ], - }, - ] -} const sidebar = { '/guide/': [ @@ -222,8 +119,7 @@ const sidebar = { { title: '小程序跨端组件库 Mpx-cube-ui 开源啦', path: 'mpx-cube-ui' }, { title: 'Mpx-cli 插件化改造', path: 'mpx-cli-next' }, { title: 'Mpx 小程序单元测试能力建设与实践', path: 'unit-test'} - ], - ...unocss + ] } const nav = [ @@ -282,27 +178,6 @@ module.exports = { chainWebpack: (config, isServer) => { // 添加node_modules避免resolve错误 config.resolve.modules.add('node_modules') - config.module.rule('vue').uses.delete('cache-loader') - config.module.rule('tsx').uses.delete('cache-loader') - config.merge({ - cache: false - }) - config.plugin('extract-css').use(require('mini-css-extract-plugin'), [ - { - filename: '[name].css', - chunkFilename: '[name].[hash:9].css' - } - ]) - }, - configureWebpack: { - plugins: [ - UnoCSS({ - presets: [ - presetUno() - ], - configFile: false - }) - ] }, markdown: { // markdown-it-toc 的选项 diff --git a/docs-vuepress/.vuepress/enhanceApp.js b/docs-vuepress/.vuepress/enhanceApp.js index dc9b21589..878e2134d 100644 --- a/docs-vuepress/.vuepress/enhanceApp.js +++ b/docs-vuepress/.vuepress/enhanceApp.js @@ -1,8 +1,3 @@ -import a from 'uno.css' - -console.log(a); - - export default ({ router }) => { if (typeof process === 'undefined' || process.env.VUE_ENV !== 'server') { router.onReady(() => { diff --git a/package.json b/package.json index a14ad37cf..903e0a3db 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,8 @@ "@types/jest": "^27.0.1", "@typescript-eslint/eslint-plugin": "^5.2.0", "@typescript-eslint/parser": "^5.2.0", - "@unocss/webpack": "0.58.9", "@vuepress/plugin-back-to-top": "^1.8.2", "@vuepress/plugin-pwa": "^1.8.0", - "@vueuse/core": "^7.7.0", - "@windicss/shared-components": "^0.1.8", - "codemirror": "^5.65.2", - "codemirror-theme-vars": "^0.1.1", "eslint": "^7.32.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-html": "^6.2.0", @@ -37,22 +32,14 @@ "eslint-plugin-jest": "^27.0.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-react-hooks": "^5.1.0", "identity-obj-proxy": "^3.0.0", "jest": "^27.2.0", - "json5": "^2.2.0", "lerna": "^8.1.8", - "lz-string": "^1.4.4", - "mini-css-extract-plugin": "^1.6.2", - "mitt": "^3.0.0", - "preact": "^10.6.6", - "prism-theme-vars": "^0.2.2", - "prismjs": "^1.27.0", - "splitpanes": "^3.1.1", "typescript": "^4.1.3", - "unocss": "0.58.9", - "vue": "^3.2.31", "vuepress": "^1.9.7", - "windicss": "^3.5.1" + "vue-template-compiler": "^2.7.16", + "webpack": "^4.47.0" }, "workspaces": [ "packages/*" From 109149712d862117047123731c040c5478c39a44 Mon Sep 17 00:00:00 2001 From: mater Date: Fri, 3 Jan 2025 14:12:42 +0800 Subject: [PATCH 2/3] fix: docs --- docs-vuepress/.vuepress/config.js | 105 +++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/docs-vuepress/.vuepress/config.js b/docs-vuepress/.vuepress/config.js index 796588e02..b9f42ca0a 100644 --- a/docs-vuepress/.vuepress/config.js +++ b/docs-vuepress/.vuepress/config.js @@ -1,5 +1,107 @@ const { headerPlugin } = require('./headerMdPlugin') + +const unocss = { + '/unocss': [ + { + title: 'General', + children: [ + '/unocss/utilities/general/colors', + '/unocss/utilities/general/typography', + '/unocss/utilities/general/svg', + '/unocss/utilities/general/variants', + ], + }, + { + title: 'Accessibility', + children: [ + '/unocss/utilities/accessibility/screen-readers' + ], + }, + { + title: 'Animations', + children: [ + '/unocss/utilities/animations/animation', + '/unocss/utilities/animations/transforms', + '/unocss/utilities/animations/transitions' + ], + }, + { + title: 'Backgrounds', + children: [ + '/unocss/utilities/backgrounds/background', + '/unocss/utilities/backgrounds/gradients', + '/unocss/utilities/backgrounds/background-blend-mode' + ], + }, + { + title: 'Behaviors', + children: [ + '/unocss/utilities/behaviors/box-decoration-break', + '/unocss/utilities/behaviors/image-rendering', + '/unocss/utilities/behaviors/listings', + '/unocss/utilities/behaviors/overflow', + '/unocss/utilities/behaviors/overscroll-behavior', + '/unocss/utilities/behaviors/placeholder', + ], + }, + { + title: 'Borders', + children: [ + '/unocss/utilities/borders/border', + '/unocss/utilities/borders/divider', + '/unocss/utilities/borders/outline', + '/unocss/utilities/borders/ring', + ], + }, + { + title: 'Effects', + children: [ + '/unocss/utilities/effects/box-shadow', + '/unocss/utilities/effects/opacity', + '/unocss/utilities/effects/mix-blend-mode', + ], + }, + { + title: 'Filters', + children: [ + '/unocss/utilities/filters/filter', + '/unocss/utilities/filters/backdrop-filter', + ], + }, + { + title: 'Interactivity', + children: [ + '/unocss/utilities/interactivity/accent-color', + '/unocss/utilities/interactivity/appearance', + '/unocss/utilities/interactivity/cursor', + '/unocss/utilities/interactivity/caret', + '/unocss/utilities/interactivity/pointer-events', + '/unocss/utilities/interactivity/resize', + '/unocss/utilities/interactivity/scroll-behavior', + '/unocss/utilities/interactivity/touch-action', + '/unocss/utilities/interactivity/user-select', + '/unocss/utilities/interactivity/will-change', + ], + }, + { + title: 'Layout', + children: [ + // { title: 'Aspect Ratio', link: '/unocss/utilities/layout/aspect-ratio' }, + '/unocss/utilities/layout/columns', + '/unocss/utilities/layout/container', + '/unocss/utilities/layout/display', + '/unocss/utilities/layout/flexbox', + '/unocss/utilities/layout/grid', + '/unocss/utilities/layout/positioning', + '/unocss/utilities/layout/sizing', + '/unocss/utilities/layout/spacing', + '/unocss/utilities/layout/tables', + ], + }, + ] +} + const sidebar = { '/guide/': [ { @@ -119,7 +221,8 @@ const sidebar = { { title: '小程序跨端组件库 Mpx-cube-ui 开源啦', path: 'mpx-cube-ui' }, { title: 'Mpx-cli 插件化改造', path: 'mpx-cli-next' }, { title: 'Mpx 小程序单元测试能力建设与实践', path: 'unit-test'} - ] + ], + ...unocss } const nav = [ From 3fc9efa731945245e9b8a47bc3d7d7de6f5e390c Mon Sep 17 00:00:00 2001 From: xiaolei <1017653702@qq.com> Date: Fri, 3 Jan 2025 16:16:19 +0800 Subject: [PATCH 3/3] [fix]formatValue --- packages/webpack-plugin/lib/react/processStyles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/webpack-plugin/lib/react/processStyles.js b/packages/webpack-plugin/lib/react/processStyles.js index ca6bbeac3..063593c65 100644 --- a/packages/webpack-plugin/lib/react/processStyles.js +++ b/packages/webpack-plugin/lib/react/processStyles.js @@ -63,6 +63,7 @@ module.exports = function (styles, { };\n let __unoClassMap global.__getUnoClassMap = function () { + const formatValue = global.__formatValue if (!__unoClassMap) { __unoClassMap = __unoCssMapPlaceholder__ }