Skip to content

Commit 3acfe01

Browse files
authored
[RN][Codegen] Backports fix: exclusion of selectively disabled libraries from codegen generation (#52040)
1 parent 0ebaaed commit 3acfe01

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe('extractLibrariesFromJSON', () => {
5252
jsSrcsDir: '.',
5353
},
5454
libraryPath: rootPath,
55+
name: 'react-native',
5556
});
5657
});
5758

@@ -71,6 +72,7 @@ describe('extractLibrariesFromJSON', () => {
7172
jsSrcsDir: '.',
7273
},
7374
libraryPath: myDependencyPath,
75+
name: 'react-native',
7476
});
7577
expect(libraries[1]).toEqual({
7678
config: {
@@ -79,6 +81,7 @@ describe('extractLibrariesFromJSON', () => {
7981
jsSrcsDir: 'component/js',
8082
},
8183
libraryPath: myDependencyPath,
84+
name: 'my-component',
8285
});
8386
expect(libraries[2]).toEqual({
8487
config: {
@@ -87,6 +90,7 @@ describe('extractLibrariesFromJSON', () => {
8790
jsSrcsDir: 'module/js',
8891
},
8992
libraryPath: myDependencyPath,
93+
name: 'my-module',
9094
});
9195
});
9296
});

packages/react-native/scripts/codegen/generate-artifacts-executor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ function printDeprecationWarningIfNeeded(dependency) {
198198
function extractLibrariesFromConfigurationArray(configFile, dependencyPath) {
199199
return configFile.codegenConfig.libraries.map(config => {
200200
return {
201+
name: config.name,
201202
config,
202203
libraryPath: dependencyPath,
203204
};
@@ -213,6 +214,7 @@ function extractLibrariesFromJSON(configFile, dependencyPath) {
213214
const config = configFile.codegenConfig;
214215
return [
215216
{
217+
name: configFile.name,
216218
config,
217219
libraryPath: dependencyPath,
218220
},

0 commit comments

Comments
 (0)