chore: add version-bump.mjs and initialize versions.json

Signed-off-by: Zoorpha <aaron@kubedo.com>
This commit is contained in:
Zoorpha 2026-06-22 22:43:44 +02:00
parent dcd6d28936
commit 31925fb32a
2 changed files with 22 additions and 0 deletions

19
version-bump.mjs Normal file
View file

@ -0,0 +1,19 @@
import { readFileSync, writeFileSync } from 'fs';
const targetVersion = process.env.npm_package_version;
// Read minAppVersion from manifest.json and bump version to target version
const manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync('manifest.json', JSON.stringify(manifest, null, 2) + '\n');
// Read versions.json and bump version to target version
let versions = {};
try {
versions = JSON.parse(readFileSync('versions.json', 'utf8'));
} catch (e) {
// If versions.json doesn't exist, initialize
}
versions[targetVersion] = minAppVersion;
writeFileSync('versions.json', JSON.stringify(versions, null, 2) + '\n');

3
versions.json Normal file
View file

@ -0,0 +1,3 @@
{
"0.1.3": "0.15.0"
}