1 line
2.9 KiB
Plaintext
1 line
2.9 KiB
Plaintext
{"version":3,"names":["getEnvironmentInfo","json","options","showNotFound","packages","outOfTreePlatforms","darwin","win32","outOfTreePlatformPackage","platform","push","info","envinfo","run","System","Binaries","IDEs","Managers","Languages","SDKs","npmPackages","npmGlobalPackages","JSON","parse","trim"],"sources":["../../src/tools/envinfo.ts"],"sourcesContent":["import envinfo from 'envinfo';\nimport {platform} from 'os';\nimport {EnvironmentInfo} from '../types';\n\n/**\n * Returns information about the running system.\n * If `json === true`, or no options are passed,\n * the return type will be an `EnvironmentInfo`.\n * If set to `false`, it will be a `string`.\n */\nasync function getEnvironmentInfo(): Promise<EnvironmentInfo>;\nasync function getEnvironmentInfo(json: true): Promise<EnvironmentInfo>;\nasync function getEnvironmentInfo(json: false): Promise<string>;\nasync function getEnvironmentInfo(\n json = true,\n): Promise<string | EnvironmentInfo> {\n const options = {json, showNotFound: true};\n\n const packages = ['react', 'react-native', '@react-native-community/cli'];\n\n const outOfTreePlatforms: {[key: string]: string} = {\n darwin: 'react-native-macos',\n win32: 'react-native-windows',\n };\n\n const outOfTreePlatformPackage = outOfTreePlatforms[platform()];\n if (outOfTreePlatformPackage) {\n packages.push(outOfTreePlatformPackage);\n }\n\n const info = (await envinfo.run(\n {\n System: ['OS', 'CPU', 'Memory', 'Shell'],\n Binaries: ['Node', 'Yarn', 'npm', 'Watchman'],\n IDEs: ['Xcode', 'Android Studio', 'Visual Studio'],\n Managers: ['CocoaPods'],\n Languages: ['Java', 'Ruby'],\n SDKs: ['iOS SDK', 'Android SDK', 'Windows SDK'],\n npmPackages: packages,\n npmGlobalPackages: ['*react-native*'],\n },\n options,\n )) as string;\n\n if (options.json) {\n return JSON.parse(info);\n }\n\n return info.trim();\n}\n\nexport default getEnvironmentInfo;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4B;AAY5B,eAAeA,kBAA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