diff --git a/generateExamples.js b/generateExamples.js index c10462089d..698aecd2a5 100644 --- a/generateExamples.js +++ b/generateExamples.js @@ -66,7 +66,7 @@ function generateTemplateExample(template) { // rewrite the package.json file with the new edit writeFileSync( `./examples/${template}/package.json`, - JSON.stringify(templatePackageJson, null, 2), + `${JSON.stringify(templatePackageJson, null, 2)}\n`, ); // create sandbox.config.json file at the root of template @@ -82,7 +82,7 @@ function generateTemplateExample(template) { }; writeFileSync( `./examples/${template}/sandbox.config.json`, - JSON.stringify(codeSanboxConfig, null, 2), + `${JSON.stringify(codeSanboxConfig, null, 2)}\n`, ); const stackBlitzConfig = { @@ -91,7 +91,7 @@ function generateTemplateExample(template) { }; writeFileSync( `./examples/${template}/.stackblitzrc`, - JSON.stringify(stackBlitzConfig, null, 2), + `${JSON.stringify(stackBlitzConfig, null, 2)}\n`, ); console.log(`Generated example for template ${template}`); diff --git a/packages/create-docusaurus/src/index.ts b/packages/create-docusaurus/src/index.ts index b51683c571..7805942a9c 100755 --- a/packages/create-docusaurus/src/index.ts +++ b/packages/create-docusaurus/src/index.ts @@ -35,7 +35,7 @@ async function updatePkg(pkgPath: string, obj: Record) { const pkg = JSON.parse(content); const newPkg = Object.assign(pkg, obj); - await fs.outputFile(pkgPath, JSON.stringify(newPkg, null, 2)); + await fs.outputFile(pkgPath, `${JSON.stringify(newPkg, null, 2)}\n`); } function readTemplates(templatesDir: string) { diff --git a/packages/docusaurus/src/server/translations/translations.ts b/packages/docusaurus/src/server/translations/translations.ts index cd0d32c282..baa8df084e 100644 --- a/packages/docusaurus/src/server/translations/translations.ts +++ b/packages/docusaurus/src/server/translations/translations.ts @@ -133,7 +133,7 @@ Maybe you should remove them? ${unknownKeys}`; filePath, )}.`; await fs.ensureDir(path.dirname(filePath)); - await fs.writeFile(filePath, JSON.stringify(mergedContent, null, 2)); + await fs.writeFile(filePath, `${JSON.stringify(mergedContent, null, 2)}\n`); } }