Skip to content

Commit

Permalink
Merge branch 'main' into Saadnajmi-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi authored Nov 13, 2024
2 parents 3d5fee1 + ffd6abb commit fd11308
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions .ado/jobs/test-react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
# We need to set the npm registry here otherwise it won't stick
$(Build.Repository.LocalPath)/.ado/scripts/verdaccio.sh configure
node $(Build.Repository.LocalPath)/packages/react-native-macos-init/bin.js --verbose --version latest --overwrite --prerelease
pod install --project-directory=macos
workingDirectory: $(Agent.BuildDirectory)/testcli
displayName: Apply macOS template (new project)
Expand Down
2 changes: 1 addition & 1 deletion .ado/variables/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ variables:
xcode_friendly_name: 'Xcode 16.0'
xcode_version: '/Applications/Xcode_16.0.app'
ios_version: '18.0'
ios_simulator: 'iPhone 16'
ios_simulator: 'iPhone 16'
2 changes: 0 additions & 2 deletions packages/react-native/local-cli/generate-macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ function generateMacOS (projectDir, name, options) {
{ overwrite: options.overwrite }
);

installPods(options);

printFinishMessage(name);
}

Expand Down
14 changes: 1 addition & 13 deletions packages/react-native/local-cli/generator-macos/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,32 +122,20 @@ function installDependencies(options) {
childProcess.execSync(isYarn ? 'yarn' : 'npm i', execOptions);
}

/**
* @param {{ verbose?: boolean }=} options
*/
function installPods(options) {
const cwd = path.join(process.cwd(), macOSDir);
const quietFlag = options && options.verbose ? '' : '--quiet';
childProcess.execSync(`npx ${quietFlag} pod-install --non-interactive ${quietFlag}`, { stdio: 'inherit', cwd });
}

/**
* @param {string} newProjectName
*/
function printFinishMessage(newProjectName) {
console.log(`
${chalk.blue(`Run instructions for ${chalk.bold('macOS')}`)}:
• pod install --project-directory=macos
• npx react-native run-macos
${chalk.dim('- or -')}
• Open ${xcworkspacePath(newProjectName)} in Xcode or run "xed -b ${macOSDir}"
• yarn start:macos
• Hit the Run button
`);
}

module.exports = {
copyProjectTemplateAndReplace,
installDependencies,
installPods,
printFinishMessage,
};

0 comments on commit fd11308

Please sign in to comment.