Skip to content

Commit aea34f0

Browse files
committed
fix: build issues
1 parent a08a098 commit aea34f0

File tree

4 files changed

+93
-100
lines changed

4 files changed

+93
-100
lines changed

src/migration/related/ApexMigration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TokenUpdater,
1414
} from '../../utils/apex/parser/apexparser';
1515
import { sfProject } from '../../utils/sfcli/project/sfProject';
16-
import { fileutil, File } from '../../utils/file/fileUtil';
16+
import { fileUtil, File } from '../../utils/file/fileUtil';
1717
import { Logger } from '../../utils/logger';
1818
import { ApexAssessmentInfo } from '../../utils';
1919
import { FileDiffUtil } from '../../utils/lwcparser/fileutils/FileDiffUtil';
@@ -71,7 +71,7 @@ export class ApexMigration extends BaseRelatedObjectMigration {
7171
public processApexFiles(dir: string): ApexAssessmentInfo[] {
7272
dir += APEX_CLASS_PATH;
7373
let files: File[] = [];
74-
files = fileutil.readFilesSync(dir);
74+
files = fileUtil.readFilesSync(dir);
7575
const fileAssessmentInfo: ApexAssessmentInfo[] = [];
7676
for (const file of files) {
7777
if (file.ext !== '.cls') continue;

src/migration/related/LwcMigration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-shadow */
22
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
33
import * as shell from 'shelljs';
4-
import { fileutil, File } from '../../utils/file/fileUtil';
4+
import { fileUtil, File } from '../../utils/file/fileUtil';
55
import { sfProject } from '../../utils/sfcli/project/sfProject';
66
import { Logger } from '../../utils/logger';
77
import { FileProcessorFactory } from '../../utils/lwcparser/fileutils/FileProcessorFactory';
@@ -51,7 +51,7 @@ export class LwcMigration extends BaseRelatedObjectMigration {
5151
dir += LWC_DIR_PATH;
5252
let filesMap: Map<string, File[]>;
5353
try {
54-
filesMap = fileutil.readAndProcessFiles(dir, 'OmniScript Auto-generated');
54+
filesMap = fileUtil.readAndProcessFiles(dir, 'OmniScript Auto-generated');
5555
} catch (error) {
5656
Logger.logger.error('Error in reading files', error);
5757
}

src/utils/resultsbuilder/assessmentReporter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ReportHeaderFormat } from '../reportGenerator/reportInterfaces';
77
import { OmnistudioOrgDetails } from '../orgUtils';
88
import { pushAssestUtilites } from '../file/fileUtil';
99
import { OSAssessmentReporter } from './OSAssessmentReporter';
10-
import { LWCAssessmentReporter } from './LWCAssessmentReporter';
1110
import { ApexAssessmentReporter } from './ApexAssessmentReporter';
1211
import { IPAssessmentReporter } from './IPAssessmentReporter';
1312
import { DRAssessmentReporter } from './DRAssessmentReporter';

src/utils/resultsbuilder/index.ts

Lines changed: 89 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import fs from 'fs';
22
import open from 'open';
33
import { Logger } from '@salesforce/core';
44
import { pushAssestUtilites } from '../file/fileUtil';
5-
import {
6-
ApexAssessmentInfo,
7-
LWCAssessmentInfo,
8-
MigratedObject,
9-
MigratedRecordInfo,
10-
RelatedObjectAssesmentInfo,
11-
} from '../interfaces';
5+
import { ApexAssessmentInfo, MigratedObject, MigratedRecordInfo, RelatedObjectAssesmentInfo } from '../interfaces';
126
import { generateHtmlTable } from '../reportGenerator/reportGenerator';
137
import {
148
ComponentDetail,
@@ -27,7 +21,7 @@ const omniScriptConstants = {
2721
title: 'OmniScripts / IP Migration Result',
2822
};
2923
const apexConstants = { componentName: 'apex', title: 'Apex Classes Migration Result' };
30-
const lwcConstants = { componentName: 'lwc', title: 'LWC Components Migration Result' };
24+
// const lwcConstants = { componentName: 'lwc', title: 'LWC Components Migration Result' };
3125
const migrationResultCSSfileName = 'reportGenerator.css';
3226
const migrationReportHTMLfileName = 'migration_report.html';
3327

@@ -442,94 +436,94 @@ export class ResultsBuilder {
442436
fs.writeFileSync(resultsDir + '/' + apexConstants.componentName + '.html', html);
443437
}
444438

445-
private static generateReportForLwcResult(
446-
result: LWCAssessmentInfo[],
447-
instanceUrl: string,
448-
orgDetails: OmnistudioOrgDetails
449-
): void {
450-
const headerColumns: HeaderColumn[] = [
451-
{
452-
label: 'Component Name',
453-
key: 'name',
454-
},
455-
{
456-
label: 'File Reference',
457-
key: 'path',
458-
},
459-
{
460-
label: 'Diff',
461-
key: 'diff',
462-
},
463-
{
464-
label: 'Errors',
465-
key: 'errors',
466-
},
467-
];
439+
// private static generateReportForLwcResult(
440+
// result: LWCAssessmentInfo[],
441+
// instanceUrl: string,
442+
// orgDetails: OmnistudioOrgDetails
443+
// ): void {
444+
// const headerColumns: HeaderColumn[] = [
445+
// {
446+
// label: 'Component Name',
447+
// key: 'name',
448+
// },
449+
// {
450+
// label: 'File Reference',
451+
// key: 'path',
452+
// },
453+
// {
454+
// label: 'Diff',
455+
// key: 'diff',
456+
// },
457+
// {
458+
// label: 'Errors',
459+
// key: 'errors',
460+
// },
461+
// ];
468462

469-
const columns: Array<TableColumn<LWCAssessmentInfo>> = [
470-
{
471-
key: 'name',
472-
cell: (record: LWCAssessmentInfo): string => record.name,
473-
filterValue: (record: LWCAssessmentInfo): string => record.name,
474-
title: (record: LWCAssessmentInfo): string => record.name,
475-
skip: (record: LWCAssessmentInfo, index: number): boolean =>
476-
!(record.changeInfos && record.changeInfos.length > 0 && index === 0),
477-
rowspan: (record: LWCAssessmentInfo): number =>
478-
record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
479-
},
480-
{
481-
key: 'path',
482-
filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
483-
title: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
484-
cell: (record: LWCAssessmentInfo, index: number): string =>
485-
record.changeInfos[index].path
486-
? `<a href="${instanceUrl}/${record.changeInfos[index].path}">${record.changeInfos[index].name}</a>`
487-
: '',
488-
},
489-
{
490-
key: 'diff',
491-
cell: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
492-
filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
493-
},
494-
{
495-
key: 'errors',
496-
cell: (record: LWCAssessmentInfo): string => (record.errors ? record.errors.join(', ') : ''),
497-
filterValue: (record: LWCAssessmentInfo): string =>
498-
record.errors && record.errors.length > 0 ? 'Has Errors' : 'Has No Errors',
499-
rowspan: (record: LWCAssessmentInfo): number =>
500-
record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
501-
skip: (record: LWCAssessmentInfo, index: number): boolean =>
502-
!(record.changeInfos && record.changeInfos.length > 0 && index === 0),
503-
},
504-
];
463+
// const columns: Array<TableColumn<LWCAssessmentInfo>> = [
464+
// {
465+
// key: 'name',
466+
// cell: (record: LWCAssessmentInfo): string => record.name,
467+
// filterValue: (record: LWCAssessmentInfo): string => record.name,
468+
// title: (record: LWCAssessmentInfo): string => record.name,
469+
// skip: (record: LWCAssessmentInfo, index: number): boolean =>
470+
// !(record.changeInfos && record.changeInfos.length > 0 && index === 0),
471+
// rowspan: (record: LWCAssessmentInfo): number =>
472+
// record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
473+
// },
474+
// {
475+
// key: 'path',
476+
// filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
477+
// title: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].path,
478+
// cell: (record: LWCAssessmentInfo, index: number): string =>
479+
// record.changeInfos[index].path
480+
// ? `<a href="${instanceUrl}/${record.changeInfos[index].path}">${record.changeInfos[index].name}</a>`
481+
// : '',
482+
// },
483+
// {
484+
// key: 'diff',
485+
// cell: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
486+
// filterValue: (record: LWCAssessmentInfo, index: number): string => record.changeInfos[index].diff,
487+
// },
488+
// {
489+
// key: 'errors',
490+
// cell: (record: LWCAssessmentInfo): string => (record.errors ? record.errors.join(', ') : ''),
491+
// filterValue: (record: LWCAssessmentInfo): string =>
492+
// record.errors && record.errors.length > 0 ? 'Has Errors' : 'Has No Errors',
493+
// rowspan: (record: LWCAssessmentInfo): number =>
494+
// record.changeInfos && record.changeInfos.length > 0 ? record.changeInfos.length : 1,
495+
// skip: (record: LWCAssessmentInfo, index: number): boolean =>
496+
// !(record.changeInfos && record.changeInfos.length > 0 && index === 0),
497+
// },
498+
// ];
505499

506-
const filters: Filter[] = [
507-
{
508-
label: 'Errors',
509-
key: 'errors',
510-
filterOptions: ['Has Errors', 'Has No Errors'],
511-
},
512-
];
500+
// const filters: Filter[] = [
501+
// {
502+
// label: 'Errors',
503+
// key: 'errors',
504+
// filterOptions: ['Has Errors', 'Has No Errors'],
505+
// },
506+
// ];
513507

514-
const html = `<html>
515-
${this.createHeadWithScript(`${lwcConstants.title} Migration Report`)}
516-
<body>
517-
<div class="slds-m-around_medium">
518-
<div class="slds-text-heading_large">${lwcConstants.title}</div>
519-
${generateHtmlTable(
520-
headerColumns,
521-
columns,
522-
result,
523-
this.formattedOrgDetails(orgDetails),
524-
filters,
525-
undefined,
526-
'',
527-
'changeInfos',
528-
false
529-
)}
530-
</div>
531-
</body>
532-
</html>`;
533-
fs.writeFileSync(resultsDir + '/' + lwcConstants.componentName + '.html', html);
534-
}
508+
// const html = `<html>
509+
// ${this.createHeadWithScript(`${lwcConstants.title} Migration Report`)}
510+
// <body>
511+
// <div class="slds-m-around_medium">
512+
// <div class="slds-text-heading_large">${lwcConstants.title}</div>
513+
// ${generateHtmlTable(
514+
// headerColumns,
515+
// columns,
516+
// result,
517+
// this.formattedOrgDetails(orgDetails),
518+
// filters,
519+
// undefined,
520+
// '',
521+
// 'changeInfos',
522+
// false
523+
// )}
524+
// </div>
525+
// </body>
526+
// </html>`;
527+
// fs.writeFileSync(resultsDir + '/' + lwcConstants.componentName + '.html', html);
528+
// }
535529
}

0 commit comments

Comments
 (0)