Skip to content

Commit dc09b58

Browse files
colinhackspaperclover
authored andcommitted
Add informative message on 'bun create react' (oven-sh#5248)
1 parent 72402c2 commit dc09b58

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/cli.zig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,28 @@ pub const Command = struct {
15101510

15111511
const template_name = positionals[0];
15121512

1513+
// if template_name is "react"
1514+
// print message telling user to use "bun create vite" instead
1515+
if (strings.eqlComptime(template_name, "react")) {
1516+
Output.prettyErrorln(
1517+
\\The "react" template has been deprecated.
1518+
\\It is recommended to use "react-app" or "vite" instead.
1519+
\\
1520+
\\To create a project using Create React App, run
1521+
\\
1522+
\\ bun create react-app
1523+
\\
1524+
\\To create a React project using Vite, run
1525+
\\
1526+
\\ bun create vite
1527+
\\
1528+
\\Then select "React" from the list of frameworks.
1529+
\\
1530+
, .{});
1531+
Global.exit(1);
1532+
return;
1533+
}
1534+
15131535
const use_bunx = !HardcodedNonBunXList.has(template_name) and
15141536
(!strings.containsComptime(template_name, "/") or
15151537
strings.startsWithChar(template_name, '@'));

0 commit comments

Comments
 (0)