Nimblesite / Nimblesite/typeDiagram
Generated output: provenance header (source SHA + version) + built-in --check + deterministic ordering
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Generated output needs provenance metadata + a built-in staleness check
To trust generated code as a true build artifact (git-ignored, regenerated in CI/build instead of committed), consumers need to (a) detect drift and (b) prove an artifact was generated from a specific contract. typeDiagram gives us neither today, so we hand-rolled both in a wrapper script.
Asks
- Provenance header in every generated file (as a language-appropriate comment): source path, SHA-256 of the source
.td, typediagram version, and the--to/flags used. Lets CI assert "this artifact matches this contract" with agrep, and makes a stale checkout obvious. - First-class
--checkmode:typediagram --check --to LANG fileexits non-zero (with a diff) if regeneration would change the output. We currently reimplement this inscripts/gen_contracts.pybecause the CLI only writes-or-prints. - Deterministic, stable ordering of types/fields/
__all__across runs and versions, so (1) and (2) are reliable rather than churn-prone. - Optional:
--emit-hashto print just the content hash for cache keys / build fingerprinting.
Why
We want to delete generated DTOs from version control and regenerate them in the build — but only if the build can guarantee the regenerated artifact matches the committed contract. Provenance + --check + determinism are exactly the metadata that makes "generated code lives outside git" safe. Without it, a stale or mismatched artifact ships silently.
Contributor 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.
Research direction
Start with the typediagram CLI output path and scripts/gen_contracts.py, which currently reimplements the staleness check. Use the requested provenance metadata, built-in --check behavior, deterministic ordering, and optional hash output as acceptance criteria, verifying that drift produces a non-zero result and useful diff.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100