Skip to content

Commit 5b9f5be

Browse files
authored
update schema option (#73)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Added “Data Source” option to the interactive add flow. - Added “React Email” option to the main add flow. - Improved prompts: “Schema” option now appears only when at least one data source exists. - Chores - Updated component installation behavior to no longer force-overwrite existing files when adding UI components. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents eadc93b + 392b9e3 commit 5b9f5be

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

packages/cli/src/cli/add/index.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,24 @@ const runAddFromRegistry = async (options?: { noInstall?: boolean }) => {
5151
...(categories.includes("page")
5252
? [{ label: "Page", value: "page" }]
5353
: []),
54-
{
55-
label: "Schema",
56-
value: "schema",
57-
hint: "load data from a new table or layout from an existing data source",
58-
},
5954

60-
...(settings.appType === "browser"
55+
// only show schema option if there is at least one data source
56+
...(settings.dataSources.length > 0
6157
? [
6258
{
63-
label: "Data Source",
64-
value: "data",
65-
hint: "to connect to a new database or FileMaker file",
59+
label: "Schema",
60+
value: "schema",
61+
hint: "load data from a new table or layout from an existing data source",
6662
},
6763
]
6864
: []),
6965

66+
{
67+
label: "Data Source",
68+
value: "data",
69+
hint: "to connect to a new database or FileMaker file",
70+
},
71+
7072
// show the rest of the categories
7173
...categories
7274
.filter((category) => category !== "page")
@@ -135,21 +137,22 @@ export const runAdd = async (
135137
message: "What do you want to add to your project?",
136138
options: [
137139
{ label: "Page", value: "page" },
138-
{
139-
label: "Schema",
140-
value: "schema",
141-
hint: "load data from a new table or layout from an existing data source",
142-
},
143-
{ label: "React Email", value: "react-email" },
144-
...(settings.appType === "browser"
140+
// only show schema option if there is at least one data source
141+
...(settings.dataSources.length > 0
145142
? [
146143
{
147-
label: "Data Source",
148-
value: "data",
149-
hint: "to connect to a new database or FileMaker file",
144+
label: "Schema",
145+
value: "schema",
146+
hint: "load data from a new table or layout from an existing data source",
150147
},
151148
]
152149
: []),
150+
{ label: "React Email", value: "react-email" },
151+
{
152+
label: "Data Source",
153+
value: "data",
154+
hint: "to connect to a new database or FileMaker file",
155+
},
153156
...(settings.auth.type === "none" && settings.appType === "browser"
154157
? [{ label: "Auth", value: "auth" }]
155158
: []),

packages/cli/src/helpers/shadcn-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function shadcnInstall(
1313
friendlyComponentName?: string
1414
) {
1515
const componentsArray = Array.isArray(components) ? components : [components];
16-
const command = ["shadcn@latest", "add", ...componentsArray, "--overwrite"];
16+
const command = ["shadcn@latest", "add", ...componentsArray];
1717
// Use execa to run the shadcn add command directly
1818

1919
try {

0 commit comments

Comments
 (0)