frontendmu / frontend.mu

A community around front-end development based in Mauritius Island. We also organise monthly meetups free for anyone interested to attend.
https://frontend.mu
BSD 3-Clause "New" or "Revised" License
27 stars 21 forks source link

JSON file typings #224

Closed n-d-r-d-g closed 2 months ago

n-d-r-d-g commented 2 months ago

Hi @MrSunshyne,

@k3ii assisted me in generating a .ts file for featured-issues.json so we can extract the literal types from it.

What do you think about converting all the other .json files in the same directory to .ts as well?

P.S. There are some .js files as well in the directory. I think we need to convert them to .json & .ts as well.

MrSunshyne commented 2 months ago

Yes, anything .js can be .json + .ts

would improve the DX a great deal!

you can test if this break anything by building the website using pnpm nuxt generate

n-d-r-d-g commented 2 months ago

@MrSunshyne alright, @k3ii thought of splitting .json & .ts files in separate directories and creating a script to convert .json to .ts.

@k3ii All .json files in the data directory contain arrays, except for photos-raw.json. This one needs to be converted slightly differently. We can look into this together.

k3ii commented 2 months ago

@MrSunshyne alright, @k3ii thought of splitting .json & .ts files in separate directories and creating a script to convert .json to .ts.

@k3ii All .json files in the data directory contain arrays, except for photos-raw.json. This one needs to be converted slightly differently. We can look into this together.

@n-d-r-d-g do we do the work in this PR or we get this one merge and work on another PR?

n-d-r-d-g commented 2 months ago

@MrSunshyne alright, @k3ii thought of splitting .json & .ts files in separate directories and creating a script to convert .json to .ts. @k3ii All .json files in the data directory contain arrays, except for photos-raw.json. This one needs to be converted slightly differently. We can look into this together.

@n-d-r-d-g do we do the work in this PR or we get this one merge and work on another PR?

@k3ii Yeah maybe it's a better idea to merge this one then. Let's work on another PR for the other changes.

@MrSunshyne could you please merge this one? We'll get rid of the unmaintainable code in the next PR.