-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature Request: Add a command to check that the generated types are in sync #6575
Comments
This sounds like it would be caught by just running We did talk about a
|
Regenerating the wrangler types before doing typechecking in CI could work to ensure that tsc uses the right type declarations in CI, but this would still create confusion for other devs in the team which would see typescript errors locally. I already have a CI job running Note that my request for |
great news. This would indeed solve my need. |
Describe the solution
In my CI job, I'd like to have a check that the
worker-configuration.d.ts
file is actually in sync with the worker configuration (i.e. that devs changing the configuration don't forget to runnpm run cf-typegen
) so that typescript type checking can be relied on.I attempted to create a GHA job running
npm run cf-typegen
to regenerate the file and then using https://github.com/marketplace/actions/verify-changed-files to make the job fail if the file is modified. However, this fails because the output ofwrangler types
is not reproducible. The output contains a comment with the timestamp of the generation run so the file would be modified all the time in my CI job.I see 2 ways to solve that:
wrangler types
(for instancewrangler types --check
) which would compare the existing file content with the generated content with special logic to ignore changes in the timestamp, and report differences by a failure exit codewrangler types
output reproducible (either always or with a dedicated flag) by removing the timestamp, which would allow to use existing tooling checking for modified files after running it again.The text was updated successfully, but these errors were encountered: