-
Notifications
You must be signed in to change notification settings - Fork 21
feat(generators): generate algoliasearch
JS client
#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
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
c7eff09
to
ff45ef0
Compare
e54129e
to
89645f8
Compare
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.
this is really nice ! Maybe some templates files could be removed from the generated if they are static
@@ -225,10 +225,6 @@ jobs: | |||
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language != 'php' }} | |||
run: yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toBuild }} | |||
|
|||
- name: Build JavaScript 'algoliasearch' client |
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.
this is beautiful
} | ||
export const GENERATORS = Object.entries( | ||
openapiConfig['generator-cli'].generators | ||
).reduce((current, [key, { output, ...gen }]) => { |
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.
I think fromEntries
would be more readable, up to you
// We want to also delete the nested `lite` client or folders that only exists in JS | ||
if (clientName === 'algoliasearch') { | ||
await run( | ||
`rm -rf ${toAbsolutePath(path.resolve('..', output, 'lite'))}`, |
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 should bump the characters per line to 140 ahah this is ridiculous
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.
maybe 120 would do it, I'll try at the very end of this PR just to see
@@ -0,0 +1,3 @@ | |||
## Usage |
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.
those files could stay in their final form, why generated them ?
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.
Mostly for portability, and also because they are (almost) identical, except for the requester/timeouts part. I thought it made more sense for later, once the code has been removed from here
generators/src/main/java/com/algolia/codegen/AlgoliaJavaScriptGenerator.java
Outdated
Show resolved
Hide resolved
I think there is an issue with the run cts command,the prompt should expect or ask for a client as we can only run all of them |
0de3389
to
f179252
Compare
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.
Looks good !
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-555
Changes included:
We encountered conflicts after removing the JavaScript from the monorepo, the main one being during the release process, as
algoliasearch
is a standalone client.The goal of this PR is to generate
algoliasearch
as we do with the others, with its nestedlite
client.I've tired to move the templates files in their dedicated folder, to avoid confusion in them between a regular client, and
algoliasearch
.There should not be any client code changes, except some naming maybe.
🧪 Test
CI :D