Skip to content

Commit

Permalink
fix: improve metadata detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Nov 4, 2024
1 parent 0d94198 commit e45beb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/collections/componentSetBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class ComponentSetBuilder {
if (resolvedComponents.forceIgnoredPaths) {
// if useFsForceIgnore = true, then we won't be able to resolve a forceignored path,
// which we need to do to get the ignored source component
const resolver = new MetadataResolver(registry, undefined, true);
const resolver = new MetadataResolver(registry, undefined, false);

for (const ignoredPath of resolvedComponents.forceIgnoredPaths ?? []) {
resolver.getComponentsFromPath(ignoredPath).map((ignored) => {
Expand Down
8 changes: 6 additions & 2 deletions src/resolve/metadataResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@ 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;

return fsPath.split(sep).includes(suffixType.directoryName);
};

/**
* If this file should be considered as a metadata file then return the metadata type
Expand Down

0 comments on commit e45beb6

Please sign in to comment.