echobind/bisonapp

Remove types from source control, add step to setup to generate them

cball opened this issue · 0 comments

cball commented

These have been causing merge problems on projects. To determine impact we looked at what needs to exist to properly run everything:

To summarize what I found with those generated files and running yarn dev: If nexus.d.ts and api.graphql are missing, the codgen that yarn dev runs will fail and it won't generate types.ts. Also, for some reason nexus.d.ts and api.graphql will not be generated either. If only types.ts is missing, yarn dev will regenerate it. So it looks like at least nexus.d.ts and api.graphql need to exist before running yarn dev

This means that when someone first sets up the project, a setup script needs to exist that runs at a minmum:

  • yarn db:migrate (creates db and generates prisma client)
  • yarn nexus:build (generates nexus.d.ts)
  • yarn codegen (generates types.ts and api.graphql)

Once those files exist, the user should be able to run yarn dev without issue.

Tasks:

  • remove those files from the template
  • add entries to .gitignore
  • add script to run setup commands