Files
react-native/packages/react-native-codegen/package.json
T
Moti Zilberman a74765eb0a Throw Flow syntax errors instead of continuing to process the AST (#39035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39035

Changelog: [General][Fixed] Flow syntax errors in Codegen specs are no longer ignored.

Instead of throwing errors like most parsers, the `flow-parser` package returns errors as part of the AST (along with a best-effort parse). It turns out that `react-native/codegen` ignores such errors and only detects a subset of them after the fact. Here we change the behaviour to immediately throwing a descriptive error message (containing the file name and a code frame).

**This change is theoretically breaking** for any published packages that already contain broken Flow code (that somehow doesn't happen to affect the Codegen output today). Hopefully, anyone using Flow-flavoured RN Codegen is also typechecking with Flow and/or building with Metro (which would both flag the same errors), so the impact should be fairly contained.

Reviewed By: huntie

Differential Revision: D48385786

fbshipit-source-id: c7e1f5fb64a61fb0eb9e9f8f7501b43264c9626c
2023-11-08 01:33:42 -08:00

61 lines
1.7 KiB
JSON

{
"name": "@react-native/codegen",
"version": "0.74.0",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native.git",
"directory": "packages/react-native-codegen"
},
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-codegen#readme",
"keywords": [
"code",
"generation",
"codegen",
"tools",
"react-native"
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">=18"
},
"scripts": {
"build": "yarn clean && node scripts/build.js --verbose",
"clean": "rimraf lib",
"prepare": "yarn run build"
},
"files": [
"lib"
],
"dependencies": {
"@babel/parser": "^7.20.0",
"@babel/code-frame": "^7.0.0",
"flow-parser": "^0.206.0",
"jscodeshift": "^0.14.0",
"nullthrows": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-class-properties": "^7.18.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0",
"@babel/plugin-proposal-object-rest-spread": "^7.20.0",
"@babel/plugin-proposal-optional-chaining": "^7.20.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.0",
"@babel/plugin-transform-async-to-generator": "^7.20.0",
"@babel/plugin-transform-destructuring": "^7.20.0",
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"chalk": "^4.0.0",
"glob": "^7.1.1",
"invariant": "^2.2.4",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"prettier": "2.8.8",
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@babel/preset-env": "^7.1.6"
}
}