-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix(resolver): ignore non-component XML files in project #1452
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -369,8 +369,21 @@ const resolveType = | |||
*/ | ||||
const parseAsContentMetadataXml = | ||||
(registry: RegistryAccess) => | ||||
(fsPath: string): boolean => | ||||
Boolean(registry.getTypeBySuffix(extName(fsPath))); | ||||
(fsPath: string): boolean => { | ||||
const suffixType = registry.getTypeBySuffix(extName(fsPath)); | ||||
if (!suffixType) return false; | ||||
|
||||
const matchesSuffixType = fsPath.split(sep).includes(suffixType.directoryName); | ||||
if (matchesSuffixType) return matchesSuffixType; | ||||
|
||||
// it might be a type that requires strict parent folder name. | ||||
const strictFolderSuffixType = registry | ||||
.getStrictFolderTypes() | ||||
.find((l) => l.suffix === suffixType.suffix && l.directoryName && l.name !== suffixType.name); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if snapshot tests caught an issue with
|
||||
if (!strictFolderSuffixType) return false; | ||||
|
||||
return fsPath.split(sep).includes(strictFolderSuffixType.directoryName); | ||||
}; | ||||
|
||||
/** | ||||
* If this file should be considered as a metadata file then return the metadata type | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for an XML file,
suffixType
would return theemailservicesfunction
entry:source-deploy-retrieve/src/registry/metadataRegistry.json
Line 522 in 9d94840