jwplayer / jwplayer-react-native

MIT License
10 stars 2 forks source link

[BUG] index.d.ts declares module name without "@jwplayer" #6

Closed chriszs closed 1 week ago

chriszs commented 2 weeks ago

Describe the bug TypeScript is complaining that the library's index.d.ts is not a module when I import @jwplayer/jwplayer-react-native. index.d.ts obviously declares a module, but I think the issue is that the module name doesn't match. Namely, it starts declare module "jwplayer-react-native" {. That error seems to go away when I modify it to declare module "@jwplayer/jwplayer-react-native" { to match the import.

Steps to reproduce Install into a TypeScript app, try to import it in a file and then run tsc.

Expected behavior The library declares a TypeScript module that matches the package name.

Screenshots / Visual evidence

Screenshot 2024-05-04 at 12 00 29 AM Screenshot 2024-05-04 at 12 02 52 AM

Desktop (please complete the following information):

System:
  OS: macOS 14.4.1
  CPU: (8) arm64 Apple M2
  Memory: 132.77 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: ~/.asdf/installs/nodejs/18.17.1/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.asdf/installs/nodejs/18.17.1/bin/yarn
  npm:
    version: 10.5.2
    path: ~/.asdf/plugins/nodejs/shims/npm
  Watchman:
    version: 2024.03.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/admin/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11330709
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /Users/admin/.asdf/shims/javac
  Ruby:
    version: 2.6.10
    path: /Users/admin/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
Jmilham21 commented 2 weeks ago

Good catch, and thank you for the PR. It's approved and waiting for another teammate's quick review. We will push a patch version to NPM as soon as possible.