Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Feature Request] Export foreign key schema in Zod plugin

Open Beginner friendly
#2,296 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Open packages/schema/src/plugins/zod/generator.ts around line 477, where the generated const fkSchema = ... line is emitted, and change it to export const fkSchema = ...; look at how neighbouring schemas are emitted for the consistent naming. Then regenerate the Zod plugin output and update any snapshot or generator tests under packages/schema that assert on the emitted text. Done means the generated file exports fkSchema and the plugin test suite passes.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
When integrating ZenStack with TanStack DB, having access to the model + foreign keys is very helpful.

Describe the solution you'd like
Adding an export to this generated line of code, i.e., export const fkSchema = ...; instead of just const fkSchema = ...;

Describe alternatives you've considered
For now I'm using [ModelName]ScalarSchema.passthrough(), which isn't type-safe.

Dominant language
TypeScript
Stars
2.9k
Forks
157
Avg merge
11h 42m
Merged PRs (30d)
20

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zenstackhq/zenstack

All issues in zenstackhq/zenstack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.