diff --git a/CHANGELOG.md b/CHANGELOG.md index 1797cd2e57..d968a248d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,29 @@ NativeScript CLI Changelog ================ +5.1.1 (2019, January 17) +== + +### Fixed +* [Fixed #4024](https://github.com/NativeScript/nativescript-cli/issues/4024): LiveSync is not working in Preview app when Angular's lazy loading is used +* [Fixed #4197](https://github.com/NativeScript/nativescript-cli/issues/4197): Not able to change IPHONEOS_DEPLOYMENT_TARGET due to CLI overwriting ARCHS and VALID_ARCHS +* [Fixed #4222](https://github.com/NativeScript/nativescript-cli/issues/4222): Sidekick restarts DevTools during debug when change in .xml/.css/.html file is applied +* [Fixed #4218](https://github.com/NativeScript/nativescript-cli/issues/4218): Cannot run app after debug-brk fail +* [Fixed #4228](https://github.com/NativeScript/nativescript-cli/issues/4228): `tns update` command doesn't work with yarn +* [Fixed #4230](https://github.com/NativeScript/nativescript-cli/issues/4230): Debugging with HMR is not working for iOS +* [Fixed #4234](https://github.com/NativeScript/nativescript-cli/issues/4234): Creating project hangs on Windows when yarn is set as package manager +* [Fixed #4236](https://github.com/NativeScript/nativescript-cli/issues/4236): Chrome DevTools(iOS): Debugger does not attach after reloading the page +* [Fixed #4238](https://github.com/NativeScript/nativescript-cli/issues/4238): Fresh project build error on ios +* [Fixed #4251](https://github.com/NativeScript/nativescript-cli/pull/4251): Unhandled promise rejection error from sidekick when livesync to preview app with bundle +* [Fixed #4260](https://github.com/NativeScript/nativescript-cli/issues/4260): CLI crashes when attaching to a non running iOS app +* [Fixed #4261](https://github.com/NativeScript/nativescript-cli/issues/4261): The CLI requires developer disk image not only in debug +* [Fixed #4272](https://github.com/NativeScript/nativescript-cli/issues/4272): Generation of splash screen fails for new templates +* [Fixed #4273](https://github.com/NativeScript/nativescript-cli/issues/4273): `tns debug ios --hmr` If you have two open tabs and close one, breakpoints stop working +* [Fixed #4291](https://github.com/NativeScript/nativescript-cli/issues/4291): Error during debug on iOS: WebSocket is not open: readyState 2 (CLOSING) +* [Fixed #4292](https://github.com/NativeScript/nativescript-cli/issues/4292): Error during debug on iOS: RangeError: Index out of range +* [Fixed #4293](https://github.com/NativeScript/nativescript-cli/issues/4293): Error during debug on iOS: RangeError [ERR_BUFFER_OUT_OF_BOUNDS] + + 5.1.0 (2018, December 11) == diff --git a/lib/device-sockets/ios/app-debug-socket-proxy-factory.ts b/lib/device-sockets/ios/app-debug-socket-proxy-factory.ts index 10cebd65ea..5f015aca8d 100644 --- a/lib/device-sockets/ios/app-debug-socket-proxy-factory.ts +++ b/lib/device-sockets/ios/app-debug-socket-proxy-factory.ts @@ -1,9 +1,9 @@ import { EventEmitter } from "events"; import { CONNECTION_ERROR_EVENT_NAME } from "../../constants"; -import { PacketStream } from "./packet-stream"; import * as net from "net"; import * as ws from "ws"; import temp = require("temp"); +import { MessageUnpackStream } from "ios-device-lib"; export class AppDebugSocketProxyFactory extends EventEmitter implements IAppDebugSocketProxyFactory { private deviceWebServers: IDictionary = {}; @@ -134,11 +134,16 @@ export class AppDebugSocketProxyFactory extends EventEmitter implements IAppDebu const encoding = "utf16le"; const appDebugSocket: net.Socket = (req)["__deviceSocket"]; - const packets = new PacketStream(); + const packets = new MessageUnpackStream(); appDebugSocket.pipe(packets); packets.on("data", (buffer: Buffer) => { - webSocket.send(buffer.toString(encoding)); + const message = buffer.toString(encoding); + if (webSocket.readyState === webSocket.OPEN) { + webSocket.send(message); + } else { + this.$logger.trace(`Received message ${message}, but unable to send it to webSocket as its state is: ${webSocket.readyState}`); + } }); webSocket.on("error", err => { diff --git a/lib/device-sockets/ios/packet-stream.ts b/lib/device-sockets/ios/packet-stream.ts deleted file mode 100644 index 220d525dd5..0000000000 --- a/lib/device-sockets/ios/packet-stream.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as stream from "stream"; - -export class PacketStream extends stream.Transform { - private buffer: Buffer; - private offset: number; - - constructor(opts?: stream.TransformOptions) { - super(opts); - } - - public _transform(packet: any, encoding: string, done: Function): void { - while (packet.length > 0) { - if (!this.buffer) { - // read length - const length = packet.readInt32BE(0); - this.buffer = Buffer.allocUnsafe(length); - this.offset = 0; - packet = packet.slice(4); - } - - packet.copy(this.buffer, this.offset); - const copied = Math.min(this.buffer.length - this.offset, packet.length); - this.offset += copied; - packet = packet.slice(copied); - - if (this.offset === this.buffer.length) { - this.push(this.buffer); - this.buffer = undefined; - } - } - done(); - } -} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3623739056..eb4afe527f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3893,9 +3893,9 @@ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, "ios-device-lib": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/ios-device-lib/-/ios-device-lib-0.4.15.tgz", - "integrity": "sha512-OzyKbLxrmpTB87hPelpAsvtmPYeucSP53IaLb2QHaIDW6ZqHjJV4XCHMpwtLGvLOcMNb2WVUHxoirQ+rwC21dQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ios-device-lib/-/ios-device-lib-0.5.0.tgz", + "integrity": "sha512-EKSXHYvOhjB+R/8EaWX9Iha7AIk1U26rxvxq7Hpg/19zOXqsnjuakyJ3fDKh5BXnU7CzBpkz1V2lwi8JPvD5fw==", "requires": { "bufferpack": "0.0.6", "node-uuid": "1.4.7" @@ -3981,9 +3981,9 @@ } }, "ios-sim-portable": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ios-sim-portable/-/ios-sim-portable-4.0.6.tgz", - "integrity": "sha512-V4f5aiQDnikC/ERM+RD9Kj5gRPoIaXv8zt9Zq6hoe8amQa7PP3lY4zSzvVAp8H+Cfts6rtrAaSKLtGpVzoZRPw==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/ios-sim-portable/-/ios-sim-portable-4.0.8.tgz", + "integrity": "sha512-/yk204on3c1qFux7h3u3rS6z051yB6OzVTLoGry210JizaqKYmkPJr6KKfLSeZIyZxF4GsBZI2KMzlFbavjUhA==", "requires": { "bplist-parser": "https://github.com/telerik/node-bplist-parser/tarball/master", "colors": "0.6.2", @@ -4009,7 +4009,7 @@ }, "lodash": { "version": "3.2.0", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.2.0.tgz", "integrity": "sha1-S/UKMkP5rrC6xBpV09WZBnWkYvs=" }, "set-blocking": { @@ -4019,7 +4019,7 @@ }, "shelljs": { "version": "0.7.0", - "resolved": "http://registry.npmjs.org/shelljs/-/shelljs-0.7.0.tgz", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.0.tgz", "integrity": "sha1-P28uSWXOxWX2X/OGHWRPh5KBpXY=", "requires": { "glob": "^7.0.0", @@ -4029,7 +4029,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { "code-point-at": "^1.0.0", @@ -4039,7 +4039,7 @@ }, "yargs": { "version": "4.7.1", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.7.1.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.7.1.tgz", "integrity": "sha1-5gQyZYozh/8mnAKOrN5KUS5Djf8=", "requires": { "camelcase": "^3.0.0", @@ -4059,7 +4059,7 @@ }, "yargs-parser": { "version": "2.4.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", "requires": { "camelcase": "^3.0.0", diff --git a/package.json b/package.json index b280c0167e..4925ea1c68 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,9 @@ "gaze": "1.1.0", "iconv-lite": "0.4.11", "inquirer": "6.2.0", - "ios-device-lib": "0.4.15", + "ios-device-lib": "0.5.0", "ios-mobileprovision-finder": "1.0.10", - "ios-sim-portable": "4.0.6", + "ios-sim-portable": "4.0.8", "istextorbinary": "2.2.1", "jimp": "0.2.28", "lockfile": "1.0.3",