当前位置:网站首页>Elegantly detect and update web applications in real time
Elegantly detect and update web applications in real time
2022-08-08 14:47:00 【InfoQ】
一、背景

二、应用场景
三、功能简介
四、功能特点
五、效果截图




六、项目地址
七、使用方法
安装
npm install version-rocket
开始使用
使用默认主题
import { checkVersion } from 'version-rocket'
// Recommended by default package.json 中的 version 字段, 若有自定义 version, please ignore this line
import { version } from '../package.json'
checkVersion({
localPackageVersion: version,
originVersionFileUrl: `${location.origin}/version.json`,
})
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"generate:version": "generate-version-file dist public"
...
},
...
}
Personalize popup text and themes
import { checkVersion } from 'version-rocket'
import { version } from '../package.json'
checkVersion(
{
localPackageVersion: version,
originVersionFileUrl: `${location.origin}/version.json`,
},
{
title: 'Title',
description: 'Description',
primaryColor: '#758bfd',
rocketColor: '#ff8600',
buttonText: 'Button Text',
}
)
Personalize the pop-up prompt picture
import { checkVersion } from 'version-rocket'
import { version } from '../package.json'
checkVersion(
{
localPackageVersion: version,
originVersionFileUrl: `${location.origin}/version.json`,
},
{
imageUrl: 'https://avatars.githubusercontent.com/u/26329117',
}
)
Support push notification of successful deployment to Lark 群聊
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"send-lark-message:test": "MESSAGE_PATH=./lark-message-staging-config.json PACKAGE_JSON_PATH=./packages/test/package.json send-lark-message"
...
},
...
}
{
// 消息卡片标题
"title": "TEST FE Deployed Successfully",
// Project name label
"projectNameLabel": "Project name label",
// 项目名称
"projectName": "TEST",
// Project branch label
"branchLabel": "Branch label",
// 项目分支, Can be used to differentiate deployment environments
"branch": "Staging",
// 版本标签
"versionLabel": "Version label",
// 版本
"version": "1.1.1.0",
// Items have access to address labels
"accessUrlLabel": "Access URL label",
// Project accessible address
"accessUrl": "https://test.com",
// 是否@Everyone label
"isNotifyAllLabel": "Is notify all label",
// 是否@所有人: true / false
"isNotifyAll": true,
// Lark 机器人的 webhook 链接
"larkWebHook": "https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxx",
// 可选: Deployment tool description
"deployToolsText": "Deploy tools text",
// 可选: The method or platform used for deployment
"deployTools": "Jenkins",
// 可选: The time zone to which the deployment time wants to be converted,默认 "Asia/Shanghai" (When your project is deployed to a target server that is different from your time zone, This field can be set to convert time zones)
"expectConvertToTimezone": "America/New_York"
// 可选: Want to show more information than templates
"remark": "Trigger by bob, fix xxx bug"
}
Supports passing in dynamically generated card copy
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"send-lark-message:test": "MESSAGE_JSON='{\"title\":\"This is a dynamically generated title\",\"version\":\"1.1.0-beta\",\"accessUrl\":\"http://test.example.com\",\"isNotifyAll\":true}' send-lark-message"
...
},
...
}
Personalize deployment message cards
// send-lark-config.json 示例
{
// Message card content
"message": {
"msg_type": "text",
"content": {
"text": "New message reminder"
}
},
// Lark 机器人的 webhook 链接
"larkWebHook": "https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxx"
}
八、属性/参数
checkVersion(config, options) 函数参数列表
九、相关链接
关于领创集团(Advance Intelligence Group)
往期回顾 BREAK AWAY
边栏推荐
猜你喜欢
随机推荐
如何使用 Eolink 实现 API 文档自动生成
H5不同屏幕大小显示不同的文字大小图片大小
shell三剑客-----sed命令
loj 6038「雅礼集训 2017 Day5」远行
Mx_yolov3环境配置+模型测试训练
现在网上开户安全么?接着证券开户选择哪个证券?
logistic regression model - based on R
医学图像数据增强-重采样itk
Create a 2D array
Common regularization methods in deep learning (Regularization) and detailed explanation of WeightDecay parameters in optimizers
HMS Core Analysis Service Intelligent Operation Version 6.5.1 Launched
【小码匠自习室】 [NOI Online 2022 入门组] 王国比赛
优雅地实时检测和更新 Web 应用
761. 特殊的二进制序列 : 经典构造题
P8352-[SDOI/SXOI2022]小N的独立集【dp套dp】
更改C盘用户目录下的用户名(亲测有效)
Interview questions 17.05. Letters and numbers
基于SCL语言的模拟量平均值滤波FB库功能介绍及创建FB库的具体方法
See how three years of CRUD programmers solve database deadlocks
Ubuntu下使用sudo dpkg --configure -a后数据库出现问题