Skip to content

Podspec not published to npm if the package name contains hyphens #39

@shirakaba

Description

@shirakaba

Bug

The files array generated by package.json removes any hyphens from the name of the generated podspec, and thus won't publish the podspec when publishing a package whose name includes hyphens to npm.

For a project named react-native-safe-popover, the package.json's files array comes out as:

  "files": [
    "src",
    "lib",
    "android",
    "ios",
    "reactnativesafepopover.podspec"
  ],

The podspec, meanwhile, is named react-native-safe-popover.podspec.

Environment info

react-native info output:

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 785.12 MB / 16.00 GB
    Shell: 4.4.23 - /usr/local/bin/bash
  Binaries:
    Node: 13.4.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.0
      System Images: android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: ~16.9.0 => 16.9.0 
    react-native: ~0.61.5 => 0.61.5

Library version: 0.10.0

Steps To Reproduce

npx @react-native-community/bob create react-native-safe-popover
cd react-native-safe-popover
yarn bootstrap

Describe what you expected to happen:

Either of these two:

  1. The podspec should be called react-native-safe-popover.podspec AND the files array in package.json should include react-native-safe-popover.podspec.
  2. The podspec should be called reactnativesafepopover.podspec AND the files array in package.json should include reactnativesafepopover.podspec.

Option 1 would be preferable, as it preserves the package name.

Reproducible sample code

See "Steps To Reproduce".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions