Markdown and MDX routes have no typed content schema
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python, typescript
Research direction
The issue proposes a new src/content/schema.py that does not exist yet, so the first step is deciding how the frontmatter collection key is read and where validation runs at dev start, reload and build. Work through the design with maintainers before coding, since it touches the Vite pipeline and generated types under __nexy__/client/. Done means a missing field or wrong type fails nx build with the file and field named, and docs/rendering/README.md gets a typing page.
Written by the indexing model from the issue text.
Description
Problem
A .md or .mdx route can carry any frontmatter. A typo in a date or a missing field is only seen when the template reads it. Astro content collections validate the same data against a schema and give editors typed values.
This is feasible with the current compiler. Pydantic already lives in the project, and the Vite pipeline can publish generated TypeScript types.
Proposal
- Add
src/content/schema.py, with one Pydantic model per collection. - Let a page name its collection in frontmatter with
collection = "posts". - Validate every page at dev start, on reload and at build.
- Generate a TypeScript declaration file for each collection under
__nexy__/client/. - Print the file, the field and the expected type when validation fails.
Acceptance
- A missing required field fails
nx buildwith the file and field in the message. - A wrong type fails with the expected type.
- Generated declarations pass
npx tsc --noEmitin a new strict project. - Locales declared by a collection are checked against the files present.
docs/rendering/README.mdgains a page that answers how to type content.- Translations are regenerated, not edited by hand.
Out of scope
A CMS, remote content and editing content from the browser.
- Dominant language
- Python
- Stars
- 11
- Forks
- 6
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 265
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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.
More from NexyPy/nexy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:cli difficulty:intermediate enhancement
Difficulty 2/5 Half a day Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area:cli area:docs question
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
conan-io/conan-center-index#31597 ·
Maintainers usually reply within 1 day
-
bug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/PictoPy#1802 · 2 comments ·
Maintainers usually reply within 3 days
-
community-request
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Run#727 ·
Maintainers usually reply within 1 day