Files
react-native/packages/react-native-codegen/package.json
T
Moti Zilberman 5abaf388cd Use hermes-parser for Flow codegen specs (#39036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39036

Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs.

`hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety.

Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement.

In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself.

Reviewed By: huntie

Differential Revision: D48384078

fbshipit-source-id: 310ad150ec62671ba395b0e2f6415ccae97ac04d
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",
"hermes-parser": "0.17.1",
"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",
"hermes-estree": "0.17.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"
}
}