SolomonDefi / solomon-monorepo

Monorepo containing core Solomon apps, services, libraries, and deploy config.
6 stars 3 forks source link

Strategy for handling generated files #159

Closed solomondefi-dev closed 3 years ago

solomondefi-dev commented 3 years ago

Per @apolkingg8 - Adding generated files to git may cause sync issues if developers forget to regenerate from the source. A better way is to add a git pre-commit hook and do the following steps:

  1. Check target files exist
  2. Check source files status
  3. If target file does not exist or source files status is modified, run generate script

Currently, we have the following targets:

@apolkingg8 I will icebox this since it's not critical, but it will be nice to have if more developers are added.

kelvin-wong commented 3 years ago

There are a few thoughts on this issue. Using a git hook is a good idea.

1. Check target files exist

It should be not necessary after the initial generation and committed files.

2. Check source files status

Nx is quite good at doing this kind of task. We could define a command for the dispute app to generate the schemas and Nx monitor the change of the event types.

solomondefi-dev commented 3 years ago

We already generate the schema & types, now we just need to generate the Typechain types in the git hook.

This can be handled together with #168

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: