feat(runtime): upgrade DSH and bundled plugins with startup migration

This commit is contained in:
2026-10-18 02:14:27 +08:00
parent eb7e809999
commit 2e31e74972
18 changed files with 501 additions and 80 deletions
+4 -4
View File
@@ -7,11 +7,11 @@ import { createConverter, runProcess } from './native-office.mjs';
import { patchOffice, target } from './install-office-preview.mjs';
test('patch is exact, version gated and refuses repeat application', () => {
const patched = patchOffice(target, '0.2.0-rc.2', '0.2.0-rc.2');
const patched = patchOffice(target, '0.2.1-rc.2', '0.2.1-rc.2');
assert.match(patched, /dsh-native-office/);
for (const source of ['', target + target, patched]) assert.throws(() => patchOffice(source, '0.2.0-rc.2', '0.2.0-rc.2'));
assert.throws(() => patchOffice(target, 'next', '0.2.0-rc.2'));
assert.throws(() => patchOffice(target, '0.2.0-rc.2', 'next'));
for (const source of ['', target + target, patched]) assert.throws(() => patchOffice(source, '0.2.1-rc.2', '0.2.1-rc.2'));
assert.throws(() => patchOffice(target, 'next', '0.2.1-rc.2'));
assert.throws(() => patchOffice(target, '0.2.1-rc.2', 'next'));
});
test('process cancellation, missing binary and failure are classified', async () => {