refactor/imports (#217)

* refactored core and core/utils imports

* refactored core and core/utils imports

* refactored media imports

* refactored auth imports

* refactored data imports

* updated package json exports, fixed mm config

* fix tests
This commit is contained in:
dswbx
2025-07-22 20:17:11 +02:00
committed by GitHub
parent 1ec3ba0e92
commit ca55503e66
214 changed files with 680 additions and 791 deletions
+2 -3
View File
@@ -1,5 +1,5 @@
import { config } from "core";
import { snakeToPascalWithSpaces, transformObject, $console } from "core/utils";
import { config } from "core/config";
import { snakeToPascalWithSpaces, transformObject, $console, s, parse } from "bknd/utils";
import {
type Field,
PrimaryField,
@@ -7,7 +7,6 @@ import {
type TActionContext,
type TRenderContext,
} from "../fields";
import { s, parse } from "bknd/core";
// @todo: entity must be migrated to typebox
export const entityConfigSchema = s
+2 -2
View File
@@ -1,5 +1,5 @@
import type { DB as DefaultDB } from "core";
import { $console } from "core/utils";
import type { DB as DefaultDB } from "bknd";
import { $console } from "bknd/utils";
import { EventManager } from "core/events";
import { sql } from "kysely";
import { Connection } from "../connection/Connection";
+2 -1
View File
@@ -1,4 +1,5 @@
import type { Entity, EntityManager, EntityRelation, TEntityType } from "data";
import type { Entity, EntityManager, TEntityType } from "data/entities";
import type { EntityRelation } from "data/relations";
import { autoFormatString } from "core/utils";
import { usersFields } from "auth/auth-entities";
import { mediaFields } from "media/media-entities";
+1 -1
View File
@@ -1,4 +1,4 @@
import { isDebug } from "core";
import { isDebug } from "core/env";
import { pick } from "core/utils";
import type { Connection } from "data/connection";
import type {
+2 -3
View File
@@ -1,7 +1,7 @@
import type { DB as DefaultDB, PrimaryFieldType } from "core";
import type { DB as DefaultDB, PrimaryFieldType } from "bknd";
import { type EmitsEvents, EventManager } from "core/events";
import type { DeleteQueryBuilder, InsertQueryBuilder, UpdateQueryBuilder } from "kysely";
import type { TActionContext } from "../..";
import type { TActionContext } from "data/fields";
import { WhereBuilder } from "../query/WhereBuilder";
import type { Entity, EntityData, EntityManager } from "../../entities";
import { InvalidSearchParamsException } from "../../errors";
@@ -9,7 +9,6 @@ import { MutatorEvents } from "../../events";
import { RelationMutator } from "../../relations";
import type { RepoQuery } from "../../server/query";
import { MutatorResult, type MutatorResultOptions } from "./MutatorResult";
import { transformObject } from "core/utils";
type MutatorQB =
| InsertQueryBuilder<any, any, any>
@@ -2,7 +2,7 @@ import { $console } from "core/utils";
import type { Entity, EntityData } from "../Entity";
import type { EntityManager } from "../EntityManager";
import { Result, type ResultJSON, type ResultOptions } from "../Result";
import { isDebug } from "core";
import { isDebug } from "core/env";
export type MutatorResultOptions = ResultOptions & {
silent?: boolean;
+1 -2
View File
@@ -1,4 +1,4 @@
import type { DB as DefaultDB, PrimaryFieldType } from "core";
import type { DB as DefaultDB, PrimaryFieldType } from "bknd";
import { $console } from "core/utils";
import { type EmitsEvents, EventManager } from "core/events";
import { type SelectQueryBuilder, sql } from "kysely";
@@ -14,7 +14,6 @@ import {
} from "../index";
import { JoinBuilder } from "./JoinBuilder";
import { RepositoryResult, type RepositoryResultOptions } from "./RepositoryResult";
import type { ResultOptions } from "../Result";
export type RepositoryQB = SelectQueryBuilder<any, any, any>;
+1 -1
View File
@@ -6,7 +6,7 @@ import {
isBooleanLike,
isPrimitive,
makeValidator,
} from "core";
} from "core/object/query/query";
import type {
DeleteQueryBuilder,
ExpressionBuilder,
+4 -2
View File
@@ -1,7 +1,9 @@
import { isObject } from "core/utils";
import type { KyselyJsonFrom, RepoQuery } from "data";
import type { KyselyJsonFrom } from "data/relations/EntityRelation";
import type { RepoQuery } from "data/server/query";
import { InvalidSearchParamsException } from "data/errors";
import type { Entity, EntityManager, RepositoryQB } from "../../entities";
import type { Entity, EntityManager, RepositoryQB } from "data/entities";
export class WithBuilder {
static addClause(