#74

Honor `from` for constant export predicates

Openfelixarntzopened 3mo ago

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

0

No activity yet.