Skip to content

Commit 8be9dbf

Browse files
tarunrajputfacebook-github-bot
authored andcommitted
consolidate parsers component schema to common root (#36219)
Summary: > [Codegen 85] The parses/flow/components/schema.js and parses/typescript/components/schema.js are the same. Move the schema.js from the one of the two folders to the parsers common root. Delete the other. Update the references to use the shared file. Part of the Codegen ☂️ Issue #34872 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Consolidated the schema.js files for parses/flow/components and parses/typescript/components to a common root. Pull Request resolved: #36219 Test Plan: Run ```yarn jest react-native-codegen``` Reviewed By: christophpurrer Differential Revision: D43444666 Pulled By: cipolleschi fbshipit-source-id: 24d791fd3a8110730d3f6054497ea3a31549a5a5
1 parent 726a40c commit 8be9dbf

File tree

8 files changed

+8
-70
lines changed

8 files changed

+8
-70
lines changed

packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import type {ParserType} from '../errors';
2424

2525
const {Visitor} = require('../flow/Visitor');
26-
const {wrapComponentSchema} = require('../flow/components/schema');
26+
const {wrapComponentSchema} = require('../schema.js');
2727
const {buildComponentSchema} = require('../flow/components');
2828
const {buildModuleSchema} = require('../flow/modules');
2929
const {isModuleRegistryCall} = require('../utils.js');

packages/react-native-codegen/src/parsers/flow/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'use strict';
1212
import type {TypeDeclarationMap} from '../../utils';
1313
import type {CommandOptions} from './options';
14-
import type {ComponentSchemaBuilderConfig} from './schema.js';
14+
import type {ComponentSchemaBuilderConfig} from '../../schema.js';
1515

1616
const {getTypes} = require('../utils');
1717
const {getCommands} = require('./commands');

packages/react-native-codegen/src/parsers/flow/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const flowParser = require('flow-parser');
2828
const {buildSchema} = require('../parsers-commons');
2929
const {Visitor} = require('./Visitor');
3030
const {buildComponentSchema} = require('./components');
31-
const {wrapComponentSchema} = require('./components/schema');
31+
const {wrapComponentSchema} = require('../schema.js');
3232
const {buildModuleSchema} = require('./modules');
3333

3434
const fs = require('fs');

packages/react-native-codegen/src/parsers/parsers-commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {
2626
import type {Parser} from './parser';
2727
import type {ParserType} from './errors';
2828
import type {ParserErrorCapturer, TypeDeclarationMap} from './utils';
29-
import type {ComponentSchemaBuilderConfig} from './flow/components/schema';
29+
import type {ComponentSchemaBuilderConfig} from './schema.js';
3030

3131
const {
3232
getConfigType,

packages/react-native-codegen/src/parsers/flow/components/schema.js renamed to packages/react-native-codegen/src/parsers/schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @flow strict
87
* @format
8+
* @flow strict
99
*/
1010

1111
'use strict';
@@ -18,7 +18,7 @@ import type {
1818
ExtendsPropsShape,
1919
SchemaType,
2020
OptionsShape,
21-
} from '../../../CodegenSchema.js';
21+
} from '../CodegenSchema.js';
2222

2323
export type ComponentSchemaBuilderConfig = $ReadOnly<{
2424
filename: string,

packages/react-native-codegen/src/parsers/typescript/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import type {ExtendsPropsShape} from '../../../CodegenSchema.js';
1313
import type {TypeDeclarationMap} from '../../utils';
1414
import type {CommandOptions} from './options';
15-
import type {ComponentSchemaBuilderConfig} from './schema.js';
15+
import type {ComponentSchemaBuilderConfig} from '../../schema.js';
1616

1717
const {getTypes} = require('../utils');
1818
const {getCommands} = require('./commands');

packages/react-native-codegen/src/parsers/typescript/components/schema.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/react-native-codegen/src/parsers/typescript/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const babelParser = require('@babel/parser');
2828
const {buildSchema} = require('../parsers-commons');
2929
const {Visitor} = require('./Visitor');
3030
const {buildComponentSchema} = require('./components');
31-
const {wrapComponentSchema} = require('./components/schema');
31+
const {wrapComponentSchema} = require('../schema.js');
3232
const {buildModuleSchema} = require('./modules');
3333

3434
const fs = require('fs');

0 commit comments

Comments
 (0)