Skip to content

Commit 96880e7

Browse files
nsunamishadcn
andauthored
fix: Fix the typo in error messages (component.jsoncomponents.json) (#4977)
* fix(prompt): fix error message, component.json -> components.json * fix(config): fix the error message, component.json -> components.json * chore: changeset --------- Co-authored-by: shadcn <m@shadcn.com>
1 parent 7dfdb02 commit 96880e7

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

.changeset/rare-bugs-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"shadcn": patch
3+
---
4+
5+
fix typo in components.json

packages/shadcn/src/commands/add.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ export const add = new Command()
8282

8383
let { errors, config } = await preFlightAdd(options)
8484

85-
// No component.json file. Prompt the user to run init.
85+
// No components.json file. Prompt the user to run init.
8686
if (errors[ERRORS.MISSING_CONFIG]) {
8787
const { proceed } = await prompts({
8888
type: "confirm",
8989
name: "proceed",
9090
message: `You need to create a ${highlighter.info(
91-
"component.json"
91+
"components.json"
9292
)} file to add components. Proceed?`,
9393
initial: true,
9494
})

packages/shadcn/src/utils/get-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export async function getRawConfig(cwd: string): Promise<RawConfig | null> {
125125

126126
return rawConfigSchema.parse(configResult.config)
127127
} catch (error) {
128-
const componentPath = `${cwd}/component.json`
128+
const componentPath = `${cwd}/components.json`
129129
throw new Error(
130130
`Invalid configuration found in ${highlighter.info(componentPath)}.`
131131
)

0 commit comments

Comments
 (0)