in-app-payments-react-native-plugin icon indicating copy to clipboard operation
in-app-payments-react-native-plugin copied to clipboard

fix: add prepack script to generate lib/ before publishing

Open gin0606 opened this issue 11 months ago • 1 comments

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 adding prepack script

Test Plan

  1. Run yarn pack and verify that lib/ directory is included in the generated tarball
  2. Verify the tarball contains lib/module/index.js and lib/typescript/src/index.d.ts

gin0606 avatar Dec 20 '25 08:12 gin0606

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 20 '25 08:12 CLAassistant

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!

gin0606 avatar Jan 20 '26 08:01 gin0606

@mansi-square @plinio-square @Charmis-Square can we please get attention here?

mat4n avatar Feb 04 '26 16:02 mat4n

any suggested fix in the meantime?

janroures avatar Mar 03 '26 15:03 janroures

@cesar-sosa-hol this PR is merged but not released. So we still get error. Please release ver 2.0.1

Soft-Gurus avatar May 15 '26 12:05 Soft-Gurus