1 line
1.9 KiB
Plaintext
1 line
1.9 KiB
Plaintext
{"version":3,"sources":["../src/Project.ts"],"names":["getExpoSDKVersion","projectRoot","exp","sdkVersion","packageJsonPath","resolveFrom","silent","expoPackageJson","JsonFile","read","json5","version","packageVersion","majorVersion","split","shift","ConfigError"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEO,SAASA,iBAAT,CACLC,WADK,EAELC,GAFK,EAGG;AACR,MAAIA,GAAJ,aAAIA,GAAJ,eAAIA,GAAG,CAAEC,UAAT,EAAqB;AACnB,WAAOD,GAAG,CAACC,UAAX;AACD;;AACD,QAAMC,eAAe,GAAGC,uBAAYC,MAAZ,CAAmBL,WAAnB,EAAgC,mBAAhC,CAAxB;;AACA,MAAIG,eAAJ,EAAqB;AACnB,UAAMG,eAAe,GAAGC,oBAASC,IAAT,CAAcL,eAAd,EAA+B;AAAEM,MAAAA,KAAK,EAAE;AAAT,KAA/B,CAAxB;;AACA,UAAM;AAAEC,MAAAA,OAAO,EAAEC;AAAX,QAA8BL,eAApC;;AACA,QAAI,OAAOK,cAAP,KAA0B,QAA9B,EAAwC;AACtC,YAAMC,YAAY,GAAGD,cAAc,CAACE,KAAf,CAAqB,GAArB,EAA0BC,KAA1B,EAArB;AACA,aAAQ,GAAEF,YAAa,MAAvB;AACD;AACF;;AACD,QAAM,KAAIG,qBAAJ,EACH,mKADG,EAEJ,kBAFI,CAAN;AAID","sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\n\nimport { ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\n\nexport function getExpoSDKVersion(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>\n): string {\n if (exp?.sdkVersion) {\n return exp.sdkVersion;\n }\n const packageJsonPath = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (packageJsonPath) {\n const expoPackageJson = JsonFile.read(packageJsonPath, { json5: true });\n const { version: packageVersion } = expoPackageJson;\n if (typeof packageVersion === 'string') {\n const majorVersion = packageVersion.split('.').shift();\n return `${majorVersion}.0.0`;\n }\n }\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` is not installed. Please install it with \\`yarn add expo\\` and try again.`,\n 'MODULE_NOT_FOUND'\n );\n}\n"],"file":"Project.js"} |