@react-native/codegen 0.78.0-nightly-20250109-cfec590f6 → 0.78.0-nightly-20250111-83699228c
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.
- package/lib/cli/combine/combine-schemas-cli.js +15 -5
- package/lib/cli/combine/combine-schemas-cli.js.flow +12 -5
- package/lib/generators/components/GeneratePropsJavaInterface.js +1 -1
- package/lib/generators/components/GeneratePropsJavaInterface.js.flow +1 -1
- package/lib/generators/components/JavaHelpers.js +5 -0
- package/lib/generators/components/JavaHelpers.js.flow +6 -0
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ for (const file of schemaFiles) {
|
|
|
46
46
|
const schema = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
47
47
|
if (schema.modules) {
|
|
48
48
|
for (const specName in schema.modules) {
|
|
49
|
+
var _module$excludedPlatf;
|
|
49
50
|
const module = schema.modules[specName];
|
|
50
51
|
if (modules[specName]) {
|
|
51
52
|
assert.deepEqual(
|
|
@@ -54,11 +55,20 @@ for (const file of schemaFiles) {
|
|
|
54
55
|
`App contained two specs with the same file name '${specName}'. Schemas: ${specNameToFile[specName]}, ${file}. Please rename one of the specs.`,
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
module.excludedPlatforms
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const excludedPlatforms =
|
|
59
|
+
(_module$excludedPlatf = module.excludedPlatforms) === null ||
|
|
60
|
+
_module$excludedPlatf === void 0
|
|
61
|
+
? void 0
|
|
62
|
+
: _module$excludedPlatf.map(excludedPlatform =>
|
|
63
|
+
excludedPlatform.toLowerCase(),
|
|
64
|
+
);
|
|
65
|
+
if (excludedPlatforms != null) {
|
|
66
|
+
const cxxOnlyModule =
|
|
67
|
+
excludedPlatforms.includes('ios') &&
|
|
68
|
+
excludedPlatforms.includes('android');
|
|
69
|
+
if (!cxxOnlyModule && excludedPlatforms.includes(platform)) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
62
72
|
}
|
|
63
73
|
modules[specName] = module;
|
|
64
74
|
specNameToFile[specName] = file;
|
|
@@ -71,11 +71,18 @@ for (const file of schemaFiles) {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
const excludedPlatforms = module.excludedPlatforms?.map(
|
|
75
|
+
excludedPlatform => excludedPlatform.toLowerCase(),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
if (excludedPlatforms != null) {
|
|
79
|
+
const cxxOnlyModule =
|
|
80
|
+
excludedPlatforms.includes('ios') &&
|
|
81
|
+
excludedPlatforms.includes('android');
|
|
82
|
+
|
|
83
|
+
if (!cxxOnlyModule && excludedPlatforms.includes(platform)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
79
86
|
}
|
|
80
87
|
|
|
81
88
|
modules[specName] = module;
|
|
@@ -28,6 +28,11 @@ function toSafeJavaString(input, shouldUpperCaseFirst) {
|
|
|
28
28
|
}
|
|
29
29
|
function getImports(component, type) {
|
|
30
30
|
const imports = new Set();
|
|
31
|
+
if (type === 'interface') {
|
|
32
|
+
imports.add(
|
|
33
|
+
'import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;',
|
|
34
|
+
);
|
|
35
|
+
}
|
|
31
36
|
component.extendsProps.forEach(extendProps => {
|
|
32
37
|
switch (extendProps.type) {
|
|
33
38
|
case 'ReactNativeBuiltInType':
|
|
@@ -43,6 +43,12 @@ function getImports(
|
|
|
43
43
|
): Set<string> {
|
|
44
44
|
const imports: Set<string> = new Set();
|
|
45
45
|
|
|
46
|
+
if (type === 'interface') {
|
|
47
|
+
imports.add(
|
|
48
|
+
'import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;',
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
component.extendsProps.forEach(extendProps => {
|
|
47
53
|
switch (extendProps.type) {
|
|
48
54
|
case 'ReactNativeBuiltInType':
|