mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-10-14 10:52:28 +08:00
feat: 合并master
This commit is contained in:
commit
7301bd9acb
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@
|
|||||||
.history
|
.history
|
||||||
.cache
|
.cache
|
||||||
.temp
|
.temp
|
||||||
|
.hound
|
||||||
dist
|
dist
|
||||||
*.log
|
*.log
|
||||||
node_modules
|
node_modules
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fesjs/plugin-enums",
|
"name": "@fesjs/plugin-enums",
|
||||||
"version": "2.0.1",
|
"version": "2.0.2",
|
||||||
"description": "@fesjs/plugin-enums",
|
"description": "@fesjs/plugin-enums",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -10,17 +10,17 @@ Object.keys(_ENUMS).forEach(key => {
|
|||||||
/**
|
/**
|
||||||
* 获取枚举键值,如不传key,则返回name的枚举数组
|
* 获取枚举键值,如不传key,则返回name的枚举数组
|
||||||
* @param {string} name 枚举名称
|
* @param {string} name 枚举名称
|
||||||
* @param {string} key 枚举键名称
|
* @param {string} [key] 枚举键名称
|
||||||
* @param {{
|
* @param {{
|
||||||
* dir: string
|
* dir: string
|
||||||
* extend: Array<{
|
* extend: Array<{
|
||||||
* key:string
|
* key:string
|
||||||
* dir:string
|
* dir:string
|
||||||
* transfer: Function
|
* transfer: Function
|
||||||
* }>}} opt 配置项
|
* }>}} [opt] 配置项
|
||||||
*/
|
*/
|
||||||
function get(name, key, opt = { dir: 'value', extend: []}) {
|
function get(name, key, opt = { dir: 'value', extend: []}) {
|
||||||
if (Object.prototype.toString.call(key) === '[object Object]') {
|
if (Object.prototype.toString.call(key) === '[object Object]') {
|
||||||
opt = key
|
opt = key
|
||||||
key = null
|
key = null
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ function get(name, key, opt = { dir: 'value', extend: []}) {
|
|||||||
} else {
|
} else {
|
||||||
value = format(list, opt.extend)
|
value = format(list, opt.extend)
|
||||||
}
|
}
|
||||||
return typeof value === 'object' ? readonly(value) : value
|
return typeof value === 'object' ? readonly(value) : value
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +86,7 @@ function concat(name, _enum, opt = { keyName: '', valueName: '', before: false,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化枚举
|
* 格式化枚举
|
||||||
* @param {Array} _enum 枚举数组
|
* @param {Array} _enum 枚举数组
|
||||||
* @param {Array<{key:string, dir:string, transfer: Function}>} extend 格式化规则
|
* @param {Array<{key:string, dir:string, transfer: Function}>} extend 格式化规则
|
||||||
*/
|
*/
|
||||||
function format(_enum = [], extend = []) {
|
function format(_enum = [], extend = []) {
|
||||||
@ -108,7 +108,7 @@ function format(_enum = [], extend = []) {
|
|||||||
/**
|
/**
|
||||||
* 根据dir解析value的属性值
|
* 根据dir解析value的属性值
|
||||||
* @param value
|
* @param value
|
||||||
* @param dir
|
* @param dir
|
||||||
*/
|
*/
|
||||||
function parseValueDir(value, dir='value') {
|
function parseValueDir(value, dir='value') {
|
||||||
if (!['object', 'function'].includes(typeof value) || !value || !dir || dir === 'value') return value
|
if (!['object', 'function'].includes(typeof value) || !value || !dir || dir === 'value') return value
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fesjs/plugin-windicss",
|
"name": "@fesjs/plugin-windicss",
|
||||||
"version": "2.0.4",
|
"version": "2.0.5",
|
||||||
"description": "@fesjs/plugin-windicss",
|
"description": "@fesjs/plugin-windicss",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
@ -31,7 +31,6 @@
|
|||||||
"vue": "^3.0.5"
|
"vue": "^3.0.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"qs": "^6.10.2",
|
|
||||||
"windicss-webpack-plugin": "^1.6.0"
|
"windicss-webpack-plugin": "^1.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
import WindiCSSWebpackPlugin from 'windicss-webpack-plugin';
|
import WindiCSSWebpackPlugin from 'windicss-webpack-plugin';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import qs from 'qs';
|
|
||||||
|
|
||||||
export default (api) => {
|
export default (api) => {
|
||||||
api.describe({
|
api.describe({
|
||||||
@ -23,15 +22,6 @@ export default (api) => {
|
|||||||
...api.config.windicss
|
...api.config.windicss
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
memo.module
|
|
||||||
.rule('vue-custom')
|
|
||||||
.resourceQuery((query) => {
|
|
||||||
if (!query) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const parsed = qs.parse(query.slice(1));
|
|
||||||
return parsed.vue != null;
|
|
||||||
}).use('vue-custom-loader').loader(require.resolve('./pitcher'));
|
|
||||||
return memo;
|
return memo;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fesjs/preset-built-in",
|
"name": "@fesjs/preset-built-in",
|
||||||
"version": "2.0.9",
|
"version": "2.0.11",
|
||||||
"description": "@fesjs/preset-built-in",
|
"description": "@fesjs/preset-built-in",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
@ -61,6 +61,7 @@
|
|||||||
"postcss-flexbugs-fixes": "^5.0.2",
|
"postcss-flexbugs-fixes": "^5.0.2",
|
||||||
"postcss-loader": "^4.2.0",
|
"postcss-loader": "^4.2.0",
|
||||||
"postcss-safe-parser": "^5.0.2",
|
"postcss-safe-parser": "^5.0.2",
|
||||||
|
"qs": "^6.10.2",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// import webpack from 'webpack';
|
import qs from 'qs';
|
||||||
|
|
||||||
export default function createVueWebpackConfig({
|
export default function createVueWebpackConfig({
|
||||||
config,
|
config,
|
||||||
@ -15,6 +15,16 @@ export default function createVueWebpackConfig({
|
|||||||
})
|
})
|
||||||
.end();
|
.end();
|
||||||
|
|
||||||
|
webpackConfig.module
|
||||||
|
.rule('vue-custom')
|
||||||
|
.resourceQuery((query) => {
|
||||||
|
if (!query) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const parsed = qs.parse(query.slice(1));
|
||||||
|
return parsed.vue != null;
|
||||||
|
}).use('vue-custom-loader').loader(require.resolve('./pitcher'));
|
||||||
|
|
||||||
webpackConfig
|
webpackConfig
|
||||||
.plugin('vue-loader-plugin')
|
.plugin('vue-loader-plugin')
|
||||||
.use(require('vue-loader').VueLoaderPlugin);
|
.use(require('vue-loader').VueLoaderPlugin);
|
||||||
|
@ -1,17 +1,9 @@
|
|||||||
import { readFileSync, existsSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { winPath } from '@fesjs/utils';
|
import { winPath } from '@fesjs/utils';
|
||||||
import { runtimePath } from '../../../../utils/constants';
|
import { runtimePath } from '../../../../utils/constants';
|
||||||
|
import { getAppPath } from '../../../../utils/getAppEntryPath';
|
||||||
|
|
||||||
function getAppPath(absSrcPath) {
|
|
||||||
for (const suffix of ['.js', '.ts', '.jsm']) {
|
|
||||||
const p = winPath(join(absSrcPath, `app${suffix}`));
|
|
||||||
if (existsSync(p)) {
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function (api) {
|
export default function (api) {
|
||||||
const {
|
const {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { chokidar, lodash, winPath } from '@fesjs/utils';
|
import { chokidar, lodash, winPath } from '@fesjs/utils';
|
||||||
import { join } from 'path';
|
import { getAppPath } from './getAppEntryPath';
|
||||||
|
|
||||||
export default async ({ api, watch }) => {
|
export default async ({ api, watch }) => {
|
||||||
const { paths } = api;
|
const { paths } = api;
|
||||||
@ -44,8 +44,7 @@ export default async ({ api, watch }) => {
|
|||||||
type: api.ApplyPluginsType.add,
|
type: api.ApplyPluginsType.add,
|
||||||
initialValue: [
|
initialValue: [
|
||||||
paths.absPagesPath,
|
paths.absPagesPath,
|
||||||
join(paths.absSrcPath, 'app.js'),
|
getAppPath(paths.absSrcPath)
|
||||||
join(paths.absSrcPath, 'app.ts')
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
lodash
|
lodash
|
||||||
|
13
packages/fes-preset-built-in/src/utils/getAppEntryPath.js
Normal file
13
packages/fes-preset-built-in/src/utils/getAppEntryPath.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { join } from 'path';
|
||||||
|
import { existsSync } from 'fs';
|
||||||
|
import { winPath } from '@fesjs/utils';
|
||||||
|
|
||||||
|
export function getAppPath(absSrcPath) {
|
||||||
|
for (const suffix of ['.js', '.ts', '.jsm', '.jsx', '.tsx']) {
|
||||||
|
const p = winPath(join(absSrcPath, `app${suffix}`));
|
||||||
|
if (existsSync(p)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
@ -42,14 +42,14 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@webank/eslint-config-webank": "0.3.1",
|
"@webank/eslint-config-webank": "0.3.1",
|
||||||
"@ttou/postcss-px-to-viewport": "1.1.4",
|
"@ttou/postcss-px-to-viewport": "1.1.4",
|
||||||
"@vue/compiler-sfc": "3.2.2"
|
"@vue/compiler-sfc": "^3.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fesjs/fes": "^2.0.0",
|
"@fesjs/fes": "^2.0.0",
|
||||||
"@fesjs/plugin-icon": "^2.0.0",
|
"@fesjs/plugin-icon": "^2.0.0",
|
||||||
"@fesjs/plugin-request": "^2.0.0",
|
"@fesjs/plugin-request": "^2.0.0",
|
||||||
"@fesjs/plugin-windicss": "^2.0.0",
|
"@fesjs/plugin-windicss": "^2.0.0",
|
||||||
"vue": "3.2.2"
|
"vue": "^3.2.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="onepiece">
|
<div class="onepiece m-10px">
|
||||||
fes h5 & 拉夫德鲁<br />
|
fes h5 & 拉夫德鲁<br />
|
||||||
<fes-icon :spin="true" class="one-icon" type="smile" @click="clickIcon" />
|
<fes-icon :spin="true" class="one-icon" type="smile" @click="clickIcon" />
|
||||||
<HelloWorld />
|
<HelloWorld />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>{{fes}}</div>
|
<div class="m-10px">{{fes}}</div>
|
||||||
<img :src="publicPath + 'logo.png'" />
|
<img :src="publicPath + 'logo.png'" />
|
||||||
</template>
|
</template>
|
||||||
<config>
|
<config>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fesjs/fes",
|
"name": "@fesjs/fes",
|
||||||
"version": "2.0.10",
|
"version": "2.0.12",
|
||||||
"description": "一个好用的前端管理台快速开发框架",
|
"description": "一个好用的前端管理台快速开发框架",
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fesjs/compiler": "^2.0.3",
|
"@fesjs/compiler": "^2.0.3",
|
||||||
"@fesjs/preset-built-in": "^2.0.9",
|
"@fesjs/preset-built-in": "^2.0.11",
|
||||||
"@fesjs/runtime": "^2.0.2",
|
"@fesjs/runtime": "^2.0.2",
|
||||||
"@fesjs/utils": "^2.0.3",
|
"@fesjs/utils": "^2.0.3",
|
||||||
"resolve-cwd": "^3.0.0"
|
"resolve-cwd": "^3.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user