From 938dc7bf17bf569adfb08a619e6e9b372bd27a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E6=9C=88=E7=89=99ritakang?= <43694785+Ritakang0451@users.noreply.github.com> Date: Wed, 13 Jul 2022 11:21:41 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 365d3a63..808f8be6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ [![GitHub issues](https://img.shields.io/github/issues/WeBankFinTech/fes.js.svg?style=flat-square)](../../issues) [![MIT](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](http://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](../../pulls) +[![Page Views Count](https://badges.toozhao.com/badges/01G7TRNN1PH9PMSCYWDF3EK4QT/green.svg)](https://badges.toozhao.com/stats/01G7TRNN1PH9PMSCYWDF3EK4QT "Get your own page views count badge on badges.toozhao.com") From bcce28d5674da8497270c0f6e414a5d9f11aa1da Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Fri, 15 Jul 2022 10:15:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dwin=E4=B8=8B?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/misc/route/index.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/fes-preset-built-in/src/plugins/misc/route/index.js b/packages/fes-preset-built-in/src/plugins/misc/route/index.js index a47eacb7..e2b46985 100644 --- a/packages/fes-preset-built-in/src/plugins/misc/route/index.js +++ b/packages/fes-preset-built-in/src/plugins/misc/route/index.js @@ -1,8 +1,10 @@ import { readdirSync, statSync, readFileSync } from 'fs'; import { - join, extname, posix, basename + join, extname, basename } from 'path'; -import { lodash, parser, generator } from '@fesjs/utils'; +import { + lodash, parser, generator, winPath +} from '@fesjs/utils'; import { parse } from '@vue/compiler-sfc'; import { Logger } from '@fesjs/compiler'; import { runtimePath } from '../../../utils/constants'; @@ -25,14 +27,14 @@ const isProcessFile = function (path) { }; const isProcessDirectory = function (path, item) { - const component = join(path, item); + const component = winPath(join(path, item)); return statSync(component).isDirectory() && !['components'].includes(item); }; const checkHasLayout = function (path) { const dirList = readdirSync(path); return dirList.some((item) => { - if (!isProcessFile(join(path, item))) { + if (!isProcessFile(winPath(join(path, item)))) { return false; } const ext = extname(item); @@ -42,7 +44,7 @@ const checkHasLayout = function (path) { }; const getRouteName = function (parentRoutePath, fileName) { - const routeName = posix.join(parentRoutePath, fileName); + const routeName = winPath(join(parentRoutePath, fileName)); return routeName .slice(1) .replace(/\//g, '_') @@ -63,7 +65,7 @@ const getRoutePath = function (parentRoutePath, fileName, isFile = true) { if (fileName.includes('*')) { fileName = fileName.replace('*', ':pathMatch(.*)'); } - return posix.join(parentRoutePath, fileName); + return winPath(join(parentRoutePath, fileName)); }; function getRouteMeta(content) { @@ -94,8 +96,8 @@ const genRoutes = function (parentRoutes, path, parentRoutePath) { } dirList.forEach((item) => { // 文件或者目录的绝对路径 - const component = join(path, item); - if (isProcessFile(component)) { + const filePath = winPath(join(path, item)); + if (isProcessFile(filePath)) { const ext = extname(item); const fileName = basename(item, ext); // 路由的path @@ -108,9 +110,9 @@ const genRoutes = function (parentRoutes, path, parentRoutePath) { // 路由名称 const routeName = getRouteName(parentRoutePath, fileName); - const componentPath = posix.join(path, item); + const componentPath = winPath(filePath); - let content = readFileSync(component, 'utf-8'); + let content = readFileSync(filePath, 'utf-8'); let routeMeta = {}; if (ext === '.vue') { const { descriptor } = parse(content); @@ -148,7 +150,7 @@ const genRoutes = function (parentRoutes, path, parentRoutePath) { dirList.forEach((item) => { if (isProcessDirectory(path, item)) { // 文件或者目录的绝对路径 - const nextPath = join(path, item); + const nextPath = winPath(join(path, item)); const nextParentRouteUrl = getRoutePath(parentRoutePath, item, false); if (hasLayout) { genRoutes(layoutRoute.children, nextPath, nextParentRouteUrl); From 41e67ca4a06316313ebb44269dbcf7efa383fba1 Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Fri, 15 Jul 2022 10:15:59 +0800 Subject: [PATCH 3/3] chore(release): publish - @fesjs/preset-built-in@2.1.3 - @fesjs/fes@2.1.3 --- packages/fes-preset-built-in/package.json | 2 +- packages/fes/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fes-preset-built-in/package.json b/packages/fes-preset-built-in/package.json index 0d9414ae..f4e2517f 100644 --- a/packages/fes-preset-built-in/package.json +++ b/packages/fes-preset-built-in/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/preset-built-in", - "version": "2.1.2", + "version": "2.1.3", "description": "@fesjs/preset-built-in", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/fes/package.json b/packages/fes/package.json index 0cbecb17..c3447613 100644 --- a/packages/fes/package.json +++ b/packages/fes/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/fes", - "version": "2.1.2", + "version": "2.1.3", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { @@ -39,7 +39,7 @@ ], "dependencies": { "@fesjs/compiler": "^2.0.5", - "@fesjs/preset-built-in": "^2.1.2", + "@fesjs/preset-built-in": "^2.1.3", "@fesjs/runtime": "^2.0.2", "@fesjs/utils": "^2.0.4", "resolve-cwd": "^3.0.0"