Repository navigation
chore: use wrangler typegen instead of types package - #528
Conversation
There was a problem hiding this comment.
Should this file be on gitignore maybe? Since it is automatically generated? cc @flakey5
There was a problem hiding this comment.
Standard practice is to have it be checked in, we can have it ignored but means that we'd need to run the generate command on each ci run + contributors run it on a fresh clone
There was a problem hiding this comment.
But aren't these generated anyways automatically? It just doesn't make sense for us to host autogen code. It's like node_modules.
There was a problem hiding this comment.
But aren't these generated anyways automatically?
Not unless you're talking about the workers-types package that we're using already?
There was a problem hiding this comment.
Im under the assumption the types get generated once the build command or something like that runs?
There was a problem hiding this comment.
That's not the case, we're currently getting our types from the @cloudflare/workers-types package
release-cloudflare-worker/package.json
Line 17 in c568323
With this pr we'd be generating them similar to how we precompile the directory listing template where we have it checked in and update it only when it needs to be
There was a problem hiding this comment.
It's just that it is a massive type file and it clobs PR reviewing... How and when does this file get updated?
There was a problem hiding this comment.
I'm just a bit confused of what's the process of updating this file and how it gets updated.
There was a problem hiding this comment.
Updating the file is done manually via npm run build:wranger-types, this is only done when it needs to be (i.e. we change our compatability_date or a new api gets released that we wanna use). The npm command just runs wrangler types --include-env=false, which just makes wrangler write the latest workers types into the .d.ts file
Closes #394 Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
Closes #394