fixing jsonv-ts imports

This commit is contained in:
dswbx
2025-08-02 16:47:24 +02:00
parent 104885ea5c
commit 5e5f0ef70f
10 changed files with 27 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ import { EntityManager } from "data/entities/EntityManager";
import { Module, type ModuleBuildContext } from "modules/Module";
import { getDummyConnection } from "../helper";
import { ModuleHelper } from "modules/ModuleHelper";
import { McpServer } from "jsonv-ts/mcp";
import { McpServer } from "bknd/utils";
export function makeCtx(overrides?: Partial<ModuleBuildContext>): ModuleBuildContext {
const { dummyConnection } = getDummyConnection();

View File

@@ -1,10 +1,9 @@
import type { CliCommand } from "cli/types";
import { makeAppFromEnv } from "../run";
import { s } from "bknd/utils";
import { s, mcp as mcpMiddleware, McpServer } from "bknd/utils";
import { ObjectToolSchema } from "modules/mcp";
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { mcp as mcpMiddleware, McpServer, Resource } from "jsonv-ts/mcp";
import type { Module } from "modules/Module";
export const mcp: CliCommand = (program) =>

View File

@@ -2,6 +2,14 @@ import * as s from "jsonv-ts";
export { validator as jsc, type Options } from "jsonv-ts/hono";
export { describeRoute, schemaToSpec, openAPISpecs } from "jsonv-ts/hono";
export {
mcp,
McpServer,
Resource,
Tool,
type ToolAnnotation,
type ToolHandlerCtx,
} from "jsonv-ts/mcp";
export { secret, SecretSchema } from "./secret";

View File

@@ -1,7 +1,5 @@
import { s } from "bknd/utils";
import { s, isObject, $console } from "bknd/utils";
import { WhereBuilder, type WhereQuery } from "data/entities/query/WhereBuilder";
import { isObject, $console } from "core/utils";
import type { anyOf, CoercionOptions, Schema } from "jsonv-ts";
// -------
// helpers
@@ -97,9 +95,9 @@ export type RepoWithSchema = Record<
}
>;
const withSchema = <Type = unknown>(self: Schema): Schema<{}, Type, Type> =>
const withSchema = <Type = unknown>(self: s.Schema): s.Schema<{}, Type, Type> =>
s.anyOf([stringIdentifier, s.array(stringIdentifier), self], {
coerce: function (this: typeof anyOf, _value: unknown, opts: CoercionOptions = {}) {
coerce: function (this: typeof s.anyOf, _value: unknown, opts: s.CoercionOptions = {}) {
let value: any = _value;
if (typeof value === "string") {

View File

@@ -7,7 +7,7 @@ import type { ModuleHelper } from "./ModuleHelper";
import { SchemaObject } from "core/object/SchemaObject";
import type { DebugLogger } from "core/utils/DebugLogger";
import type { Guard } from "auth/authorize/Guard";
import type { McpServer } from "jsonv-ts/mcp";
import type { McpServer } from "bknd/utils";
type PartialRec<T> = { [P in keyof T]?: PartialRec<T[P]> };

View File

@@ -1,4 +1,4 @@
import { mark, stripMark, $console, s, objectEach, transformObject } from "bknd/utils";
import { mark, stripMark, $console, s, objectEach, transformObject, McpServer } from "bknd/utils";
import { Guard } from "auth/authorize/Guard";
import { env } from "core/env";
import { BkndError } from "core/errors";
@@ -21,7 +21,6 @@ import { AppMedia } from "../media/AppMedia";
import type { ServerEnv } from "./Controller";
import { Module, type ModuleBuildContext } from "./Module";
import { ModuleHelper } from "./ModuleHelper";
import { McpServer, type Resource, type Tool } from "jsonv-ts/mcp";
export type { ModuleBuildContext };

View File

@@ -1,7 +1,13 @@
import * as s from "jsonv-ts";
import { type Resource, Tool, type ToolAnnotation, type ToolHandlerCtx } from "jsonv-ts/mcp";
import { excludePropertyTypes, rescursiveClean } from "./utils";
import { autoFormatString, getPath } from "bknd/utils";
import {
type Resource,
Tool,
type ToolAnnotation,
type ToolHandlerCtx,
autoFormatString,
getPath,
s,
} from "bknd/utils";
import type { App } from "App";
import type { ModuleBuildContext } from "modules";

View File

@@ -1,5 +1,4 @@
import * as s from "jsonv-ts";
import { isPlainObject, transformObject } from "bknd/utils";
import { isPlainObject, transformObject, s } from "bknd/utils";
export function rescursiveClean(
input: s.Schema,

View File

@@ -13,10 +13,10 @@ import {
s,
describeRoute,
InvalidSchemaError,
openAPISpecs,
} from "bknd/utils";
import type { Context, Hono } from "hono";
import { Controller } from "modules/Controller";
import { openAPISpecs } from "jsonv-ts/hono";
import { swaggerUI } from "@hono/swagger-ui";
import {
MODULE_NAMES,

View File

@@ -1,4 +1,4 @@
import * as s from "jsonv-ts";
import { s } from "bknd/utils";
import type {
CustomValidator,