Drift
Drift is a tool for building a JSON representation of your router (schema) and detecting changes to it.
Generating a schema
To begin, run the following command:
trpc drifttrpc driftThis will output the JSON representation of your router in trpc/schema.json (see an example schema here). Commit this schema to Git.
Detecting changes
When you make changes to your router, run the command again:
trpc drifttrpc driftIf there are any changes, the command will exit with a non-zero exit code, and output a diff of the changes. You can use this to fail your CI pipeline if there are any changes to your router that you haven't explicitly approved.
When you make changes and want to update your schema file, run the command with the -u flag:
trpc drift -utrpc drift -u