added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -13,7 +13,7 @@ import {
attachServeStatic,
getConfigPath,
getConnectionCredentialsFromEnv,
startServer
startServer,
} from "./platform";
dotenv.config();
@@ -26,26 +26,26 @@ export const run: CliCommand = (program) => {
new Option("-p, --port <port>", "port to run on")
.env("PORT")
.default(config.server.default_port)
.argParser((v) => Number.parseInt(v))
.argParser((v) => Number.parseInt(v)),
)
.addOption(
new Option("-m, --memory", "use in-memory database").conflicts([
"config",
"db-url",
"db-token"
])
"db-token",
]),
)
.addOption(new Option("-c, --config <config>", "config file"))
.addOption(
new Option("--db-url <db>", "database url, can be any valid libsql url").conflicts(
"config"
)
"config",
),
)
.addOption(new Option("--db-token <db>", "database token").conflicts("config"))
.addOption(
new Option("--server <server>", "server type")
.choices(PLATFORMS)
.default(isBun ? "bun" : "node")
.default(isBun ? "bun" : "node"),
)
.action(action);
};
@@ -76,7 +76,7 @@ async function makeApp(config: MakeAppConfig) {
await config.onBuilt(app);
}
},
"sync"
"sync",
);
await app.build();
@@ -95,7 +95,7 @@ export async function makeConfigApp(config: CliBkndConfig, platform?: Platform)
await config.onBuilt?.(app);
},
"sync"
"sync",
);
await config.beforeBuild?.(app);
@@ -141,7 +141,7 @@ async function action(options: {
console.info("Using connection", c.cyan(connection.url));
app = await makeApp({
connection,
server: { platform: options.server }
server: { platform: options.server },
});
}