@react-native/codegen 0.82.0-nightly-20250714-79ca9036d → 0.82.0-nightly-20250715-7f224941b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,9 +39,10 @@ if (!schemaQuery.startsWith('@')) {
|
|
|
39
39
|
}
|
|
40
40
|
const schemaQueryOutputFile = schemaQuery.replace(/^@/, '');
|
|
41
41
|
const schemaQueryOutput = fs.readFileSync(schemaQueryOutputFile, 'utf8');
|
|
42
|
-
const schemaFiles = schemaQueryOutput.split(' ');
|
|
43
42
|
const modules = {};
|
|
44
43
|
const specNameToFile = {};
|
|
44
|
+
const schemaFiles =
|
|
45
|
+
schemaQueryOutput.length > 0 ? schemaQueryOutput.split(' ') : [];
|
|
45
46
|
for (const file of schemaFiles) {
|
|
46
47
|
const schema = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
47
48
|
if (schema.modules) {
|
|
@@ -51,12 +51,13 @@ if (!schemaQuery.startsWith('@')) {
|
|
|
51
51
|
const schemaQueryOutputFile = schemaQuery.replace(/^@/, '');
|
|
52
52
|
const schemaQueryOutput = fs.readFileSync(schemaQueryOutputFile, 'utf8');
|
|
53
53
|
|
|
54
|
-
const schemaFiles = schemaQueryOutput.split(' ');
|
|
55
54
|
const modules: {
|
|
56
55
|
[hasteModuleName: string]: NativeModuleSchema | ComponentSchema,
|
|
57
56
|
} = {};
|
|
58
57
|
const specNameToFile: {[hasteModuleName: string]: string} = {};
|
|
59
58
|
|
|
59
|
+
const schemaFiles =
|
|
60
|
+
schemaQueryOutput.length > 0 ? schemaQueryOutput.split(' ') : [];
|
|
60
61
|
for (const file of schemaFiles) {
|
|
61
62
|
const schema: SchemaType = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
62
63
|
|
|
@@ -33,15 +33,15 @@ ${componentTests}
|
|
|
33
33
|
`.trim();
|
|
34
34
|
const TestTemplate = ({componentName, testName, propName, propValue}) => `
|
|
35
35
|
TEST(${componentName}_${testName}, etc) {
|
|
36
|
-
|
|
36
|
+
RawPropsParser propParser{};
|
|
37
37
|
propParser.prepare<${componentName}>();
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
${componentName} sourceProps{};
|
|
39
|
+
RawProps rawProps(folly::dynamic::object("${propName}", ${propValue}));
|
|
40
40
|
|
|
41
41
|
ContextContainer contextContainer{};
|
|
42
42
|
PropsParserContext parserContext{-1, contextContainer};
|
|
43
43
|
|
|
44
|
-
rawProps.parse(propParser
|
|
44
|
+
rawProps.parse(propParser);
|
|
45
45
|
${componentName}(parserContext, sourceProps, rawProps);
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
@@ -65,15 +65,15 @@ const TestTemplate = ({
|
|
|
65
65
|
propValue: string,
|
|
66
66
|
}) => `
|
|
67
67
|
TEST(${componentName}_${testName}, etc) {
|
|
68
|
-
|
|
68
|
+
RawPropsParser propParser{};
|
|
69
69
|
propParser.prepare<${componentName}>();
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
${componentName} sourceProps{};
|
|
71
|
+
RawProps rawProps(folly::dynamic::object("${propName}", ${propValue}));
|
|
72
72
|
|
|
73
73
|
ContextContainer contextContainer{};
|
|
74
74
|
PropsParserContext parserContext{-1, contextContainer};
|
|
75
75
|
|
|
76
|
-
rawProps.parse(propParser
|
|
76
|
+
rawProps.parse(propParser);
|
|
77
77
|
${componentName}(parserContext, sourceProps, rawProps);
|
|
78
78
|
}
|
|
79
79
|
`;
|