Give the plugin its own CalVer
The plugin ships inside the server image but shared the app's CalVer, so an app-only release marked every paired reader as needing a plugin update. It also let the version drift: the 2026.10.09 release still reported 2026.09.25. - read the plugin version from const.lua at startup so LATEST_PLUGIN_VERSION cannot diverge from the packaged plugin - keep MIN_COVER_PLUGIN_VERSION and MIN_INCREMENTAL_PLUGIN_VERSION as independent compatibility floors instead of copies of the app version - add scripts/version.mjs (check by default, --write to sync) with a dependency-free zip reader; npm test now fails on a drifted version string or a stale public/kovi-plugin.zip - bump the app version to 2026.11.13
This commit is contained in:
7 files changed
+185
-7
No files matched your search
@@ -45,9 +45,12 @@ test('server detects plugins too old for embedded-cover requests',()=>{
|
||||
assert.match(server,/update_recommended/);
|
||||
});
|
||||
|
||||
test('packaged plugin version is aligned with kovi 2026.09.25',()=>{
|
||||
test('plugin version is declared once and surfaced in its metadata',()=>{
|
||||
const constants=fs.readFileSync(new URL('../plugins/kovi.koplugin/const.lua', import.meta.url),'utf8');
|
||||
assert.match(constants,/2026\.09\.25/);
|
||||
const meta=fs.readFileSync(new URL('../plugins/kovi.koplugin/_meta.lua', import.meta.url),'utf8');
|
||||
const version=/VERSION\s*=\s*"([^"]+)"/.exec(constants)?.[1];
|
||||
assert.match(version||'',/^\d{4}\.\d{2}\.\d{2}$/);
|
||||
assert.ok(meta.includes(`v${version}`));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { check, versions } from '../scripts/version.mjs';
|
||||
|
||||
test('app and plugin versions stay consistent across sources and the packaged zip', () => {
|
||||
assert.deepEqual(check(), []);
|
||||
});
|
||||
|
||||
test('app and plugin versions are independent CalVer values', () => {
|
||||
const { app, plugin } = versions();
|
||||
assert.match(app, /^\d{4}\.\d{2}\.\d{2}$/);
|
||||
assert.match(plugin, /^\d{4}\.\d{2}\.\d{2}$/);
|
||||
});
|
||||
Reference in new issue
Block a user