Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
673b02052a
|
|||
| 5e6900e70d | |||
|
68a0c0e35b
|
|||
| 8cc93d55da |
@@ -1,7 +1,16 @@
|
||||
# Changelog
|
||||
Generation of this changelog is based on commits
|
||||
## v1.12.3
|
||||
### Miscellaneous
|
||||
- [5e6900e70] - downgrade commander to v10
|
||||
## v1.12.2
|
||||
### Fixes
|
||||
- [8cc93d55d] - use http module instead of fetch (#17)
|
||||
### Miscellaneous
|
||||
- [68a0c0e35] - **release**: v1.12.2
|
||||
## v1.12.1
|
||||
### Miscellaneous
|
||||
- [dd4ca1f1c] - **release**: v1.12.1
|
||||
- [7264816e0] - change installation instructions
|
||||
## v1.12.0
|
||||
### Miscellaneous
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# rcz
|
||||
|
||||
Resultium commit standardization library
|
||||
Resultium commit standardization library. Supported by NodeJS v14 and above
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
11
package.json
11
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@resultium/rcz",
|
||||
"version": "1.12.1",
|
||||
"version": "1.12.3",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"description": "Resultium commit standardization library, inspired by conventional commits",
|
||||
"main": "./dist/index.js",
|
||||
@@ -13,9 +13,12 @@
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.resultium.net/technology/rcz.git"
|
||||
"url": "https://git.resultium.net/public/rcz.git"
|
||||
},
|
||||
"keywords": [
|
||||
"conventional",
|
||||
@@ -23,18 +26,18 @@
|
||||
],
|
||||
"author": {
|
||||
"name": "Resultium",
|
||||
"email": "contact@resultium.io",
|
||||
"email": "technology@resultium.io",
|
||||
"url": "https://www.resultium.io"
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.7.0",
|
||||
"commander": "^11.1.0",
|
||||
"semver": "^7.5.4",
|
||||
"simple-git": "^3.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.10.4",
|
||||
"@types/semver": "^7.5.6",
|
||||
"commander": "^10.0.1",
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
14
pnpm-lock.yaml
generated
14
pnpm-lock.yaml
generated
@@ -8,9 +8,6 @@ dependencies:
|
||||
'@clack/prompts':
|
||||
specifier: ^0.7.0
|
||||
version: 0.7.0
|
||||
commander:
|
||||
specifier: ^11.1.0
|
||||
version: 11.1.0
|
||||
semver:
|
||||
specifier: ^7.5.4
|
||||
version: 7.5.4
|
||||
@@ -25,6 +22,9 @@ devDependencies:
|
||||
'@types/semver':
|
||||
specifier: ^7.5.6
|
||||
version: 7.5.6
|
||||
commander:
|
||||
specifier: ^10.0.1
|
||||
version: 10.0.1
|
||||
typescript:
|
||||
specifier: ^5.3.3
|
||||
version: 5.3.3
|
||||
@@ -70,10 +70,10 @@ packages:
|
||||
resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==}
|
||||
dev: true
|
||||
|
||||
/commander@11.1.0:
|
||||
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
|
||||
engines: {node: '>=16'}
|
||||
dev: false
|
||||
/commander@10.0.1:
|
||||
resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==}
|
||||
engines: {node: '>=14'}
|
||||
dev: true
|
||||
|
||||
/debug@4.3.4:
|
||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
||||
|
||||
21
src/index.ts
21
src/index.ts
@@ -37,6 +37,7 @@ import { Command } from "commander";
|
||||
import semver from "semver";
|
||||
import { execSync } from "child_process";
|
||||
import { tmpdir } from "os";
|
||||
import { request } from "http";
|
||||
|
||||
const GetConfig = async () => {
|
||||
if (fs.existsSync(path.join(process.cwd(), ".rczrc"))) {
|
||||
@@ -105,6 +106,21 @@ const GetPostReleaseScript = async () => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const isOnline = () => {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
request({ method: "GET", hostname: "icanhazip.com" }, (res) => {
|
||||
res.on("data", () => {});
|
||||
|
||||
res.on("end", () => {
|
||||
resolve(res.statusCode === 200);
|
||||
});
|
||||
})
|
||||
.on("error", () => {
|
||||
resolve(false);
|
||||
})
|
||||
.end();
|
||||
});
|
||||
};
|
||||
|
||||
const CheckForUpdates = async () => {
|
||||
const updateText =
|
||||
@@ -119,8 +135,7 @@ const CheckForUpdates = async () => {
|
||||
|
||||
// even if cached once in a while it should get newest data
|
||||
if ((cachedVersion && Math.random() < 0.1) || cachedVersion === null) {
|
||||
const isOnline = (await fetch("https://icanhazip.com")).status === 200;
|
||||
if (!isOnline) return;
|
||||
if (!(await isOnline())) return;
|
||||
|
||||
const serverVersion = execSync("npm show @resultium/rcz version")
|
||||
.toString()
|
||||
@@ -142,7 +157,7 @@ const program = new Command();
|
||||
program
|
||||
.name("rcz")
|
||||
.description("Resultium commit standardization command-line interface")
|
||||
.version("1.12.1");
|
||||
.version("1.12.3");
|
||||
|
||||
program
|
||||
.command("commit")
|
||||
|
||||
Reference in New Issue
Block a user