Skip to content

Commit 40d471a

Browse files
committed
refactor: remove buildSchema from parseFile params and import it in parsers
1 parent 860b256 commit 40d471a

20 files changed

+28
-71
lines changed

packages/react-native-codegen/e2e/__tests__/components/GenerateComponentDescriptorH-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateComponentDescriptorH');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GenerateComponentDescriptorH can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GenerateComponentHObjCpp-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateComponentHObjCpp');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GenerateComponentHObjCpp can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GenerateEventEmitterCpp-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateEventEmitterCpp');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GenerateEventEmitterCpp can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GenerateEventEmitterH-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateEventEmitterH');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GenerateEventEmitterH can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsCpp-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GeneratePropsCpp');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GeneratePropsCpp can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsH-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GeneratePropsH');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GeneratePropsH can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsJavaDelegate-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GeneratePropsJavaDelegate');
1716
const fs = require('fs');
1817

@@ -25,7 +24,7 @@ const parser = new FlowParser();
2524
fixtures.forEach(fixture => {
2625
it(`GeneratePropsJavaDelegate can generate for '${fixture}'`, () => {
2726
const libName = 'RNCodegenModuleFixtures';
28-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
27+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2928
const output = generator.generate(libName, schema);
3029
expect(Object.fromEntries(output)).toMatchSnapshot();
3130
});

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsJavaInterface-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GeneratePropsJavaInterface');
1716
const fs = require('fs');
1817

@@ -24,7 +23,7 @@ const parser = new FlowParser();
2423
fixtures.forEach(fixture => {
2524
it(`GeneratePropsJavaInterface can generate for '${fixture}'`, () => {
2625
const libName = 'RNCodegenModuleFixtures';
27-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
26+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2827
const output = generator.generate(libName, schema, undefined, false);
2928
expect(Object.fromEntries(output)).toMatchSnapshot();
3029
});

packages/react-native-codegen/e2e/__tests__/components/GenerateShadowNodeCpp-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateShadowNodeCpp');
1716
const fs = require('fs');
1817

@@ -24,7 +23,7 @@ const parser = new FlowParser();
2423
fixtures.forEach(fixture => {
2524
it(`GenerateShadowNodeCpp can generate for '${fixture}'`, () => {
2625
const libName = 'RNCodegenModuleFixtures';
27-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
26+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2827
const output = generator.generate(libName, schema, undefined, false);
2928
expect(Object.fromEntries(output)).toMatchSnapshot();
3029
});

packages/react-native-codegen/e2e/__tests__/components/GenerateShadowNodeH-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const {FlowParser} = require('../../../src/parsers/flow/parser');
15-
const {buildSchema} = require('../../../src/parsers/flow');
1615
const generator = require('../../../src/generators/components/GenerateShadowNodeH');
1716
const fs = require('fs');
1817

@@ -24,7 +23,7 @@ const parser = new FlowParser();
2423
fixtures.forEach(fixture => {
2524
it(`GenerateShadowNodeH can generate for '${fixture}'`, () => {
2625
const libName = 'RNCodegenModuleFixtures';
27-
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`, buildSchema);
26+
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2827
const output = generator.generate(libName, schema, undefined, false);
2928
expect(Object.fromEntries(output)).toMatchSnapshot();
3029
});

0 commit comments

Comments
 (0)