[publish] Fix `files` field for packages, invalid version range
The [`files` field](https://docs.npmjs.com/cli/v10/commands/npm-publish#files-included-in-package) controls what files get included in the published package. This PR specifies the `files` field on our publishable packages to only include the `dist` directory, since we don't need to ship any types or sourcemaps with 3 of them. react-compiler-runtime is a runtime package which has sourcemaps, so we also include the `src` directory in the published package. Also fixes an invalid version range for the react peer dependency in react-compiler-runtime, tested that it works via https://semver.npmjs.com/ ghstack-source-id: 12b36c203fc9fd8d72a1995fb3fba2312de4aa51 Pull Request resolved: https://github.com/facebook/react-forget/pull/2965
Lauren Tan committed
May 14, 2024 at 11:01 UTC
67ea821e5fe6ddf3c734ec08ccf3630de9ef73ae
3 files changed
+6
-2
compiler/packages/babel-plugin-react-compiler/package.json
+1
-1
@@ -5,7 +5,7 @@
5
"main": "dist/index.js",
6
"license": "MIT",
7
"files": [
8
- "src"
8
+ "dist"
9
],
10
"scripts": {
11
"build": "rimraf dist && rollup --config --bundleConfigAsCjs",
compiler/packages/eslint-plugin-react-compiler/package.json
+3
@@ -6,6 +6,9 @@
6
"build": "rimraf dist && rollup --config --bundleConfigAsCjs",
7
"test": "tsc && jest"
8
},
9
+ "files": [
10
+ "dist"
11
+ ],
12
"dependencies": {
13
"@babel/core": "^7.24.4",
14
"@babel/parser": "^7.24.4",
compiler/packages/react-compiler-runtime/package.json
+2
-1
@@ -5,10 +5,11 @@
5
"license": "MIT",
6
"main": "dist/index.js",
7
"files": [
8
+ "dist",
9
"src"
10
],
11
"peerDependencies": {
11
- "react": "^18.2.0 | ^19.0.0"
12
+ "react": "^18.2.0 || ^19.0.0"
13
},
14
"scripts": {
15
"build": "rimraf dist && rollup --config --bundleConfigAsCjs",