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: manually copy API files in build/api folder #22

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

D4ryl00
Copy link
Contributor

@D4ryl00 D4ryl00 commented Oct 23, 2024

Doing yarn or yarn install creates a build directory with compiled files, but omits to include src/api/rpcmanager.pb.d.ts, src/api/rpcmanager.pb.js, src/api/protocoltypes.pb.d.ts and src/api/protocoltypes.pb.js into build/api.
So when a third app installs weshnet-expo as a dependency, build/api/index.js can't find those files and returns an error.

This PR add a new package.json script to copy those files into the build/api folder`. This script is added in the Makefile and in the Github Action release workflow.

@D4ryl00 D4ryl00 self-assigned this Oct 23, 2024
package.json Outdated
@@ -7,6 +7,7 @@
"type": "module",
"scripts": {
"build": "expo-module build",
"postbuild": "sh postbuild.sh",
Copy link
Collaborator

@iuricmp iuricmp Oct 24, 2024

Choose a reason for hiding this comment

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

did you tried the postinstall (link)

If it works, you won't need to update Makefile and release.yml because it will run automatically after yarn or yarn install command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally putting the code in the prepare stage is better: https://docs.npmjs.com/cli/v10/using-npm/scripts#life-cycle-scripts

Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@D4ryl00
Copy link
Contributor Author

D4ryl00 commented Oct 24, 2024

Tested on Android and iOS, with new expo app (npx create-expo-app my-app --template expo-template-blank-typescript) and the example app (in the example folder).

@D4ryl00 D4ryl00 requested a review from iuricmp October 24, 2024 09:59
@D4ryl00 D4ryl00 merged commit 01865ac into berty:main Oct 24, 2024
1 check passed
@D4ryl00 D4ryl00 deleted the fix/api-file-missing branch October 24, 2024 15:04
Copy link

🎉 This PR is included in version 1.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants