Skip to content

Commit

Permalink
Generate Extension Info in server application
Browse files Browse the repository at this point in the history
fixes #13481

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu committed Apr 11, 2024
1 parent 635eb5b commit 80c6513
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ serverAddress.then((addressInfo) => {
});
globalThis.serverAddress = serverAddress;
globalThis.extensionInfo = ${this.prettyStringify(this.pck.extensionPackages.map(({ name, version }) => ({ name, version }))) };
`;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/node/application-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export class ApplicationServerImpl implements ApplicationServer {
protected readonly applicationPackage: ApplicationPackage;

getExtensionsInfos(): Promise<ExtensionInfo[]> {
const extensions = this.applicationPackage.extensionPackages;
const infos: ExtensionInfo[] = extensions.map(extension => ({ name: extension.name, version: extension.version }));
return Promise.resolve(infos);
// @ts-expect-error
const appInfo: ExtensionInfo[] = globalThis.extensionInfo;
return Promise.resolve(appInfo);
}

getApplicationInfo(): Promise<ApplicationInfo | undefined> {
Expand Down

0 comments on commit 80c6513

Please sign in to comment.