Skip to content

feat(core): check field order instead of adding data:format - #49

Merged
hazeliscoding merged 2 commits into
mainfrom
feat/data-format
Oct 21, 2026
Merged

hazeliscoding merged 2 commits into
mainfrom
feat/data-format

Conversation

@hazeliscoding

Copy link
Copy Markdown
Owner

Prettier already formats data/ and CI fails on its layout, and every record already lists its fields in schema order, so a pnpm data:format command would have had almost nothing to rewrite.

Instead, loading a record warns when its fields stray from schema order, naming the order to use:

warning editions/lone-star-anime-fest-2026: evidence.0 fields are out of order; list them as source, facts, checked_at, excerpt

It shows up in pnpm data:validate and pnpm data:diff, so a draft is caught before it's published. The record still loads; it's a warning, not an error.

  • packages/core/src/load.ts: the check, comparing each raw record with its parsed form (which lists fields in schema order), nested objects included
  • data/README.md: write fields in the order the tables list them
  • ROADMAP.md: the decision, dated 2026-10-20

pnpm data:validate on the current data: 0 errors, 0 warnings.

Closes #11

@hazeliscoding
hazeliscoding merged commit a2e52c7 into main Oct 21, 2026
2 checks passed
@hazeliscoding
hazeliscoding deleted the feat/data-format branch October 21, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm data:format

1 participant