Adding a types folder to inform decisions about generated/incoming data #747
Labels
Status: Needs Triage
This issue hasn't been reviewed by maintainers yet.
Tech: Typescript
Type: enhancement
New feature or request
Is there an existing issue for this?
Issue Context
While working on issue #693 and putting up the subsequent #720 I noticed that we ended up in a particular pattern:
_generatedData/
folder where we put.json
files with necessary runtime data for the application.For example, in the case of
buildUrls.json
, the data frequently has the shapeTypescript will determine that the type of
buildUrls
to beBut we know in the actual usage it's shape should be more like
Proposed solution
typings.ts
ortypings.d.ts
file in thesrc/
folder containing the necessary type info.As long as that file in included in our
.tsconfig
folder, we would get the correct info whenever someone doesAlternatives Considered
We could also just not do this; a downside is type information consequently leaves the space where it's used. Arguably, this has less benefit if a piece of data is only used in one place, and most of ours still is, currently. It may be me wanting to do a neat thing, but not a needed thing.
Additional Resources
Stackoverflow that describes the idea/solution a bit more
Code of Conduct
The text was updated successfully, but these errors were encountered: