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

Resolved metadata paths does not respect .packageIgnore #56

Open
kristofferjansson opened this issue Oct 12, 2021 · 0 comments
Open

Resolved metadata paths does not respect .packageIgnore #56

kristofferjansson opened this issue Oct 12, 2021 · 0 comments

Comments

@kristofferjansson
Copy link

kristofferjansson commented Oct 12, 2021

Hello!

We are using git-sfdc-packager to create our changesets for deploy but got an issue with lwc jest tests getting included in the package. The test setup is similar to lwc-recipes with a __tests__ folder in the lwc components.

In our .packageIgnore we have specified **/__tests__/** but the test folder and its content are still included in the package if a file in that component is changed.

The issue seems to be that the resolved metadata paths for lwc components includes all files and directories in the parent dir of the changed file and these are not checked against the ignore patterns.

One option to solve this would be to check the resolved.path with ignore.ignores() in this loop:

for (const resolved of resolvedMetadata) {
let mdPath = resolved.path;
if (isAbsolute(mdPath)) {
mdPath = relative(this.projectPath, mdPath);
}
const newPath = join(tempDir, mdPath);
await fs.mkdirp(dirname(newPath));
if (typeof resolved.source === 'string') {
await fs.writeFile(newPath, resolved.source);
} else {
await resolved.source(newPath);
}
}

and just continue if the file should be ignored.

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

No branches or pull requests

1 participant