Skip to content

Commit

Permalink
fix: updated codegen src paths
Browse files Browse the repository at this point in the history
  • Loading branch information
shivenmian committed Oct 5, 2022
1 parent 600d173 commit 11dc296
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/babel-plugin-codegen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ let flowParser, typeScriptParser, RNCodegen;
const {basename} = require('path');

try {
flowParser = require('react-native-codegen/src/parsers/flow');
typeScriptParser = require('react-native-codegen/src/parsers/typescript');
RNCodegen = require('react-native-codegen/src/generators/RNCodegen');
flowParser = require('@react-native/codegen/src/parsers/flow');
typeScriptParser = require('@react-native/codegen/src/parsers/typescript');
RNCodegen = require('@react-native/codegen/src/generators/RNCodegen');
} catch (e) {
// Fallback to lib when source doesn't exit (e.g. when installed as a dev dependency)
flowParser = require('@react-native/codegen/lib/parsers/flow');
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-specs/react-native-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ let RNParserUtils;

function requireModuleParser() {
if (RNModuleParser == null || RNParserUtils == null) {
// If using this externally, we leverage react-native-codegen as published form
// If using this externally, we leverage @react-native/codegen as published form
if (!PACKAGE_USAGE) {
const config = {
only: [/react-native-codegen\/src\//],
plugins: [require('@babel/plugin-transform-flow-strip-types').default],
};

withBabelRegister(config, () => {
RNModuleParser = require('react-native-codegen/src/parsers/flow/modules');
RNParserUtils = require('react-native-codegen/src/parsers/flow/utils');
RNModuleParser = require('@react-native/codegen/src/parsers/flow/modules');
RNParserUtils = require('@react-native/codegen/src/parsers/flow/utils');
});
} else {
const config = {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ yarn add --dev @react-native/codegen

*Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like*

[version-badge]: https://img.shields.io/npm/v/react-native-codegen?style=flat-square
[package]: https://www.npmjs.com/package/react-native-codegen
[version-badge]: https://img.shields.io/npm/v/@react-native/codegen?style=flat-square
[package]: https://www.npmjs.com/package/@react-native/codegen

## Testing

Expand Down

0 comments on commit 11dc296

Please sign in to comment.