Files
react-native/packages/react-native-codegen/package.json
T
Alex Hunt 4db31a3110 Migrate codegen to shared build setup, remove package build pre-step from RNTester (#39540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39540

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Fixup small Flow syntax quirks that fail under `hermes-parser`.
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D49370200

fbshipit-source-id: 992913155169912ea1a3cb24cb26efbd3f783058
2023-10-23 08:32:33 -07:00

72 lines
2.4 KiB
JSON

{
"name": "@react-native/codegen",
"version": "0.74.0",
"description": "Code generation tools for React Native",
"license": "MIT",
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-codegen#readme",
"bugs": "https://github.com/facebook/react-native/issues",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native.git",
"directory": "packages/react-native-codegen"
},
"keywords": [
"code",
"generation",
"codegen",
"tools",
"react-native"
],
"exports": {
"./cli/combine/combine-js-to-schema-cli": "./src/cli/combine/combine-js-to-schema-cli.js",
"./cli/combine/combine-js-to-schema-cli.js": "./src/cli/combine/combine-js-to-schema-cli.js",
"./cli/generators/generate-all": "./src/cli/generators/generate-all.js",
"./cli/generators/generate-all.js": "./src/cli/generators/generate-all.js",
"./generators/RNCodegen": "./src/generators/RNCodegen.js",
"./generators/RNCodegen.js": "./src/generators/RNCodegen.js",
"./parsers/flow/parser": "./src/parsers/flow/parser.js",
"./parsers/flow/parser.js": "./src/parsers/flow/parser.js",
"./parsers/typescript/parser": "./src/parsers/typescript/parser.js",
"./parsers/typescript/parser.js": "./src/parsers/typescript/parser.js",
"./lib/*": "./src/*.js",
"./lib/*.js": "./src/*.js",
"./src/*": "./src/*.js",
"./src/*.js": "./src/*.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"dependencies": {
"@babel/parser": "^7.20.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"
},
"engines": {
"node": ">=18"
}
}