From a01f7b7aae1dbab3c0e5c47e436995497f54b36c Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Thu, 14 Sep 2023 02:08:59 +0200 Subject: [PATCH] fix ci --- packages/rsc-builder/buildRsc.ts | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/packages/rsc-builder/buildRsc.ts b/packages/rsc-builder/buildRsc.ts index 3a4616d63a967f..59705255ed8dcd 100644 --- a/packages/rsc-builder/buildRsc.ts +++ b/packages/rsc-builder/buildRsc.ts @@ -73,21 +73,6 @@ async function processFile( await fse.writeFile(filename, newContents); } -function getIndexFile(directory: string) { - const items = fse.readdirSync(directory); - - const indexFile = items.reduce((prev, curr) => { - if (!/^index.(js|ts)/.test(curr)) { - return prev; - } - return curr; - }, ''); - - return { - filename: path.join(directory, indexFile), - }; -} - async function findAll( directories: string[], grep: RegExp | null, @@ -124,24 +109,11 @@ async function run(argv: yargs.ArgumentsCamelCase) { ]; } - const indexFile = getIndexFile(projectSrc); - - try { - processFile(indexFile.filename); - } catch (error: any) { - error.message = `${path.relative(process.cwd(), indexFile.filename)}: ${error.message}`; - throw error; - } - const components = await findAll(directories, grep, findComponents); components.forEach(async (component) => { try { processFile(component.filename); - - if (component.indexFilename) { - processFile(component.indexFilename); - } } catch (error: any) { error.message = `${path.relative(process.cwd(), component.filename)}: ${error.message}`; throw error; @@ -153,10 +125,6 @@ async function run(argv: yargs.ArgumentsCamelCase) { hooks.forEach(async (hook) => { try { processFile(hook.filename); - - if (hook.indexFilename) { - processFile(hook.indexFilename); - } } catch (error: any) { error.message = `${path.relative(process.cwd(), hook.filename)}: ${error.message}`; throw error;