From eda4979997aa01aaee4dd9f57b0dac24183209d9 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Fri, 22 Apr 2022 15:01:16 -0400 Subject: [PATCH] feat: remove online editor configs (#3175) --- packages/create-astro/src/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index 2286c13f5..9c102c37e 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -36,6 +36,7 @@ const { version } = JSON.parse( fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8') ); +const FILES_TO_REMOVE = ['.stackblitzrc', 'sandbox.config.json']; // some files are only needed for online editors when using astro.new. Remove for create-astro installs. const POSTPROCESS_FILES = ['package.json', 'astro.config.mjs', 'CHANGELOG.md']; // some files need processing after copying. export async function main() { @@ -179,8 +180,12 @@ export async function main() { } // Post-process in parallel - await Promise.all( - POSTPROCESS_FILES.map(async (file) => { + await Promise.all([ + ...FILES_TO_REMOVE.map(async (file) => { + const fileLoc = path.resolve(path.join(cwd, file)); + return fs.promises.rm(fileLoc); + }), + ...POSTPROCESS_FILES.map(async (file) => { const fileLoc = path.resolve(path.join(cwd, file)); switch (file) { @@ -232,8 +237,8 @@ export async function main() { break; } } - }) - ); + }), + ]); // Inject framework components into starter template if (selectedTemplate?.value === 'starter') {