sfdx-git-packager
sfdx-git-packager copied to clipboard
Resolved metadata paths does not respect .packageIgnore
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: https://github.com/callawaycloud/sfdx-git-packager/blob/272452d48d244948a766e79973b7a847efe6c3d8/src/commands/git/package.ts#L194-L206
and just continue if the file should be ignored.