Skip to content

Commit 36a4d52

Browse files
authored
Merge pull request #3684 from NativeScript/kddimitrov/merge-release-master
Kddimitrov/merge release master
2 parents c18a818 + 49e8b73 commit 36a4d52

21 files changed

+75
-51
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
NativeScript CLI Changelog
22
================
33

4+
4.1.0 (2018, May 31)
5+
==
6+
7+
### New
8+
* [Implemented #3321](https://github.com/NativeScript/nativescript-cli/issues/3321): Work simultaneously with multiple iOS Simulators
9+
* [Implemented #3404](https://github.com/NativeScript/nativescript-cli/issues/3404): Start LiveSync watcher earlier during run
10+
* [Implemented #3570](https://github.com/NativeScript/nativescript-cli/issues/3570): Add deprecation message for macOS versions under High Sierra
11+
* [Implemented #3581](https://github.com/NativeScript/nativescript-cli/issues/3581): Drop support for Node.js 4.x.x
12+
* [Implemented #3582](https://github.com/NativeScript/nativescript-cli/issues/3582): Deprecate support for Node.js 6.x.x
13+
* [Implemented #3605](https://github.com/NativeScript/nativescript-cli/issues/3605): Support Java 10
14+
* [Implemented #3636](https://github.com/NativeScript/nativescript-cli/issues/3636): Allow templates to be full applications - BETA support
15+
* [Implemented #3650](https://github.com/NativeScript/nativescript-cli/issues/3650): Enable using source code in iOS part of plugins
16+
17+
### Fixed
18+
* [Fixed #1398](https://github.com/NativeScript/nativescript-cli/issues/1398): CLI detects iOS devices connected over Wi-fi and fails to work with them
19+
* [Fixed #2831](https://github.com/NativeScript/nativescript-cli/issues/2831): `tns debug android --start` releases the terminal session
20+
* [Fixed #3580](https://github.com/NativeScript/nativescript-cli/pull/3580): API: isValidNativeScriptProject returns incorrect result
21+
* [Fixed #3593](https://github.com/NativeScript/nativescript-cli/issues/3593): Tracking for used Debug tools is not correct
22+
* [Fixed #3629](https://github.com/NativeScript/nativescript-cli/issues/3629): `tns debug android --start` does not print application console.logs
23+
24+
425
4.0.2 (2018, May 18)
526
==
627

@@ -14,7 +35,6 @@ NativeScript CLI Changelog
1435
### New
1536
* [Implemented #3535](https://github.com/NativeScript/nativescript-cli/pull/3535) API: Expose androidProcessService - getAppProcessId method
1637

17-
1838
### Fixed
1939
* [Fixed #1548](https://github.com/NativeScript/nativescript-cli/issues/1548): `--sdk` flag not working properly when starting emulators in iOS
2040
* [Fixed #2131](https://github.com/NativeScript/nativescript-cli/issues/2131): Simulators with `(` in name are not started after `tns run ios --device <device_name>`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ How the NativeScript CLI works
5353

5454
The NativeScript CLI is the command-line interface for interacting with NativeScript. It incorporates several important services. Consider the following diagram:
5555

56-
![NativeScript CLI diagram](https://github.com/NativeScript/nativescript-cli/blob/master/ns-cli.png)
56+
![NativeScript CLI diagram](https://github.com/NativeScript/nativescript-cli/raw/release/ns-cli.png)
5757

5858
* **Commands** - pretty much what every CLI does - support of different command options, input validation and help
5959
* **Devices Service** - provides the communication between NativeScript and devices/emulators/simulators used to run/debug the app. Uses iTunes to talk to iOS and adb for Android

docs/man_pages/lib-management/plugin-add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ position: 1
88
Usage | Synopsis
99
------|-------
1010
General | `$ tns plugin add <Plugin>`
11+
Alias | `$ tns plugin install <Plugin>`
1112

1213
<% if(isConsole) { %>Installs the specified plugin and any packages that it depends on.<% } %>
1314
<% if(isHtml) { %>Installs the specified plugin and its dependencies in the local `node_modules` folder, adds it to the `dependencies` section in `package.json`, and prepares the plugin for all installed platforms. If you have not configured any platforms for the project, the NativeScript CLI will prepare the plugin when you add a platform. For more information about working with plugins, see [NativeScript Plugins](https://github.com/NativeScript/nativescript-cli/blob/master/PLUGINS.md).<% } %>

docs/man_pages/lib-management/plugin-install.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ position: 3
88
Usage | Synopsis
99
------|-------
1010
General | `$ tns plugin install <Plugin>`
11+
Alias | `$ tns plugin add <Plugin>`
1112

1213
<% if(isConsole) { %>Installs the specified plugin and any packages that it depends on.<% } %>
1314
<% if(isHtml) { %>Installs the specified plugin and its dependencies in the local `node_modules` folder, adds it to the `dependencies` section in `package.json`, and prepares the plugin for all installed platforms. If you have not configured any platforms for the project, the NativeScript CLI will prepare the plugin when you add a platform. For more information about working with plugins, see [NativeScript Plugins](https://github.com/NativeScript/nativescript-cli/blob/master/PLUGINS.md).<% } %>

lib/definitions/livesync.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ interface IPlatformLiveSyncService {
337337
fullSync(syncInfo: IFullSyncInfo): Promise<ILiveSyncResultInfo>;
338338
liveSyncWatchAction(device: Mobile.IDevice, liveSyncInfo: ILiveSyncWatchInfo): Promise<ILiveSyncResultInfo>;
339339
refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise<void>;
340+
prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir, liveSyncInfo: ILiveSyncInfo): void;
340341
}
341342

342343
interface INativeScriptDeviceLiveSyncService extends IDeviceLiveSyncServiceBase {

lib/device-sockets/ios/packet-stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class PacketStream extends stream.Transform {
1313
if (!this.buffer) {
1414
// read length
1515
const length = packet.readInt32BE(0);
16-
this.buffer = new Buffer(length);
16+
this.buffer = Buffer.allocUnsafe(length);
1717
this.offset = 0;
1818
packet = packet.slice(4);
1919
}

lib/device-sockets/ios/socket-proxy-factory.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,15 @@ export class SocketProxyFactory extends EventEmitter implements ISocketProxyFact
124124

125125
webSocket.on("message", (message: string) => {
126126
const length = Buffer.byteLength(message, encoding);
127-
const payload = new Buffer(length + 4);
127+
const payload = Buffer.allocUnsafe(length + 4);
128128
payload.writeInt32BE(length, 0);
129129
payload.write(message, 4, length, encoding);
130130
deviceSocket.write(payload);
131131
});
132132

133133
deviceSocket.on("close", () => {
134134
this.$logger.info("Backend socket closed!");
135-
if (!this.$options.watch) {
136-
webSocket.close();
137-
}
135+
webSocket.close();
138136
});
139137

140138
webSocket.on("close", () => {

lib/services/debug-service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export class DebugService extends EventEmitter implements IDebugService {
5151
this.$errors.failWithoutHelp(`Unsupported device OS: ${device.deviceInfo.platform}. You can debug your applications only on iOS or Android.`);
5252
}
5353

54+
// TODO: Consider to move this code to ios-debug-service
5455
if (this.$mobileHelper.isiOSPlatform(device.deviceInfo.platform)) {
5556
if (device.isEmulator && !debugData.pathToAppPackage && debugOptions.debugBrk) {
5657
this.$errors.failWithoutHelp("To debug on iOS simulator you need to provide path to the app package.");
@@ -61,12 +62,10 @@ export class DebugService extends EventEmitter implements IDebugService {
6162
} else if (!this.$hostInfo.isDarwin) {
6263
this.$errors.failWithoutHelp(`Debugging on iOS devices is not supported for ${platform()} yet.`);
6364
}
64-
65-
result = await debugService.debug(debugData, debugOptions);
66-
} else if (this.$mobileHelper.isAndroidPlatform(device.deviceInfo.platform)) {
67-
result = await debugService.debug(debugData, debugOptions);
6865
}
6966

67+
result = await debugService.debug(debugData, debugOptions);
68+
7069
return this.getDebugInformation(result, device.deviceInfo.identifier);
7170
}
7271

lib/services/ios-debug-service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
6363
await this.device.openDeviceLogStream();
6464
}
6565

66+
this.$iOSDebuggerPortService.attachToDebuggerPortFoundEvent(this.device, debugData);
67+
6668
if (debugOptions.emulator) {
6769
if (debugOptions.start) {
6870
return this.emulatorStart(debugData, debugOptions);
@@ -142,12 +144,8 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
142144
}
143145

144146
private async emulatorStart(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
145-
const device = await this.$devicesService.getDevice(debugData.deviceIdentifier);
146-
this.$iOSDebuggerPortService.attachToDebuggerPortFoundEvent(device, debugData);
147147
const result = await this.wireDebuggerClient(debugData, debugOptions);
148-
149148
const attachRequestMessage = this.$iOSNotification.getAttachRequest(debugData.applicationIdentifier, debugData.deviceIdentifier);
150-
151149
const iOSEmulatorService = <Mobile.IiOSSimulatorService>this.$iOSEmulatorServices;
152150
await iOSEmulatorService.postDarwinNotification(attachRequestMessage, debugData.deviceIdentifier);
153151
return result;
@@ -192,7 +190,7 @@ export class IOSDebugService extends DebugServiceBase implements IPlatformDebugS
192190
}
193191

194192
private async deviceStartCore(device: Mobile.IiOSDevice, debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
195-
this.$iOSDebuggerPortService.attachToDebuggerPortFoundEvent(device, debugData);
193+
196194
await this.$iOSSocketRequestExecutor.executeAttachRequest(device, AWAIT_NOTIFICATION_TIMEOUT_SECONDS, debugData.applicationIdentifier);
197195
return this.wireDebuggerClient(debugData, debugOptions, device);
198196
}

lib/services/livesync/android-device-livesync-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class AndroidDeviceLiveSyncService extends DeviceLiveSyncServiceBase impl
129129
const socket = new net.Socket();
130130

131131
socket.connect(this.port, '127.0.0.1', () => {
132-
socket.write(new Buffer([0, 0, 0, 1, 1]));
132+
socket.write(Buffer.from([0, 0, 0, 1, 1]));
133133
});
134134
socket.on("data", (data: any) => {
135135
isResolved = true;

0 commit comments

Comments
 (0)