2024-05-15 16:09:24 +02:00
|
|
|
import { program } from "commander";
|
|
|
|
|
|
|
|
import { registerOssPrograms } from "@bitwarden/cli/register-oss-programs";
|
2024-06-13 03:32:51 +02:00
|
|
|
import { ServeProgram } from "@bitwarden/cli/serve.program";
|
2024-05-15 16:09:24 +02:00
|
|
|
|
2024-06-13 03:32:51 +02:00
|
|
|
import { BitServeConfigurator } from "./bit-serve-configurator";
|
2024-05-15 16:09:24 +02:00
|
|
|
import { registerBitPrograms } from "./register-bit-programs";
|
|
|
|
import { ServiceContainer } from "./service-container";
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const serviceContainer = new ServiceContainer();
|
|
|
|
await serviceContainer.init();
|
|
|
|
|
|
|
|
await registerOssPrograms(serviceContainer);
|
|
|
|
await registerBitPrograms(serviceContainer);
|
|
|
|
|
2024-06-13 03:32:51 +02:00
|
|
|
const serveConfigurator = new BitServeConfigurator(serviceContainer);
|
|
|
|
new ServeProgram(serviceContainer, serveConfigurator).register();
|
|
|
|
|
2024-05-15 16:09:24 +02:00
|
|
|
program.parse(process.argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Node does not support top-level await statements until ES2022, esnext, etc which we don't use yet
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
|
|
main();
|