refactor version check

This commit is contained in:
proddy
2024-11-26 13:32:30 +01:00
parent 3ba0bb80e7
commit f11b9ee420
20 changed files with 545 additions and 494 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.5.2.cjs
yarnPath: .yarn/releases/yarn-4.5.3.cjs

View File

@@ -13,7 +13,7 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"formidable": "^3.5.2",
"itty-router": "^5.0.18",
"prettier": "^3.3.3"
"prettier": "^3.4.0"
},
"packageManager": "yarn@4.5.2"
"packageManager": "yarn@4.5.3"
}

View File

@@ -29,19 +29,45 @@ const headers = {
'Content-type': 'application/msgpack'
};
// Versions - all without the 'v'
let VERSION_IS_UPGRADEABLE;
// Versions
// default - on latest stable, no upgrades
let THIS_VERSION = '3.7.0';
let LATEST_STABLE_VERSION = '3.7.0';
let LATEST_DEV_VERSION = '3.7.1-dev.1';
let VERSION_IS_UPGRADEABLE = false;
// for testing - scenario 1
THIS_VERSION = '3.7.1-dev.1';
VERSION_IS_UPGRADEABLE = true;
// scenarios for testing, overriding the default
const version_test = 0;
// for testing - scenario 2
// THIS_VERSION = '3.6.5';
// VERSION_IS_UPGRADEABLE = true;
switch (version_test as number) {
case 0:
default:
// use default - on latest stable, no upgrades, but can switch
VERSION_IS_UPGRADEABLE = false;
break;
case 1:
// on latest dev, no update
THIS_VERSION = '3.7.1-dev.12';
LATEST_STABLE_VERSION = '3.7.0';
LATEST_DEV_VERSION = '3.7.1-dev.12';
VERSION_IS_UPGRADEABLE = false;
break;
case 2:
// upgrade stable to latest stable
THIS_VERSION = '3.6.5';
LATEST_STABLE_VERSION = '3.7.0';
LATEST_DEV_VERSION = '3.7.1-dev.12';
VERSION_IS_UPGRADEABLE = true;
break;
case 3:
// upgrade dev to latest dev
THIS_VERSION = '3.7.0-dev-1';
LATEST_STABLE_VERSION = '3.7.0';
LATEST_DEV_VERSION = '3.7.1-dev.12';
VERSION_IS_UPGRADEABLE = true;
break;
}
// GLOBAL VARIABLES
let countWifiScanPoll = 0; // wifi network scan

View File

@@ -328,7 +328,7 @@ __metadata:
"@trivago/prettier-plugin-sort-imports": "npm:^4.3.0"
formidable: "npm:^3.5.2"
itty-router: "npm:^5.0.18"
prettier: "npm:^3.3.3"
prettier: "npm:^3.4.0"
languageName: unknown
linkType: soft
@@ -355,12 +355,12 @@ __metadata:
languageName: node
linkType: hard
"prettier@npm:^3.3.3":
version: 3.3.3
resolution: "prettier@npm:3.3.3"
"prettier@npm:^3.4.0":
version: 3.4.0
resolution: "prettier@npm:3.4.0"
bin:
prettier: bin/prettier.cjs
checksum: 10c0/b85828b08e7505716324e4245549b9205c0cacb25342a030ba8885aba2039a115dbcf75a0b7ca3b37bc9d101ee61fab8113fc69ca3359f2a226f1ecc07ad2e26
checksum: 10c0/00974e5053dcf04cefe8d6bdef16d6a311d834ff074e927dcb85a425c8a300113fe60dc269373c892edb58e0e57749541f2a7a91ee51cdd40ab3092587772cae
languageName: node
linkType: hard