@zonekit/schema
v0.2.0
Published
TypeScript types and JSON Schema definitions for Zonekit configuration
Maintainers
Readme
@zonekit/schema
TypeScript types and JSON Schema definitions for Zonekit configuration.
@zonekit/schema is the contract package for Zonekit. Use it when you want one shared source of truth for authored config, resolved config, runtime interfaces, publishing metadata, or JSON Schema validation in external tools.
This package has no runtime dependencies of its own. It is the right package to share between config repos, shells, remotes, validators, and code generation tools.
Installation
pnpm add @zonekit/schemaQuick start
import type { ZonekitConfig, ResolvedConfig, RouteConfig } from "@zonekit/schema";
import { parseRemoteSpec } from "@zonekit/schema";
const entry = parseRemoteSpec("app", "./App@http://localhost:3001/remoteEntry.js");
// { url: "http://localhost:3001/remoteEntry.js", module: "./App" }When to use this package
- share types between a shell, remotes, and an external config repo
- validate authored JSON or YAML with the shipped schemas
- build tools or CI checks that should not depend on the full runtime
- import interfaces like
ResolvedConfig,ManifestFetcher, orConfigResolver
What ships in this package
Core configuration
ZonekitConfig,ZoneConfig,RoutingConfig,Transition, andRouteConfigfor authored config.FederationConfig,FederationSharedConfig,NavigationItem, andNavigationBadgefor federation and nav modeling.
Resolution and runtime
ResolvedConfig,ManifestConfig,TenantContext, andResolutionDimensionfor config evaluation.ConfigResolver,ManifestFetcher, andFlagProviderfor resolution contracts.ShellContext<TAuth>,EventBus, andZonekitEventfor runtime integration points.
Flows and handoffs
FlowConfig,FlowStep, andGuardConditionfor config-driven workflow control.HandoffConfigand the individual cookie, token-redirect, session, and in-memory variants for zone handoff strategies.
Infrastructure
CircuitBreakerOptions,CircuitBreakerStatus,CircuitBreakerStore, andManifestCacheStorefor supporting infrastructure.ConfigContract,ConfigMeta,LockFile, andVersionFilefor publishing and promotion metadata.ValidationError,ValidationResult, andValidationConfigfor validation results and authored strictness.
Functions
parseRemoteSpec(key, spec)to convert a remote spec string into aRemoteEntry.
JSON Schemas
JSON Schema files ship in schemas/ and are importable via @zonekit/schema/schemas/*.json.
Stability notes
- Many core domain types are marked
@stablein the source and are the safest surface for external consumers. - Integration and extension-point types are marked
@unstableand may still move during pre-1.0 development.
License
MIT
Read more:
