From fb7c68324fe38ffbbd4978b24e931dccc90a9a4e Mon Sep 17 00:00:00 2001 From: Felix Kaechele Date: Tue, 12 Nov 2024 13:04:40 -0500 Subject: [PATCH] fix(next): add newline to end of components.json (#1479) Co-authored-by: CokaKoala <31664583+AdrianGonz97@users.noreply.github.com> --- .changeset/young-wombats-prove.md | 5 +++++ packages/cli/src/utils/get-config.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/young-wombats-prove.md diff --git a/.changeset/young-wombats-prove.md b/.changeset/young-wombats-prove.md new file mode 100644 index 000000000..16745aad4 --- /dev/null +++ b/.changeset/young-wombats-prove.md @@ -0,0 +1,5 @@ +--- +"shadcn-svelte": patch +--- + +fix(next): add newline to end of `components.json` diff --git a/packages/cli/src/utils/get-config.ts b/packages/cli/src/utils/get-config.ts index 89235d2da..07ce90dd4 100644 --- a/packages/cli/src/utils/get-config.ts +++ b/packages/cli/src/utils/get-config.ts @@ -176,5 +176,5 @@ export async function getRawConfig(cwd: string): Promise { export function writeConfig(cwd: string, config: any): void { const targetPath = path.resolve(cwd, "components.json"); const conf = v.parse(rawConfigSchema, config); // inefficient, but it'll do - fs.writeFileSync(targetPath, JSON.stringify(conf, null, "\t"), "utf8"); + fs.writeFileSync(targetPath, JSON.stringify(conf, null, "\t") + "\n", "utf8"); }