2024-01-31 23:17:04 +01:00
|
|
|
import { program } from "commander";
|
2024-03-04 21:33:25 +01:00
|
|
|
|
2024-06-13 03:32:51 +02:00
|
|
|
import { OssServeConfigurator } from "./oss-serve-configurator";
|
2024-05-15 16:09:24 +02:00
|
|
|
import { registerOssPrograms } from "./register-oss-programs";
|
2024-06-13 03:32:51 +02:00
|
|
|
import { ServeProgram } from "./serve.program";
|
2024-08-05 17:39:08 +02:00
|
|
|
import { ServiceContainer } from "./service-container/service-container";
|
2024-03-04 21:33:25 +01:00
|
|
|
|
2024-05-15 16:09:24 +02:00
|
|
|
async function main() {
|
|
|
|
const serviceContainer = new ServiceContainer();
|
|
|
|
await serviceContainer.init();
|
2021-12-20 18:04:00 +01:00
|
|
|
|
2024-05-15 16:09:24 +02:00
|
|
|
await registerOssPrograms(serviceContainer);
|
2024-04-29 23:43:14 +02:00
|
|
|
|
2024-06-13 03:32:51 +02:00
|
|
|
// ServeProgram is registered separately so it can be overridden by bit-cli
|
|
|
|
const serveConfigurator = new OssServeConfigurator(serviceContainer);
|
|
|
|
new ServeProgram(serviceContainer, serveConfigurator).register();
|
|
|
|
|
2024-05-15 16:09:24 +02:00
|
|
|
program.parse(process.argv);
|
2018-05-14 17:15:54 +02:00
|
|
|
}
|
2018-05-14 17:59:34 +02:00
|
|
|
|
2024-05-15 16:09:24 +02:00
|
|
|
// Node does not support top-level await statements until ES2022, esnext, etc which we don't use yet
|
2024-02-02 21:13:37 +01:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
2024-05-15 16:09:24 +02:00
|
|
|
main();
|