Skip to content

Commit b1a8f90

Browse files
Merge pull request #3936 from NativeScript/vladimirov/fix-hmr-bundle
fix: passing --hmr must always set bundle option to "webpack"
2 parents c376458 + 6c354ad commit b1a8f90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+303
-355
lines changed

lib/common/appbuilder/project/project-base.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export abstract class ProjectBase implements Project.IProjectBase {
2121
protected $fs: IFileSystem,
2222
protected $logger: ILogger,
2323
protected $nativeScriptProjectCapabilities: Project.ICapabilities,
24-
protected $options: ICommonOptions,
24+
protected $options: IOptions,
2525
protected $projectConstants: Project.IConstants,
2626
protected $staticConfig: Config.IStaticConfig) {
2727
this.configurationSpecificData = Object.create(null);

lib/common/appbuilder/project/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Project extends ProjectBase {
99
protected $fs: IFileSystem,
1010
protected $logger: ILogger,
1111
protected $nativeScriptProjectCapabilities: Project.ICapabilities,
12-
protected $options: ICommonOptions,
12+
protected $options: IOptions,
1313
protected $projectConstants: Project.IConstants,
1414
protected $staticConfig: Config.IStaticConfig) {
1515
super($cordovaProjectCapabilities, $errors, $fs, $logger, $nativeScriptProjectCapabilities, $options, $projectConstants, $staticConfig);

lib/common/appbuilder/proton-bootstrap.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
require("./appbuilder-bootstrap");
22
$injector.require("messages", "./messages/messages");
33

4-
import { OptionsBase } from "../options";
54
$injector.require("staticConfig", "./appbuilder/proton-static-config");
65
$injector.register("config", {});
76
// Proton will track the features and exceptions, so no need of analyticsService here.
87
$injector.register("analyiticsService", {});
9-
$injector.register("options", $injector.resolve(OptionsBase, { options: {}, defaultProfileDir: "" }));
108
$injector.requirePublicClass("deviceEmitter", "./appbuilder/device-emitter");
119
$injector.requirePublicClass("deviceLogProvider", "./appbuilder/device-log-provider");
1210
import { installUncaughtExceptionListener } from "../errors";

lib/common/appbuilder/providers/project-files-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class ProjectFilesProvider extends ProjectFilesProviderBase {
1818
private $projectConstants: Project.IConstants,
1919
private $injector: IInjector,
2020
$mobileHelper: Mobile.IMobileHelper,
21-
$options: ICommonOptions) {
21+
$options: IOptions) {
2222
super($mobileHelper, $options);
2323
}
2424

lib/common/appbuilder/services/livesync/android-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class AppBuilderAndroidLiveSyncService extends AndroidLiveSyncService imp
66
constructor(_device: Mobile.IAndroidDevice,
77
$fs: IFileSystem,
88
$mobileHelper: Mobile.IMobileHelper,
9-
private $options: ICommonOptions) {
9+
private $options: IOptions) {
1010
super(_device, $fs, $mobileHelper);
1111
}
1212

lib/common/appbuilder/services/livesync/ios-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class IOSLiveSyncService implements IDeviceLiveSyncService {
1313
private $injector: IInjector,
1414
private $logger: ILogger,
1515
private $errors: IErrors,
16-
private $options: ICommonOptions,
16+
private $options: IOptions,
1717
private $iosDeviceOperations: IIOSDeviceOperations) {
1818
// If we execute livesync with --watch we do not want to dispose the $iosDeviceOperations.
1919
this.$iosDeviceOperations.setShouldDispose(!this.$options.watch);

lib/common/commands/analytics.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AnalyticsCommand implements ICommand {
1919
constructor(protected $analyticsService: IAnalyticsService,
2020
private $logger: ILogger,
2121
private $errors: IErrors,
22-
private $options: ICommonOptions,
22+
private $options: IOptions,
2323
private settingName: string,
2424
private humanReadableSettingName: string) { }
2525

@@ -51,7 +51,7 @@ export class UsageReportingCommand extends AnalyticsCommand {
5151
constructor(protected $analyticsService: IAnalyticsService,
5252
$logger: ILogger,
5353
$errors: IErrors,
54-
$options: ICommonOptions,
54+
$options: IOptions,
5555
$staticConfig: Config.IStaticConfig) {
5656
super($analyticsService, $logger, $errors, $options, $staticConfig.TRACK_FEATURE_USAGE_SETTING_NAME, "Usage reporting");
5757
}
@@ -62,7 +62,7 @@ export class ErrorReportingCommand extends AnalyticsCommand {
6262
constructor(protected $analyticsService: IAnalyticsService,
6363
$logger: ILogger,
6464
$errors: IErrors,
65-
$options: ICommonOptions,
65+
$options: IOptions,
6666
$staticConfig: Config.IStaticConfig
6767
) {
6868
super($analyticsService, $logger, $errors, $options, $staticConfig.ERROR_REPORT_SETTING_NAME, "Error reporting");

lib/common/commands/device/device-log-stream.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class OpenDeviceLogStreamCommand implements ICommand {
44
constructor(private $devicesService: Mobile.IDevicesService,
55
private $errors: IErrors,
66
private $commandsService: ICommandsService,
7-
private $options: ICommonOptions,
7+
private $options: IOptions,
88
private $deviceLogProvider: Mobile.IDeviceLogProvider,
99
private $loggingLevels: Mobile.ILoggingLevels,
1010
$iOSSimulatorLogProvider: Mobile.IiOSSimulatorLogProvider) {

lib/common/commands/device/get-file.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export class GetFileCommand implements ICommand {
33
private $stringParameter: ICommandParameter,
44
private $project: Project.IProjectBase,
55
private $errors: IErrors,
6-
private $options: ICommonOptions) { }
6+
private $options: IOptions) { }
77

88
public allowedParameters: ICommandParameter[] = [this.$stringParameter, this.$stringParameter];
99

lib/common/commands/device/list-applications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as util from "util";
44
export class ListApplicationsCommand implements ICommand {
55
constructor(private $devicesService: Mobile.IDevicesService,
66
private $logger: ILogger,
7-
private $options: ICommonOptions) { }
7+
private $options: IOptions) { }
88

99
allowedParameters: ICommandParameter[] = [];
1010

lib/common/commands/device/list-devices.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class ListDevicesCommand implements ICommand {
77
private $logger: ILogger,
88
private $stringParameter: ICommandParameter,
99
private $mobileHelper: Mobile.IMobileHelper,
10-
private $options: ICommonOptions) { }
10+
private $options: IOptions) { }
1111

1212
public allowedParameters = [this.$stringParameter];
1313

lib/common/commands/device/list-files.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class ListFilesCommand implements ICommand {
22
constructor(private $devicesService: Mobile.IDevicesService,
33
private $stringParameter: ICommandParameter,
4-
private $options: ICommonOptions,
4+
private $options: IOptions,
55
private $project: Project.IProjectBase,
66
private $errors: IErrors) { }
77

lib/common/commands/device/put-file.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class PutFileCommand implements ICommand {
22
constructor(private $devicesService: Mobile.IDevicesService,
33
private $stringParameter: ICommandParameter,
4-
private $options: ICommonOptions,
4+
private $options: IOptions,
55
private $project: Project.IProjectBase,
66
private $errors: IErrors) { }
77

lib/common/commands/device/run-application.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class RunApplicationOnDeviceCommand implements ICommand {
44
private $errors: IErrors,
55
private $stringParameter: ICommandParameter,
66
private $staticConfig: Config.IStaticConfig,
7-
private $options: ICommonOptions) { }
7+
private $options: IOptions) { }
88

99
public allowedParameters: ICommandParameter[] = [this.$stringParameter, this.$stringParameter];
1010

lib/common/commands/device/stop-application.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export class StopApplicationOnDeviceCommand implements ICommand {
22

33
constructor(private $devicesService: Mobile.IDevicesService,
44
private $stringParameter: ICommandParameter,
5-
private $options: ICommonOptions) { }
5+
private $options: IOptions) { }
66

77
allowedParameters: ICommandParameter[] = [this.$stringParameter, this.$stringParameter, this.$stringParameter];
88

lib/common/commands/device/uninstall-application.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class UninstallApplicationCommand implements ICommand {
22
constructor(private $devicesService: Mobile.IDevicesService,
33
private $stringParameter: ICommandParameter,
4-
private $options: ICommonOptions) { }
4+
private $options: IOptions) { }
55

66
allowedParameters: ICommandParameter[] = [this.$stringParameter];
77

lib/common/commands/generate-messages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class GenerateMessages implements ICommand {
66

77
constructor(private $fs: IFileSystem,
88
private $messageContractGenerator: IServiceContractGenerator,
9-
private $options: ICommonOptions) {
9+
private $options: IOptions) {
1010
}
1111

1212
allowedParameters: ICommandParameter[] = [];

lib/common/commands/help.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class HelpCommand implements ICommand {
22
constructor(private $injector: IInjector,
33
private $helpService: IHelpService,
4-
private $options: ICommonOptions) { }
4+
private $options: IOptions) { }
55

66
public enableHooks = false;
77
public async canExecute(args: string[]): Promise<boolean> {

lib/common/commands/proxy/proxy-set.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ProxySetCommand extends ProxyCommandBase {
2222
private $staticConfig: Config.IStaticConfig,
2323
protected $analyticsService: IAnalyticsService,
2424
protected $logger: ILogger,
25-
protected $options: ICommonOptions,
25+
protected $options: IOptions,
2626
protected $proxyService: IProxyService) {
2727
super($analyticsService, $logger, $proxyService, proxySetCommandName);
2828
}

lib/common/declarations.d.ts

+1-42
Original file line numberDiff line numberDiff line change
@@ -1256,47 +1256,6 @@ interface IHasEmulatorOption {
12561256
emulator: boolean;
12571257
}
12581258

1259-
interface ICommonOptions extends IRelease, IDeviceIdentifier, IJustLaunch, IAvd, IAvailableDevices, IProfileDir, IHasEmulatorOption {
1260-
argv: IYargArgv;
1261-
validateOptions(commandSpecificDashedOptions?: IDictionary<IDashedOption>): void;
1262-
options: IDictionary<any>;
1263-
shorthands: string[];
1264-
/**
1265-
* Project Configuration
1266-
*/
1267-
config: string[];
1268-
log: string;
1269-
verbose: boolean;
1270-
path: string;
1271-
version: boolean;
1272-
help: boolean;
1273-
json: boolean;
1274-
watch: boolean;
1275-
timeout: string;
1276-
appid: string;
1277-
geny: string;
1278-
debugBrk: boolean;
1279-
debugPort: number;
1280-
start: boolean;
1281-
stop: boolean;
1282-
ddi: string; // the path to developer disk image
1283-
insecure: boolean;
1284-
skipRefresh: boolean;
1285-
file: string;
1286-
analyticsClient: string;
1287-
force: boolean;
1288-
companion: boolean;
1289-
sdk: string;
1290-
template: string;
1291-
certificate: string;
1292-
certificatePassword: string;
1293-
var: Object;
1294-
default: Boolean;
1295-
count: number;
1296-
hooks: boolean;
1297-
debug: boolean;
1298-
}
1299-
13001259
interface IYargArgv extends IDictionary<any> {
13011260
_: string[];
13021261
$0: string;
@@ -1372,7 +1331,7 @@ interface IDoctorService {
13721331
* @param configOptions: defines if the result should be tracked by Analytics
13731332
* @returns {Promise<void>}
13741333
*/
1375-
printWarnings(configOptions?: { trackResult: boolean, projectDir?: string, runtimeVersion?: string, options?: ICommonOptions }): Promise<void>;
1334+
printWarnings(configOptions?: { trackResult: boolean, projectDir?: string, runtimeVersion?: string, options?: IOptions }): Promise<void>;
13761335
/**
13771336
* Runs the setup script on host machine
13781337
* @returns {Promise<ISpawnResult>}

lib/common/dispatchers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class CommandDispatcher implements ICommandDispatcher {
77
private $commandsService: ICommandsService,
88
private $staticConfig: Config.IStaticConfig,
99
private $sysInfo: ISysInfo,
10-
private $options: ICommonOptions,
10+
private $options: IOptions,
1111
private $fs: IFileSystem) { }
1212

1313
public async dispatchCommand(): Promise<void> {

lib/common/logger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class Logger implements ILogger {
1212
private static LABEL = "[WARNING]:";
1313

1414
constructor($config: Config.IConfig,
15-
private $options: ICommonOptions) {
15+
private $options: IOptions) {
1616
const appenders: log4js.IAppender[] = [];
1717

1818
if (!$config.CI_LOGGER) {

lib/common/mobile/android/android-application-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class AndroidApplicationManager extends ApplicationManagerBase {
1010

1111
constructor(private adb: Mobile.IDeviceAndroidDebugBridge,
1212
private identifier: string,
13-
private $options: ICommonOptions,
13+
private $options: IOptions,
1414
private $logcatHelper: Mobile.ILogcatHelper,
1515
private $androidProcessService: Mobile.IAndroidProcessService,
1616
private $httpClient: Server.IHttpClient,

lib/common/mobile/device-app-data/device-app-data-factory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class DeviceAppDataFactory implements Mobile.IDeviceAppDataFactory {
22
constructor(private $deviceAppDataProvider: Mobile.IDeviceAppDataProvider,
33
private $injector: IInjector,
4-
private $options: ICommonOptions) { }
4+
private $options: IOptions) { }
55

66
create<T>(appIdentifier: string, platform: string, device: Mobile.IDevice, liveSyncOptions?: { isForCompanionApp: boolean }): T {
77
const factoryRules = this.$deviceAppDataProvider.createFactoryRules();

lib/common/mobile/ios/device/ios-application-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class IOSApplicationManager extends ApplicationManagerBase {
1212
private $errors: IErrors,
1313
private $iOSNotificationService: IiOSNotificationService,
1414
private $iosDeviceOperations: IIOSDeviceOperations,
15-
private $options: ICommonOptions,
15+
private $options: IOptions,
1616
private $deviceLogProvider: Mobile.IDeviceLogProvider) {
1717
super($logger, $hooksService);
1818
}

lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { cache } from "../../../decorators";
77
export class IOSSimulatorApplicationManager extends ApplicationManagerBase {
88
constructor(private iosSim: any,
99
private device: Mobile.IiOSDevice,
10-
private $options: ICommonOptions,
10+
private $options: IOptions,
1111
private $fs: IFileSystem,
1212
private $plistParser: IPlistParser,
1313
private $deviceLogProvider: Mobile.IDeviceLogProvider,

lib/common/mobile/mobile-core/devices-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
3636
private $deviceLogProvider: Mobile.IDeviceLogProvider,
3737
private $hostInfo: IHostInfo,
3838
private $injector: IInjector,
39-
private $options: ICommonOptions,
39+
private $options: IOptions,
4040
private $androidProcessService: Mobile.IAndroidProcessService,
4141
private $processService: IProcessService,
4242
private $iOSEmulatorServices: Mobile.IiOSSimulatorService,

0 commit comments

Comments
 (0)