mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace .npmignore files, ignore all test/fixture/docs directories (#50784)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50784 Migrates us from several `.npmignore` files to `package.json#files`, for the main `react-native` package. This reduces the size of our npm package by 38 files — in particular, catching previously missed `__tests__` and `__docs__` directories. ```diff - npm notice package size: 4.4 MB - npm notice unpacked size: 23.7 MB - npm notice total files: 4533 + npm notice package size: 4.4 MB + npm notice unpacked size: 23.7 MB + npm notice total files: 4533 ``` NOTE: `"files"` or `.npmignore` — one or the other! - Having `.npmignore` at the package root does not behave(!). Having `"files"` as one source of truth is better and safer. See https://github.com/npm/cli/issues/6221. Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D73185321 fbshipit-source-id: 429c9fec4f447d63440a38bb8e3f3ce3bd155414
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cd5991c648
commit
d1cf58484d
@@ -1 +0,0 @@
|
||||
__tests__
|
||||
@@ -1,9 +0,0 @@
|
||||
# Make sure we never publish ReactAndroid/build (Gradle output)
|
||||
# or ReactAndroid/.cxx (CMake output) to npm.
|
||||
# Those folders are huge (> 100MB)!
|
||||
/build/
|
||||
.cxx/
|
||||
# Exclude buck config/jars for third-party libraries
|
||||
src/main/third-party/
|
||||
# Exclude Android & JVM tests
|
||||
src/test/
|
||||
@@ -1,3 +0,0 @@
|
||||
# Make sure we never publish the build and artifacts folders to npm.
|
||||
build/
|
||||
artifacts/
|
||||
@@ -1,3 +0,0 @@
|
||||
# Make sure we never publish the build folders to npm.
|
||||
build/
|
||||
.cxx/
|
||||
@@ -49,48 +49,61 @@
|
||||
"React",
|
||||
"!React/Fabric/RCTThirdPartyFabricComponentsProvider.*",
|
||||
"ReactAndroid",
|
||||
"!ReactAndroid/.cxx",
|
||||
"!ReactAndroid/build",
|
||||
"!ReactAndroid/external-artifacts/artifacts",
|
||||
"!ReactAndroid/external-artifacts/build",
|
||||
"!ReactAndroid/hermes-engine/.cxx",
|
||||
"!ReactAndroid/hermes-engine/build",
|
||||
"!ReactAndroid/src/main/third-party",
|
||||
"!ReactAndroid/src/test",
|
||||
"ReactApple",
|
||||
"ReactCommon",
|
||||
"README.md",
|
||||
"rn-get-polyfills.js",
|
||||
"scripts/bundle.js",
|
||||
"scripts/cocoapods",
|
||||
"scripts/codegen",
|
||||
"scripts/compose-source-maps.js",
|
||||
"scripts/find-node-for-xcode.sh",
|
||||
"scripts/bundle.js",
|
||||
"scripts/generate-codegen-artifacts.js",
|
||||
"scripts/generate-provider-cli.js",
|
||||
"scripts/generate-specs-cli.js",
|
||||
"scripts/codegen",
|
||||
"!scripts/codegen/__tests__",
|
||||
"!scripts/codegen/__test_fixtures__",
|
||||
"scripts/hermes/hermes-utils.js",
|
||||
"scripts/hermes/prepare-hermes-for-build.js",
|
||||
"scripts/ios-configure-glog.sh",
|
||||
"scripts/xcode/ccache-clang++.sh",
|
||||
"scripts/xcode/ccache-clang.sh",
|
||||
"scripts/xcode/ccache.conf",
|
||||
"scripts/xcode/with-environment.sh",
|
||||
"scripts/native_modules.rb",
|
||||
"scripts/node-binary.sh",
|
||||
"scripts/packager.sh",
|
||||
"scripts/packager-reporter.js",
|
||||
"scripts/packager.sh",
|
||||
"scripts/react_native_pods_utils/script_phases.rb",
|
||||
"scripts/react_native_pods_utils/script_phases.sh",
|
||||
"scripts/react_native_pods.rb",
|
||||
"scripts/cocoapods",
|
||||
"!scripts/cocoapods/__tests__",
|
||||
"scripts/react-native-xcode.sh",
|
||||
"scripts/xcode/ccache-clang.sh",
|
||||
"scripts/xcode/ccache-clang++.sh",
|
||||
"scripts/xcode/ccache.conf",
|
||||
"scripts/xcode/with-environment.sh",
|
||||
"sdks/.hermesversion",
|
||||
"sdks/hermes-engine",
|
||||
"sdks/hermesc",
|
||||
"settings.gradle.kts",
|
||||
"src",
|
||||
"!src/private/testing",
|
||||
"template.config.js",
|
||||
"template",
|
||||
"!template/node_modules",
|
||||
"!template/package-lock.json",
|
||||
"!template/yarn.lock",
|
||||
"third-party-podspecs",
|
||||
"types"
|
||||
"types",
|
||||
"!**/__docs__/**",
|
||||
"!**/__fixtures__/**",
|
||||
"!**/__flowtests__/**",
|
||||
"!**/__mocks__/**",
|
||||
"!**/__test_fixtures__/**",
|
||||
"!**/__tests__/**",
|
||||
"!**/__typetests__/**"
|
||||
],
|
||||
"scripts": {
|
||||
"prepack": "node ./scripts/prepack.js",
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Make sure we never publish __test__ folders (Gradle output)
|
||||
**/__*tests__/
|
||||
@@ -1,2 +0,0 @@
|
||||
__tests__
|
||||
private/testing
|
||||
@@ -1 +0,0 @@
|
||||
__docs__
|
||||
@@ -1 +0,0 @@
|
||||
__typetests__
|
||||
Reference in New Issue
Block a user