Skip to content

Commit

Permalink
Log normalized paths and no moduleId found
Browse files Browse the repository at this point in the history
  • Loading branch information
ethriel3695 committed Jun 6, 2023
1 parent 64bb9a6 commit 56aadf1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin-src/lib/getDependentStoryFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ export async function getDependentStoryFiles(
const CSF_REGEX = /\s+sync\s+/g;
const URL_PARAM_REGEX = /(\?.*)/g;
const newPath = normalizePath(posixPath, rootPath, baseDir);
if (
(posixPath?.includes('generated-stories-entry') || posixPath?.includes('preview')) &&
!posixPath?.includes('node_modules') &&
!posixPath?.includes('webpack')
) {
ctx.log.debug('Normalizing path:', posixPath, '=>', newPath);
}
// Trim query params such as `?ngResource` which are sometimes present
return URL_PARAM_REGEX.test(newPath) && !CSF_REGEX.test(newPath)
? newPath.replace(URL_PARAM_REGEX, '')
Expand Down Expand Up @@ -236,7 +243,7 @@ export async function getDependentStoryFiles(

ctx.log.debug('Trace file...');
ctx.log.debug(name);
ctx.log.debug(id);
ctx.log.debug(id || 'no moduleId found for this file');

if (!id || !reasonsById.get(id) || checkedIds[id]) return;
// Queue this id for tracing
Expand Down

0 comments on commit 56aadf1

Please sign in to comment.