You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85c2c5d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: __e2e__/__snapshots__/config.test.ts.snap
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,13 @@ exports[`shows up current config without unnecessary output 1`] = `
56
56
"<<REPLACED>>"
57
57
]
58
58
},
59
+
{
60
+
"name": "spm [action]",
61
+
"description": "Set up or maintain Swift Package Manager support for the iOS/macOS app. Actions: add, update, deinit, scaffold. With no action: add (or update if SPM is already set up).",
Copy file name to clipboardExpand all lines: packages/cli-config/src/__tests__/__snapshots__/index-test.ts.snap
+1-17Lines changed: 1 addition & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -85,15 +85,7 @@ Object {
85
85
}
86
86
`;
87
87
88
-
exports[`should not skip packages that have invalid configuration (to avoid breaking users): dependencies config 1`] =`
89
-
Object {
90
-
"react-native": Object {
91
-
"name": "react-native",
92
-
"platforms": Object {},
93
-
"root": "<<REPLACED>>/node_modules/react-native",
94
-
},
95
-
}
96
-
`;
88
+
exports[`should not skip packages that have invalid configuration (to avoid breaking users): dependencies config 1`] =`Object {}`;
97
89
98
90
exports[`should not skip packages that have invalid configuration (to avoid breaking users): logged warning 1`] =`"warn Package react-native contains invalid configuration: \\"dependency.invalidProperty\\" is not allowed. Please verify it's properly linked using \\"npx react-native config\\" command and contact the package maintainers about this."`;
99
91
@@ -138,14 +130,6 @@ Object {
138
130
139
131
exports[`should return dependencies from package.json 1`] =`
`The "${commandName}" command is provided by ${pico.bold(
179
+
'@react-native/community-cli-plugin',
180
+
)}, which is not installed in this project. Add it to your devDependencies, at the same version as react-native, then run your package manager's install.`,
181
+
);
182
+
process.exit(1);
183
+
}
184
+
152
185
asyncfunctionsetupAndRun(platformName?: string){
153
186
// Commander is not available yet
154
187
@@ -197,6 +230,24 @@ async function setupAndRun(platformName?: string) {
197
230
198
231
config=awaitloadConfigAsync({
199
232
selectedPlatform,
233
+
// iOS and Android are core platforms bundled with the CLI, so they are
234
+
// always registered. The project's own and dependencies' configs can
235
+
// still override them.
236
+
//
237
+
// The cast is needed because the platform packages' `projectConfig`/
238
+
// `dependencyConfig` return `null` and take required params, whereas the
239
+
// `PlatformConfig` interface models these as `void`. These functions are
240
+
// the canonical implementations the CLI already calls via the config scan.
241
+
platforms: {
242
+
ios: {
243
+
projectConfig: iosProjectConfig,
244
+
dependencyConfig: iosDependencyConfig,
245
+
},
246
+
android: {
247
+
projectConfig: androidProjectConfig,
248
+
dependencyConfig: androidDependencyConfig,
249
+
},
250
+
}asConfig['platforms'],
200
251
});
201
252
202
253
logger.enable();
@@ -211,6 +262,8 @@ async function setupAndRun(platformName?: string) {
211
262
for(constcommandofObject.values(commands)){
212
263
attachCommand(command,config);
213
264
}
265
+
266
+
exitIfCommunityCliPluginMissing(process.argv);
214
267
}catch(error){
215
268
/**
216
269
* When there is no `package.json` found, the CLI will enter `detached` mode and a subset
0 commit comments