Skip to content

Commit 266c63f

Browse files
author
Fatme
authored
Merge pull request #4481 from NativeScript/fatme/merge-release
chore: merge release into master
2 parents a65a461 + 891381d commit 266c63f

23 files changed

+801
-680
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
NativeScript CLI Changelog
22
================
33

4+
5.3.0 (2019, March 27)
5+
==
6+
7+
### Implemented
8+
* [Implemented #3965](https://github.com/NativeScript/nativescript-cli/issues/3965): [Beta] Support for iOS app extensions
9+
* [Implemented #4389](https://github.com/NativeScript/nativescript-cli/issues/4389): Provide a way to use Hot Module Replacement (`--hmr`) by default for a project
10+
* [Implemented #4392](https://github.com/NativeScript/nativescript-cli/issues/4392): Ability to run unit tests with `--bundle`
11+
* [Implemented #4456](https://github.com/NativeScript/nativescript-cli/issues/4456): Official support for Hot Module Replacement (`--hmr`)
12+
13+
### Fixed
14+
* [Fixed #4403](https://github.com/NativeScript/nativescript-cli/issues/4403): Exception in iOS app entry point not shown in terminal
15+
* [Fixed #4440](https://github.com/NativeScript/nativescript-cli/issues/4440): `NativeScript can only run in Xcode version 6.0 or greater` error is shown on every iOS command
16+
* [Fixed #4441](https://github.com/NativeScript/nativescript-cli/issues/4441): Nothing happens with app on device if you delete a file with bundle
17+
* [Fixed #4458](https://github.com/NativeScript/nativescript-cli/issues/4458): Warnings for short imports are shown for browser code
18+
* [Fixed #4459](https://github.com/NativeScript/nativescript-cli/pull/4459): API: Raise `debuggerAttached` only if app is restarted during debug
19+
20+
421
5.2.3 (2019, March 12)
522
==
623

lib/commands/debug.ts

-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
6666
this.$errors.fail("--release flag is not applicable to this command");
6767
}
6868

69-
if (this.$options.hmr && this.$options.debugBrk) {
70-
this.$errors.fail("--debug-brk and --hmr flags cannot be combined");
71-
}
72-
7369
const minSupportedWebpackVersion = this.$options.hmr ? LiveSyncCommandHelper.MIN_SUPPORTED_WEBPACK_VERSION_WITH_HMR : null;
7470
this.$bundleValidatorHelper.validate(minSupportedWebpackVersion);
7571

lib/commands/preview.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export class PreviewCommand implements ICommand {
2929
env: this.$options.env
3030
});
3131

32-
await this.$previewQrCodeService.printLiveSyncQrCode({ useHotModuleReload: this.$options.hmr, link: this.$options.link });
32+
await this.$previewQrCodeService.printLiveSyncQrCode({
33+
projectDir: this.$projectData.projectDir,
34+
useHotModuleReload: this.$options.hmr,
35+
link: this.$options.link
36+
});
3337
}
3438

3539
public async canExecute(args: string[]): Promise<boolean> {

lib/common/declarations.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ declare const enum ErrorCodes {
596596
KARMA_FAIL = 130,
597597
UNHANDLED_REJECTION_FAILURE = 131,
598598
DELETED_KILL_FILE = 132,
599-
TESTS_INIT_REQUIRED = 133
599+
TESTS_INIT_REQUIRED = 133,
600+
ALL_DEVICES_DISCONNECTED = 134
600601
}
601602

602603
interface IFutureDispatcher {

lib/common/definitions/mobile.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ declare module Mobile {
106106
}
107107

108108
interface IiOSDevice extends IDevice {
109-
getDebugSocket(appId: string, projectName: string): Promise<any>;
109+
getDebugSocket(appId: string, projectName: string, ensureAppStarted?: boolean): Promise<any>;
110110
destroyDebugSocket(appId: string): Promise<void>;
111111
openDeviceLogStream(options?: IiOSLogStreamOptions): Promise<void>;
112112
destroyAllSockets(): Promise<void>;

lib/common/mobile/android/android-device.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ export class AndroidDevice implements Mobile.IAndroidDevice {
7171
const adbStatusInfo = AndroidDevice.ADB_DEVICE_STATUS_INFO[this.status];
7272
const type = await this.getType();
7373

74+
let version = details.release;
75+
if (version && version.toLowerCase() === 'q') {
76+
version = '10.0.0';
77+
}
78+
7479
this.deviceInfo = {
7580
identifier: this.identifier,
7681
displayName: details.name,
7782
model: details.model,
78-
version: details.release,
83+
version,
7984
vendor: details.brand,
8085
platform: this.$devicePlatformsConstants.Android,
8186
status: adbStatusInfo ? adbStatusInfo.deviceStatus : this.status,

lib/common/mobile/ios/ios-device-base.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice {
1515
abstract openDeviceLogStream(options?: Mobile.IiOSLogStreamOptions): Promise<void>;
1616

1717
@performanceLog()
18-
public async getDebugSocket(appId: string, projectName: string): Promise<net.Socket> {
18+
public async getDebugSocket(appId: string, projectName: string, ensureAppStarted: boolean = false): Promise<net.Socket> {
1919
return this.$lockService.executeActionWithLock(
2020
async () => {
2121
if (this.cachedSockets[appId]) {
2222
return this.cachedSockets[appId];
2323
}
2424

2525
await this.attachToDebuggerFoundEvent(appId, projectName);
26-
await this.applicationManager.startApplication({ appId, projectName });
26+
if (ensureAppStarted) {
27+
await this.applicationManager.startApplication({ appId, projectName });
28+
}
29+
2730
this.cachedSockets[appId] = await this.getDebugSocketCore(appId);
2831

2932
if (this.cachedSockets[appId]) {

lib/constants.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require("colors");
2+
import { PreviewAppLiveSyncEvents } from "./services/livesync/playground/preview-app-constants";
23

34
export const APP_FOLDER_NAME = "app";
45
export const APP_RESOURCES_FOLDER_NAME = "App_Resources";
@@ -269,3 +270,13 @@ export class AndroidAppBundleMessages {
269270
public static ANDROID_APP_BUNDLE_DOCS_MESSAGE = "What is Android App Bundle: https://docs.nativescript.org/tooling/publishing/android-app-bundle";
270271
public static ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE = "How to use Android App Bundle for publishing: https://docs.nativescript.org/tooling/publishing/publishing-android-apps#android-app-bundle";
271272
}
273+
274+
export const LiveSyncEvents = {
275+
liveSyncStopped: "liveSyncStopped",
276+
// In case we name it error, EventEmitter expects instance of Error to be raised and will also raise uncaught exception in case there's no handler
277+
liveSyncError: "liveSyncError",
278+
previewAppLiveSyncError: PreviewAppLiveSyncEvents.PREVIEW_APP_LIVE_SYNC_ERROR,
279+
liveSyncExecuted: "liveSyncExecuted",
280+
liveSyncStarted: "liveSyncStarted",
281+
liveSyncNotification: "notify"
282+
};

0 commit comments

Comments
 (0)