Skip to content

Honor from for constant export predicates #74

Description

@felixarntz

exportConstants accepts definition objects with a from field in the generated schema, but its evaluator ignores from and only recognizes exports parsed directly as local const declarations. Constant re-exports therefore cannot be constrained by module source as the schema suggests.

Relevant files:

  • packages/konsistent/src/typescript/predicates/export-constants.ts
  • packages/konsistent/src/typescript/predicates/export-constants.test.ts
  • packages/konsistent/src/typescript/parser.ts
  • packages/konsistent/konsistent.schema.json
  • docs/reference/predicates.md

Honor from using the same module-source matching semantics as export and exportTypes, including re-exports, and add coverage for correct, incorrect, and missing module sources. Apply structural schema checks only when a local constant declaration is available.

Backward compatibility: internal code and documentation can be refactored without compatibility shims. Keep the existing from config field; no schema rename is needed. If a replacement field is introduced, retain from and its prior behavior as deprecated and emit a non-failing CLI warning when it is used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions