vafast 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -834,8 +834,7 @@ const routes = defineRoutes([
834
834
  Vafast 内置验证器 JIT 编译,自动缓存编译后的验证器:
835
835
 
836
836
  ```typescript
837
- import { createValidator, validateFast, precompileSchemas } from 'vafast';
838
- import { Type } from '@sinclair/typebox';
837
+ import { createValidator, validateFast, precompileSchemas, Type } from 'vafast';
839
838
 
840
839
  const UserSchema = Type.Object({
841
840
  name: Type.String(),
package/dist/index.d.mts CHANGED
@@ -22,5 +22,6 @@ import "./utils/index.mjs";
22
22
  import { normalizePath } from "./router.mjs";
23
23
  import { a as ServeResult, c as serve, i as ServeOptions, n as GracefulShutdownOptions, o as TrustProxyOption, r as RequestTimeoutOptions, t as FetchHandler } from "./serve-Dh6Ux5Pg.mjs";
24
24
  import "./serve.mjs";
25
- import { FormatRegistry, Type } from "@sinclair/typebox";
26
- export { ApiSpec, BaseServer, ComponentRoute, ComponentServer, DependencyManager, ErrorDetail, type FetchHandler, FlattenedComponentRoute, FormatRegistry, type GracefulShutdownOptions, Handler, HandlerContext, HtmlRenderer, InferableRoute, LeafRouteConfig, Method, Middleware, NestedComponentRoute, NestedRouteConfig, Patterns, ProcessedRoute, type RequestTimeoutOptions, ResponseBody, Route, RouteMeta, RouteRegistry, RouteSchema, RoutesWithSource, SSEEvent, SSEEventType, SSEEventWithMeta, SSEGeneratorType, SSEMeta, SchemaConfig, SchemaLocation, type ServeOptions, type ServeResult, Server, ServerFactory, type TrustProxyOption, Type, TypedMiddleware, VAFAST_ERROR_SYMBOL, VALIDATION_FAILED_SYMBOL, VafastError, VafastRequest, ValidationError, ValidationFailedError, ValidationResult, base64urlDecode, base64urlEncode, composeMiddleware, createErrorDetail, createRouteRegistry, createValidator, defineMiddleware, defineRoute, defineRoutes, empty, err, errorHandler, filterRoutes, generateAITools, getAllRoutes, getApiSpec, getCookie, getHeader, getRoute, getRouteRegistry, getRoutesByMethod, getValidatorCacheStats, goAwait, hasFormat, html, isVafastError, isValidationFailedError, json, normalizePath, parseBody, parseCookies, parseCookiesFast, parseHeaders, parseQuery, parseQueryFast, pathToField, precompileSchemas, redirect, registerFormat, registerFormats, serve, sse, stream, text, validateAllSchemas, validateFast, validateSchema, validateSchemaOrThrow, withContext };
25
+ import { FormatRegistry, Kind, Static, TSchema, Type } from "@sinclair/typebox";
26
+ import { Value } from "@sinclair/typebox/value";
27
+ export { ApiSpec, BaseServer, ComponentRoute, ComponentServer, DependencyManager, ErrorDetail, type FetchHandler, FlattenedComponentRoute, FormatRegistry, type GracefulShutdownOptions, Handler, HandlerContext, HtmlRenderer, InferableRoute, Kind, LeafRouteConfig, Method, Middleware, NestedComponentRoute, NestedRouteConfig, Patterns, ProcessedRoute, type RequestTimeoutOptions, ResponseBody, Route, RouteMeta, RouteRegistry, RouteSchema, RoutesWithSource, SSEEvent, SSEEventType, SSEEventWithMeta, SSEGeneratorType, SSEMeta, SchemaConfig, SchemaLocation, type ServeOptions, type ServeResult, Server, ServerFactory, type Static, type TSchema, type TrustProxyOption, Type, TypedMiddleware, VAFAST_ERROR_SYMBOL, VALIDATION_FAILED_SYMBOL, VafastError, VafastRequest, ValidationError, ValidationFailedError, ValidationResult, Value, base64urlDecode, base64urlEncode, composeMiddleware, createErrorDetail, createRouteRegistry, createValidator, defineMiddleware, defineRoute, defineRoutes, empty, err, errorHandler, filterRoutes, generateAITools, getAllRoutes, getApiSpec, getCookie, getHeader, getRoute, getRouteRegistry, getRoutesByMethod, getValidatorCacheStats, goAwait, hasFormat, html, isVafastError, isValidationFailedError, json, normalizePath, parseBody, parseCookies, parseCookiesFast, parseHeaders, parseQuery, parseQueryFast, pathToField, precompileSchemas, redirect, registerFormat, registerFormats, serve, sse, stream, text, validateAllSchemas, validateFast, validateSchema, validateSchemaOrThrow, withContext };
package/dist/index.mjs CHANGED
@@ -20,11 +20,12 @@ import "./types/index.mjs";
20
20
  import "./request-COqaDa-c.mjs";
21
21
  import { n as serve } from "./serve-CozN9Tlz.mjs";
22
22
  import "./serve.mjs";
23
- import { FormatRegistry, Type } from "@sinclair/typebox";
23
+ import { FormatRegistry, Kind, Type } from "@sinclair/typebox";
24
+ import { Value } from "@sinclair/typebox/value";
24
25
 
25
26
  //#region src/index.ts
26
27
  registerFormats();
27
28
 
28
29
  //#endregion
29
- export { BaseServer, ComponentServer, DependencyManager, FormatRegistry, HtmlRenderer, Patterns, RouteRegistry, Server, ServerFactory, Type, VAFAST_ERROR_SYMBOL, VALIDATION_FAILED_SYMBOL, VafastError, ValidationFailedError, base64urlDecode, base64urlEncode, composeMiddleware, createErrorDetail, createRouteRegistry, createValidator, defineMiddleware, defineRoute, defineRoutes, empty, err, errorHandler, filterRoutes, generateAITools, getAllRoutes, getApiSpec, getCookie, getHeader, getRoute, getRouteRegistry, getRoutesByMethod, getValidatorCacheStats, goAwait, hasFormat, html, isVafastError, isValidationFailedError, json, normalizePath, parseBody, parseCookies, parseCookiesFast, parseHeaders, parseQuery, parseQueryFast, pathToField, precompileSchemas, redirect, registerFormat, registerFormats, serve, sse, stream, text, validateAllSchemas, validateFast, validateSchema, validateSchemaOrThrow, withContext };
30
+ export { BaseServer, ComponentServer, DependencyManager, FormatRegistry, HtmlRenderer, Kind, Patterns, RouteRegistry, Server, ServerFactory, Type, VAFAST_ERROR_SYMBOL, VALIDATION_FAILED_SYMBOL, VafastError, ValidationFailedError, Value, base64urlDecode, base64urlEncode, composeMiddleware, createErrorDetail, createRouteRegistry, createValidator, defineMiddleware, defineRoute, defineRoutes, empty, err, errorHandler, filterRoutes, generateAITools, getAllRoutes, getApiSpec, getCookie, getHeader, getRoute, getRouteRegistry, getRoutesByMethod, getValidatorCacheStats, goAwait, hasFormat, html, isVafastError, isValidationFailedError, json, normalizePath, parseBody, parseCookies, parseCookiesFast, parseHeaders, parseQuery, parseQueryFast, pathToField, precompileSchemas, redirect, registerFormat, registerFormats, serve, sse, stream, text, validateAllSchemas, validateFast, validateSchema, validateSchemaOrThrow, withContext };
30
31
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./server\";\nexport * from \"./middleware\";\nexport * from \"./utils\";\nexport * from \"./router\";\nexport * from \"./defineRoute\";\nexport * from \"./types\";\n\n// 统一的 serve 函数\nexport { serve } from \"./serve\";\nexport type {\n ServeOptions,\n ServeResult,\n FetchHandler,\n GracefulShutdownOptions,\n RequestTimeoutOptions,\n TrustProxyOption,\n} from \"./serve\";\n\n// 重新导出 TypeBox 类型\nexport { Type, FormatRegistry } from \"@sinclair/typebox\";\n\n// 自动注册内置 format 验证器\nimport { registerFormats } from \"./utils/formats\";\nregisterFormats();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,iBAAiB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./server\";\nexport * from \"./middleware\";\nexport * from \"./utils\";\nexport * from \"./router\";\nexport * from \"./defineRoute\";\nexport * from \"./types\";\n\n// 统一的 serve 函数\nexport { serve } from \"./serve\";\nexport type {\n ServeOptions,\n ServeResult,\n FetchHandler,\n GracefulShutdownOptions,\n RequestTimeoutOptions,\n TrustProxyOption,\n} from \"./serve\";\n\n// 重新导出 TypeBox(与脚手架一致:用户/插件从 vafast 取,勿另装冲突版本)\nexport {\n\tType,\n\tFormatRegistry,\n\tKind,\n\ttype Static,\n\ttype TSchema,\n} from \"@sinclair/typebox\";\nexport { Value } from \"@sinclair/typebox/value\";\n\n// 自动注册内置 format 验证器\nimport { registerFormats } from \"./utils/formats\";\nregisterFormats();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vafast",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "极简结构化Web框架,支持 Bun 和 Node.js。Go风格,函数优先。",
5
5
  "type": "module",
6
6
  "repository": {