mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
Aligns naming with the convention that "Config" is for file-level configuration while "Options" and "Settings" describe runtime parameters. Also applies rustfmt formatting fixes in web_auth.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
44 lines
921 B
TypeScript
44 lines
921 B
TypeScript
const service = process.argv[2];
|
|
|
|
type ServiceOptions = {
|
|
command: string[];
|
|
cwd?: string;
|
|
};
|
|
|
|
const services: Record<string, ServiceOptions> = {
|
|
api: {
|
|
command: ["fabro", "serve", "--host", "0.0.0.0"],
|
|
},
|
|
web: {
|
|
command: ["bun", "run", "dev", "--host", "0.0.0.0"],
|
|
cwd: "apps/fabro-web",
|
|
},
|
|
docs: {
|
|
command: ["mintlify", "dev", "--port", "3333", "--host", "0.0.0.0"],
|
|
cwd: "docs",
|
|
},
|
|
};
|
|
|
|
const validServices = Object.keys(services).join("|");
|
|
|
|
if (!service) {
|
|
console.error(`Usage: docker run fabro <${validServices}>`);
|
|
process.exit(1);
|
|
}
|
|
|
|
const config = services[service];
|
|
if (!config) {
|
|
console.error(
|
|
`Unknown service: ${service}. Use one of: ${Object.keys(services).join(", ")}`,
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
const child = Bun.spawn(config.command, {
|
|
stdout: "inherit",
|
|
stderr: "inherit",
|
|
stdin: "inherit",
|
|
cwd: config.cwd,
|
|
});
|
|
|
|
process.exit(await child.exited);
|