autofix-page-name-cs

1.0.1 • Public • Published

autofix-page-name

自动修复服务云项目中Vue页面的name值

这个工具的初衷是为了解决服务云前端项目中Vue页面的name值设置不符合服务云规范,导致keep-alive不生效的问题。

快速开始

package.json 里添加私有仓库(内网环境)

{
  "scripts": {
    "autofix": "autofix"
  },
  "dependencies": {
    "autofix-page-name-cs": "git+ssh://g.lenovo.com.cn/cloudservice/packages/autofix-page-name-cs.git"
  }
}

翻译配置

请在项目根目录下创建 fix.config.js,进行目录和排除项配置

const path = require('path')

module.exports = {
  root: path.resolve(process.cwd(), 'src/views'),
  src: path.resolve(process.cwd(), 'src/views'),
  exclude: []
}

参数及其说明

  • root 根目录,默认为src/views ,用于参与文件Name值的计算
  • src 需要处理的文件夹,默认为src/views
  • exclude 需要排除的文件夹/文件路径

执行操作

autofix
# 可选参数 -c或者--check
autofix -c // 只检查不修复
# 可选参数 -f或者--fix 
autofix -f // 检查并修复
# 可选参数 -p或者--paths 文件夹/文件目录
 autofix -f -p /view/user;/view/role // 检查并修复指定目录的文件

Readme

Keywords

none

Package Sidebar

Install

npm i autofix-page-name-cs

Weekly Downloads

0

Version

1.0.1

License

none

Unpacked Size

11.9 kB

Total Files

18

Last publish

Collaborators

  • jiaxiaopeng