Skip to content

Commit

Permalink
Merge branch 'master' into fix-vite-html
Browse files Browse the repository at this point in the history
  • Loading branch information
wanchun committed Nov 10, 2023
2 parents 72dddfb + b37392a commit 0c103e6
Show file tree
Hide file tree
Showing 19 changed files with 1,896 additions and 2,515 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [3.0.18](https://github.com/WeBankFinTech/fes.js/compare/v3.0.17...v3.0.18) (2023-11-08)


### Bug Fixes

* 添加默认 responseType 配置 ([2e01629](https://github.com/WeBankFinTech/fes.js/commit/2e0162984a34f52e4f1f02be5d660105ea479986))



## [3.0.17](https://github.com/WeBankFinTech/fes.js/compare/v3.0.16...v3.0.17) (2023-10-24)


### Bug Fixes

* 优化依赖 ([#220](https://github.com/WeBankFinTech/fes.js/issues/220)) ([3e580db](https://github.com/WeBankFinTech/fes.js/commit/3e580dbed98c8b34faed7a504e8809d965693bc9))



## [3.0.16](https://github.com/WeBankFinTech/fes.js/compare/v3.0.15...v3.0.16) (2023-09-18)


Expand Down
16 changes: 7 additions & 9 deletions docs/reference/plugin/plugins/request-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,16 @@ export default defineRuntimeConfig({
},
// http 异常,和插件异常
errorHandler(error) {
if (error.response) {
// 处理业务异常,例如上述 transformData 抛出的异常
if (error.code) {
console.log(error.msg)
} else if (error.response) {
// 请求成功发出且服务器也响应了状态码,但状态代码超出了 2xx 的范围
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.msg) {
console.log(error.msg);
console.log(`服务异常:${error.response.status}`)
} else {
// 发送请求时出了点问题
console.log('Error', error.message);
// 请求异常
console.log(error.msg || error.message || `请求失败`)
}
console.log(error.config);
},
// 支持其他 fetch 配置
...otherConfigs,
Expand Down
7 changes: 7 additions & 0 deletions docs/reference/plugin/plugins/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,10 @@ export default {
},
};
```
## 2.x 升级到 3.x
1. 删除 dataField 配置,通过 dataHandler 实现类似功能,详情看上文案例
2. errorHandler 改成了函数了,异常处理逻辑,查看上文案例
3. 废弃 base 参数,用 baseURL
4. 移除 skipErrorHandler 参数,直接传 errorHandler 可覆盖默认 errorHandler
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fes.js",
"version": "3.0.16",
"version": "3.0.18",
"description": "一个好用的前端管理台快速开发框架",
"preferGlobal": true,
"private": true,
Expand Down Expand Up @@ -30,7 +30,7 @@
],
"dependencies": {
"chalk": "^5.0.1",
"conventional-changelog-cli": "^2.2.2",
"conventional-changelog-cli": "^4.1.0",
"enquirer": "^2.3.6",
"execa": "^6.1.0",
"minimist": "^1.2.6",
Expand All @@ -39,19 +39,17 @@
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@vite-pwa/vitepress": "^0.0.5",
"@webank/eslint-config-webank": "1.2.7",
"chokidar": "^3.5.2",
"commitizen": "^4.2.1",
"chokidar": "^3.5.3",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"deepmerge": "^4.2.2",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.0",
"typescript": "^5.0.4",
"vite-plugin-pwa": "^0.14.7",
"vitepress": "1.0.0-alpha.73",
"vue": "^3.2.47",
"vue": "^3.3.4",
"yargs-parser": "^21.1.1"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-fes-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/create-fes-app",
"version": "3.0.1",
"version": "3.0.2",
"description": "create a app base on fes.js",
"main": "lib/index.js",
"files": [
Expand Down
5 changes: 3 additions & 2 deletions packages/create-fes-app/templates/app/h5/.fes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// fes.config.js 只负责管理 cli 相关的配置
import { defineBuildConfig } from '@fesjs/fes';
import pxtoviewport from '@ttou/postcss-px-to-viewport';
import postcsspxtoviewport8plugin from 'postcss-px-to-viewport-8-plugin';


export default defineBuildConfig({
define: {
Expand All @@ -15,7 +16,7 @@ export default defineBuildConfig({
ios: '10',
},
extraPostCSSPlugins: [
pxtoviewport({
postcsspxtoviewport8plugin({
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 5,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-fes-app/templates/app/h5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@webank/eslint-config-webank": "1.2.7",
"@ttou/postcss-px-to-viewport": "^2.0.3"
"postcss-px-to-viewport-8-plugin": "^1.2.3"
},
"dependencies": {
"@fesjs/fes": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-fes-app/templates/plugin/package.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"dependencies": {
},
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@webank/eslint-config-webank": "1.2.7",
"chalk": "^4.1.2",
"chokidar": "^3.5.2",
Expand Down
22 changes: 11 additions & 11 deletions packages/fes-builder-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/builder-webpack",
"version": "3.0.5",
"version": "3.0.6",
"description": "@fesjs/builder-webpack",
"main": "lib/index.js",
"types": "types.d.ts",
Expand All @@ -26,20 +26,20 @@
"access": "public"
},
"dependencies": {
"@babel/core": "^7.21.3",
"@babel/plugin-proposal-do-expressions": "^7.18.6",
"@babel/plugin-proposal-export-default-from": "^7.18.10",
"@babel/plugin-proposal-function-bind": "^7.18.9",
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@babel/core": "^7.23.2",
"@babel/plugin-proposal-do-expressions": "^7.22.5",
"@babel/plugin-proposal-export-default-from": "^7.22.17",
"@babel/plugin-proposal-function-bind": "^7.22.5",
"@babel/plugin-proposal-pipeline-operator": "^7.22.15",
"@babel/plugin-transform-runtime": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@fesjs/utils": "^3.0.1",
"@vue/babel-plugin-jsx": "^1.1.1",
"ajv": "^8.12.0",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"cli-highlight": "^2.1.4",
"cli-highlight": "^2.1.11",
"cliui": "^8.0.1",
"connect-history-api-fallback": "^2.0.0",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -66,7 +66,7 @@
"webpackbar": "^5.0.2"
},
"peerDependencies": {
"@fesjs/fes": "^3.1.4",
"@fesjs/fes": "^3.1.5",
"core-js": "^3.29.1"
}
}
8 changes: 4 additions & 4 deletions packages/fes-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/compiler",
"version": "3.0.1",
"version": "3.0.2",
"description": "@fesjs/compiler",
"main": "lib/index.js",
"files": [
Expand All @@ -24,9 +24,9 @@
"access": "public"
},
"dependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/register": "^7.21.0",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/register": "^7.22.15",
"@fesjs/utils": "^3.0.1",
"commander": "^7.0.0",
"dotenv": "8.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/fes-plugin-jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/plugin-jest",
"version": "3.1.0",
"version": "3.1.1",
"description": "@fesjs/plugin-jest",
"main": "lib/index.js",
"files": [
Expand Down Expand Up @@ -30,11 +30,11 @@
"access": "public"
},
"peerDependencies": {
"@fesjs/fes": "^3.1.4"
"@fesjs/fes": "^3.1.5"
},
"dependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.15.0",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@vue/babel-plugin-jsx": "^1.0.6",
"babel-jest": "^29.0.0",
"jest": "^29.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fes-plugin-request/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/plugin-request",
"version": "4.0.0-beta.5",
"version": "4.0.0-beta.6",
"description": "@fesjs/plugin-request",
"main": "lib/index.js",
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/fes-plugin-request/src/template/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function getRequestInstance() {
type: ApplyPluginsType.modify,
initialValue: {
timeout: 10000,
responseType: 'json',
},
});

Expand Down
6 changes: 3 additions & 3 deletions packages/fes-plugin-windicss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/plugin-windicss",
"version": "3.0.0",
"version": "3.0.1",
"description": "@fesjs/plugin-windicss",
"main": "lib/index.js",
"files": [
Expand Down Expand Up @@ -28,11 +28,11 @@
"access": "public"
},
"peerDependencies": {
"@fesjs/fes": "^3.0.0",
"@fesjs/fes": "^3.1.5",
"vue": "^3.2.47"
},
"dependencies": {
"vite-plugin-windicss": "^1.8.3",
"vite-plugin-windicss": "^1.9.1",
"windicss": "^3.5.1",
"windicss-webpack-plugin": "^1.6.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/fes-preset-built-in/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/preset-built-in",
"version": "3.1.4",
"version": "3.1.5",
"description": "@fesjs/preset-built-in",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -26,10 +26,10 @@
"access": "public"
},
"dependencies": {
"@fesjs/compiler": "^3.0.1",
"@fesjs/compiler": "^3.0.2",
"@fesjs/utils": "^3.0.1",
"@fesjs/runtime": "^3.0.0",
"@vue/compiler-sfc": "^3.2.47",
"@vue/compiler-sfc": "^3.3.4",
"envinfo": "^7.7.3",
"express": "^4.17.3",
"mockjs": "^1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/fes-template-h5/.fes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// fes.config.js 只负责管理 cli 相关的配置
import pxtoviewport from '@ttou/postcss-px-to-viewport';
import pxtoviewport from 'postcss-px-to-viewport-8-plugin';
import { defineBuildConfig } from '@fesjs/fes';

export default defineBuildConfig({
Expand Down
2 changes: 1 addition & 1 deletion packages/fes-template-h5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"access": "public"
},
"dependencies": {
"@ttou/postcss-px-to-viewport": "^2.0.3",
"postcss-px-to-viewport-8-plugin": "^1.2.3",
"@fesjs/fes": "workspace:*",
"@fesjs/plugin-icon": "workspace:*",
"@fesjs/plugin-request": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/fes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fesjs/fes",
"version": "3.1.4",
"version": "3.1.5",
"description": "一个好用的前端管理台快速开发框架",
"preferGlobal": true,
"scripts": {
Expand Down Expand Up @@ -38,8 +38,8 @@
"strong"
],
"dependencies": {
"@fesjs/compiler": "^3.0.1",
"@fesjs/preset-built-in": "^3.1.4",
"@fesjs/compiler": "^3.0.2",
"@fesjs/preset-built-in": "^3.1.5",
"@fesjs/runtime": "^3.0.0",
"@fesjs/utils": "^3.0.1",
"pirates": "^4.0.5",
Expand Down
Loading

0 comments on commit 0c103e6

Please sign in to comment.