-
Notifications
You must be signed in to change notification settings - Fork 38
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
cleanups to "go generate" #166
Conversation
- don't check in the generated files; instead, add them to a local gitignore - use "npx tsc" rather than "tsc". This means people don't need tsc globally installed, plus it ensures we all use the same version. - only invoke tsc once, to save some time
/node_modules/ | ||
dispatcher_fargate.js.tmpl | ||
dispatcher_lambda.js.tmpl | ||
emitter.js.tmpl | ||
fs.js.tmpl | ||
keyvalue.js.tmpl | ||
orm.js.tmpl | ||
proxy_eks.js.tmpl | ||
proxy_fargate.js.tmpl | ||
redis_cluster.js.tmpl | ||
redis_node.js.tmpl | ||
secret.js.tmpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ignore checking these in? we dont have .js files for all of them so we need some of these checked in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which ones don't we have .ts
files for? I actually even create the changes to this file manually; they're all from the bash script's changes to add the generated files to this ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i guess this list doesnt include the ones which we dont have ts files for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, been waiting for this. Looks like we need to add the generate to the govulncheck action though
sort -u .gitignore > gitignore-tmp | ||
mv gitignore-tmp .gitignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever, I like this a lot.
|
I'm putting this out on spec; if people don't like it, I'm happy to withdraw it. My motivation is that I keep editing the wrong file and/or forgetting which I should edit, and I'm happier if my IDE reminds me which one is generated and which one is committed.
Changes in this PR:
npx tsc
rather thantsc
. This means people don't need tsc globally installed, plus it ensures we all use the same version.tsc
once, to save some time (on my machine, it broughtgo generate ./...
down from ~10 seconds to ~3).This does have one tradeoff, which is that you need to run
go generate ./...
at least once before you build. In particular, this means that I had to add that command to the integ test runner. That's arguably a bit less convenient and a bit more safe (in terms of not compiling old code that someone forgot to generate), so whether it's good or bad in net is up for interpretation.Standard checks
md5sum *
inklotho/pkg/lang/[python|javascript]/aws_runtime
(on main, vs on this branch aftergo generate
), and confirmed that they're the same other than the bash scriptsgo generate ./...
will fix it