feat(runtime): upgrade DSH and bundled plugins with startup migration
This commit is contained in:
@@ -8,6 +8,11 @@ const replacement = 'const persistence = "host"; /* dsh-mgr: authenticated remot
|
||||
// Deliberately scoped to the settings UI, not connection.isLoopback or auth.
|
||||
// Fail closed on upstream changes instead of silently shipping a broken UI.
|
||||
export function patchSettings(source, version) {
|
||||
// Native host settings supersede the old persistence patch.
|
||||
if (version === "0.2.1-rc.2") {
|
||||
if (source.includes(target) || !source.includes("this.ctx.remote.settings.describe()") || !source.includes("this.ctx.remote.settings.mutate(")) throw new Error("expected native host settings API");
|
||||
return source;
|
||||
}
|
||||
if (version !== '0.2.0-rc.2') throw new Error('unsupported DSH version for host settings patch');
|
||||
if (source.split(target).length !== 2 || source.includes(replacement)) {
|
||||
throw new Error('expected exactly one unpatched settings persistence selector');
|
||||
|
||||
Reference in New Issue
Block a user