Repository navigation
counterfact@3.1.0
Minor Changes
-
a724401: Generate a central
types/index.tsexportingRoutes,Components, andSchemas(an alias ofComponents["schemas"]). Include unused components, preserve lowercase OpenAPI categories, and use indexedRoutescontracts in new route handlers while preserving existing route edits and deep imports.Deprecate deep imports of generated operation and component types. Use the central exports throughout the manual, API reference, homepage, walkthrough, and agent guidance.
Expose
Context$,Scenario,Scenario$, and directory-indexedMiddlewarethrough the central entry point. New context and scenario starters use central imports; context watching refreshes the helper module and middleware directory map. Dedicated helper imports remain compatible but deprecated.Fix versioned handler narrowing after
minVersion()checks, including early returns, negated conditions, and explicit else branches. Literal checks narrow both request and response contracts; dynamic union thresholds use a boolean overload to avoid incorrectly excluding possible versions.Organize
Routesas a tree of slash-prefixed path segments. Select/hello/worldwithRoutes["/hello"]["/world"]; parent operations and child branches coexist, and generated handlers and documentation use the nested indexes.Write watched helper modules atomically and skip unchanged content so TypeScript readers do not observe empty modules during regeneration.
Declare a local
Routealias once per generated route file and annotate handlers withRoute["GET"],Route["POST"], and other method keys. Regeneration reuses matching aliases and avoids existing local names while preserving user code.
Patch Changes
- 40656be: Require Node 22.22 or later for Chokidar 6 compatibility.
- acec81d: Updated dependency
@counterfact/replincounterfactto0.1.7.
Updated dependency@counterfact/runtimeincounterfactto0.3.0.
Updated dependency@counterfact/tutorialsincounterfactto0.2.0.
Updated dependencyposthog-nodeincounterfactto5.57.1. - e12dd71: Updated dependency
posthog-nodeincounterfactto5.57.2. - Updated dependencies [a724401]
- Updated dependencies [40656be]
- Updated dependencies [1f340b6]
- Updated dependencies [93944c6]
- @counterfact/generator@1.1.0
- @counterfact/tutorials@0.2.2
- @counterfact/runtime@0.3.2
- @counterfact/openapi@0.1.7
- @counterfact/repl@0.1.9