zenstackhq / zenstack

Fullstack TypeScript toolkit enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
1.83k stars 78 forks source link

CLI errs when running generate without network connection #1529

Open ymc9 opened 1 week ago

aloisklink commented 5 days ago

Potentially related to https://github.com/zenstackhq/zenstack/issues/1464

Ideally, there should also be some sort of timeout (e.g. 1 second), so that if you're on a slow network connection, running generate doesn't take a long time (I've encountered this issue before when running zenstack generate while on a train with a spotty internet connection).

I wonder if it's worth just creating a custom version checker function, e.g. something like: https://github.com/promptfoo/promptfoo/blob/fb6cbce74b0d627c7a6811923cb4f4d983e5ff73/src/updates.ts

Both get-latest-version ~and latest-version~ don't have timeouts. Edit: latest-version seems to have a 10s timeout by default, but it's not possible to change.