fix(plugins): load official hosted plugins from bundled resources

This commit is contained in:
brother7 committed 2026-09-01 18:32:22 +08:00
1 parent 52e2a97a12
commit 1530ac7740
23 files changed
+835 -48

No files matched your search

+26
View File
@@ -135,4 +135,30 @@ describe('MarketplaceHostedAdmissionResolver', () => {
retryable: false,
});
});
it('resolves a code-owned bundled Release without consulting the device Package Store', async () => {
const getInstalledRelease = vi.fn(async () => null);
const resolve = vi.fn(async () => resolved({ sha256: null, sizeBytes: null }));
const options = {
packageStore: { getInstalledRelease },
marketplace: { resolve },
makeloreVersion: '2.0.0',
bundledReleases: {
[PLUGIN_ID]: { releaseId: RELEASE_ID, version: '1.0.0', channel: 'stable' as const },
},
} as unknown as ConstructorParameters<typeof MarketplaceHostedAdmissionResolver>[0];
const bundledResolver = new MarketplaceHostedAdmissionResolver(options);
await expect(bundledResolver.resolve({
pluginId: PLUGIN_ID,
workerSnapshot: { requestId: REQUEST_ID, pluginReleaseId: RELEASE_ID },
})).resolves.toEqual({ releaseId: RELEASE_ID, releaseAdmissionId: 'admission-game-1' });
expect(getInstalledRelease).not.toHaveBeenCalled();
expect(resolve).toHaveBeenCalledWith({
resolveRequestId: REQUEST_ID,
makeloreVersion: '2.0.0',
channel: 'stable',
installed: [],
});
});
});