callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.75k stars 2.08k forks source link

Types are not loaded when using npm package from git #4082

Closed tux2nicolae closed 1 year ago

tux2nicolae commented 1 year ago

We have a fork of this repository here https://github.com/crisposoft/react-native-paper/tree/checkbox-custom-icon

After upgrading the library (rebasing our changes to latest changes from this repository) we noticed that the types are not working anymore.

We investigated a little bit and noticed that in this PR https://github.com/callstack/react-native-paper/pull/3964 the prepare script was changed to prepack, which does not run when installing this package from git repository thus not generating the lib folder.

lukewalczak commented 1 year ago

Hey @tux2nicolae, the script change coming from react-native-builder-bob update and it's related to optimization. The prepack runs before pack script, which creates tarball to publish to npm, where prepare runs both on install and publish.

I've noticed that you've already changed it internally in your fork, so your problem should be solved, however in general, the recommendation is rather to use the library from the npm because the version installed directly from github includes additional code, which I guess you don't need e.g. the example app.