Skip to content

Commit da1870e

Browse files
committed
fix: validate the version of nativescript-dev-webpack plugin from prepare-controller
1 parent 5dc21ba commit da1870e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/commands/preview.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export class PreviewCommand implements ICommand {
44
public allowedParameters: ICommandParameter[] = [];
55

66
constructor(private $analyticsService: IAnalyticsService,
7+
private $bundleValidatorHelper: IBundleValidatorHelper,
78
private $errors: IErrors,
89
private $logger: ILogger,
910
private $previewAppController: IPreviewAppController,
@@ -41,6 +42,7 @@ export class PreviewCommand implements ICommand {
4142
}
4243

4344
await this.$networkConnectivityValidator.validate();
45+
this.$bundleValidatorHelper.validate(this.$projectData, "1.0.0");
4446
return true;
4547
}
4648
}

lib/common/services/commands-service.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export class CommandsService implements ICommandsService {
2828
private $helpService: IHelpService,
2929
private $extensibilityService: IExtensibilityService,
3030
private $optionsTracker: IOptionsTracker,
31-
private $projectDataService: IProjectDataService,
32-
private $bundleValidatorHelper: IBundleValidatorHelper) {
31+
private $projectDataService: IProjectDataService) {
3332
}
3433

3534
public allCommands(opts: { includeDevCommands: boolean }): string[] {
@@ -116,8 +115,6 @@ export class CommandsService implements ICommandsService {
116115

117116
const dashedOptions = command ? command.dashedOptions : null;
118117
this.$options.validateOptions(dashedOptions, projectData);
119-
120-
this.$bundleValidatorHelper.validate(projectData, "1.0.0");
121118
}
122119

123120
return this.canExecuteCommand(commandName, commandArguments);

lib/controllers/prepare-controller.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class PrepareController extends EventEmitter {
1717
private persistedData: IFilesChangeEventData[] = [];
1818

1919
constructor(
20+
private $bundleValidatorHelper: IBundleValidatorHelper,
2021
private $platformController: IPlatformController,
2122
public $hooksService: IHooksService,
2223
private $logger: ILogger,
@@ -32,12 +33,14 @@ export class PrepareController extends EventEmitter {
3233
@performanceLog()
3334
@hook("prepare")
3435
public async prepare(prepareData: IPrepareData): Promise<IPrepareResultData> {
36+
const projectData = this.$projectDataService.getProjectData(prepareData.projectDir);
37+
this.$bundleValidatorHelper.validate(projectData, "1.0.0");
38+
3539
await this.$platformController.addPlatformIfNeeded(prepareData);
3640

3741
this.$logger.info("Preparing project...");
3842
let result = null;
3943

40-
const projectData = this.$projectDataService.getProjectData(prepareData.projectDir);
4144
const platformData = this.$platformsDataService.getPlatformData(prepareData.platform, projectData);
4245

4346
if (prepareData.watch) {

0 commit comments

Comments
 (0)