Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply exclude filter to imported paths #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Mar 19, 2024

No description provided.

@Amxx Amxx marked this pull request as draft March 19, 2024 12:15
const { getExposed } = await import('./core');

const inputFiles = Object.fromEntries(compilationJob.getResolvedFiles().map(rf => [rf.sourceName, rf.absolutePath]));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unused

@Amxx Amxx marked this pull request as ready for review March 19, 2024 12:24
@Amxx Amxx requested a review from frangio March 19, 2024 19:20

const include = await getMatcher(hre.config);
const exposed = getExposed(output, include, hre.config);
const include = (sourceName: string) => sourceName.startsWith(sourcesDir) && hre.config.exposed.include.some(p => isMatch(path.relative(sourcesDir, sourceName), p));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the sourceName.startsWith(sourcesDir) is really necessary. The hre.config.exposed.includeis likelly to only allow these path anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const include = (sourceName: string) => sourceName.startsWith(sourcesDir) && hre.config.exposed.include.some(p => isMatch(path.relative(sourcesDir, sourceName), p));
const include = (sourceName: string) => hre.config.exposed.include.some(p => isMatch(path.relative(sourcesDir, sourceName), p));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant