🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@vtx/cli

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtx/cli - npm Package Compare versions

Comparing version
2.3.5
to
2.3.6
+173
-74
CHANGELOG.md

@@ -1,123 +0,222 @@

## 2.3.5
## [2.3.6](https://git.cloudhw.cn:3443/front-end/cli/compare/2.3.5...2.3.6) (2021-08-09)
### `umi` 应用
#### ✨ Features
### ✨ Features
- 集成 `@vtx/sdk`
- `src/util/renderColumn.js` 内添加 `renderColumnParam` 方法
* umi工程支持字体12px打包 ([d3285b2](https://git.cloudhw.cn:3443/front-end/cli/commit/d3285b2)) by: **yemu**
* umi应用icons.js内添加常用图标 ([f969158](https://git.cloudhw.cn:3443/front-end/cli/commit/f969158)) by: **yemu**
* umi开启mfsu ([7f2b473](https://git.cloudhw.cn:3443/front-end/cli/commit/7f2b473)) by: **yemu**
* 按钮权限验证方式修改 ([13c0781](https://git.cloudhw.cn:3443/front-end/cli/commit/13c0781)) by: **yemu**
## 2.3.4
### `umi` 应用
### 🎫 Chores
#### ✨ Features
* 支持自动生成changelog ([00e9eb3](https://git.cloudhw.cn:3443/front-end/cli/commit/00e9eb3)) by: **yemu**
- 支持通过配置快速生成 ums 菜单结构
## 2.3.3
### `umi` 应用
## [2.3.5](https://git.cloudhw.cn:3443/front-end/cli/compare/2.3.3...2.3.5) (2021-07-15)
#### 🐛 Bug Fixes
- 修复工程内 `process.env.UMI_ENV` 环境变量 `UMI_ENV` 取不值的问题
### ✨ Features
## 2.3.2
* umi应用支持快速生成ums菜单结构 ([6f94af8](https://git.cloudhw.cn:3443/front-end/cli/commit/6f94af8)) by: **yemu**
* ums工程添加renderColumnParam方法 ([d7a45ab](https://git.cloudhw.cn:3443/front-end/cli/commit/d7a45ab)) by: **yemu**
* ums工程集成@vtx/sdk ([2aaa674](https://git.cloudhw.cn:3443/front-end/cli/commit/2aaa674)) by: **yemu**
### `uni-app`应用
#### ✨ Features
### 🎫 Chores
- 请求库使用`uni.request`,优化了小程序开发环境和生产环境主机名端口的差异性写法
- 添加 h5 打包配置
* v2.3.4 ([6c4760c](https://git.cloudhw.cn:3443/front-end/cli/commit/6c4760c)) by: **yemu**
* v2.3.5 ([25d648d](https://git.cloudhw.cn:3443/front-end/cli/commit/25d648d)) by: **yemu**
## 2.3.1
### `umi` 应用
### 📝 Documentation
#### ✨ Features
* 修改安装指令 ([c2c83d6](https://git.cloudhw.cn:3443/front-end/cli/commit/c2c83d6)) by: **yemu**
- 添加`namespace`高级函数
- 添加 eslint 对 hooks 检查的支持
- `.gitignore` 添加 `.svn`
- 修改了 `useFormModal` 的使用方法
## 2.3.0
### `umi` 应用
## [2.3.3](https://git.cloudhw.cn:3443/front-end/cli/compare/2.2.2...2.3.3) (2021-06-16)
#### style
- `src/pages/Example` 目录修改为 `src/pages/demo`
### ♻ Code Refactoring
### uni-app 应用
* 重构了useFormModal ([e7afedb](https://git.cloudhw.cn:3443/front-end/cli/commit/e7afedb)) by: **yemu**
#### ✨ Features
- 添加 `request.js`
- uView 改为 npm 管理
### ✨ Features
## 2.2.4
* .gitignore add .svn ([f0067f0](https://git.cloudhw.cn:3443/front-end/cli/commit/f0067f0)) by: **yemu**
* prettier ingnore .ejs ([d747df4](https://git.cloudhw.cn:3443/front-end/cli/commit/d747df4)) by: **yemu**
* proxy ([2c2ab3c](https://git.cloudhw.cn:3443/front-end/cli/commit/2c2ab3c)) by: **yemu**
* umi应用提交前npm run prettier:check ([7c86bf0](https://git.cloudhw.cn:3443/front-end/cli/commit/7c86bf0)) by: **yemu**
* umi应用添加hooks lint ([8a8277c](https://git.cloudhw.cn:3443/front-end/cli/commit/8a8277c)) by: **yemu**
* uni-app应用工作流验证 ([c6234ca](https://git.cloudhw.cn:3443/front-end/cli/commit/c6234ca)) by: **yemu**
* uni-app请求变更为uni.request ([0121b75](https://git.cloudhw.cn:3443/front-end/cli/commit/0121b75)) by: **yemu**
* 按钮权限组件验证形式更改为hooks ([ad53b40](https://git.cloudhw.cn:3443/front-end/cli/commit/ad53b40)) by: **yemu**
* 新增按钮权限组件 ([48605e7](https://git.cloudhw.cn:3443/front-end/cli/commit/48605e7)) by: **yemu**
* 新增按钮权限脚本 ([eab5648](https://git.cloudhw.cn:3443/front-end/cli/commit/eab5648)) by: **yemu**
* 是否显示菜单前置条件变更 ([0ffed1f](https://git.cloudhw.cn:3443/front-end/cli/commit/0ffed1f)) by: **yemu**
* 添加h5打包配置 ([c3c54bd](https://git.cloudhw.cn:3443/front-end/cli/commit/c3c54bd)) by: **yemu**
* 添加namespace高阶函数 ([99ad9fc](https://git.cloudhw.cn:3443/front-end/cli/commit/99ad9fc)) by: **yemu**
* 添加vscode别名支持配置 ([f0ab9f9](https://git.cloudhw.cn:3443/front-end/cli/commit/f0ab9f9)) by: **yemu**
* 添加一些图标的支持 ([6f36559](https://git.cloudhw.cn:3443/front-end/cli/commit/6f36559)) by: **yemu**
* 菜单页面切换默认拼接地址栏参数 ([a178bc6](https://git.cloudhw.cn:3443/front-end/cli/commit/a178bc6)) by: **yemu**
* 解析字段functions变更为permissions ([04d6dbf](https://git.cloudhw.cn:3443/front-end/cli/commit/04d6dbf)) by: **yemu**
* 请求request ([8ea862b](https://git.cloudhw.cn:3443/front-end/cli/commit/8ea862b)) by: **yemu**
### `umi` 应用
#### ✨ Features
### 🎫 Chores
- `permission2md.js` 内部解析字段由之前的 `functions` 变更为 `permissions`
* v2.2.3 ([c8fefaa](https://git.cloudhw.cn:3443/front-end/cli/commit/c8fefaa)) by: **yemu**
* v2.2.4 ([61aaa1d](https://git.cloudhw.cn:3443/front-end/cli/commit/61aaa1d)) by: **yemu**
* v2.3.0 ([7bc9fb3](https://git.cloudhw.cn:3443/front-end/cli/commit/7bc9fb3)) by: **yemu**
* v2.3.1 ([b693573](https://git.cloudhw.cn:3443/front-end/cli/commit/b693573)) by: **yemu**
* v2.3.2 ([c8813ca](https://git.cloudhw.cn:3443/front-end/cli/commit/c8813ca)) by: **yemu**
* v2.3.3 ([4f7a37b](https://git.cloudhw.cn:3443/front-end/cli/commit/4f7a37b)) by: **yemu**
## 2.2.3
### `umi` 应用
### 🐛 Bug Fixes
#### ✨ Features
* 修复umi工程内process取不到环境变量的问题 ([20b8a45](https://git.cloudhw.cn:3443/front-end/cli/commit/20b8a45)) by: **yemu**
* 修改headFootHeight高度修复表格样式问题 ([600af45](https://git.cloudhw.cn:3443/front-end/cli/commit/600af45)) by: **yemu**
- 新增 hooks 文件`src/hooks/usePermission.js`
- 新增按钮权限功能码自动生成脚本,通过指令`yarn p2md`生成`PERMISSION_CODE.md`文件,该`md`文件会帮你自动生成所有的按钮权限功能码,生成规则为 `CF_{ 工程包名 }_{ 页面路由名 }_{ 操作类型 }`
- 通过`yarn start:menu`指令打开菜单模式
## 2.2.2
### 💄 Styles
### `umi` 应用
* Example调整为demo ([fe1a09b](https://git.cloudhw.cn:3443/front-end/cli/commit/fe1a09b)) by: **yemu**
* useDeleteRows修改为js文件 ([26cb132](https://git.cloudhw.cn:3443/front-end/cli/commit/26cb132)) by: **yemu**
* 移除uview-ui文件,改为npm管理 ([4d1668a](https://git.cloudhw.cn:3443/front-end/cli/commit/4d1668a)) by: **yemu**
#### ✨ Features
- 新增[`@vtx/utils`](http://front-end.pages.cloudhw.cn:8000/utils/)包,内部 `Javascript` 工具库
- 开发环境下,可通过访问`/menu`打开菜单界面,可跳转所有路由页面,方便开发过程中快速切换页面,可选择使用。生产环境下(打包后)不会存在此路由
- `request.js` 内部会对请求传参中的字符串前面和后面的空格进行 `trim`
- `icon.js` 里添加一些图标的支持
## 2.2.1
## [2.2.2](https://git.cloudhw.cn:3443/front-end/cli/compare/2.1.4...2.2.2) (2021-03-27)
### `umi` 应用
#### 🐛 fix:
### ✨ Features
- 解决 npm 发布如果没有`.npmignore`文件,会自动把 `.gitignore` 重命名为 `.npmignore` 的问题
* umi工程新增@vtx/utils包 ([903703d](https://git.cloudhw.cn:3443/front-end/cli/commit/903703d)) by: **yemu**
* 对@vtx/components内使用到的图标进行支持 ([c19f1cd](https://git.cloudhw.cn:3443/front-end/cli/commit/c19f1cd)) by: **yemu**
* 支持可初始化uni-app应用结构 ([ce7d15f](https://git.cloudhw.cn:3443/front-end/cli/commit/ce7d15f)) by: **yemu**
* 新增menu页面 ([c2ffa29](https://git.cloudhw.cn:3443/front-end/cli/commit/c2ffa29)) by: **yemu**
* 添加stylelint检查 ([82ff07a](https://git.cloudhw.cn:3443/front-end/cli/commit/82ff07a)) by: **yemu**
* 表格headFootHeight设置为165 ([392cc18](https://git.cloudhw.cn:3443/front-end/cli/commit/392cc18)) by: **yemu**
* 请求传参中的字符串前面和后面的空格进行trim ([d36f1f7](https://git.cloudhw.cn:3443/front-end/cli/commit/d36f1f7)) by: **yemu**
### `uni-app`应用
#### ✨ Features
### 🎫 Chores
- 新增 `uni-app`应用结构
- 使用 `uview-ui` 插件做为 UI 库
- 集成了 `stylelint` 和 `prettier` 提升代码质量
* v2.2.1 ([4f70292](https://git.cloudhw.cn:3443/front-end/cli/commit/4f70292)) by: **yemu**
* v2.2.2 ([d8f2dfe](https://git.cloudhw.cn:3443/front-end/cli/commit/d8f2dfe)) by: **yemu**
* 添加.npmignore,解决npm安装根目录下没.npmignore文件会吧.gitignore修改成.npmignore的问题 ([fc00c20](https://git.cloudhw.cn:3443/front-end/cli/commit/fc00c20)) by: **yemu**
## 2.1.4
### `umi` 应用
### 🐛 Bug Fixes
#### ✨ Features
* rename .npmignore to .gitignore ([02e6f2d](https://git.cloudhw.cn:3443/front-end/cli/commit/02e6f2d)) by: **yemu**
- 应用框架变更为 `umijs@3.3.x`
- `React` 版本升级,当前版本为 `v16.12`
- `ant-design` 版本升级,当前版本为 `v3.26.19`
- 组件库由之前的 [`vtx-ui`](https://github.com/yukinight/vtx-ui) 变更为 [`@vtx/components`](https://git.cloudhw.cn:3443/front-end/react-components)
- 时间库由之前的 `moment` 变更为 `dayjs`
- `http` 请求库使用 `axios`
- 引入依赖包 [`ahooks`](https://github.com/alibaba/hooks)
- 引入依赖包 [`@vtx/hooks`](https://git.cloudhw.cn:3443/front-end/vhooks)
- 支持自动生成 `CHANGELOG.md` 文件
- 通过 UMI 插件([`@vtx/umi-plugin-generate`](https://git.cloudhw.cn:3443/front-end/umi-plugin-generate))重写 `umi g page` 指令,一行指令即可生成页面模板
- 目录结构调整,加强可阅读性和可移植性等
- 按需加载 `icon` 图标,打包后总包大小可减少 100k 以上
### 💄 Styles
* 移除.npmignore文件 ([936354d](https://git.cloudhw.cn:3443/front-end/cli/commit/936354d)) by: **yemu**
## [2.1.4](https://git.cloudhw.cn:3443/front-end/cli/compare/v1.1.0...2.1.4) (2021-03-19)
### ♻ Code Refactoring
* 按需加载icon ([dac44e2](https://git.cloudhw.cn:3443/front-end/cli/commit/dac44e2)) by: **yemu**
### ✨ Features
* husky验证提交信息 ([d091254](https://git.cloudhw.cn:3443/front-end/cli/commit/d091254)) by: **yemu**
* 工程添加第三方插件 ([ebeab22](https://git.cloudhw.cn:3443/front-end/cli/commit/ebeab22)) by: **yemu**
* 按需加载hooks ([ec66eec](https://git.cloudhw.cn:3443/front-end/cli/commit/ec66eec)) by: **yemu**
* 支持生成页面模板 ([b3a5f56](https://git.cloudhw.cn:3443/front-end/cli/commit/b3a5f56)) by: **yemu**
* 支持选择是否引入react-virtualized ([c33915b](https://git.cloudhw.cn:3443/front-end/cli/commit/c33915b)) by: **yemu**
* 新增404页面 ([9013dae](https://git.cloudhw.cn:3443/front-end/cli/commit/9013dae)) by: **yemu**
* 新增version指令 ([f7f45f0](https://git.cloudhw.cn:3443/front-end/cli/commit/f7f45f0)) by: **yemu**
* 添加release和pretty-quick指令 ([6f75803](https://git.cloudhw.cn:3443/front-end/cli/commit/6f75803)) by: **yemu**
* 添加公共models目录 ([0d665fc](https://git.cloudhw.cn:3443/front-end/cli/commit/0d665fc)) by: **yemu**
* 示例 ([07fc685](https://git.cloudhw.cn:3443/front-end/cli/commit/07fc685)) by: **yemu**
* 示例表列按钮渲染逻辑修改 ([2a17eea](https://git.cloudhw.cn:3443/front-end/cli/commit/2a17eea)) by: **yemu**
* 示例页面修改为一个简单的增删改查界面 ([467e952](https://git.cloudhw.cn:3443/front-end/cli/commit/467e952)) by: **yemu**
* 表格hooks和列处理函数 ([e9404c8](https://git.cloudhw.cn:3443/front-end/cli/commit/e9404c8)) by: **yemu**
* 请求200但无返回信息return不抛出error ([43cd83a](https://git.cloudhw.cn:3443/front-end/cli/commit/43cd83a)) by: **yemu**
### 🎫 Chores
* 2.0.1-alpha.4 ([e57500e](https://git.cloudhw.cn:3443/front-end/cli/commit/e57500e)) by: **yemu**
* 2.0.1-alpha.5 ([2a01303](https://git.cloudhw.cn:3443/front-end/cli/commit/2a01303)) by: **yemu**
* 2.0.1-alpha.6 ([487f4b3](https://git.cloudhw.cn:3443/front-end/cli/commit/487f4b3)) by: **yemu**
* 2.1.0-alpha.1 ([0e51ef7](https://git.cloudhw.cn:3443/front-end/cli/commit/0e51ef7)) by: **yemu**
* 2.1.0-alpha.2 ([d506ac4](https://git.cloudhw.cn:3443/front-end/cli/commit/d506ac4)) by: **yemu**
* 2.1.0-alpha.3 ([b40f819](https://git.cloudhw.cn:3443/front-end/cli/commit/b40f819)) by: **yemu**
* 2.1.1 ([e0b3738](https://git.cloudhw.cn:3443/front-end/cli/commit/e0b3738)) by: **yemu**
* delete .npmignore ([07ec165](https://git.cloudhw.cn:3443/front-end/cli/commit/07ec165)) by: **yemu**
* lint关闭no-duplicate-imports和react/display-name ([92d3152](https://git.cloudhw.cn:3443/front-end/cli/commit/92d3152)) by: **yemu**
* umi添加fastRefresh配置,开发环境下,可以保持组件状态 ([daa9e6c](https://git.cloudhw.cn:3443/front-end/cli/commit/daa9e6c)) by: **yemu**
* update bin ([5a090f7](https://git.cloudhw.cn:3443/front-end/cli/commit/5a090f7)) by: **yemu**
* v2.1.4 ([246a547](https://git.cloudhw.cn:3443/front-end/cli/commit/246a547)) by: **yemu**
* 使用datjs替换moment ([48ada14](https://git.cloudhw.cn:3443/front-end/cli/commit/48ada14)) by: **yemu**
* 依赖包版本修改 ([c23c847](https://git.cloudhw.cn:3443/front-end/cli/commit/c23c847)) by: **yemu**
* 完善CHANGLOG信息 ([823eb02](https://git.cloudhw.cn:3443/front-end/cli/commit/823eb02)) by: **yemu**
* 按需加载vtx-ui ([a2d6ae6](https://git.cloudhw.cn:3443/front-end/cli/commit/a2d6ae6)) by: **yemu**
* 支持自动生成CHANGELOG ([0413fe4](https://git.cloudhw.cn:3443/front-end/cli/commit/0413fe4)) by: **yemu**
* 添加lint检查 ([93515c6](https://git.cloudhw.cn:3443/front-end/cli/commit/93515c6)) by: **yemu**
* 添加vtx-ui依赖 ([28cf68a](https://git.cloudhw.cn:3443/front-end/cli/commit/28cf68a)) by: **yemu**
### 🐛 Bug Fixes
* 修复dayjs替换moment日期控件显示不正确的问题 ([59a13c3](https://git.cloudhw.cn:3443/front-end/cli/commit/59a13c3)) by: **yemu**
* 修复Icon type='setting'不显示的问题 ([1ff219b](https://git.cloudhw.cn:3443/front-end/cli/commit/1ff219b)) by: **yemu**
* 修复ie10以下语言包出错的问题,暂时使用ConfigProvider ([8aa19ed](https://git.cloudhw.cn:3443/front-end/cli/commit/8aa19ed)) by: **yemu**
* 修复path is not found的问题 ([3ef0054](https://git.cloudhw.cn:3443/front-end/cli/commit/3ef0054)) by: **yemu**
* 修复分割线无效的问题 ([4b546d8](https://git.cloudhw.cn:3443/front-end/cli/commit/4b546d8)) by: **yemu**
* 解决global.less无效的问题 ([72a55e5](https://git.cloudhw.cn:3443/front-end/cli/commit/72a55e5)) by: **yemu**
* 配置locale在ie10下出错,暂时隐藏 ([7e8a314](https://git.cloudhw.cn:3443/front-end/cli/commit/7e8a314)) by: **yemu**
### 💄 Styles
* Demo文件目录修改为Example ([05c9567](https://git.cloudhw.cn:3443/front-end/cli/commit/05c9567)) by: **yemu**
* 去除无效代码 ([68f73fc](https://git.cloudhw.cn:3443/front-end/cli/commit/68f73fc)) by: **yemu**
* 去除无效代码 ([17e8fd6](https://git.cloudhw.cn:3443/front-end/cli/commit/17e8fd6)) by: **yemu**
* 目录调整 ([d096a51](https://git.cloudhw.cn:3443/front-end/cli/commit/d096a51)) by: **yemu**
* 项目结构调整 ([2902596](https://git.cloudhw.cn:3443/front-end/cli/commit/2902596)) by: **yemu**
### 📝 Documentation
* 介绍变更 ([7de6d37](https://git.cloudhw.cn:3443/front-end/cli/commit/7de6d37)) by: **yemu**
* 精简使用文档 ([a54a7b1](https://git.cloudhw.cn:3443/front-end/cli/commit/a54a7b1)) by: **yemu**
# [1.1.0](https://git.cloudhw.cn:3443/front-end/cli/compare/460851e...v1.1.0) (2020-10-26)
### ♻ Code Refactoring
* request 重构 ([a4fbb16](https://git.cloudhw.cn:3443/front-end/cli/commit/a4fbb16)) by: **yemu**
### 🎫 Chores
* update alias config ([9922166](https://git.cloudhw.cn:3443/front-end/cli/commit/9922166)) by: **yemu**
* 添加lint校验和提交信息规范校验 ([460851e](https://git.cloudhw.cn:3443/front-end/cli/commit/460851e)) by: **yemu**
* 添加全局变量 OPERATE_INFO ([337c9c9](https://git.cloudhw.cn:3443/front-end/cli/commit/337c9c9)) by: **yemu**
### 🐛 Bug Fixes
* 修复默认页面背景色的图片路径报错问题 ([b6e9580](https://git.cloudhw.cn:3443/front-end/cli/commit/b6e9580)) by: **yemu**

@@ -1,1 +0,2 @@

PORT=8000
PORT=8000
FONT_SIZE_BASE=14

@@ -28,2 +28,6 @@ import { defineConfig } from 'umi';

publicPath: './',
// 主题色
theme: {
'@font-size-base': `${process.env.FONT_SIZE_BASE}px`,
},
// 国际化插件

@@ -75,3 +79,3 @@ // https://umijs.org/zh-CN/plugins/plugin-locale

extraBabelPlugins: [
['import', { libraryName: 'antd', style: 'css' }, 'antd'],
['import', { libraryName: 'antd', style: true }, 'antd'],
['import', { libraryName: 'vtx-ui', camel2DashComponentName: false }, 'vtx-ui'],

@@ -102,2 +106,3 @@ // https://git.cloudhw.cn:3443/front-end/react-components

},
mfsu: {},
});

@@ -22,45 +22,46 @@ import { defineConfig } from 'umi';

// 注意:cacheGroups拆分了几个包,chunks也得同步配置,且必须得存在拆分的文件,不然打包会报错
chunks: ['vendors', 'antd', 'umi'],
// chunks: ['vendors', 'antd', 'umi'],
// 通过 webpack-chain 的 API 修改 webpack 配置。
chainWebpack(config) {
config.merge({
optimization: {
splitChunks: {
chunks: 'all',
// byte, == 30 kb,
// 越大那么单个文件越大,chunk 数就会变少(针对于提取公共 chunk 的时候,不管再大也不会把动态加载的模块合并到初始化模块中)
// 当这个值很大的时候就不会做公共部分的抽取了
minSize: 30000,
// 文件的最大尺寸,优先级:maxInitialRequest/maxAsyncRequests < maxSize < minSize,
// 需要注意的是这个如果配置了,umi.js 就可能被拆开,最后构建出来的 chunkMap 中可能就找不到 umi.js 了。
maxSize: 0,
// 被提取的一个模块至少需要在几个 chunk 中被引用,这个值越大,抽取出来的文件就越小
minChunks: 1,
// 在做一次按需加载的时候最多有多少个异步请求,为 1 的时候就不会抽取公共 chunk 了
maxAsyncRequests: 10,
// 针对一个 entry 做初始化模块分隔的时候的最大文件数,优先级高于 cacheGroup,所以为 1 的时候就不会抽取 initial common 了。
maxInitialRequests: 3,
// 缓存组
// 注意:工程内至少在一个chunk中被引用才会拆出配置的文件
cacheGroups: {
vendors: {
name: 'vendors',
chunks: 'all',
// 表示要过滤 modules,默认为所有的 modules,可匹配模块路径或 chunk 名字,
// 当匹配到某个 chunk 的名字时,这个 chunk 里面引入的所有 module 都会选中;
test: /[\\/]node_modules[\\/](react|react-dom|react-router|lodash|dayjs|dva|rc-select|rc-pagination)[\\/]/,
// 权重,数字越大表示优先级越高
priority: -10,
},
// 提取出antd文件
antd: {
name: 'antd',
chunks: 'all',
test: /[\\/]node_modules[\\/](@ant-design|antd)[\\/]/,
priority: -11,
},
},
},
},
});
// 因为配置了mfsu,不需要splitChunks
// config.merge({
// optimization: {
// splitChunks: {
// chunks: 'all',
// // byte, == 30 kb,
// // 越大那么单个文件越大,chunk 数就会变少(针对于提取公共 chunk 的时候,不管再大也不会把动态加载的模块合并到初始化模块中)
// // 当这个值很大的时候就不会做公共部分的抽取了
// minSize: 30000,
// // 文件的最大尺寸,优先级:maxInitialRequest/maxAsyncRequests < maxSize < minSize,
// // 需要注意的是这个如果配置了,umi.js 就可能被拆开,最后构建出来的 chunkMap 中可能就找不到 umi.js 了。
// maxSize: 0,
// // 被提取的一个模块至少需要在几个 chunk 中被引用,这个值越大,抽取出来的文件就越小
// minChunks: 1,
// // 在做一次按需加载的时候最多有多少个异步请求,为 1 的时候就不会抽取公共 chunk 了
// maxAsyncRequests: 10,
// // 针对一个 entry 做初始化模块分隔的时候的最大文件数,优先级高于 cacheGroup,所以为 1 的时候就不会抽取 initial common 了。
// maxInitialRequests: 3,
// // 缓存组
// // 注意:工程内至少在一个chunk中被引用才会拆出配置的文件
// cacheGroups: {
// vendors: {
// name: 'vendors',
// chunks: 'all',
// // 表示要过滤 modules,默认为所有的 modules,可匹配模块路径或 chunk 名字,
// // 当匹配到某个 chunk 的名字时,这个 chunk 里面引入的所有 module 都会选中;
// test: /[\\/]node_modules[\\/](react|react-dom|react-router|lodash|dayjs|dva|rc-select|rc-pagination)[\\/]/,
// // 权重,数字越大表示优先级越高
// priority: -10,
// },
// // 提取出antd文件
// antd: {
// name: 'antd',
// chunks: 'all',
// test: /[\\/]node_modules[\\/](@ant-design|antd)[\\/]/,
// priority: -11,
// },
// },
// },
// },
// });
// antd moment -> dayjs

@@ -67,0 +68,0 @@ config.plugin('moment2dayjs').use('antd-dayjs-webpack-plugin', [

@@ -9,2 +9,3 @@ {

"build": "cross-env UMI_ENV=prod umi build",
"build:bad": "cross-env UMI_ENV=prod FONT_SIZE_BASE=12 umi build ",
"build:noCompress": "cross-env UMI_ENV=prod COMPRESS=none umi build",

@@ -67,3 +68,3 @@ "build:analyze": "cross-env UMI_ENV=prod ANALYZE=1 umi build",

"react-dom": "^16.12.0",
"umi": "^3.3.7",
"umi": "^3.5.15",
"updeep": "^1.2.0"

@@ -70,0 +71,0 @@ },

/*
* @Author: yemu
* @Date: 2021-03-30 22:27:16
* @LastEditTime: 2021-04-04 22:26:43
* @LastEditTime: 2021-08-09 11:48:58
* @LastEditors: yemu

@@ -10,33 +10,30 @@ * @Description: 按钮权限

import http from '@/utils/request';
import { getUrlParam } from '@vtx/utils';
import { name as packageName } from '../../package';
import packageInfo from '../../package';
// 从地址栏中获取用户信息和系统code信息
const { userId, systemCode } = getUrlParam();
// 接口路径
const FUNCTION_INTERFACE_PATH =
'/cloud/management/rest/np/function/getFunctionsByUsreIdAndSystem.read';
// 验证按钮权限接口路径
const FUNCTION_INTERFACE_PATH = '/cloud/management/api/v101/userAuth/hasFunctions';
function usePermission(route = {}) {
const [permissions, setPermissions] = useState({});
function usePermission(codes = [], { route = {} }) {
const [permissions, setPermissions] = useState([]);
const getFunctionCode = code => {
const PREFIX = `CF_${packageInfo.name?.toUpperCase()}_${route?.path
?.replace('/', '')
?.toUpperCase()}`;
return `${PREFIX}_${code.toUpperCase()}`;
};
// 请求接口服务,默认生产环境开启
useEffect(() => {
if (process.env.UMI_ENV === 'prod') {
http.get(FUNCTION_INTERFACE_PATH, {
body: { parameters: JSON.stringify({ userId, systemCode }) },
}).then(res => {
if (Array.isArray(res?.data)) {
const CODE = `_${packageName?.toUpperCase()}_${route?.path
?.replace('/', '')
?.toUpperCase()}`;
let currentPageFunctionMap = {};
res.data.map(item => {
if (item?.code?.includes(CODE)) {
currentPageFunctionMap[item.code.match('[^_]+(?!.*_)')[0]] = true;
}
});
setPermissions(currentPageFunctionMap);
}
});
if (codes.length > 0) {
const functionCodes = codes.map(code => getFunctionCode(code)).join(',');
http.post(FUNCTION_INTERFACE_PATH, {
body: { functionCodes },
}).then(res => {
if (Array.isArray(res?.data) && res.data.length > 0) {
setPermissions(res.data);
}
});
}
}

@@ -46,7 +43,8 @@ }, []);

// 验证
const validate = type => {
const validate = code => {
if (process.env.UMI_ENV !== 'prod') {
return true;
} else {
return !!permissions[type?.toUpperCase()];
const functionCode = getFunctionCode(code);
return permissions.includes(functionCode);
}

@@ -57,3 +55,2 @@ };

validate,
codes: permissions,
};

@@ -60,0 +57,0 @@ }

@@ -13,4 +13,2 @@ // export what antd other components need

export { default as ExclamationCircleFill } from '@ant-design/icons/lib/fill/ExclamationCircleFill';
export { default as UpOutline } from '@ant-design/icons/lib/outline/UpOutline';
export { default as DownOutline } from '@ant-design/icons/lib/outline/DownOutline';
export { default as LeftOutline } from '@ant-design/icons/lib/outline/LeftOutline';

@@ -42,2 +40,5 @@ export { default as RightOutline } from '@ant-design/icons/lib/outline/RightOutline';

export { default as MenuFoldOutline } from '@ant-design/icons/lib/outline/MenuFoldOutline';
export { default as ColumnHeightOutline } from '@ant-design/icons/lib/outline/ColumnHeightOutline';
export { default as ColumnHeightOutline } from '@ant-design/icons/lib/outline/ColumnHeightOutline';
export { default as CaretUpFilled } from '@ant-design/icons/lib/fill/CaretUpFill';
export { default as CaretDownFilled } from '@ant-design/icons/lib/fill/CaretDownFill';
export { default as ExportOutline } from '@ant-design/icons/lib/outline/ExportOutline';

@@ -29,3 +29,3 @@ /**

// 按钮权限验证
const { validate } = usePermission(route);
const { validate } = usePermission(['add', 'edit', 'delete'], { route });

@@ -32,0 +32,0 @@ // 列表分页查询

{
"name": "@vtx/cli",
"version": "2.3.5",
"version": "2.3.6",
"description": "前端项目脚手架工具",

@@ -8,2 +8,16 @@ "bin": {

},
"scripts": {
"release": "release-it --no-npm.publish",
"version": "npm run changelog && git add CHANGELOG.md",
"changelog": "conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0"
},
"release-it": {
"git": {
"commitMessage": "chore: release v${version}"
}
},
"changelog": {
"emojis": true,
"authorName": true
},
"dependencies": {

@@ -20,3 +34,6 @@ "chalk": "^3.0.0",

"devDependencies": {
"prettier": "^1.19.1"
"conventional-changelog-cli": "^2.1.1",
"conventional-changelog-custom-config": "^0.3.1",
"prettier": "^1.19.1",
"release-it": "^14.11.0"
},

@@ -23,0 +40,0 @@ "files": [