fix: add prepack script to generate lib/ before publishing
Summary
Yarn Berry does not automatically run the prepare script during yarn pack. This causes the lib/ directory (generated by bob build) to be missing from the published npm package, resulting in the error:
The resolution for "react-native-square-in-app-payments" defined in "exports" is lib/module/index.js, however this file does not exist.
This PR adds a prepack script that explicitly runs bob build before the tarball is created, ensuring the lib/ directory is included in the published package.
Note: This PR is based on v2.0.0 tag and includes commit 3b19f0e ("update publish pipeline") which was not merged to master.
Related issues
Fix #259
Changelog
- Fixed missing
lib/directory in published npm package by addingprepackscript
Test Plan
- Run
yarn packand verify thatlib/directory is included in the generated tarball - Verify the tarball contains
lib/module/index.jsandlib/typescript/src/index.d.ts
Hi @mansi-square @plinio-square @Charmis-Square 👋
I'd like to kindly request a review of this PR. This fix addresses a critical issue where the published v2.0.0 package is missing the lib/ directory, making it unusable for consumers.
Since this is a small, low-risk change (adding a prepack script), it would be great to get this merged and a patch release published so users can actually use the latest version.
Please let me know if there's anything I can do to help move this forward. Thanks!
@mansi-square @plinio-square @Charmis-Square can we please get attention here?
any suggested fix in the meantime?
@cesar-sosa-hol this PR is merged but not released. So we still get error. Please release ver 2.0.1