refactor console imports, added config update event

This commit is contained in:
dswbx
2025-07-02 14:02:50 +02:00
parent d41fd5541f
commit 70737c04cd
48 changed files with 100 additions and 63 deletions

View File

@@ -1,4 +1,3 @@
import { $console, isDebug } from "core";
import {
DataPermissions,
type EntityData,

View File

@@ -1,5 +1,6 @@
import { $console, config } from "core";
import { config } from "core";
import {
$console,
type Static,
StringEnum,
parse,

View File

@@ -1,4 +1,5 @@
import { $console, type DB as DefaultDB } from "core";
import type { DB as DefaultDB } from "core";
import { $console } from "core/utils";
import { EventManager } from "core/events";
import { sql } from "kysely";
import { Connection } from "../connection/Connection";

View File

@@ -1,4 +1,4 @@
import { $console } from "core/console";
import { $console } from "core/utils";
import type { Entity, EntityData } from "../Entity";
import type { EntityManager } from "../EntityManager";
import { Result, type ResultJSON, type ResultOptions } from "../Result";
@@ -32,6 +32,7 @@ export class MutatorResult<T = EntityData[]> extends Result<T> {
onError: (error) => {
if (!options?.silent) {
$console.error("[ERROR] Mutator:", error.message);
throw error;
}
},
...options,

View File

@@ -1,5 +1,5 @@
import type { DB as DefaultDB, PrimaryFieldType } from "core";
import { $console } from "core";
import { $console } from "core/utils";
import { type EmitsEvents, EventManager } from "core/events";
import { type SelectQueryBuilder, sql } from "kysely";
import { InvalidSearchParamsException } from "../../errors";

View File

@@ -1,9 +1,8 @@
import { $console } from "core/console";
import type { Entity, EntityData } from "../Entity";
import type { EntityManager } from "../EntityManager";
import { Result, type ResultJSON, type ResultOptions } from "../Result";
import type { Compilable, SelectQueryBuilder } from "kysely";
import { ensureInt } from "core/utils";
import { $console, ensureInt } from "core/utils";
export type RepositoryResultOptions = ResultOptions & {
silent?: boolean;

View File

@@ -1,4 +1,5 @@
import { $console, type PrimaryFieldType } from "core";
import type { PrimaryFieldType } from "core";
import { $console } from "core/utils";
import { Event, InvalidEventReturn } from "core/events";
import type { Entity, EntityData } from "../entities";
import type { RepoQuery } from "data/server/query";

View File

@@ -1,7 +1,6 @@
import { type Static, StringEnum, dayjs } from "core/utils";
import { $console, type Static, StringEnum, dayjs } from "core/utils";
import type { EntityManager } from "../entities";
import { Field, type TActionContext, type TRenderContext, baseFieldConfigSchema } from "./Field";
import { $console } from "core";
import * as tbbox from "@sinclair/typebox";
import type { TFieldTSType } from "data/entities/EntityTypescript";
const { Type } = tbbox;

View File

@@ -2,7 +2,7 @@ import type { CompiledQuery, TableMetadata } from "kysely";
import type { IndexMetadata, SchemaResponse } from "../connection/Connection";
import type { Entity, EntityManager } from "../entities";
import { PrimaryField } from "../fields";
import { $console } from "core";
import { $console } from "core/utils";
type IntrospectedTable = TableMetadata & {
indices: IndexMetadata[];

View File

@@ -1,7 +1,6 @@
import { s } from "core/object/schema";
import { WhereBuilder, type WhereQuery } from "data/entities/query/WhereBuilder";
import { $console } from "core";
import { isObject } from "core/utils";
import { isObject, $console } from "core/utils";
import type { CoercionOptions, TAnyOf } from "jsonv-ts";
// -------