mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
minor fixes in build and console
This commit is contained in:
@@ -56,7 +56,7 @@ async function buildApi() {
|
|||||||
watch,
|
watch,
|
||||||
entry: ["src/index.ts", "src/data/index.ts", "src/core/index.ts", "src/core/utils/index.ts"],
|
entry: ["src/index.ts", "src/data/index.ts", "src/core/index.ts", "src/core/utils/index.ts"],
|
||||||
outDir: "dist",
|
outDir: "dist",
|
||||||
external: ["bun:test", "@libsql/client", /^bknd/],
|
external: ["bun:test", "@libsql/client", "bknd/client"],
|
||||||
metafile: true,
|
metafile: true,
|
||||||
platform: "browser",
|
platform: "browser",
|
||||||
format: ["esm"],
|
format: ["esm"],
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ function errorOutro() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function action(options: { template?: string; dir?: string; integration?: string }) {
|
async function action(options: { template?: string; dir?: string; integration?: string }) {
|
||||||
colorizeConsole(console);
|
|
||||||
console.log("");
|
console.log("");
|
||||||
|
colorizeConsole(console);
|
||||||
|
|
||||||
const downloadOpts = {
|
const downloadOpts = {
|
||||||
dir: options.dir || "./",
|
dir: options.dir || "./",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class LibsqlConnection extends SqliteConnection {
|
|||||||
constructor(clientOrCredentials: Client | LibSqlCredentials) {
|
constructor(clientOrCredentials: Client | LibSqlCredentials) {
|
||||||
const plugins = [new FilterNumericKeysPlugin(), new ParseJSONResultsPlugin()];
|
const plugins = [new FilterNumericKeysPlugin(), new ParseJSONResultsPlugin()];
|
||||||
let client: Client;
|
let client: Client;
|
||||||
if ("url" in clientOrCredentials) {
|
if (clientOrCredentials && "url" in clientOrCredentials) {
|
||||||
let { url, authToken, protocol } = clientOrCredentials;
|
let { url, authToken, protocol } = clientOrCredentials;
|
||||||
if (protocol && LIBSQL_PROTOCOLS.includes(protocol)) {
|
if (protocol && LIBSQL_PROTOCOLS.includes(protocol)) {
|
||||||
console.log("changing protocol to", protocol);
|
console.log("changing protocol to", protocol);
|
||||||
@@ -36,11 +36,8 @@ export class LibsqlConnection extends SqliteConnection {
|
|||||||
url = `${protocol}://${rest}`;
|
url = `${protocol}://${rest}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log("using", url, { protocol });
|
|
||||||
|
|
||||||
client = createClient({ url, authToken });
|
client = createClient({ url, authToken });
|
||||||
} else {
|
} else {
|
||||||
//console.log("-- client provided");
|
|
||||||
client = clientOrCredentials;
|
client = clientOrCredentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +45,6 @@ export class LibsqlConnection extends SqliteConnection {
|
|||||||
// @ts-expect-error libsql has type issues
|
// @ts-expect-error libsql has type issues
|
||||||
dialect: new CustomLibsqlDialect({ client }),
|
dialect: new CustomLibsqlDialect({ client }),
|
||||||
plugins
|
plugins
|
||||||
//log: ["query"],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
super(kysely, {}, plugins);
|
super(kysely, {}, plugins);
|
||||||
@@ -90,7 +86,6 @@ export class LibsqlConnection extends SqliteConnection {
|
|||||||
const rows = await kyselyPlugins.transformResultRows(r.rows);
|
const rows = await kyselyPlugins.transformResultRows(r.rows);
|
||||||
data.push(rows);
|
data.push(rows);
|
||||||
}
|
}
|
||||||
//console.log("data", data);
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,17 +164,13 @@ export class AdminController extends Controller {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (isProd) {
|
if (isProd) {
|
||||||
try {
|
// @ts-ignore
|
||||||
// @ts-ignore
|
const manifest = await import("bknd/dist/manifest.json", {
|
||||||
const manifest = await import("bknd/dist/manifest.json", {
|
assert: { type: "json" }
|
||||||
assert: { type: "json" }
|
});
|
||||||
}).then((m) => m.default);
|
// @todo: load all marked as entry (incl. css)
|
||||||
// @todo: load all marked as entry (incl. css)
|
assets.js = manifest.default["src/ui/main.tsx"].file;
|
||||||
assets.js = manifest["src/ui/main.tsx"].file;
|
assets.css = manifest.default["src/ui/main.tsx"].css[0] as any;
|
||||||
assets.css = manifest["src/ui/main.tsx"].css[0] as any;
|
|
||||||
} catch (e) {
|
|
||||||
console.error("Error loading manifest", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const theme = configs.server.admin.color_scheme ?? "light";
|
const theme = configs.server.admin.color_scheme ?? "light";
|
||||||
|
|||||||
Reference in New Issue
Block a user