mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-27 00:06:55 +00:00
[change] Add generated Flow files to package dist
Fix #1684 Close #1982
This commit is contained in:
committed by
Nicolas Gallagher
parent
4e77aebc17
commit
c4e2d7a919
@@ -7,6 +7,7 @@
|
|||||||
"compile": "npm-run-all clean -p \"compile:* {@}\" --",
|
"compile": "npm-run-all clean -p \"compile:* {@}\" --",
|
||||||
"compile:commonjs": "cd packages/react-native-web && cross-env BABEL_ENV=commonjs babel --root-mode upward src --out-dir dist/cjs --ignore \"**/__tests__\"",
|
"compile:commonjs": "cd packages/react-native-web && cross-env BABEL_ENV=commonjs babel --root-mode upward src --out-dir dist/cjs --ignore \"**/__tests__\"",
|
||||||
"compile:es": "cd packages/react-native-web && babel --root-mode upward src --out-dir dist --ignore \"**/__tests__\"",
|
"compile:es": "cd packages/react-native-web && babel --root-mode upward src --out-dir dist --ignore \"**/__tests__\"",
|
||||||
|
"compile:flow": "gen-flow-files packages/react-native-web/src --out-dir packages/react-native-web/dist",
|
||||||
"benchmarks": "cd packages/benchmarks && yarn dev",
|
"benchmarks": "cd packages/benchmarks && yarn dev",
|
||||||
"benchmarks:build": "cd packages/benchmarks && yarn build",
|
"benchmarks:build": "cd packages/benchmarks && yarn build",
|
||||||
"benchmarks:release": "yarn benchmarks:build && git checkout gh-pages && rm -rf ./docs/benchmarks && mv packages/benchmarks/dist ./docs/benchmarks && git add -A && git commit -m \"Deploy benchmarks\" && git push origin gh-pages && git checkout -",
|
"benchmarks:release": "yarn benchmarks:build && git checkout gh-pages && rm -rf ./docs/benchmarks && mv packages/benchmarks/dist ./docs/benchmarks && git add -A && git commit -m \"Deploy benchmarks\" && git push origin gh-pages && git checkout -",
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
"eslint-plugin-react": "^7.22.0",
|
"eslint-plugin-react": "^7.22.0",
|
||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
"flow-bin": "^0.148.0",
|
"flow-bin": "^0.148.0",
|
||||||
|
"gen-flow-files": "^0.4.11",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"inline-style-prefixer": "^6.0.0",
|
"inline-style-prefixer": "^6.0.0",
|
||||||
|
|||||||
@@ -65,10 +65,12 @@ module.exports = {
|
|||||||
|
|
||||||
### Flow
|
### Flow
|
||||||
|
|
||||||
[Flow](https://flow.org) can be configured to understand the aliased module. You may also need to include a custom libdef ([example](https://gist.github.com/paularmstrong/f60b40d16fc83e1e8e532d483336f9bb)) in your config.
|
[Flow](https://flow.org) can be configured to understand the aliased module and pull types from Reac Native Web's source code. To do this, you can alias the name as below. You will also need to tell flow to use the `module` field of RNW's `package.json` or it may not find the flow types.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
[options]
|
[options]
|
||||||
|
module.system.node.main_field=module
|
||||||
|
module.system.node.main_field=main
|
||||||
module.name_mapper='^react-native$' -> 'react-native-web'
|
module.name_mapper='^react-native$' -> 'react-native-web'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// @flow strict
|
||||||
export { default as unstable_createElement } from './exports/createElement';
|
export { default as unstable_createElement } from './exports/createElement';
|
||||||
export { default as findNodeHandle } from './exports/findNodeHandle';
|
export { default as findNodeHandle } from './exports/findNodeHandle';
|
||||||
export { default as processColor } from './exports/processColor';
|
export { default as processColor } from './exports/processColor';
|
||||||
|
|||||||
@@ -703,6 +703,14 @@
|
|||||||
"@babel/helper-create-class-features-plugin" "^7.12.13"
|
"@babel/helper-create-class-features-plugin" "^7.12.13"
|
||||||
"@babel/helper-plugin-utils" "^7.12.13"
|
"@babel/helper-plugin-utils" "^7.12.13"
|
||||||
|
|
||||||
|
"@babel/plugin-proposal-throw-expressions@^7.7.4":
|
||||||
|
version "7.12.13"
|
||||||
|
resolved "https://registry.npmjs.org/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.12.13.tgz#48a6e4a5988041d16b0a2f1568a3b518f8b6c1d4"
|
||||||
|
integrity sha512-zhItTJGy2xLYneBdOk9CeyuEXWJt9J+pwTEIDl+A/VKMCq6E9ij3l1RRuTYBwtktTO9bCcIfA4/+d0HibVWSEA==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-plugin-utils" "^7.12.13"
|
||||||
|
"@babel/plugin-syntax-throw-expressions" "^7.12.13"
|
||||||
|
|
||||||
"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4":
|
"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4":
|
||||||
version "7.12.13"
|
version "7.12.13"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba"
|
||||||
@@ -746,7 +754,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-plugin-utils" "^7.8.3"
|
"@babel/helper-plugin-utils" "^7.8.3"
|
||||||
|
|
||||||
"@babel/plugin-syntax-flow@^7.12.13":
|
"@babel/plugin-syntax-flow@^7.12.13", "@babel/plugin-syntax-flow@^7.7.4":
|
||||||
version "7.12.13"
|
version "7.12.13"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86"
|
||||||
integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA==
|
integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA==
|
||||||
@@ -823,6 +831,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-plugin-utils" "^7.8.0"
|
"@babel/helper-plugin-utils" "^7.8.0"
|
||||||
|
|
||||||
|
"@babel/plugin-syntax-throw-expressions@^7.12.13":
|
||||||
|
version "7.12.13"
|
||||||
|
resolved "https://registry.npmjs.org/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.12.13.tgz#bb02bfbaf57d71ab69280ebf6a53aa45ad4c3f1a"
|
||||||
|
integrity sha512-vbpx/IxHR3qqWEfYeiVLq4+RFj2F4GjsMzoXEx/YU/pgmTA6o7T92DQHWIeetg7msKQFnyG1PwmPLWMlAn+Fmg==
|
||||||
|
dependencies:
|
||||||
|
"@babel/helper-plugin-utils" "^7.12.13"
|
||||||
|
|
||||||
"@babel/plugin-syntax-top-level-await@^7.12.13", "@babel/plugin-syntax-top-level-await@^7.8.3":
|
"@babel/plugin-syntax-top-level-await@^7.12.13", "@babel/plugin-syntax-top-level-await@^7.8.3":
|
||||||
version "7.12.13"
|
version "7.12.13"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178"
|
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178"
|
||||||
@@ -5421,6 +5436,22 @@ gauge@~2.7.3:
|
|||||||
strip-ansi "^3.0.1"
|
strip-ansi "^3.0.1"
|
||||||
wide-align "^1.1.0"
|
wide-align "^1.1.0"
|
||||||
|
|
||||||
|
gen-flow-files@^0.4.11:
|
||||||
|
version "0.4.11"
|
||||||
|
resolved "https://registry.npmjs.org/gen-flow-files/-/gen-flow-files-0.4.11.tgz#ace4934f529aa6a40c83337f21494ed6dc57ac4e"
|
||||||
|
integrity sha512-88WjoL6gaxTaJtSal6Nsw9LerVKRVjQEAJy330VOmCS1k+lu2h1HJEJyU9LhviaphZBNG088j6JigA6YiP0xGQ==
|
||||||
|
dependencies:
|
||||||
|
"@babel/core" "^7.7.5"
|
||||||
|
"@babel/generator" "^7.7.4"
|
||||||
|
"@babel/parser" "^7.7.5"
|
||||||
|
"@babel/plugin-proposal-throw-expressions" "^7.7.4"
|
||||||
|
"@babel/plugin-syntax-flow" "^7.7.4"
|
||||||
|
"@babel/traverse" "^7.7.4"
|
||||||
|
"@babel/types" "^7.7.4"
|
||||||
|
glob "^7.1.6"
|
||||||
|
mkdirp "^0.5.1"
|
||||||
|
yargs "^15.0.2"
|
||||||
|
|
||||||
gensync@^1.0.0-beta.1:
|
gensync@^1.0.0-beta.1:
|
||||||
version "1.0.0-beta.1"
|
version "1.0.0-beta.1"
|
||||||
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz"
|
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz"
|
||||||
@@ -11492,7 +11523,7 @@ yargs@16.2.0:
|
|||||||
y18n "^5.0.5"
|
y18n "^5.0.5"
|
||||||
yargs-parser "^20.2.2"
|
yargs-parser "^20.2.2"
|
||||||
|
|
||||||
yargs@^15.3.1, yargs@^15.4.1:
|
yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1:
|
||||||
version "15.4.1"
|
version "15.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
|
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
|
||||||
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
|
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
|
||||||
|
|||||||
Reference in New Issue
Block a user