dev-resources.site
for different kinds of informations.
๐ version-rocket ๐
Published at
7/4/2022
Categories
npm
workder
version
web
Author
akimyou
Main Article
Author
7 person written this
akimyou
open
๐ version-rocket ๐
English | ็ฎไฝไธญๆ
Notify users when a new version of your site is available and prompt them to refresh the page.
When you finish deploying your app, send a deployment message to Lark Group Chat
About
version-rocket checks the version in the user's current browser against the version file in the remote server.
If a new version is available, a new version update prompt will be displayed to and the user will be given an operation button to refresh the page. Alternatively, version-rocket can notify you by receiving a callback function to support custom user interface.
We use the Web Worker API based on javascript to do the polling loop, will not affect the browser rendering process.
Features
- Compatible with all modern browsers
- The version prompt interface supports customization, and the content of the deployment message card can be customized.
- Available version real-time monitoring
- Synchronize deployment message to Lark group chat after successful deployment.
- Npm package support
Screenshots
- The first picture prompts user to refresh the page.
- The second picture shows that after the successful deployment of the project, the deployment message will be sent to the group chat to inform the team members.
- The third picture @All with optional settings based on second picture
Usage
Install
npm install version-rocket -S
Get Started
// 1. Import version-rocket, and invoke pollingCompareVersion method
import { pollingCompareVersion } from 'version-rocket'
import { version } from '../package.json'
/**
* @param 1: current version
* @param 2: remote server version.json file path
* @param 3: time interval of rotation monitoring (in ms), default 5000ms
* @param 4: custom version tip ui callback(optional)
*/
pollingCompareVersion(version, `${location.origin}/version.json`, 30000, (data) => {
console.log(data)
})
/**
* 2.
* generate-version-file shortcut command to create the version.json file.
* The parameter is the directory where you want to create version.json.
* If you don't pass the parameter, it will be created in the dist directory by default.
*/
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"generate:version": "generate-version-file dist public"
...
},
...
}
If you want to push the successful deployment message to the group chat where lark Robot is located, please continue.
/**
* 3.
* You need to create a send-lark-config.json file first, it store the field for setting the copy for the message card.
* Then, you can just execute the send-lark-message shortcut command. By default, the send-lark-config.json file in the current path is selected.
* If you want to customize the file path and file name, you can set the MESSAGE_PATH parameter to pass it in.
*/
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"send-lark-message:test": "MESSAGE_PATH=./lark-message-config.json send-lark-message"
...
},
...
}
// send-lark-config.json example
{
// card title
"title": "TEST FE Deployed Successfully",
// deploy project name
"projectName": "TEST",
// deploy branch name
"branch": "Staging",
// project url
"accessUrl": "https://test.com",
// remind group chat members: true/false
"isNotifyAll": true,
// lark robot webhook url
"larkWebHook": "https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxx",
// deploy type
"deployTools": "Jenkins",
// the deploy time zone that you want to display, default "Asia/Shanghai"
"expectConvertToTimezone": "America/New_York"
}
Link
version Article's
30 articles in total
What is Actually GitLab?
read article
The Ultimate Guide: How to Check Laravel Version
read article
Bitbucket vs GitHub: Whatโs the Difference Between Both?
read article
Letz Understand NPM Versioning: A Beginner's Guide
read article
Crossing the Bridge: Migrating and Working Across Version Control Systems
read article
PuroโโโUma forma eficiente de gerenciar as versรตes flutter
read article
Version Control Systems and Their Importance
read article
Check PyTorch version, CPU and GPU(CUDA) in PyTorch
read article
How To Use Versioning On AWS S3 Buckets To Enable Overwrite Protection Of Your Data
read article
What is semantic version and why knowing semantic versioning matters!
read article
GreptimeDB v0.6 Released - Support Migrating Table's Regions between Datanodes
read article
What is Semantic Versioning and why you should use it for your software ?
read article
Contaktlab Full Version VST Plug-ins โ Elevate Your Music Production Experience Download.
read article
Alpha 1.0.3 Upcoming Changes (wip)
read article
Alpha v1.0.2 - Upcoming Changes
read article
Difference between tilde(~) and caret(^) in package.json?
read article
How to Add a Build Number to the Web Build in Angular
read article
Versions Are For Humans
read article
How to Install Any Laravel Version
read article
Why Your Cloud Assets Need A Time Machine
read article
Angular version upgrade v4 to v12 - part1
read article
Rust Revolution - `r` the rust version manager
read article
VS Code Extension - Git Graph
read article
React Versiyon Dรผลรผrme
read article
Flutter Versiyon Dรผลรผrme
read article
What is the differences between GIT and SVN
read article
Notify users when a new version of your site is available and prompt them to refresh the page.
read article
๐ version-rocket ๐
currently reading
Understanding version control and mastering git - Branches and more...!!
read article
Choose your preferred major version on all open-source managed software!
read article
Featured ones: