Merge remote-tracking branch 'origin/release/0.15' into feat/plugin-improvements

# Conflicts:
#	app/package.json
#	app/src/App.ts
This commit is contained in:
dswbx
2025-06-13 17:24:54 +02:00
86 changed files with 1821 additions and 1782 deletions

View File

@@ -16,6 +16,7 @@ export interface Test {
skipIf: (condition: boolean) => (label: string, fn: TestFn) => void;
}
export type TestRunner = {
describe: (label: string, asyncFn: () => Promise<void>) => void;
test: Test;
mock: <T extends (...args: any[]) => any>(fn: T) => T | any;
expect: <T = unknown>(

View File

@@ -0,0 +1,12 @@
import { createApp as createAppInternal, type CreateAppConfig } from "App";
import { bunSqlite } from "adapter/bun/connection/BunSqliteConnection";
import { Connection } from "data/connection/Connection";
export { App } from "App";
export function createApp({ connection, ...config }: CreateAppConfig = {}) {
return createAppInternal({
...config,
connection: Connection.isConnection(connection) ? connection : bunSqlite(connection as any),
});
}

View File

@@ -48,6 +48,14 @@ export function isNode() {
}
}
export function isBun() {
try {
return typeof Bun !== "undefined";
} catch (e) {
return false;
}
}
export function invariant(condition: boolean | any, message: string) {
if (!condition) {
throw new Error(message);