aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-09-13 01:48:42 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-13 01:48:42 -0700
commita18e3ff4514d311657077472d06ffdfb829a2d51 (patch)
tree3aa06cd0d391fba8d331c49d06e70ed2bccca58d
parenteeb790a2f17337546c5749d713c0be31f5181d02 (diff)
downloadbun-a18e3ff4514d311657077472d06ffdfb829a2d51.tar.gz
bun-a18e3ff4514d311657077472d06ffdfb829a2d51.tar.zst
bun-a18e3ff4514d311657077472d06ffdfb829a2d51.zip
Add informative message on 'bun create react' (#5248)
-rw-r--r--src/cli.zig22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cli.zig b/src/cli.zig
index 303063574..889da9320 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -1510,6 +1510,28 @@ pub const Command = struct {
const template_name = positionals[0];
+ // if template_name is "react"
+ // print message telling user to use "bun create vite" instead
+ if (strings.eqlComptime(template_name, "react")) {
+ Output.prettyErrorln(
+ \\The "react" template has been deprecated.
+ \\It is recommended to use "react-app" or "vite" instead.
+ \\
+ \\To create a project using Create React App, run
+ \\
+ \\ bun create react-app
+ \\
+ \\To create a React project using Vite, run
+ \\
+ \\ bun create vite
+ \\
+ \\Then select "React" from the list of frameworks.
+ \\
+ , .{});
+ Global.exit(1);
+ return;
+ }
+
const use_bunx = !HardcodedNonBunXList.has(template_name) and
(!strings.containsComptime(template_name, "/") or
strings.startsWithChar(template_name, '@'));