software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.52k stars 1.14k forks source link

[15.7.0] missing types #2453

Closed efstathiosntonas closed 2 months ago

efstathiosntonas commented 2 months ago

Description

After upgrading to 15.7.0 the types are missing because this line:

https://github.com/software-mansion/react-native-svg/blob/1ca8edd6d2ada9f1c1f92de77db2090c3d6317c7/package.json#L13

should be(?): "types": "lib/typescript/src/index.d.ts",

Screenshot 2024-09-17 at 12 50 25

Steps to reproduce

  1. upgrade to 15.7.0
  2. boom, no types

Snack or a link to a repository

none

SVG version

15.7.0

React Native version

0.75.3

Platforms

Android, iOS, macOS, Web

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

None

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 2 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

vovkasm commented 2 months ago

Actually issue does contain enough info. It's enough to compare value of "types" field in package.json and actual file locations in node_modules after installing.

vovkasm commented 2 months ago

This issue most probably related to https://github.com/software-mansion/react-native-svg/commit/a089cc2efcbea01de1a2b87c852b09d525a105ae#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0R24 which include additional folders to tsconfig.json, now bob (and typescript) builds not only src content, but also e2e and do not do folder aggregation ;-) May be solution is distinct tsconfig.build.json used only for build without e2e folder.

efstathiosntonas commented 2 months ago

Thanks @jakex7 for the quick fix!

jakex7 commented 2 months ago

Hello,
thank you for reporting this issue so quickly. I was able to resolve it in #2454, and the fix has been included in the v15.7.1 release.