UNPKG

3.17 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/config/index.ts"],"names":["projectConfig","folder","userConfig","src","path","join","sourceDir","podfile","dirname","xcodeProject","fs","readdirSync","dependencyConfig","podspecPath","configurations","scriptPhases","findPodfilePaths","findAllPodfilePaths"],"mappings":";;;;;;;;;AAOA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACO,SAASA,aAAT,CACLC,MADK,EAELC,UAFK,EAGoB;AACzB,MAAI,CAACA,UAAL,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,QAAMC,GAAG,GAAGC,gBAAKC,IAAL,CAAUJ,MAAV,EAAkBC,UAAU,CAACI,SAAX,IAAwB,EAA1C,CAAZ;;AACA,QAAMC,OAAO,GAAG,8BAAgBJ,GAAhB,CAAhB;AAEA;AACF;AACA;AACA;;AACE,MAAI,CAACI,OAAL,EAAc;AACZ,WAAO,IAAP;AACD;;AAED,QAAMD,SAAS,GAAGF,gBAAKI,OAAL,CAAaD,OAAb,CAAlB;;AAEA,QAAME,YAAY,GAAG,+BAAiBC,cAAGC,WAAH,CAAeL,SAAf,CAAjB,CAArB;AAEA,SAAO;AACLA,IAAAA,SADK;AAELG,IAAAA;AAFK,GAAP;AAID;;AAEM,SAASG,gBAAT,CACLX,MADK,EAELC,UAAsC,GAAG,EAFpC,EAGuB;AAC5B,MAAIA,UAAU,KAAK,IAAnB,EAAyB;AACvB,WAAO,IAAP;AACD;;AAED,QAAMW,WAAW,GAAG,0BAAYZ,MAAZ,CAApB;;AAEA,MAAI,CAACY,WAAL,EAAkB;AAChB,WAAO,IAAP;AACD;;AAED,SAAO;AACLA,IAAAA,WADK;AAELC,IAAAA,cAAc,EAAEZ,UAAU,CAACY,cAAX,IAA6B,EAFxC;AAGLC,IAAAA,YAAY,EAAEb,UAAU,CAACa,YAAX,IAA2B;AAHpC,GAAP;AAKD;;AAEM,MAAMC,gBAAgB,GAAGC,4BAAzB","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nimport path from 'path';\nimport fs from 'fs';\nimport findPodfilePath from './findPodfilePath';\nimport findXcodeProject from './findXcodeProject';\nimport findPodspec from './findPodspec';\nimport findAllPodfilePaths from './findAllPodfilePaths';\nimport {\n IOSProjectParams,\n IOSDependencyParams,\n IOSProjectConfig,\n IOSDependencyConfig,\n} from '@react-native-community/cli-types';\n\n/**\n * Returns project config by analyzing given folder and applying some user defaults\n * when constructing final object\n */\nexport function projectConfig(\n folder: string,\n userConfig: IOSProjectParams,\n): IOSProjectConfig | null {\n if (!userConfig) {\n return null;\n }\n\n const src = path.join(folder, userConfig.sourceDir ?? '');\n const podfile = findPodfilePath(src);\n\n /**\n * In certain repos, the Xcode project can be generated by a tool.\n * The only file that we can assume to exist on disk is `Podfile`.\n */\n if (!podfile) {\n return null;\n }\n\n const sourceDir = path.dirname(podfile);\n\n const xcodeProject = findXcodeProject(fs.readdirSync(sourceDir));\n\n return {\n sourceDir,\n xcodeProject,\n };\n}\n\nexport function dependencyConfig(\n folder: string,\n userConfig: IOSDependencyParams | null = {},\n): IOSDependencyConfig | null {\n if (userConfig === null) {\n return null;\n }\n\n const podspecPath = findPodspec(folder);\n\n if (!podspecPath) {\n return null;\n }\n\n return {\n podspecPath,\n configurations: userConfig.configurations || [],\n scriptPhases: userConfig.scriptPhases || [],\n };\n}\n\nexport const findPodfilePaths = findAllPodfilePaths;\n"]}
\No newline at end of file