Skip to content

Commit

Permalink
chore: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Aug 29, 2024
1 parent 6729257 commit f63be1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
16 changes: 11 additions & 5 deletions src/collections/componentSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,7 @@ export class ComponentSet extends LazyCollection<MetadataComponent> {
addToTypeMap({
typeMap,
type: type.folderContentType ? this.registry.getTypeByName(type.folderContentType) : type,
fullName:
this.registry.getParentType(type.name)?.strategies?.recomposition === 'startEmpty' && fullName.includes('.')
? // they're reassembled like CustomLabels.MyLabel
fullName.split('.')[1]
: fullName,
fullName: constructFullName(this.registry, type, fullName),
destructiveType,
});
});
Expand Down Expand Up @@ -738,6 +734,16 @@ const splitOnFirstDelimiter = (input: string): [string, string] => {
return [input.substring(0, indexOfSplitChar), input.substring(indexOfSplitChar + 1)];
};

const constructFullName = (registry: RegistryAccess, type: MetadataType, fullName: string): string =>
// InFolder types are different (e.g., Report/ReportFolder). ReportFolders are deployed/retrieved as Reports.
// If a ReportFolder is being added append a "/" so the metadata API can identify it as a folder.
type.folderContentType && !fullName.endsWith('/')
? `${fullName}/`
: registry.getParentType(type.name)?.strategies?.recomposition === 'startEmpty' && fullName.includes('.')
? // they're reassembled like CustomLabels.MyLabel
fullName.split('.')[1]
: fullName;

/** side effect: mutates the typeMap property */
const addToTypeMap = ({
typeMap,
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/local/replacements/replacements.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('e2e replacements test', () => {
if (image && !image.dir) {
const content = await image.async('nodebuffer');
// The file size would be much larger if it was corrupted via the string replacement method
expect(content.byteLength).to.equal(1562121);
expect(content.byteLength).to.equal(1_562_121);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Top_Level_Folder</members>
<members>Top_Level_Folder/</members>
<members>Top_Level_Folder/Template_in_folder</members>
<members>unfiled$public/Top_level_email</members>
<name>EmailTemplate</name>
</types>
<types>
<members>TopFolder</members>
<members>TopFolder/ChildFolder</members>
<members>TopFolder/</members>
<members>TopFolder/ChildFolder/</members>
<members>TopFolder/ChildFolder/Report_in_Child_Folder_qz4</members>
<members>TopFolder/Copy_of_Top_level_report_DOj</members>
<members>unfiled$public/Top_level_report_cZJ</members>
Expand Down

2 comments on commit f63be1d

@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: f63be1d Previous: b3cf693 Ratio
eda-componentSetCreate-linux 235 ms 232 ms 1.01
eda-sourceToMdapi-linux 2320 ms 2356 ms 0.98
eda-sourceToZip-linux 1867 ms 1853 ms 1.01
eda-mdapiToSource-linux 2921 ms 2853 ms 1.02
lotsOfClasses-componentSetCreate-linux 429 ms 471 ms 0.91
lotsOfClasses-sourceToMdapi-linux 3675 ms 3643 ms 1.01
lotsOfClasses-sourceToZip-linux 3212 ms 3113 ms 1.03
lotsOfClasses-mdapiToSource-linux 3609 ms 3537 ms 1.02
lotsOfClassesOneDir-componentSetCreate-linux 759 ms 744 ms 1.02
lotsOfClassesOneDir-sourceToMdapi-linux 6444 ms 6428 ms 1.00
lotsOfClassesOneDir-sourceToZip-linux 5580 ms 5459 ms 1.02
lotsOfClassesOneDir-mdapiToSource-linux 6550 ms 6489 ms 1.01

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: f63be1d Previous: b3cf693 Ratio
eda-componentSetCreate-win32 663 ms 730 ms 0.91
eda-sourceToMdapi-win32 4345 ms 4945 ms 0.88
eda-sourceToZip-win32 2981 ms 3343 ms 0.89
eda-mdapiToSource-win32 5546 ms 6534 ms 0.85
lotsOfClasses-componentSetCreate-win32 1165 ms 1366 ms 0.85
lotsOfClasses-sourceToMdapi-win32 7633 ms 8819 ms 0.87
lotsOfClasses-sourceToZip-win32 4936 ms 5662 ms 0.87
lotsOfClasses-mdapiToSource-win32 7854 ms 8192 ms 0.96
lotsOfClassesOneDir-componentSetCreate-win32 2052 ms 2165 ms 0.95
lotsOfClassesOneDir-sourceToMdapi-win32 13634 ms 14099 ms 0.97
lotsOfClassesOneDir-sourceToZip-win32 9247 ms 9684 ms 0.95
lotsOfClassesOneDir-mdapiToSource-win32 14055 ms 14511 ms 0.97

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

Please sign in to comment.