-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(script): use typescript for all scripts APIC-334 #170
Conversation
include me as reviewer when ready for review. |
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.
First small review, will do an other batch soon
Good initiative :D I prefer that 100000000% GG
@@ -0,0 +1,19 @@ | |||
{ |
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.
We definitely need a config folder
Can we have another script name than
|
did you know i was going to comment that, or did you make that change in the speed of light? 😂 |
ahah @shortcuts already proposed something similar #170 (comment) |
ahah I missed it lol |
{ language, key, additionalProperties: { packageName } }: Generator, | ||
verbose: boolean | ||
): Promise<void> { | ||
const spinner = createSpinner(`building ${key}`, verbose).start(); |
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.
it seems we don't want to call this function for non-js languages. what if we add throw
just in case it's used wrongly in the future?
It's not exported, so it won't matter much. It's still easier to read if there's a short comment here and for buildAllClients
.
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.
that is stylé
(need a break from review, brb in a few mins D:)
// generate clients to release | ||
for (const lang of Object.keys(versionsToRelease)) { | ||
console.log(`Generating ${lang} client(s)...`); | ||
await run(`yarn cli generate ${lang}`); |
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.
you may want to give verbose: true
here too?
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.
verbose shows the output of openapi generator and formatter which is very verbose, it should only be used when debugging IMO
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.
Really nice :D Time to do some further testing!!
🧭 What and Why
🎟 JIRA Ticket: APIC-334
Replace bash file by a beautiful typescript cli
Everything is called from one command,
yarn api
, oryarn docker
to run it under docker (mandatory for local),with a helper and completion if you don't provide the arguments on local (maybe overkill). On CI it defaults to
all
.ts-node
is a bit too slow, it takes 9 seconds to launch, 6 with--transpile-only
and 12 withswc
(I think it's because of docker, it should be way faster). Maybe we could compile it and just standard js, but we don't want to build before each command, andts-node
gives us more visibility when failing, with error in ts source code.Improvements
🧪 Test
yarn docker
all commands