Skip to content
Flare 0.1.x is pre-release. Expect breaking changes before 1.0 — see the changelog.

Core

@flare-ts/core is Flare’s framework package: the composition root (FlareHost), HTTP arc, dependency injection, config tokens, logger, and runtime adapters. For how these pieces fit together, see Concepts. For schema primitives used in contracts and config, see Lib.

  • Host: FlareHost, runtime adapters, build(), and the app lifecycle (.run(), .export(), .test()).
  • HTTP: routing, controllers, middleware, request state, and contracts.
  • Logger: transports, log levels, and log config.
  • Config: flareConfig() tokens, flare.json, and FLARE__* environment overrides.
  • Testing: FLARE_MODE=test, app.test(), and the test harness API.
  • Errors: FlareError, flareErrorCodes, categories, and error-schema typing.
  • Failure modes: when errors surface during composition, build, startup, and request handling.
SubpathUse for
. (default)FlareHost; DI (FlareService, FlareBase, ServiceToken); config (flareConfig, HOST_CONFIG, LOG_CONFIG, ConfigToken, FlareHostConfig, FlareLogConfig); Logger, LoggerTransport, CFWLoggerTransport, LogLevel, LogRecord, HttpErrorContext; HTTP bases (ControllerBase, MiddlewareBase, ErrorHandlerBase), flareContract, flareState (with StateToken, StateGetter, TypedStateToken, FlareReadonly), request/response (FlareRequest, FlareResponse, FlareHttpContext, CookieOptions), CorsConfig, route/handler types (RouteHandler, RouteOptions, MiddlewareOptions, FlareHandlerScope, ControllerFn, RedirectOptions, MiddlewareBeforeFn, MiddlewareAfterFn, MiddlewareFinallyFn, BeforeMiddlewareHandler, AfterMiddlewareHandler, FinallyMiddlewareHandler, FlareErrorHandler, ErrorHandlerOptions, HandlerResult, MiddlewareOverride, ResponseHeaders, ResponseLike); FlareError, FlareValidationError. Schema and model symbols (str, int, bool, array, date, float, uuid, enums, optional, defaultTo, model, ModelTokenBuilder, schema, text, compileSerializer, toJsonSchema, and related types) are owned by @flare-ts/lib/schema — see Lib.
./decoratorsRoute decorators (@Get, @Post, @Put, @Patch, @Delete, @Head, @Options, @Method) for controller classes
./errorsflareErrorCodes, errorSchema, FlareError, FlareValidationError, FlareErrorCategories, and error types (FlareErrorCategory, ErrorCodesToken, CodeDescriptor, ErrorSchema, ValidationError, ValidationSeverity)
./nodenode adapter; types NodeRunHandle, NodeRunOptions
./cloudflarecf adapter (empty bundled config; FLARE__* overrides from adapter.env, e.g. wrangler.toml [vars]), buildCf (pre-loaded flare.json), and type CFWExportedHandle. See Host for adapter setup.
./bunbun adapter stub; host.build() throws when the adapter creates the app. Use node or cf until Bun support lands.
./denodeno adapter stub; host.build() throws when the adapter creates the app. Use node or cf until Deno support lands.
./testingTestAppHandle, mockContainer, mockContext, inspectBuild, FlareTestError, and types (AppTestOptions, FlareBuildSnapshot, FlareTestReq, FlareTestRequestInput, MockContextOpts)
./flare.schema.jsonJSON Schema for $schema in flare.json (reference in JSON, not a TypeScript import)