# goldencis-cli

> 金盾自定义cli

Latest version **3.0.4** (published 2022-04-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install goldencis-cli
pnpm add goldencis-cli
yarn add goldencis-cli
bun add goldencis-cli
```

Provides the command `goldencis`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2022-04-20 |
| First published | 2022-04-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 37.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zhaoke |
| Maintainers | natluc |

## Links

- npm: https://www.npmjs.com/package/goldencis-cli
- npm.io page: https://npm.io/package/goldencis-cli

## Dependencies (11)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [ora](https://npm.io/package/ora.md) ^1.3.0
- [vuex](https://npm.io/package/vuex.md) ^4.0.2
- [chalk](https://npm.io/package/chalk.md) ^2.3.0
- [execa](https://npm.io/package/execa.md) ^4.1.0
- [grunt](https://npm.io/package/grunt.md) ^1.4.1
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [inquirer](https://npm.io/package/inquirer.md) ^4.0.0
- [prettier](https://npm.io/package/prettier.md) ^2.5.1
- [commander](https://npm.io/package/commander.md) ^2.11.0
- [download-git-repo](https://npm.io/package/download-git-repo.md) ^3.0.2

## Recent versions

- 3.0.4 (latest) — 2022-04-20
- 3.0.3 — 2022-04-07
- 3.0.2 — 2022-04-07
- 3.0.1 — 2022-04-07
- 3.0.0 — 2022-04-07

## README

# 前提
## 使用前提
1. 安装node.js且版本为14.x,16.x
1. git配备了环境变量 

## NPM配置
首次配置
输入npm config get 获取.npmrc地址
修改.npmrc 仓库地址

```
registry=http://10.10.15.50:8081/content/groups/npm-all/
@vue:registry=https://registry.npm.taobao.org
@babel:registry=https://registry.npm.taobao.org
@sindresorhus:registry=https://registry.npm.taobao.org
```
修改完成后在cmd中使用
```
npm i goldencis-cli -g 
```
安装完成后建议换回原来的仓库地址
registry = https://registry.npm.taobao.org

## 使用方式

初始化项目

```
goldencis init 项目名
```

如果需要设置50映射服务器地址则需

```
goldencis set 50服务器映射地址
```

# 说明
项目带自动生成路由模式和非自动生成路由模式
## 自动生成路由模式
```javascript
let routes = autoRouter({ 
    // 页面级的.vue存放位置，必传
    rc: require.context('@/views', true, /\.vue$/),
    // '/'的重定向，可选，默认为''
    redirect: '/test',
    // 页面级的.vue存放的文件夹，可选，默认为:views
    rootFile: 'views',
})

```
### 基础路由
假设 views 的目录结构如下：
```
views/
--| login.vue
--| home.vue
--| user/
-----| index.vue
-----| edit.vue
-----| info.vue
```
那么，vue-router-auto 自动生成的路由配置如下：
```javascript
[
    { 
        name:'login',
        path:'/login',
        component: () => import('@/views/login.vue')
    },
    { 
        name:'home',
        path:'/home',
        component: () => import('@/views/Home.vue')
    },
    { 
        name:'user',
        path:'/user',
        component: () => import('@/views/user/index.vue')
    },
    { 
        name:'user-info',
        path:'/user/info',
        component: () => import('@/views/user/info.vue')
    },
    { 
        name:'user-edit',
        path:'/user/edit',
        component: () => import('@/views/user/edit.vue')
    }
]
```
### 嵌套路由
假设 views 的目录结构如下：
```
views/
--| login.vue
--| home.vue
--| home/
-----| index.vue
-----| about.vue
-----| product.vue
--| user/
-----| index.vue
-----| info.vue
```
那么，vue-router-auto 自动生成的路由配置如下：
```javascript
[
    { 
        name:'login',
        path:'/login',
        component: () => import('@/views/login.vue')
    },
    { 
        path:'/home',
        component: () => import('@/views/Home.vue'),
        children:[
            { 
                name:'home-index',
                path:'',
                component: () => import('@/views/home/index.vue')
            },
            { 
                name:'home-about',
                path:'about',
                component: () => import('@/views/home/about.vue')
            },
            { 
                name:'home-product',
                path:'product',
                component: () => import('@/views/home/product.vue')
            }
        ]
    },
    { 
        name:'user',
        path:'/user',
        component: () => import('@/views/user/index.vue')
    },
    { 
        name:'user-info',
        path:'/user/info',
        component: () => import('@/views/user/info.vue')
    }
]
```
### 动态嵌套路由
假设 views 的目录结构如下：
```
views/
--| login.vue
--| home.vue
--| home/
-----| _id.vue
-----| about.vue
--| user/
-----| user-edit.vue
 
```
那么，vue-router-auto 自动生成的路由配置如下： 
```javascript
[
    { 
        name:'login',
        path:'/login',
        component: () => import('@/views/login.vue')
    },
    { 
        name:'home',
        path:'/home',
        component: () => import('@/views/Home.vue'),
        children:[
            { 
                name:'home-id',
                path:':id',
                component: () => import('@/views/home/_id.vue')
            },
            { 
                name:'home-about',
                path:'about',
                component: () => import('@/views/home/about.vue')
            }
        ]
    },
    { 
        name:'user-edit',
        path:'/user/edit',
        component: () => import('@/views/user/user-edit.vue')
    }
]
```

---
_Source: https://npm.io/package/goldencis-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
