23 lines
633 B
TypeScript
23 lines
633 B
TypeScript
import { cliProduct } from "./cli";
|
|
import { desktopProduct } from "./desktop";
|
|
import { webProduct } from "./web";
|
|
|
|
import type { ProductDefinition, ProductId } from "./product";
|
|
|
|
export * from "./product";
|
|
export { sharedExtensions } from "./shared";
|
|
|
|
const products: Readonly<Record<ProductId, ProductDefinition>> = Object.freeze({
|
|
cli: cliProduct,
|
|
web: webProduct,
|
|
desktop: desktopProduct,
|
|
});
|
|
|
|
export function getProduct(id: string): ProductDefinition {
|
|
if (id === "cli" || id === "web" || id === "desktop") {
|
|
return products[id];
|
|
}
|
|
|
|
throw new Error(`Unknown product "${id}". Expected cli, web, or desktop.`);
|
|
}
|