Skip to content
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(javascript): expose models #252

Merged
merged 2 commits into from
Mar 15, 2022
Merged

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Mar 14, 2022

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-374

Changes included:

This PR updates the JavaScript template to use the models.ts file to expose generated models at the root of the package.

-import type { SearchResponse } from '@experimental-api-clients-automation/client-search/dist/model/searchResponse';
+import type { SearchResponse } from '@experimental-api-clients-automation/client-search';

🧪 Test

  • CI :D
  • Generated branch :D

@shortcuts shortcuts requested a review from a team March 14, 2022 17:10
@shortcuts shortcuts self-assigned this Mar 14, 2022
@shortcuts shortcuts requested review from eunjae-lee and millotp and removed request for a team March 14, 2022 17:10
@netlify
Copy link

netlify bot commented Mar 14, 2022

✔️ Deploy Preview for api-clients-automation canceled.

🔨 Explore the source changes: 966c8cb

🔍 Inspect the deploy log: https://app.netlify.com/sites/api-clients-automation/deploys/6230514bf9ce020008834f03

@shortcuts
Copy link
Member Author

shortcuts commented Mar 14, 2022

I forgot to fix the client_* matrix in #250, which makes the CI skip JS jobs 😮‍💨

@shortcuts
Copy link
Member Author

✔️ codegen triggered on commit 966c8cb6a07b1f0dff4d815622a5323bfe006161.

🔍 Browse the generated code on branch generated/feat/javascript-expose-models: eca3f9757822f460bef175c837775b3fea0321b6.

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement !

@@ -29,7 +31,7 @@ client.addUserAgent('algoliasearch node playground', '0.0.1');

async function testAlgoliasearch() {
try {
const res = await client.search({
const res: SearchResponse = await client.search({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to type here ? It can only return SearchResponse

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was mostly to test if it worked, and since we don't have a way to ensure it's still exposed, I've left it here

@@ -0,0 +1,5 @@
{{#models}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this works ahah

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, sometimes the generator have really easy features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants