amis-rpc-design/node_modules/@react-native-community/cli-doctor/build/commands/doctor.js.map

1 line
14 KiB
Plaintext
Raw Normal View History

2023-10-07 19:42:30 +08:00
{"version":3,"names":["printCategory","label","key","logger","log","chalk","dim","printVersions","version","versions","versionRange","versionsToShow","Array","isArray","join","logMessage","red","green","printIssue","needsToBeFixed","isRequired","description","symbol","yellow","descriptionToShow","printOverallStats","errors","warnings","bold","getAutomaticFixForPlatform","healthcheck","platform","win32AutomaticFix","runAutomaticFix","darwinAutomaticFix","linuxAutomaticFix","doctorCommand","_","options","config","loader","getLoader","start","environmentInfo","getEnvironmentInfo","iterateOverHealthChecks","healthchecks","Promise","all","map","visible","getDiagnostics","isWarning","Boolean","process","type","HEALTHCHECK_TYPES","WARNING","ERROR","undefined","filter","removeFixedCategories","categories","category","some","iterateOverCategories","healthchecksPerCategory","Object","values","getHealthchecks","stop","stats","forEach","issueCategory","fix","automaticFixLevel","AUTOMATIC_FIX_LEVELS","ALL_ISSUES","removeKeyPressListener","stdin","setRawMode","removeAllListeners","onKeyPress","KEYS","EXIT","exit","FIX_ALL_ISSUES","FIX_ERRORS","FIX_WARNINGS","includes","ERRORS","WARNINGS","err","printFixOptions","func","detached","name"],"sources":["../../src/commands/doctor.ts"],"sourcesContent":["import chalk from 'chalk';\nimport {logger, getLoader} from '@react-native-community/cli-tools';\nimport {getHealthchecks, HEALTHCHECK_TYPES} from '../tools/healthchecks';\nimport printFixOptions, {KEYS} from '../tools/printFixOptions';\nimport runAutomaticFix, {AUTOMATIC_FIX_LEVELS} from '../tools/runAutomaticFix';\nimport {DetachedCommandFunction} from '@react-native-community/cli-types';\nimport {\n HealthCheckCategoryResult,\n HealthCheckInterface,\n HealthCheckCategory,\n HealthCheckResult,\n} from '../types';\nimport getEnvironmentInfo from '../tools/envinfo';\nimport {logMessage} from '../tools/healthchecks/common';\n\nconst printCategory = ({label, key}: {label: string; key: number}) => {\n if (key > 0) {\n logger.log();\n }\n\n logger.log(chalk.dim(label));\n};\n\nconst printVersions = ({\n version,\n versions,\n versionRange,\n}: {\n version?: 'Not Found' | string;\n versions?: [string] | string;\n versionRange: string;\n}) => {\n if (versions) {\n const versionsToShow = Array.isArray(versions)\n ? versions.join(', ')\n : 'N/A';\n\n logMessage(`- Versions found: ${chalk.red(versionsToShow)}`);\n logMessage(`- Version supported: ${chalk.green(versionRange)}`);\n\n return;\n }\n\n const versionsToShow = version && version !== 'Not Found' ? version : 'N/A';\n\n logMessage(`- Version found: ${chalk.red(versionsToShow)}`);\n logMessage(`- Version supported: ${chalk.green(versionRange)}`);\n\n return;\n};\n\nconst printIssue = ({\n label,\n needsToBeFixed,\n version,\n versions,\n versionRange,\n isRequired,\n description,\n}: HealthCheckResult) => {\n const symbol = needsToBeFixed\n ? isRequired\n ? chalk.red('✖')\n : chalk.yellow('●')\n : chalk.green('✓');\n\n const descriptionToShow = description ? ` - ${description}` : '';\n\n logger.log(` ${symbol} ${label}${descriptionToShow}`);\n\n if (needsToBeFixed && versionRange) {\n return printVersions({version, versions, versionRange});\n }\n};\n\nconst printOverallStats = ({\n errors,\n warnings,\n}: {\n errors: number;\n warnings: number;\n}) => {\n logger.log(`\\n${chalk.bold('Errors:')} ${errors}`);\n logger.log(`${chalk.bold('Warnings:')} ${warnings}`);\n};\n\ntype FlagsT = {\n fix: boolean | void;\n contributor: boolean | void;\n};\n\n/**\n * Given a `healthcheck` and a `platform`, returns the specific fix for\n * it or the fallback one if there is not one (`runAutomaticFix`).\n */\nconst getAutomaticFixForPlatform = (\n healthcheck: HealthCheckInterface,\n platform: NodeJS.Platform,\n) => {\n switch (platform) {\n case 'win32':\n return healthcheck.win32AutomaticFix || healthcheck.runAutomaticFix;\n case 'darwin':\n return healthcheck.darwinAutomaticFix || healthcheck.runAut