Skip to content

Commit d82b290

Browse files
committed
feat: show message when there is plugins with native dependencies from preview command
In case when there are one or more plugin with native dependencies on preview command, we want to show a message that the users should use `tns run` command instead.
1 parent f3b4be8 commit d82b290

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as util from "util";
44
import { Device } from "nativescript-preview-sdk";
55
import { PluginComparisonMessages } from "./preview-app-constants";
66
import { NODE_MODULES_DIR_NAME } from "../../../common/constants";
7-
import { PLATFORMS_DIR_NAME, PACKAGE_JSON_FILE_NAME, TNS_CORE_THEME_NAME, SCOPED_TNS_CORE_THEME_NAME } from "../../../constants";
7+
import { PLATFORMS_DIR_NAME, PACKAGE_JSON_FILE_NAME, TNS_CORE_THEME_NAME, SCOPED_TNS_CORE_THEME_NAME, LoggerConfigData } from "../../../constants";
88

99
export class PreviewAppPluginsService implements IPreviewAppPluginsService {
1010
constructor(private $errors: IErrors,
@@ -40,6 +40,11 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
4040
public async comparePluginsOnDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<void> {
4141
const warnings = await this.getPluginsUsageWarnings(data, device);
4242
_.map(warnings, warning => this.$logger.warn(warning));
43+
44+
if (warnings && warnings.length) {
45+
this.$logger.warn(`In the app are used one or more NativeScript plugins with native dependencies.
46+
Those plugins will not work while building the project via \`$ tns preview\`. Please, use \`$ tns run <platform>\` command instead.`, { [LoggerConfigData.wrapMessageWithBorders]: true });
47+
}
4348
}
4449

4550
public getExternalPlugins(device: Device): string[] {

0 commit comments

Comments
 (0)