0.0.4 • Published 2 years ago

zhixin-cli-tool v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

智信微应用命令行工具

安装

npm install -D zhixin-cli-tool

or

yarn add -D zhixin-cli-tool

新增配置文件 .zx-env

{
  "url": "http://localhost:8080",
  "server": "http://192.168.5.54/",
  "active": {
    "username": "1112223333",
    "corpId": "6"
  },
  "useToken": false,
  "accounts": [
    {
      "username": "1112223333",
      "password": "pwdpwdpwd"
    }
  ]
}

配置文件字段说明

url

String

开发环境链接

  • 本地开发,如 http://localhost:8080
  • 远程联调,监听 0.0.0.0, 如: http://192.168.12.34

server

String

后端线上地址

useToken

Boolean | { "key": String }

配置后生成的 URL 不再拼接 userCode,拼接 token.生成的链接为:http://host:port?token=xxxxx

  • 不配置确实为 false => ?userCode=xxx&corpId=yyy
  • useToken: true / useToken: { key: 'token' } => ?token=xxx&corpId=yyy
  • useToken: { key: 'someToken' } => ?someToken=xxx&corpId=yyy

accounts

Array<{username: String, password: String}>

多个账号密码

active

undefined | { username: String, corpId: String }

配置当前使用的用户和公司,不配置则使用 accounts0 登录后通过 corpInfo 解析其中第一个公司获得 corpId.

package.json 增加 script

scripts: {
    ...
    "start": "zx"
}

todo

  • 显示线上微应用列表
  • 打开线上微应用
  • 多环境/多配置文件
  • watch 模式,修改配置后打开新链接
  • 选人并发送包含链接卡片到线上智信,用于微应用联调涉及 原生 / wnsdk 的功能
  • mrm 提供项目集成
  • vite 模板生成微应用
  • @vue/cli 模板生成微应用
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago