From e3e3f43d3805d8771407682fb0542f939a1d24b9 Mon Sep 17 00:00:00 2001 From: Manfred Steyer Date: Thu, 29 Aug 2024 21:16:52 +0200 Subject: [PATCH] fix(core): `createDump` now takes an optional entry point --- packages/core/src/lib/cli/export-data.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/core/src/lib/cli/export-data.ts b/packages/core/src/lib/cli/export-data.ts index df2075b..3cfe36d 100644 --- a/packages/core/src/lib/cli/export-data.ts +++ b/packages/core/src/lib/cli/export-data.ts @@ -31,8 +31,9 @@ function calcOrGetTags(modulePath: FsPath, projectInfo: ProjectInfo): string[] { return tags; } -export function createDump(projectInfo: ProjectInfo) { +export function createDump(entry?: string) { const fs = getFs(); + const projectInfo = getEntryFromCliOrConfig(entry); const relative = (path: FsPath) => fs.relativeTo(projectInfo.rootDir, path); const data: Record = {}; @@ -48,9 +49,6 @@ export function createDump(projectInfo: ProjectInfo) { } export function exportData(...args: string[]): void { - const projectInfo = getEntryFromCliOrConfig(args[0]); - - const data: Record = createDump(projectInfo); - + const data: Record = createDump(args[0]); cli.log(JSON.stringify(data, null, ' ')); -} \ No newline at end of file +}