Skip to content

Commit 7383806

Browse files
committed
fix(preview-publicApi): Add force option when getting the plugin's warnings
1 parent 65eeeeb commit 7383806

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/definitions/preview-app-livesync.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,11 @@ declare global {
6262
getDevicesForPlatform(platform: string): Device[];
6363
getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[];
6464
}
65+
66+
interface IPluginsUsageWarningOptions {
67+
/**
68+
* If set to true, the cache will not be respected
69+
*/
70+
force: boolean;
71+
}
6572
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
1414
private $logger: ILogger,
1515
private $pluginsService: IPluginsService) { }
1616

17-
public getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device): string[] {
17+
public getPluginsUsageWarnings(data: IPreviewAppLiveSyncData, device: Device, pluginsUsageWarningOptions?: IPluginsUsageWarningOptions): string[] {
1818
if (!device) {
1919
this.$errors.failWithoutHelp("No device provided.");
2020
}
@@ -23,7 +23,8 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
2323
this.$errors.failWithoutHelp("No version of preview app provided.");
2424
}
2525

26-
if (!this.previewAppVersionWarnings[device.previewAppVersion]) {
26+
const force = !!(pluginsUsageWarningOptions && pluginsUsageWarningOptions.force);
27+
if (!this.previewAppVersionWarnings[device.previewAppVersion] || force) {
2728
const devicePlugins = this.getDevicePlugins(device);
2829
const localPlugins = this.getLocalPlugins(data.projectDir);
2930
const warnings = _.keys(localPlugins)

0 commit comments

Comments
 (0)