patmood / pocketbase-typegen

Typescript generation for pocketbase records
https://www.npmjs.com/package/pocketbase-typegen
541 stars 20 forks source link

Add `--watch` option #88

Closed babakfp closed 1 year ago

babakfp commented 1 year ago

Hi

I think it could be useful if we had a feature to watch for the changes and regenerate the types.

patmood commented 1 year ago

This was discussed in https://github.com/patmood/pocketbase-typegen/pull/76

I think it's better to do outside of the library, for example you could use a script in your package.json like this to poll your schema:

  "scripts": {
    "typegen:watch": "while true; do pocketbase-typegen --url https://myproject.pockethost.io --env; sleep 15; done"
  }