vercel-labs / vercel-labs/konsistent
Honor `from` for constant export predicates
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 176
- Forks
- 6
- Avg merge
- 20h 26m
- Merged PRs (30d)
- 11
Description
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.tspackages/konsistent/src/typescript/predicates/export-constants.test.tspackages/konsistent/src/typescript/parser.tspackages/konsistent/konsistent.schema.jsondocs/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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/konsistent/src/typescript/predicates/export-constants.ts and compare its handling with export and exportTypes, then inspect parser.ts for module-source information. Extend export-constants.test.ts to cover correct, incorrect, and missing sources, including re-exports. Done means the existing schema and docs remain aligned and structural checks apply only when a local declaration is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100