Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relying only .npmignore for publishing files #346

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

jdivock-stripe
Copy link
Contributor

Summary

Removing the files:[] section from package.json in favor of relying solely on .npmignore as using both looks to have unpredictable behavior. Our last publish was ~7mb due to the android/build folder getting picked up despite being ignored.

Took a fair amount of motivation from https://github.com/wix/react-native-navigation/blob/master/.npmignore and filled in the rest of the gaps by poking at the output of npm pack

Motivation

Reduce lib size, remove footguns

Testing

Created a tarball with npm pack and pulled it into the example app

  • ✅ iOS build
  • ✅ android build

Output of most recent npm pack

stripe-terminal-react-native git/jdivock/npmignore-only
❯ npm pack
npm notice
npm notice 📦  @stripe/stripe-terminal-react-native@0.0.1-beta.4
npm notice === Tarball Contents ===
npm notice 178B   Gemfile
npm notice 6.2kB  Gemfile.lock
npm notice 1.1kB  LICENSE
npm notice 6.2kB  README.md
npm notice 4.8kB  android/build.gradle
npm notice 912B   android/gradle.properties
npm notice 59.2kB android/gradle/wrapper/gradle-wrapper.jar
npm notice 202B   android/gradle/wrapper/gradle-wrapper.properties
npm notice 8.1kB  android/gradlew
npm notice 2.8kB  android/gradlew.bat
npm notice 443B   android/src/main/AndroidManifest.xml
npm notice 570B   android/src/main/java/com/stripeterminalreactnative/callback/NoOpCallback.kt
npm notice 873B   android/src/main/java/com/stripeterminalreactnative/callback/RNLocationListCallback.kt
npm notice 948B   android/src/main/java/com/stripeterminalreactnative/callback/RNPaymentIntentCallback.kt
npm notice 829B   android/src/main/java/com/stripeterminalreactnative/callback/RNPaymentMethodCallback.kt
npm notice 759B   android/src/main/java/com/stripeterminalreactnative/callback/RNRefundCallback.kt
npm notice 920B   android/src/main/java/com/stripeterminalreactnative/callback/RNSetupIntentCallback.kt
npm notice 2.1kB  android/src/main/java/com/stripeterminalreactnative/Errors.kt
npm notice 5.5kB  android/src/main/java/com/stripeterminalreactnative/ktx/TerminalExtensions.kt
npm notice 3.2kB  android/src/main/java/com/stripeterminalreactnative/listener/RNBluetoothReaderListener.kt
npm notice 1.5kB  android/src/main/java/com/stripeterminalreactnative/listener/RNDiscoveryListener.kt
npm notice 742B   android/src/main/java/com/stripeterminalreactnative/listener/RNHandoffReaderListener.kt
npm notice 1.8kB  android/src/main/java/com/stripeterminalreactnative/listener/RNTerminalListener.kt
npm notice 3.3kB  android/src/main/java/com/stripeterminalreactnative/listener/RNUsbReaderListener.kt
npm notice 18.1kB android/src/main/java/com/stripeterminalreactnative/Mappers.kt
npm notice 602B   android/src/main/java/com/stripeterminalreactnative/ReactExtensions.kt
npm notice 838B   android/src/main/java/com/stripeterminalreactnative/ReactNativeConstants.kt
npm notice 20.9kB android/src/main/java/com/stripeterminalreactnative/StripeTerminalReactNativeModule.kt
npm notice 598B   android/src/main/java/com/stripeterminalreactnative/StripeTerminalReactNativePackage.kt
npm notice 1.4kB  android/src/main/java/com/stripeterminalreactnative/TokenProvider.kt
npm notice 70B    app.plugin.js
npm notice 6.9kB  ios/Errors.swift
npm notice 19.1kB ios/Mappers.swift
npm notice 101B   ios/StripeTerminalReactNative-Bridging-Header.h
npm notice 6.8kB  ios/StripeTerminalReactNative.m
npm notice 34.5kB ios/StripeTerminalReactNative.swift
npm notice 11.1kB ios/StripeTerminalReactNative.xcodeproj/project.pbxproj
npm notice 2.5kB  ios/StripeTerminalReactNative.xcodeproj/xcshareddata/xcschemes/StripeTerminalReactNative.xcscheme
npm notice 846B   ios/TokenProvider.swift
npm notice 581B   lib/commonjs/components/StripeTerminalContext.js
npm notice 1.6kB  lib/commonjs/components/StripeTerminalContext.js.map
npm notice 9.7kB  lib/commonjs/components/StripeTerminalProvider.js
npm notice 14.7kB lib/commonjs/components/StripeTerminalProvider.js.map
npm notice 1.1kB  lib/commonjs/components/withStripeTerminal.js
npm notice 1.6kB  lib/commonjs/components/withStripeTerminal.js.map
npm notice 43B    lib/commonjs/declarations.d.js
npm notice 918B   lib/commonjs/declarations.d.js.map
npm notice 40.4kB lib/commonjs/functions.js
npm notice 30.8kB lib/commonjs/functions.js.map
npm notice 484B   lib/commonjs/hooks/useListener.js
npm notice 1.0kB  lib/commonjs/hooks/useListener.js.map
npm notice 32.2kB lib/commonjs/hooks/useStripeTerminal.js
npm notice 42.8kB lib/commonjs/hooks/useStripeTerminal.js.map
npm notice 4.1kB  lib/commonjs/index.js
npm notice 955B   lib/commonjs/index.js.map
npm notice 752B   lib/commonjs/index.test.js.map
npm notice 6.2kB  lib/commonjs/logger.js
npm notice 12.8kB lib/commonjs/logger.js.map
npm notice 3.9kB  lib/commonjs/plugin/withStripeTerminal.js
npm notice 8.4kB  lib/commonjs/plugin/withStripeTerminal.js.map
npm notice 314B   lib/commonjs/StripeTerminalSdk.js
npm notice 5.1kB  lib/commonjs/StripeTerminalSdk.js.map
npm notice 2.2kB  lib/commonjs/types/index.js
npm notice 7.5kB  lib/commonjs/types/index.js.map
npm notice 268B   lib/commonjs/types/PaymentIntent.js
npm notice 545B   lib/commonjs/types/PaymentIntent.js.map
npm notice 367B   lib/commonjs/types/Reader.js
npm notice 2.8kB  lib/commonjs/types/Reader.js.map
npm notice 367B   lib/commonjs/types/Refund.js
npm notice 1.1kB  lib/commonjs/types/Refund.js.map
npm notice 432B   lib/commonjs/types/SetupIntent.js
npm notice 1.9kB  lib/commonjs/types/SetupIntent.js.map
npm notice 2.9kB  lib/commonjs/utils/androidPermissionsUtils.js
npm notice 3.7kB  lib/commonjs/utils/androidPermissionsUtils.js.map
npm notice 655B   lib/commonjs/utils/b64EncodeDecode.js
npm notice 1.6kB  lib/commonjs/utils/b64EncodeDecode.js.map
npm notice 581B   lib/module/components/StripeTerminalContext.js
npm notice 1.6kB  lib/module/components/StripeTerminalContext.js.map
npm notice 9.7kB  lib/module/components/StripeTerminalProvider.js
npm notice 14.7kB lib/module/components/StripeTerminalProvider.js.map
npm notice 1.1kB  lib/module/components/withStripeTerminal.js
npm notice 1.6kB  lib/module/components/withStripeTerminal.js.map
npm notice 43B    lib/module/declarations.d.js
npm notice 918B   lib/module/declarations.d.js.map
npm notice 40.4kB lib/module/functions.js
npm notice 30.8kB lib/module/functions.js.map
npm notice 484B   lib/module/hooks/useListener.js
npm notice 1.0kB  lib/module/hooks/useListener.js.map
npm notice 32.2kB lib/module/hooks/useStripeTerminal.js
npm notice 42.8kB lib/module/hooks/useStripeTerminal.js.map
npm notice 4.1kB  lib/module/index.js
npm notice 955B   lib/module/index.js.map
npm notice 752B   lib/module/index.test.js.map
npm notice 6.2kB  lib/module/logger.js
npm notice 12.8kB lib/module/logger.js.map
npm notice 3.9kB  lib/module/plugin/withStripeTerminal.js
npm notice 8.4kB  lib/module/plugin/withStripeTerminal.js.map
npm notice 314B   lib/module/StripeTerminalSdk.js
npm notice 5.1kB  lib/module/StripeTerminalSdk.js.map
npm notice 2.2kB  lib/module/types/index.js
npm notice 7.5kB  lib/module/types/index.js.map
npm notice 268B   lib/module/types/PaymentIntent.js
npm notice 545B   lib/module/types/PaymentIntent.js.map
npm notice 367B   lib/module/types/Reader.js
npm notice 2.8kB  lib/module/types/Reader.js.map
npm notice 367B   lib/module/types/Refund.js
npm notice 1.1kB  lib/module/types/Refund.js.map
npm notice 432B   lib/module/types/SetupIntent.js
npm notice 1.9kB  lib/module/types/SetupIntent.js.map
npm notice 2.9kB  lib/module/utils/androidPermissionsUtils.js
npm notice 3.7kB  lib/module/utils/androidPermissionsUtils.js.map
npm notice 655B   lib/module/utils/b64EncodeDecode.js
npm notice 1.6kB  lib/module/utils/b64EncodeDecode.js.map
npm notice 714B   lib/typescript/src/components/StripeTerminalContext.d.ts
npm notice 640B   lib/typescript/src/components/StripeTerminalProvider.d.ts
npm notice 630B   lib/typescript/src/components/withStripeTerminal.d.ts
npm notice 4.4kB  lib/typescript/src/functions.d.ts
npm notice 92B    lib/typescript/src/hooks/useListener.d.ts
npm notice 5.9kB  lib/typescript/src/hooks/useStripeTerminal.d.ts
npm notice 735B   lib/typescript/src/index.d.ts
npm notice 2.0kB  lib/typescript/src/logger.d.ts
npm notice 1.1kB  lib/typescript/src/plugin/withStripeTerminal.d.ts
npm notice 4.0kB  lib/typescript/src/StripeTerminalSdk.d.ts
npm notice 7.4kB  lib/typescript/src/types/index.d.ts
npm notice 392B   lib/typescript/src/types/PaymentIntent.d.ts
npm notice 2.4kB  lib/typescript/src/types/Reader.d.ts
npm notice 875B   lib/typescript/src/types/Refund.d.ts
npm notice 1.6kB  lib/typescript/src/types/SetupIntent.d.ts
npm notice 359B   lib/typescript/src/utils/androidPermissionsUtils.d.ts
npm notice 161B   lib/typescript/src/utils/b64EncodeDecode.d.ts
npm notice 5.1kB  package.json
npm notice 769B   scripts/bootstrap.js
npm notice 2.8kB  scripts/publish.sh
npm notice 921B   src/components/StripeTerminalContext.ts
npm notice 7.8kB  src/components/StripeTerminalProvider.tsx
npm notice 953B   src/components/withStripeTerminal.tsx
npm notice 796B   src/declarations.d.ts
npm notice 18.4kB src/functions.ts
npm notice 433B   src/hooks/useListener.ts
npm notice 22.8kB src/hooks/useStripeTerminal.tsx
npm notice 807B   src/index.tsx
npm notice 6.7kB  src/logger.ts
npm notice 4.6kB  src/plugin/withStripeTerminal.ts
npm notice 4.8kB  src/StripeTerminalSdk.tsx
npm notice 6.9kB  src/types/index.ts
npm notice 400B   src/types/PaymentIntent.ts
npm notice 2.5kB  src/types/Reader.ts
npm notice 825B   src/types/Refund.ts
npm notice 1.6kB  src/types/SetupIntent.ts
npm notice 2.0kB  src/utils/androidPermissionsUtils.ts
npm notice 759B   src/utils/b64EncodeDecode.ts
npm notice 626B   stripe-terminal-react-native.podspec
npm notice === Tarball Details ===
npm notice name:          @stripe/stripe-terminal-react-native
npm notice version:       0.0.1-beta.4
npm notice filename:      @stripe/stripe-terminal-react-native-0.0.1-beta.4.tgz
npm notice package size:  176.3 kB
npm notice unpacked size: 857.1 kB
npm notice shasum:        ad335c755a66a2bcce184685ce28bed362f97624
npm notice integrity:     sha512-6gh2vmYCkMoD9[...]CAMeqrxUZjimA==
npm notice total files:   152
npm notice
stripe-stripe-terminal-react-native-0.0.1-beta.4.tgz

@jdivock-stripe jdivock-stripe merged commit e105a21 into main Jun 2, 2022
arekkubaczkowski pushed a commit to arekkubaczkowski/stripe-terminal-react-native that referenced this pull request Jun 29, 2022
jdivock-stripe added a commit that referenced this pull request Jul 18, 2022
jdivock-stripe added a commit that referenced this pull request Aug 31, 2022
@nazli-stripe nazli-stripe deleted the jdivock/npmignore-only branch September 6, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant