From 188f99b17ac9dec5bf977414fc0bb498e7d98646 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 17 Sep 2024 10:40:35 -0700 Subject: [PATCH] Clarify behaviour of noop init command in 0.76 (#46547) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46547 While testing the 0.76 RCs, it was initially unclear to me that `npx react-native init` was both deprecated and **removed** (performs a noop). Update message for clarity. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D62881266 fbshipit-source-id: b9017e63360c7aee5483d437ce1510be9a14ef42 --- packages/react-native/cli.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/react-native/cli.js b/packages/react-native/cli.js index d9434451be3..0c97d9788b8 100755 --- a/packages/react-native/cli.js +++ b/packages/react-native/cli.js @@ -119,10 +119,13 @@ function warnWithDeprecated() { } console.warn(` -🚨️ The \`init\` command is deprecated. +🚨️ Creating a project using ${chalk.green('npx react-native init')} is deprecated. Please use: -- Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior. -- Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`); + ${chalk.green('npx @react-native-community/cli init')} + +Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')} + +${chalk.green('No changes made.')}`); } function warnWithExplicitDependency(version = '*') {