UNPKG

@reuvenorg/react-native-boilerplate-ultimate

Version:

A powerful CLI tool for creating React Native projects with modular architecture. Generate, manage, and scaffold React Native applications with pre-built modules and best practices.

48 lines 1.54 kB
import fs from 'fs-extra'; import * as path from 'path'; import { getProjectName } from './project-name.js'; export function getProjectInfo(projectPath) { // DRY: Reuse existing getProjectName utility const name = getProjectName(projectPath); // Simple app.json read for displayName let displayName = name; try { const appJsonPath = path.join(projectPath, 'app.json'); const appJson = fs.readJsonSync(appJsonPath); displayName = appJson.displayName || appJson.name || name; } catch { // Fallback to name if app.json read fails displayName = name; } // Simple iOS scheme detection let iosScheme = name; try { const iosDir = path.join(projectPath, 'ios'); if (fs.existsSync(iosDir)) { const items = fs.readdirSync(iosDir); // Find first valid folder that's not system folders const validFolder = items.find(item => { if (['Pods', 'build', 'DerivedData'].includes(item)) return false; try { return fs.statSync(path.join(iosDir, item)).isDirectory(); } catch { return false; } }); iosScheme = validFolder || name; } } catch { // Fallback to name if iOS detection fails iosScheme = name; } return { name, displayName, iosScheme, }; } //# sourceMappingURL=project-info.js.map