minor fixes in build and console

This commit is contained in:
dswbx
2025-02-19 17:41:48 +01:00
parent b436758fe6
commit a29e824ecc
4 changed files with 10 additions and 19 deletions

View File

@@ -48,8 +48,8 @@ function errorOutro() {
}
async function action(options: { template?: string; dir?: string; integration?: string }) {
colorizeConsole(console);
console.log("");
colorizeConsole(console);
const downloadOpts = {
dir: options.dir || "./",

View File

@@ -28,7 +28,7 @@ export class LibsqlConnection extends SqliteConnection {
constructor(clientOrCredentials: Client | LibSqlCredentials) {
const plugins = [new FilterNumericKeysPlugin(), new ParseJSONResultsPlugin()];
let client: Client;
if ("url" in clientOrCredentials) {
if (clientOrCredentials && "url" in clientOrCredentials) {
let { url, authToken, protocol } = clientOrCredentials;
if (protocol && LIBSQL_PROTOCOLS.includes(protocol)) {
console.log("changing protocol to", protocol);
@@ -36,11 +36,8 @@ export class LibsqlConnection extends SqliteConnection {
url = `${protocol}://${rest}`;
}
//console.log("using", url, { protocol });
client = createClient({ url, authToken });
} else {
//console.log("-- client provided");
client = clientOrCredentials;
}
@@ -48,7 +45,6 @@ export class LibsqlConnection extends SqliteConnection {
// @ts-expect-error libsql has type issues
dialect: new CustomLibsqlDialect({ client }),
plugins
//log: ["query"],
});
super(kysely, {}, plugins);
@@ -90,7 +86,6 @@ export class LibsqlConnection extends SqliteConnection {
const rows = await kyselyPlugins.transformResultRows(r.rows);
data.push(rows);
}
//console.log("data", data);
return data;
}

View File

@@ -164,17 +164,13 @@ export class AdminController extends Controller {
};
if (isProd) {
try {
// @ts-ignore
const manifest = await import("bknd/dist/manifest.json", {
assert: { type: "json" }
}).then((m) => m.default);
// @todo: load all marked as entry (incl. css)
assets.js = manifest["src/ui/main.tsx"].file;
assets.css = manifest["src/ui/main.tsx"].css[0] as any;
} catch (e) {
console.error("Error loading manifest", e);
}
// @ts-ignore
const manifest = await import("bknd/dist/manifest.json", {
assert: { type: "json" }
});
// @todo: load all marked as entry (incl. css)
assets.js = manifest.default["src/ui/main.tsx"].file;
assets.css = manifest.default["src/ui/main.tsx"].css[0] as any;
}
const theme = configs.server.admin.color_scheme ?? "light";