Skip to content

Commit

Permalink
fix: filter types combined with source dir
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Feb 5, 2025
1 parent ac40090 commit 7cec15a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/collections/componentSetBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,22 @@ export class ComponentSetBuilder {
fsPaths,
registry,
});
if (metadata?.excludedEntries) {
if (metadata?.excludedEntries?.length) {
const toRemove = metadata.excludedEntries
.map(entryToTypeAndName(registry))
.flatMap(typeAndNameToMetadataComponents({ directoryPaths: fsPaths, registry }));
componentSet = componentSet.filter((md) => !toRemove.includes(md));
componentSet = componentSet.filter(
(md) =>
!toRemove.some((n) => n.type.name === md.type.name && (n.fullName === md.fullName || n.fullName === '*'))
);
}
if (metadata?.metadataEntries?.length) {
const toKeep = metadata.metadataEntries
.map(entryToTypeAndName(registry))
.flatMap(typeAndNameToMetadataComponents({ directoryPaths: fsPaths, registry }));
componentSet = componentSet.filter((md) =>
toKeep.some((n) => n.type.name === md.type.name && (n.fullName === md.fullName || n.fullName === '*'))
);
}
}

Expand Down Expand Up @@ -135,7 +146,7 @@ export class ComponentSetBuilder {

// Resolve metadata entries with source in package directories, unless we are building a ComponentSet
// from metadata in an org.
if (metadata && !org) {
if (metadata && !org && !sourcepath) {
getLogger().debug(`Building ComponentSet from metadata: ${metadata.metadataEntries.toString()}`);
const directoryPaths = metadata.directoryPaths;
componentSet ??= new ComponentSet(undefined, registry);
Expand Down

2 comments on commit 7cec15a

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 7cec15a Previous: ac40090 Ratio
eda-componentSetCreate-linux 262 ms 230 ms 1.14
eda-sourceToMdapi-linux 2361 ms 2064 ms 1.14
eda-sourceToZip-linux 2249 ms 1892 ms 1.19
eda-mdapiToSource-linux 3014 ms 2683 ms 1.12
lotsOfClasses-componentSetCreate-linux 545 ms 488 ms 1.12
lotsOfClasses-sourceToMdapi-linux 4027 ms 3752 ms 1.07
lotsOfClasses-sourceToZip-linux 3528 ms 3164 ms 1.12
lotsOfClasses-mdapiToSource-linux 3893 ms 3602 ms 1.08
lotsOfClassesOneDir-componentSetCreate-linux 947 ms 828 ms 1.14
lotsOfClassesOneDir-sourceToMdapi-linux 7223 ms 6413 ms 1.13
lotsOfClassesOneDir-sourceToZip-linux 6284 ms 5097 ms 1.23
lotsOfClassesOneDir-mdapiToSource-linux 7181 ms 6355 ms 1.13

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 7cec15a Previous: ac40090 Ratio
eda-componentSetCreate-win32 682 ms 709 ms 0.96
eda-sourceToMdapi-win32 4914 ms 4122 ms 1.19
eda-sourceToZip-win32 3338 ms 3286 ms 1.02
eda-mdapiToSource-win32 6136 ms 5797 ms 1.06
lotsOfClasses-componentSetCreate-win32 1476 ms 1435 ms 1.03
lotsOfClasses-sourceToMdapi-win32 8301 ms 8351 ms 0.99
lotsOfClasses-sourceToZip-win32 5230 ms 4825 ms 1.08
lotsOfClasses-mdapiToSource-win32 8320 ms 7671 ms 1.08
lotsOfClassesOneDir-componentSetCreate-win32 2493 ms 2281 ms 1.09
lotsOfClassesOneDir-sourceToMdapi-win32 14913 ms 13385 ms 1.11
lotsOfClassesOneDir-sourceToZip-win32 8870 ms 8339 ms 1.06
lotsOfClassesOneDir-mdapiToSource-win32 13967 ms 13606 ms 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.