Skip to content

Commit

Permalink
fix: allow CFTs to be retrieved across packages
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Oct 18, 2023
1 parent 07d8ca9 commit c04f43a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/convert/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ export class StandardWriter extends ComponentWriter {
// queue is empty when that call exits and overall less memory is consumed.
await Promise.all(
chunk.writeInfos.map((info: WriteInfo) => {
// assertion logic: the rootDestination is required in this subclass of ComponentWriter but the super doesn't know that
// the eslint comment should remain until strictMode is fully implemented
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const fullDest = isAbsolute(info.output) ? info.output : join(this.rootDestination as string, info.output);
if (!existsSync(fullDest)) {
for (const ignoredPath of this.forceIgnoredPaths) {
Expand Down
20 changes: 19 additions & 1 deletion src/resolve/adapters/decomposedSourceAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class DecomposedSourceAdapter extends MixedContentSourceAdapter {
const childTypeId = this.type.children?.suffixes?.[metaXml.suffix];
const triggerIsAChild = !!childTypeId;
const strategy = this.type.strategies?.decomposition;

// look at changing this
if (triggerIsAChild && this.type.children && !this.type.children.types[childTypeId].unaddressableWithoutParent) {
if (strategy === DecompositionStrategy.FolderPerType || isResolvingSource) {
let parent = component;
Expand All @@ -115,6 +115,24 @@ export class DecomposedSourceAdapter extends MixedContentSourceAdapter {
this.forceIgnore
);
}
} else if (
triggerIsAChild &&
this.type.children &&
this.type.children.types[childTypeId].unaddressableWithoutParent
) {
let parent = component;
if (!parent) {
parent = new SourceComponent(
{
name: baseName(pathToContent),
type: this.type.children.types[childTypeId],
},
this.tree,
this.forceIgnore
);
}
parent.content = pathToContent;
return parent;
} else if (!component) {
// This is most likely metadata found within a CustomObject folder that is not a
// child type of CustomObject. E.g., Layout, SharingRules, ApexClass.
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
typescript "^4.9.5"
wireit "^0.9.5"

"@salesforce/kit@^3.0.11", "@salesforce/kit@^3.0.13":
"@salesforce/kit@^3.0.13":
version "3.0.13"
resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.0.13.tgz#10b47ad6e0e27c3a9f97eb6a5cdcfffa9ba1f163"
integrity sha512-HLQ5L5bBi0tsMeH5ZHJAhHUpvNUNPQoNJt2O82Jf6C60GGsrlzwzQ5ONAHGNBgKSZ7HLr0UGL5xaA+hE9uOcgw==
Expand Down

2 comments on commit c04f43a

@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: c04f43a Previous: ad51d43 Ratio
eda-componentSetCreate-linux 296 ms 277 ms 1.07
eda-sourceToMdapi-linux 7823 ms 7221 ms 1.08
eda-sourceToZip-linux 5825 ms 5761 ms 1.01
eda-mdapiToSource-linux 4255 ms 4184 ms 1.02
lotsOfClasses-componentSetCreate-linux 572 ms 731 ms 0.78
lotsOfClasses-sourceToMdapi-linux 9604 ms 8879 ms 1.08
lotsOfClasses-sourceToZip-linux 7745 ms 10821 ms 0.72
lotsOfClasses-mdapiToSource-linux 4041 ms 4718 ms 0.86
lotsOfClassesOneDir-componentSetCreate-linux 924 ms 929 ms 0.99
lotsOfClassesOneDir-sourceToMdapi-linux 13692 ms 13455 ms 1.02
lotsOfClassesOneDir-sourceToZip-linux 12519 ms 13283 ms 0.94
lotsOfClassesOneDir-mdapiToSource-linux 8221 ms 8702 ms 0.94

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: c04f43a Previous: ad51d43 Ratio
eda-componentSetCreate-win32 492 ms 798 ms 0.62
eda-sourceToMdapi-win32 9128 ms 12038 ms 0.76
eda-sourceToZip-win32 6599 ms 9344 ms 0.71
eda-mdapiToSource-win32 7833 ms 11652 ms 0.67
lotsOfClasses-componentSetCreate-win32 1068 ms 1923 ms 0.56
lotsOfClasses-sourceToMdapi-win32 14306 ms 21690 ms 0.66
lotsOfClasses-sourceToZip-win32 10102 ms 15685 ms 0.64
lotsOfClasses-mdapiToSource-win32 9708 ms 14553 ms 0.67
lotsOfClassesOneDir-componentSetCreate-win32 1895 ms 3254 ms 0.58
lotsOfClassesOneDir-sourceToMdapi-win32 23324 ms 33222 ms 0.70
lotsOfClassesOneDir-sourceToZip-win32 16326 ms 20061 ms 0.81
lotsOfClassesOneDir-mdapiToSource-win32 16940 ms 27088 ms 0.63

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

Please sign in to comment.