cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
815 stars 150 forks source link

Use .npmignore instead of files field #154

Closed sonicdoe closed 4 years ago

sonicdoe commented 4 years ago

Fixes publication of extraneous files when using Yarn. See https://github.com/yarnpkg/yarn/issues/685#issuecomment-484304385.

You can compare npm’s and Yarn’s final packages by running npm pack and yarn pack. Don’t be surprised about some shallow differences as Yarn generates the package in a slightly different way.

Fixes #143.

cooperka commented 4 years ago

Love it, thanks! I may use this for other projects since it keeps things simple.

Comparison, for posterity:

# tree npm.tgz

package
├── LICENSE
├── README.md
├── RNSnackbar.podspec
├── android
│   ├── build.gradle
│   ├── gradle
│   │   └── wrapper
│   │       ├── gradle-wrapper.jar
│   │       └── gradle-wrapper.properties
│   ├── gradle.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── proguard-rules.pro
│   └── src
│       └── main
│           ├── AndroidManifest.xml
│           └── java
│               └── com
│                   └── azendoo
│                       └── reactnativesnackbar
│                           ├── SnackbarModule.java
│                           └── SnackbarPackage.java
├── ios
│   ├── RNSnackBarView.h
│   ├── RNSnackBarView.m
│   ├── RNSnackbar.h
│   ├── RNSnackbar.m
│   └── RNSnackbar.xcodeproj
│       ├── project.pbxproj
│       └── project.xcworkspace
│           ├── contents.xcworkspacedata
│           └── xcshareddata
│               └── IDEWorkspaceChecks.plist
├── lib
│   └── index.js
├── package.json
└── src
    ├── index.d.ts
    └── index.js

15 directories, 24 files
# tree yarn.tgz

├── LICENSE
├── README.md
├── RNSnackbar.podspec
├── android
│   ├── build.gradle
│   ├── gradle
│   │   └── wrapper
│   │       ├── gradle-wrapper.jar
│   │       └── gradle-wrapper.properties
│   ├── gradle.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── proguard-rules.pro
│   └── src
│       └── main
│           ├── AndroidManifest.xml
│           └── java
│               └── com
│                   └── azendoo
│                       └── reactnativesnackbar
│                           ├── SnackbarModule.java
│                           └── SnackbarPackage.java
├── ios
│   ├── RNSnackBarView.h
│   ├── RNSnackBarView.m
│   ├── RNSnackbar.h
│   ├── RNSnackbar.m
│   └── RNSnackbar.xcodeproj
│       ├── project.pbxproj
│       ├── project.xcworkspace
│       │   ├── contents.xcworkspacedata
│       │   ├── xcshareddata
│       │   │   └── IDEWorkspaceChecks.plist
│       │   └── xcuserdata
│       │       └── klap-hotel.xcuserdatad
│       │           └── UserInterfaceState.xcuserstate
│       └── xcuserdata
│           └── klap-hotel.xcuserdatad
│               ├── xcdebugger
│               │   └── Breakpoints_v2.xcbkptlist
│               └── xcschemes
│                   ├── RNSnackbar.xcscheme
│                   └── xcschememanagement.plist
├── lib
│   └── index.js
├── package.json
└── src
    ├── index.d.ts
    └── index.js

21 directories, 28 files
sonicdoe commented 4 years ago

Interesting, so Yarn still includes xcuserdata. Since most of the extraneous files are now gone, I’ll leave it be. Perhaps this will be improved in a future version of Yarn 🙂