@@ -201,6 +201,166 @@ module.exports = {
201201}
202202` ;
203203
204+ exports [` gatherConfig() returns common configuration 1` ] = `
205+ Object {
206+ " dependencies" : Object {},
207+ " files" : Object {
208+ " .gitignore" : Object {
209+ " source" : " example/.gitignore" ,
210+ },
211+ " .watchmanconfig" : Object {
212+ " source" : " node_modules/react-native/template/_watchmanconfig" ,
213+ },
214+ " babel.config.js" : Object {
215+ " source" : " node_modules/react-native/template/babel.config.js" ,
216+ },
217+ " common/.gitignore" : Object {
218+ " source" : " example/.gitignore" ,
219+ },
220+ " common/.watchmanconfig" : Object {
221+ " source" : " node_modules/react-native/template/_watchmanconfig" ,
222+ },
223+ " common/babel.config.js" : Object {
224+ " source" : " node_modules/react-native/template/babel.config.js" ,
225+ },
226+ " common/metro.config.js" : Object {
227+ " source" : " example/metro.config.js" ,
228+ },
229+ " common/react-native.config.js" : " const fs = require(\\ " fs \\" );
230+ const path = require (\\" path\\ " );
231+
232+ const windowsProjectFile = path .join (
233+ \\" node_modules\\ " ,
234+ \\" .generated\\ " ,
235+ \\" windows\\ " ,
236+ \\" ReactTestApp\\ " ,
237+ \\" ReactTestApp.vcxproj\\ "
238+ );
239+
240+ module .exports = {
241+ project: {
242+ android: {
243+ sourceDir: \\" android\\ " ,
244+ manifestPath: path .relative (
245+ path .join (__dirname , \\" android\\ " ),
246+ path .join (
247+ path .dirname (require .resolve (\\" react-native-test-app/package.json\\ " )),
248+ \\" android\\ " ,
249+ \\" app\\ " ,
250+ \\" src\\ " ,
251+ \\" main\\ " ,
252+ \\" AndroidManifest.xml\\ "
253+ )
254+ ),
255+ },
256+ ios: {
257+ project: (() => {
258+ const {
259+ packageSatisfiesVersionRange,
260+ } = require (\\" react-native-test-app/scripts/configure\\ " );
261+ if (
262+ packageSatisfiesVersionRange (
263+ \\" @react-native-community/cli-platform-ios\\ " ,
264+ \\" <5.0.2\\ "
265+ )
266+ ) {
267+ // Prior to @react-native-community/cli-platform-ios v5.0.0,
268+ // \`project\` was only used to infer \`sourceDir\` and \`podfile\`.
269+ return \\" ios/ReactTestApp-Dummy.xcodeproj\\ " ;
270+ }
271+
272+ // \`sourceDir\` and \`podfile\` detection was fixed in
273+ // @react-native-community/cli-platform-ios v5.0.2 (see
274+ // https://github.com/react-native-community/cli/pull/1444).
275+ return \\" node_modules/.generated/ios/ReactTestApp.xcodeproj\\ " ;
276+ })(),
277+ },
278+ windows: fs .existsSync (windowsProjectFile ) && {
279+ sourceDir: \\" windows\\ " ,
280+ solutionFile: \\" Test.sln\\ " ,
281+ project: {
282+ projectFile: path .relative (
283+ path .join (__dirname , \\" windows\\ " ),
284+ windowsProjectFile
285+ ),
286+ },
287+ },
288+ },
289+ };
290+ " ,
291+ " metro.config.js" : Object {
292+ " source" : " example/metro.config.js" ,
293+ },
294+ " react-native.config.js" : " const fs = require(\\ " fs \\" );
295+ const path = require (\\" path\\ " );
296+
297+ const windowsProjectFile = path .join (
298+ \\" node_modules\\ " ,
299+ \\" .generated\\ " ,
300+ \\" windows\\ " ,
301+ \\" ReactTestApp\\ " ,
302+ \\" ReactTestApp.vcxproj\\ "
303+ );
304+
305+ module .exports = {
306+ project: {
307+ android: {
308+ sourceDir: \\" android\\ " ,
309+ manifestPath: path .relative (
310+ path .join (__dirname , \\" android\\ " ),
311+ path .join (
312+ path .dirname (require .resolve (\\" react-native-test-app/package.json\\ " )),
313+ \\" android\\ " ,
314+ \\" app\\ " ,
315+ \\" src\\ " ,
316+ \\" main\\ " ,
317+ \\" AndroidManifest.xml\\ "
318+ )
319+ ),
320+ },
321+ ios: {
322+ project: (() => {
323+ const {
324+ packageSatisfiesVersionRange,
325+ } = require (\\" react-native-test-app/scripts/configure\\ " );
326+ if (
327+ packageSatisfiesVersionRange (
328+ \\" @react-native-community/cli-platform-ios\\ " ,
329+ \\" <5.0.2\\ "
330+ )
331+ ) {
332+ // Prior to @react-native-community/cli-platform-ios v5.0.0,
333+ // \`project\` was only used to infer \`sourceDir\` and \`podfile\`.
334+ return \\" ios/ReactTestApp-Dummy.xcodeproj\\ " ;
335+ }
336+
337+ // \`sourceDir\` and \`podfile\` detection was fixed in
338+ // @react-native-community/cli-platform-ios v5.0.2 (see
339+ // https://github.com/react-native-community/cli/pull/1444).
340+ return \\" node_modules/.generated/ios/ReactTestApp.xcodeproj\\ " ;
341+ })(),
342+ },
343+ windows: fs .existsSync (windowsProjectFile ) && {
344+ sourceDir: \\" windows\\ " ,
345+ solutionFile: \\" Test.sln\\ " ,
346+ project: {
347+ projectFile: path .relative (
348+ path .join (__dirname , \\" windows\\ " ),
349+ windowsProjectFile
350+ ),
351+ },
352+ },
353+ },
354+ };
355+ " ,
356+ },
357+ " oldFiles" : Array [],
358+ " scripts" : Object {
359+ " start" : " react-native start" ,
360+ },
361+ }
362+ ` ;
363+
204364exports [` gatherConfig() returns configuration for a single platform 1` ] = `
205365Object {
206366 " dependencies" : Object {},
0 commit comments