Skip to content

counterfact@3.1.0

Choose a tag to compare

@pmcelhaney pmcelhaney released this 31 Oct 01:46
· 151 commits to main since this release
623075b

Minor Changes

  • a724401: Generate a central types/index.ts exporting Routes, Components, and Schemas (an alias of Components["schemas"]). Include unused components, preserve lowercase OpenAPI categories, and use indexed Routes contracts 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-indexed Middleware through 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 Routes as a tree of slash-prefixed path segments. Select /hello/world with Routes["/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 Route alias once per generated route file and annotate handlers with Route["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/repl in counterfact to 0.1.7.
    Updated dependency @counterfact/runtime in counterfact to 0.3.0.
    Updated dependency @counterfact/tutorials in counterfact to 0.2.0.
    Updated dependency posthog-node in counterfact to 5.57.1.
  • e12dd71: Updated dependency posthog-node in counterfact to 5.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