Skip to content

Commit

Permalink
chore: resolve a TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Apr 29, 2024
1 parent 16860c1 commit 5a6e5fa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/resolve/sourceComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { join, dirname } from 'node:path';
import { Messages, SfError } from '@salesforce/core';
import { SfError } from '@salesforce/core/sfError';
import { Messages } from '@salesforce/core/messages';
import { Lifecycle } from '@salesforce/core/lifecycle';

import { XMLParser, XMLValidator } from 'fast-xml-parser';
import { get, getString, JsonMap } from '@salesforce/ts-types';
import { ensureArray } from '@salesforce/kit';
Expand Down Expand Up @@ -310,9 +313,13 @@ export class SourceComponent implements MetadataComponent {
const childXml = parseMetadataXml(fsPath);
const fileIsRootXml = childXml?.suffix === this.type.suffix || childXml?.suffix === this.type.legacySuffix;
if (childXml && !fileIsRootXml && this.type.children && childXml.suffix) {
// TODO: Log warning if missing child type definition
const childTypeId = this.type.children?.suffixes[childXml.suffix];
const childType = this.type.children.types[childTypeId];
if (!childTypeId || !childType) {
void Lifecycle.getInstance().emitWarning(
`${fsPath}: Expected a child type for ${childXml.suffix} in ${this.type.name} but none was found.`
);
}
const childComponent = new SourceComponent(
{
name: childType?.suffix ? baseWithoutSuffixes(fsPath, childType) : baseName(fsPath),
Expand Down

2 comments on commit 5a6e5fa

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 5a6e5fa Previous: 5ed405d Ratio
eda-componentSetCreate-linux 195 ms 189 ms 1.03
eda-sourceToMdapi-linux 1957 ms 1922 ms 1.02
eda-sourceToZip-linux 1406 ms 1380 ms 1.02
eda-mdapiToSource-linux 3225 ms 2751 ms 1.17
lotsOfClasses-componentSetCreate-linux 393 ms 363 ms 1.08
lotsOfClasses-sourceToMdapi-linux 3586 ms 3611 ms 0.99
lotsOfClasses-sourceToZip-linux 3060 ms 3012 ms 1.02
lotsOfClasses-mdapiToSource-linux 3515 ms 3435 ms 1.02
lotsOfClassesOneDir-componentSetCreate-linux 622 ms 625 ms 1.00
lotsOfClassesOneDir-sourceToMdapi-linux 6581 ms 6445 ms 1.02
lotsOfClassesOneDir-sourceToZip-linux 5691 ms 5494 ms 1.04
lotsOfClassesOneDir-mdapiToSource-linux 6280 ms 6156 ms 1.02

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

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 5a6e5fa Previous: 5ed405d Ratio
eda-componentSetCreate-win32 416 ms 375 ms 1.11
eda-sourceToMdapi-win32 3811 ms 3470 ms 1.10
eda-sourceToZip-win32 2293 ms 2151 ms 1.07
eda-mdapiToSource-win32 6382 ms 5707 ms 1.12
lotsOfClasses-componentSetCreate-win32 927 ms 861 ms 1.08
lotsOfClasses-sourceToMdapi-win32 8281 ms 7656 ms 1.08
lotsOfClasses-sourceToZip-win32 4993 ms 4790 ms 1.04
lotsOfClasses-mdapiToSource-win32 7524 ms 7697 ms 0.98
lotsOfClassesOneDir-componentSetCreate-win32 1507 ms 1498 ms 1.01
lotsOfClassesOneDir-sourceToMdapi-win32 13856 ms 13786 ms 1.01
lotsOfClassesOneDir-sourceToZip-win32 8883 ms 8746 ms 1.02
lotsOfClassesOneDir-mdapiToSource-win32 13673 ms 13582 ms 1.01

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

Please sign in to comment.