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.

32 lines 1.25 kB
import fs from 'fs-extra'; import * as path from 'path'; import { execCommandInteractive } from './index.js'; export function getProjectName(projectPath) { try { const appJsonPath = path.join(projectPath, 'app.json'); const appJson = fs.readJsonSync(appJsonPath); return appJson.displayName || appJson.name || 'ExApp'; } catch { // Fallback to package.json if app.json doesn't exist try { const packageJsonPath = path.join(projectPath, 'package.json'); const packageJson = fs.readJsonSync(packageJsonPath); return packageJson.name || 'ExApp'; } catch { return 'ExApp'; // Ultimate fallback } } } export async function renameReactNativeApp(projectPath, newName) { // Use npx to run react-native-rename (it will download automatically if needed) try { execCommandInteractive(`npx react-native-rename "${newName}" --skipGitStatusCheck --bundleID com.${newName.toLowerCase()}`, projectPath); } catch { // Fallback: try without bundleID execCommandInteractive(`npx react-native-rename "${newName}" --skipGitStatusCheck`, projectPath); } } //# sourceMappingURL=project-name.js.map