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

fix(javascript): build #867

Merged
merged 9 commits into from
Aug 9, 2022
Merged

fix(javascript): build #867

merged 9 commits into from
Aug 9, 2022

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Jul 25, 2022

🧭 What and Why

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

Problem

Changes included:

Leverage Lerna + Nx as our building tool for the JavaScript client, which allow us to:

  • Cache build processes (only works locally for now)
  • Let lerna handle dependencies and build order
  • Remove some custom logic
  • Fix the wrong built destination of the algoliasearch client, resulting in duplicate types and nested lite/lite folder

Cache does not seem to trigger on the CI but time seems to be more consistent.

Rollup config:

There is build-related changes in the rollup config other than the map logic to save previously built types (checkForTypes). The core logic that previously was in clients/algoliasearch-client-javascript/rollup.config.js have been merged with the base.rollup.config, and some logic have changed to handle the per-client build logic.

🧪 Test

  1. checkout to generated/fix/js-build
  2. cd clients/algoliasearch-client-javascript && yarn build:all
  3. (optional) test any of the other build commands

@netlify
Copy link

netlify bot commented Jul 25, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 5d17278
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/62f223d7cc423f00090b7945

@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 25, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@shortcuts shortcuts self-assigned this Aug 8, 2022
@shortcuts shortcuts marked this pull request as ready for review August 8, 2022 12:35
@shortcuts
Copy link
Member Author

cc @millotp if you want to check when you come back

Copy link
Contributor

@bodinsamuel bodinsamuel left a comment

Choose a reason for hiding this comment

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

Why not 👍🏻
I could not test

~ yarn build:all                                                                                                    0 [16:01:45]
lerna notice cli v5.3.0
lerna info versioning independent
lerna notice filter excluding "{@algolia/requester-*,@algolia/client-common}"
lerna info filter [ '!{@algolia/requester-*,@algolia/client-common}' ]
lerna success run No packages found with the lifecycle script 'build'

@shortcuts
Copy link
Member Author

I could not test

I've added in the PR body test to checkout the generated branch, so the build command appears in each packages

@bodinsamuel
Copy link
Contributor

I've added in the PR body test to checkout the generated branch, so the build command appears in each packages

Yep this is the one I tried and didn't work. It might require additional generation?

@shortcuts
Copy link
Member Author

shortcuts commented Aug 9, 2022

Yep this is the one I tried and didn't work. It might require additional generation?

Hm it shouldn't 🤔 that's the same that is used on the CI and for my tests. Maybe a yarn install but nothing more, I'll start from scratch and try myself to see if it correctly works

edit: seems to work correctly on my side

Copy link
Contributor

@bodinsamuel bodinsamuel left a comment

Choose a reason for hiding this comment

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

not sure what changed but works now 👍🏻

@shortcuts
Copy link
Member Author

not sure what changed but works now 👍🏻

nothing related to how the build works but glad to hear it :D

@shortcuts shortcuts merged commit 27b78d9 into main Aug 9, 2022
@shortcuts shortcuts deleted the fix/js-build branch August 9, 2022 12:41
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.

None yet

3 participants