Skip to content

Commit f9be51d

Browse files
committed
chore: fix PR comments
1 parent f2d59a7 commit f9be51d

File tree

14 files changed

+28
-19
lines changed

14 files changed

+28
-19
lines changed

lib/commands/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
1616
}
1717

1818
public async executeCore(args: string[]): Promise<string> {
19-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
19+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
2020
const platform = args[0].toLowerCase();
2121
const appFilesUpdaterOptions: IAppFilesUpdaterOptions = {
2222
bundle: !!this.$options.bundle,

lib/commands/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
2424
}
2525

2626
public async execute(args: string[]): Promise<void> {
27-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
27+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
2828
await this.$devicesService.initialize({
2929
platform: this.platform,
3030
deviceId: this.$options.device,

lib/commands/prepare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
1414
}
1515

1616
public async execute(args: string[]): Promise<void> {
17-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
17+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
1818
const appFilesUpdaterOptions: IAppFilesUpdaterOptions = {
1919
bundle: !!this.$options.bundle,
2020
release: this.$options.release,

lib/commands/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class PreviewCommand implements ICommand {
2121
}
2222

2323
public async execute(): Promise<void> {
24-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
24+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
2525
this.$previewAppLogProvider.on(DEVICE_LOG_EVENT_NAME, (deviceId: string, message: string) => {
2626
this.$logger.info(message);
2727
});

lib/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class RunCommandBase implements ICommand {
1919

2020
public allowedParameters: ICommandParameter[] = [];
2121
public async execute(args: string[]): Promise<void> {
22-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
22+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
2323
await this.$analyticsService.trackPreviewAppData(this.platform, this.$projectData.projectDir);
2424
return this.$liveSyncCommandHelper.executeCommandLiveSync(this.platform, this.liveSyncCommandHelperAdditionalOptions);
2525
}

lib/commands/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class TestCommandBase {
1414
protected abstract $workflowService: IWorkflowService;
1515

1616
async execute(args: string[]): Promise<void> {
17-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, true);
17+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, skipWarnings: true });
1818
await this.$testExecutionService.startKarmaServer(this.platform, this.$projectData, this.projectFilesConfig);
1919
}
2020

lib/commands/update.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
3030

3131
public async execute(args: string[]): Promise<void> {
3232
if (this.$options.workflow) {
33-
const forceWebpackWorkflow = true;
34-
await this.$workflowService.handleLegacyWorkflow(this.$projectData.projectDir, this.$options, forceWebpackWorkflow);
33+
await this.$workflowService.handleLegacyWorkflow({ projectDir: this.$projectData.projectDir, settings: this.$options, force: true });
3534
return;
3635
}
3736

lib/common/helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,11 @@ export function createTable(headers: string[], data: string[][]): any {
385385
}
386386

387387
export function getMessageWithBorders(message: string, spanLength = 3): string {
388-
const longestRowLength = message.split(EOL).sort(function (a, b) { return b.length - a.length; })[0].length;
388+
if (!message) {
389+
return "";
390+
}
391+
392+
const longestRowLength = message.split(EOL).sort((a, b) => { return b.length - a.length; })[0].length;
389393
let border = "*".repeat(longestRowLength + 2 * spanLength); // * 2 for both sides
390394
if (border.length % 2 === 0) {
391395
border += "*"; // the * should always be an odd number in order to get * in each edge (we will remove the even *s below)

lib/definitions/platform.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ interface IBuildPlatformAction {
1515
}
1616

1717
interface IWorkflowService {
18-
handleLegacyWorkflow(projectDir: string, settings: IWebpackWorkflowSettings, skipWarnings?: boolean, force?: boolean): Promise<void>;
18+
handleLegacyWorkflow(options: IHandleLegacyWorkflowOptions): Promise<void>;
19+
}
20+
21+
interface IHandleLegacyWorkflowOptions {
22+
projectDir: string;
23+
settings: IWebpackWorkflowSettings;
24+
skipWarnings?: boolean;
25+
force?: boolean;
1926
}
2027

2128
interface IWebpackWorkflowSettings {

lib/services/livesync/playground/preview-app-livesync-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class PreviewAppLiveSyncService extends EventEmitter implements IPreviewA
3030
@performanceLog()
3131
public async initialize(data: IPreviewAppLiveSyncData): Promise<void> {
3232
await this.$previewSdkService.initialize(data.projectDir, async (device: Device) => {
33-
await this.$workflowService.handleLegacyWorkflow(data.projectDir, data);
33+
await this.$workflowService.handleLegacyWorkflow({ projectDir: data.projectDir, settings: data });
3434
try {
3535
if (!device) {
3636
this.$errors.failWithoutHelp("Sending initial preview files without a specified device is not supported.");

0 commit comments

Comments
 (0)