Skip to content

Commit d8babb3

Browse files
committed
Read plugin framework names that contain a space; fix Flow variance syntax
1 parent 361ddf3 commit d8babb3

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/react-native/scripts/spm/__tests__/plugin-framework-mismatch-test.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ describe('assertPluginFrameworksLinked', () => {
206206
expect(check(app)).toEqual({error: null, lines: []});
207207
});
208208

209+
it('reads framework names that contain a space', () => {
210+
const app = scaffoldApp();
211+
const spaced = frameworkEntry('my-fw', 'My Fw', 'My Fw.xcframework');
212+
inject(app, [REACT, HERMES, spaced]);
213+
writeSidecar(app.appRoot, [spaced]);
214+
215+
expect(check(app)).toEqual({error: null, lines: []});
216+
});
217+
209218
it('compares only setting prefixes when the frameworks manifest is missing', () => {
210219
const app = scaffoldApp();
211220
inject(app, [REACT, HERMES, EXPO]);

‎packages/react-native/scripts/spm/generate-spm-xcodeproj.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,7 @@ class PluginFrameworkMismatchError extends Error {
22832283
*/
22842284
function assertPluginFrameworksLinked(
22852285
appRoot /*: string */,
2286-
env /*: {+[string]: ?string} */ = process.env,
2286+
env /*: {readonly [string]: ?string} */ = process.env,
22872287
) /*: void */ {
22882288
const builtProjectPath = env.PROJECT_FILE_PATH;
22892289
const xcodeprojPath =
@@ -2336,7 +2336,7 @@ function assertPluginFrameworksLinked(
23362336
);
23372337
linkedPluginNames = new Set(
23382338
Array.from(
2339-
outputs.matchAll(/([^/"\s]+)\.framework\b/g),
2339+
outputs.matchAll(/([^/"\n]+)\.framework\b/g),
23402340
m => m[1],
23412341
).filter(name => !builtinNames.has(name)),
23422342
);

0 commit comments

Comments
 (0)