From 0f5f5ad3ba463cf90c38f64c104973dea7b1098e Mon Sep 17 00:00:00 2001 From: fatme Date: Mon, 15 Jul 2019 14:05:50 +0300 Subject: [PATCH 01/38] fix: start native watch on cloud run command and from sidekick when cloud build is selected Currently native watch is not started on cloud run command and from sidekick when cloud build is selected. --- lib/controllers/prepare-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/controllers/prepare-controller.ts b/lib/controllers/prepare-controller.ts index 86c871027d..8361c686c0 100644 --- a/lib/controllers/prepare-controller.ts +++ b/lib/controllers/prepare-controller.ts @@ -122,7 +122,7 @@ export class PrepareController extends EventEmitter { } private async startNativeWatcherWithPrepare(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise { - if ((prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare) || this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].nativeFilesWatcher) { + if (this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].nativeFilesWatcher) { return false; } From deffafc970dd9340f82f454fad2b55a96cb9844e Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Mon, 15 Jul 2019 15:49:29 +0300 Subject: [PATCH 02/38] docs: --no-hmr added, --syncAllFiles and --bundle removed, added notes for hmr in commands --- .../man_pages/project/configuration/prepare.md | 10 ++++++++++ .../man_pages/project/testing/build-android.md | 3 +-- docs/man_pages/project/testing/build-ios.md | 3 +-- docs/man_pages/project/testing/build.md | 15 +++++++++------ .../man_pages/project/testing/debug-android.md | 8 +------- docs/man_pages/project/testing/debug-ios.md | 8 +------- docs/man_pages/project/testing/preview.md | 9 +-------- docs/man_pages/project/testing/run-android.md | 18 ++++++++---------- docs/man_pages/project/testing/run-ios.md | 18 ++++++++---------- docs/man_pages/project/testing/run.md | 12 ++++++------ 10 files changed, 46 insertions(+), 58 deletions(-) diff --git a/docs/man_pages/project/configuration/prepare.md b/docs/man_pages/project/configuration/prepare.md index 99f8efe46b..7749afa15d 100644 --- a/docs/man_pages/project/configuration/prepare.md +++ b/docs/man_pages/project/configuration/prepare.md @@ -10,6 +10,12 @@ position: 7 Copies common and relevant platform-specific content from the `app` directory to the subdirectory for the selected target platform in the `platforms` directory. This lets you build the project with the SDK for the selected platform. <% if(isMacOS) { %>You must specify the target platform for which you want to prepare your project.<% } %> +When running this command the HMR (Hot Module Replacement) is not enabled by default. In case you want to enable HMR, you can pass `--hmr` flag. + +<% if(isHtml) { %> +> NOTE: When passing `--release` CLI will disable HMR. +<% } %> + ### Commands Usage | Synopsis @@ -21,6 +27,10 @@ Usage | Synopsis * `android` - Prepares your project for an Android build. * `ios` - Prepares your project for an iOS build.<% } %> +### Options + +* `--hmr` - Enables the hot module replacement (HMR) feature. + <% if(isHtml) { %> ### Command Limitations diff --git a/docs/man_pages/project/testing/build-android.md b/docs/man_pages/project/testing/build-android.md index a68d6e2543..835e62e254 100644 --- a/docs/man_pages/project/testing/build-android.md +++ b/docs/man_pages/project/testing/build-android.md @@ -13,7 +13,7 @@ Builds the project for Android and produces an APK that you can manually deploy Usage | Synopsis ---|--- -General | `$ tns build android [--compileSdk ] [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--static-bindings] [--copy-to ] [--bundle [] [--env.*]] [--aab]` +General | `$ tns build android [--compileSdk ] [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--static-bindings] [--copy-to ] [--env.*]] [--aab]` ### Options @@ -25,7 +25,6 @@ General | `$ tns build android [--compileSdk ] [--key-store-path ] [--provision []] [--bundle [] [--env.*]]` +General | `$ tns build ios [--for-device] [--release] [--copy-to ] [--provision []] [--env.*]]` ### Options @@ -27,7 +27,6 @@ General | `$ tns build ios [--for-device] [--release] [--copy-to ] [- * `--copy-to` - Specifies the file path where the built `.ipa` will be copied. If it points to a non-existent directory path, it will be created. If the specified value is existing directory, the original file name will be used. * `--team-id` - If used without parameter, lists all team names and ids. If used with team name or id, it will switch to automatic signing mode and configure the .xcodeproj file of your app. In this case .xcconfig should not contain any provisioning/team id flags. This team id will be further used for codesigning the app. For Xcode 9.0+, xcodebuild will be allowed to update and modify automatically managed provisioning profiles. * `--provision` - If used without parameter, lists all eligible provisioning profiles. If used with UUID or name of your provisioning profile, it will switch to manual signing mode and configure the .xcodeproj file of your app. In this case xcconfig should not contain any provisioning/team id flags. This provisioning profile will be further used for codesigning the app. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. * `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags: * `--env.aot` - creates Ahead-Of-Time build (Angular only). * `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android). diff --git a/docs/man_pages/project/testing/build.md b/docs/man_pages/project/testing/build.md index ca58867483..eb4e7d7954 100644 --- a/docs/man_pages/project/testing/build.md +++ b/docs/man_pages/project/testing/build.md @@ -9,6 +9,12 @@ position: 3 Builds the project for Android <% if(isMacOS) { %>or iOS <% } %>and produces an application package that you can manually deploy on a device or native emulator. <% if(isMacOS) { %>You must specify the target platform for which you want to build your project.<% } %> +When running this command the HMR (Hot Module Replacement) is not enabled by default. In case you want to enable HMR, you can pass `--hmr` flag. + +<% if(isHtml) { %> +> NOTE: When passing `--release` CLI will disable HMR. +<% } %> + ### Commands Usage | Synopsis @@ -20,15 +26,12 @@ Usage | Synopsis * `android` - Build the project for Android and produces an `APK` that you can manually deploy on a device or in the native emulator. * `ios` - Build the project for iOS and produces an `APP` or `IPA` that you can manually deploy in the iOS Simulator or on a device.<% } %> -<% if(isHtml) { %> - ### Options * `--justlaunch` - If set, does not print the application output in the console. -* `--release` - If set, produces a release build. Otherwise, produces a debug build. +* `--release` -If set, produces a release build by running webpack in production mode and native build in release mode. Otherwise, produces a debug build. * `--device` - Specifies a connected device/emulator to start and run the app. `` is the index or `Device Identifier` of the target device as listed by the `$ tns device --available-devices` command. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--hmr` - Enables the hot module replacement (HMR) feature. * `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags: * `--env.aot` - creates Ahead-Of-Time build (Angular only). * `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android). @@ -36,8 +39,8 @@ Usage | Synopsis * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! +<% if(isHtml) { %> ### Related Commands diff --git a/docs/man_pages/project/testing/debug-android.md b/docs/man_pages/project/testing/debug-android.md index 2553e63ace..706ad97259 100644 --- a/docs/man_pages/project/testing/debug-android.md +++ b/docs/man_pages/project/testing/debug-android.md @@ -9,8 +9,6 @@ position: 4 Initiates a debugging session for your project on a connected Android device or Android emulator. When necessary, the command will prepare, build, deploy and launch the app before starting the debug session. While debugging, the output from the application is printed in the console and any changes made to your code are synchronizes with the deployed app. -To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in [the HMR documentation section](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#hot-module-replacement). - ### Commands Usage | Synopsis @@ -30,14 +28,10 @@ Attach the debug tools to a running app in the native emulator | `$ tns debug an * `--timeout` - Sets the number of seconds that the NativeScript CLI will wait for the emulator/device to boot. If not set, the default timeout is 90 seconds. * `--no-watch` - If set, changes in your code will not be reflected during the execution of this command. * `--clean` - If set, forces the complete rebuild of the native application. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well.<% if(isConsole) { %> For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. <% if(isHtml) { %> ->Note: For more information about HMR, the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ### Command Limitations * You must have Google Chrome installed on your machine. diff --git a/docs/man_pages/project/testing/debug-ios.md b/docs/man_pages/project/testing/debug-ios.md index 99efd2064e..c7fd745f7f 100644 --- a/docs/man_pages/project/testing/debug-ios.md +++ b/docs/man_pages/project/testing/debug-ios.md @@ -13,8 +13,6 @@ Initiates a debugging session for your project on a connected iOS device or in t <% if((isConsole && isMacOS) || isHtml) { %> <% if(isHtml) { %>> <% } %>IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your macOS system. <% if(isHtml) { %>For more information, see the [Code Signing](https://developer.apple.com/support/code-signing/) and [Maintain Signing Assets](https://help.apple.com/xcode/mac/current/#/dev3a05256b8) sections from the Apple Developer documentation.<% } %> -To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR. - ### Commands Usage | Synopsis @@ -35,17 +33,13 @@ Attach the debug tools to a running app in the iOS simulator | `$ tns debug ios * `--timeout` - Sets the number of seconds that NativeScript CLI will wait to find the inspector socket port from device's logs. If not set, the default timeout is 10 seconds. * `--no-watch` - If set, changes in your code will not be reflected during the execution of this command. * `--clean` - If set, forces the complete rebuild of the native application. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. * `--chrome` - Deprecated - default behavior uses '--chrome' implicitly. Allows debugging in Chrome Developer Tools. If set, Safari Web Inspector is not started and debugging is attached to Chrome Developer Tools. * `--inspector` - If set, the developer tools in the Safari Web Inspector are used for debugging the application. -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! <% } %> <% if(isHtml) { %> ->Note: Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ### Command Limitations * You can run `$ tns debug ios` only on macOS systems. diff --git a/docs/man_pages/project/testing/preview.md b/docs/man_pages/project/testing/preview.md index 8ab4fa79dc..e7d6063309 100644 --- a/docs/man_pages/project/testing/preview.md +++ b/docs/man_pages/project/testing/preview.md @@ -15,8 +15,6 @@ To scan the QR code and deploy your app on a device, you need to have the Native After scanning the QR code with the scanner provided in the NativeScript Playground app, your app will be launched on your device through the Preview app. Additionally, any changes made to your project will be automatically synchronized with the deployed app. -To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR. - ### Commands Usage | Synopsis @@ -25,15 +23,10 @@ Generates a QR code that can be scanned by the NativeScript PlayGround app | `tn ### Options -* `--bundle` - (Beta) Specifies that the `webpack` bundler will be used to bundle the application.<% if(isConsole) { %> The support for webpack in preview is currently in Beta. Please, do not hesitate to report any problems that you experience with the feature by opening a new issue in the NativeScript CLI repository: https://github.com/NativeScript/nativescript-cli/issues/new/choose.<% } %> -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well.<% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. <% if(isHtml) { %> ->Note: Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ->Note: Webpack support for the `tns preview` command is currently in Beta. Please, do not hesitate to report any problems that you experience with the feature by opening a new issue in the NativeScript CLI repository: https://github.com/NativeScript/nativescript-cli/issues/new/choose. - ### Command Limitations * The Preview app comes with a predefined set of NativeScript plugins. If your app utilizes a plugin that is not present in the Preview app, you will see a warning message and your app might not work as expected. diff --git a/docs/man_pages/project/testing/run-android.md b/docs/man_pages/project/testing/run-android.md index 2026e0b4da..f95712f7e8 100644 --- a/docs/man_pages/project/testing/run-android.md +++ b/docs/man_pages/project/testing/run-android.md @@ -9,15 +9,17 @@ position: 10 Runs your project on a connected Android device or Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application. -To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR. +<% if(isHtml) { %> +When running this command without passing `--release` flag, the HMR (Hot Module Replacement) is enabled by default. In case you want to disable HMR, you can pass `--no-hmr` flag. When `--release` is passed, CLI disables HMR. +<% } %> ### Commands Usage | Synopsis ---|--- -Run on all connected devices and running emulators | `$ tns run android [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--bundle [] [--env.*]]` -Run on a selected connected device or running emulator. Will start emulator with specified `Device Identifier`, if not already running. | `$ tns run android --device [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--bundle [] [--env.*]]` -Start a default emulator if none are running, or run application on all connected emulators. | `$ tns run android --emulator [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--bundle [] [--env.*]]` +Run on all connected devices and running emulators | `$ tns run android [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--env.*]]` +Run on a selected connected device or running emulator. Will start emulator with specified `Device Identifier`, if not already running. | `$ tns run android --device [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--env.*]]` +Start a default emulator if none are running, or run application on all connected emulators. | `$ tns run android --emulator [--key-store-path --key-store-password --key-store-alias --key-store-alias-password ] [--release] [--justlaunch] [--env.*]]` ### Options @@ -26,13 +28,12 @@ Start a default emulator if none are running, or run application on all connecte * `--justlaunch` - If set, does not print the application output in the console. * `--clean` - If set, forces the complete rebuild of the native application. * `--no-watch` - If set, changes in your code will not be reflected during the execution of this command. -* `--release` - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the `--key-store-*` options. +* `--release` - If set, produces a release build by running webpack in production mode and native build in release mode. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options. * `--key-store-path` - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options. * `--key-store-password` - Provides the password for the keystore file specified with `--key-store-path`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options. * `--key-store-alias` - Provides the alias for the keystore file specified with `--key-store-path`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options. * `--key-store-alias-password` - Provides the password for the alias specified with `--key-store-alias-password`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. * `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. * `--env.aot` - creates Ahead-Of-Time build (Angular only). * `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android). @@ -40,12 +41,9 @@ Start a default emulator if none are running, or run application on all connecte * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! <% if(isHtml) { %> ->Note: Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ### Prerequisites Before running your app in the Android emulator from the Android SDK, verify that your system meets the following requirements. diff --git a/docs/man_pages/project/testing/run-ios.md b/docs/man_pages/project/testing/run-ios.md index 997464e95e..3e30c3f4c9 100644 --- a/docs/man_pages/project/testing/run-ios.md +++ b/docs/man_pages/project/testing/run-ios.md @@ -13,15 +13,17 @@ Runs your project on a connected iOS device or in the iOS Simulator, if configur <% if((isConsole && isMacOS) || isHtml) { %> <% if(isHtml) { %>> <% } %>IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your macOS system. <% if(isHtml) { %>For more information, see the [Code Signing](https://developer.apple.com/support/code-signing/) and [Maintain Signing Assets](https://help.apple.com/xcode/mac/current/#/dev3a05256b8) sections from the Apple Developer documentation.<% } %> -To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR. +<% if(isHtml) { %> +When running this command without passing `--release` flag, the HMR (Hot Module Replacement) is enabled by default. In case you want to disable HMR, you can pass `--no-hmr` flag. When `--release` is passed, CLI disables HMR. +<% } %> ### Commands Usage | Synopsis ---|--- -Run on all connected devices | `$ tns run ios [--release] [--justlaunch] [--bundle [] [--env.*]]` -Run on a selected connected device. Will start simulator with specified `Device Identifier`, if not already running. | `$ tns run ios [--device ] [--release] [--justlaunch] [--bundle [] [--env.*]]` -Start an emulator and run the app inside it | `$ tns run ios --emulator [--release] [--bundle [] [--env.*]]` +Run on all connected devices | `$ tns run ios [--release] [--justlaunch] [--env.*]]` +Run on a selected connected device. Will start simulator with specified `Device Identifier`, if not already running. | `$ tns run ios [--device ] [--release] [--justlaunch] [--env.*]]` +Start an emulator and run the app inside it | `$ tns run ios --emulator [--release] [--env.*]]` Start an emulator with specified device name and sdk | `$ tns run ios [--device ] [--sdk ]` Start an emulator with specified device identifier and sdk | `$ tns run ios [--device ] [--sdk ]` @@ -33,9 +35,8 @@ Start an emulator with specified device identifier and sdk | `$ tns run ios [--d * `--justlaunch` - If set, does not print the application output in the console. * `--clean` - If set, forces the complete rebuild of the native application. * `--no-watch` - If set, changes in your code will not be reflected during the execution of this command. -* `--release` - If set, produces a release build. Otherwise, produces a debug build. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--release` - If set, produces a release build by running webpack in production mode and native build in release mode. Otherwise, produces a debug build. +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. * `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. * `--env.aot` - creates Ahead-Of-Time build (Angular only). * `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android). @@ -43,13 +44,10 @@ Start an emulator with specified device identifier and sdk | `$ tns run ios [--d * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! <% } %> <% if(isHtml) { %> ->Note: Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ### Prerequisites Before running the iOS Simulator, verify that your system meets the following requirements. diff --git a/docs/man_pages/project/testing/run.md b/docs/man_pages/project/testing/run.md index ed555af37f..6b6c9044a1 100644 --- a/docs/man_pages/project/testing/run.md +++ b/docs/man_pages/project/testing/run.md @@ -9,6 +9,10 @@ position: 12 Runs your project on all connected devices or in native emulators for the selected platform.<% if(isConsole && (isLinux || isWindows)) { %>The command will work with all currently running Android devices and emulators.<% } %> The command will prepare, build and deploy the app when necessary. By default listens for changes in your code, synchronizes those changes and refreshes all selected devices. +<% if(isHtml) { %> +When running this command without passing `--release` flag, the HMR (Hot Module Replacement) is enabled by default. In case you want to disable HMR, you can pass `--no-hmr` flag. When `--release` is passed, CLI disables HMR. +<% } %> + ### Commands Usage | Synopsis @@ -20,10 +24,9 @@ Run on a selected connected device or running emulator. Will start emulator with ### Options * `--justlaunch` - If set, does not print the application output in the console. -* `--release` - If set, produces a release build. Otherwise, produces a debug build. +* `--release` - If set, produces a release build by running webpack in production mode and native build in release mode. Otherwise, produces a debug build. * `--device` - Specifies a connected device/emulator to start and run the app. `` is the index or `Device Identifier` of the target device as listed by the `$ tns device --available-devices` command. -* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application. -* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %> +* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. * `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags: * `--env.aot` - creates Ahead-Of-Time build (Angular only). * `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android). @@ -31,7 +34,6 @@ Run on a selected connected device or running emulator. Will start emulator with * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). -* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary! <% if((isConsole && isMacOS) || isHtml) { %>### Arguments @@ -43,8 +45,6 @@ Run on a selected connected device or running emulator. Will start emulator with <% if(isHtml) { %> ->Note: Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398. - ### Command Limitations * The command will work with all connected devices and running emulators on macOS. On Windows and Linux the command will work with Android devices only. From 04584cd88a63265fdd4ecfddbfa93b5cc7922cb1 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Mon, 15 Jul 2019 18:35:54 +0300 Subject: [PATCH 03/38] docs: describe how different changes are synced --- docs/man_pages/project/testing/debug.md | 18 ++++++++++++++++++ docs/man_pages/project/testing/run.md | 16 +++++++++++++++- docs/man_pages/project/testing/test.md | 8 ++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/man_pages/project/testing/debug.md b/docs/man_pages/project/testing/debug.md index 40e1bb37d7..2b3270c72c 100644 --- a/docs/man_pages/project/testing/debug.md +++ b/docs/man_pages/project/testing/debug.md @@ -9,6 +9,24 @@ position: 6 Initiates a debugging session for your project on a connected device or native emulator. <% if(isMacOS) { %>You must specify the target platform on which you want to debug.<% } %> When necessary, the command will prepare, build, deploy and launch the app before starting the debug session. While debugging, the output from the application is printed in the console and any changes made to your code are synchronized on all connected devices or running emulators. +<% if(isHtml) { %> +#### How file changes are handled +With HMR (Hot Module Replacement): +* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types that are accepted will cause a refresh of the application. +* Changes in `App_Resources` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin` if accepted will cause a refresh of the application. +* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes that are not accepted and HMR fails will cause a restart of the native application. + +With **no** HMR: +* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. +* Changes in `App_Resources` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin` will cause a restart of the native application. +* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. + +When running this command with `--debug-brk` any file change will cause a restart of the native application. Changes in `App_Resources` and `node_modules/somePlugin/platforms` will cause a rebuild of the application. +<% } %> + ### Commands Usage | Synopsis diff --git a/docs/man_pages/project/testing/run.md b/docs/man_pages/project/testing/run.md index 6b6c9044a1..07772ceb52 100644 --- a/docs/man_pages/project/testing/run.md +++ b/docs/man_pages/project/testing/run.md @@ -11,6 +11,20 @@ Runs your project on all connected devices or in native emulators for the select <% if(isHtml) { %> When running this command without passing `--release` flag, the HMR (Hot Module Replacement) is enabled by default. In case you want to disable HMR, you can pass `--no-hmr` flag. When `--release` is passed, CLI disables HMR. + +#### How file changes are handled +With HMR (Hot Module Replacement): +* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types that are accepted will cause a refresh of the application. +* Changes in `App_Resources` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin` if accepted will cause a refresh of the application. +* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes that are not accepted and HMR fails will cause a restart of the native application. + +With **no** HMR: +* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. +* Changes in `App_Resources` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin` will cause a restart of the native application. +* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. <% } %> ### Commands @@ -19,7 +33,7 @@ Usage | Synopsis ---|--- Run on all connected devices | `$ tns run [--release] [--justlaunch]` Run on a selected connected device or running emulator. Will start emulator with specified `Device Identifier`, if not already running. | `$ tns run --device [--release] [--justlaunch]` -<% if((isConsole && isMacOS) || isHtml) { %>Run on all connected devices of the speficied `Platform` | `$ tns run [--release] [--justlaunch]`<% } %> +<% if((isConsole && isMacOS) || isHtml) { %>Run on all connected devices of the specified `Platform` | `$ tns run [--release] [--justlaunch]`<% } %> ### Options diff --git a/docs/man_pages/project/testing/test.md b/docs/man_pages/project/testing/test.md index c09a07f54d..0e20fd85cd 100644 --- a/docs/man_pages/project/testing/test.md +++ b/docs/man_pages/project/testing/test.md @@ -9,6 +9,14 @@ position: 23 Runs unit tests on the selected mobile platform.<% if(isConsole) { %> Your project must already be configured for unit testing by running `$ tns test init`.<% } %> +<% if(isHtml) { %> +#### How file changes are handled +* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. +* Changes in `App_Resources` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin` will cause a restart of the native application. +* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +<% } %> + ### Commands Usage | Synopsis From b4b4f2d554ac5d64d83ccdbe584a84b26026cdf3 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Mon, 15 Jul 2019 17:47:11 +0300 Subject: [PATCH 04/38] fix: update nativescript-angular during app migration as we are updating the compiler-cli from dev-webpack --- lib/controllers/migrate-controller.ts | 75 ++++++++++++--------------- lib/definitions/migrate.d.ts | 1 - 2 files changed, 33 insertions(+), 43 deletions(-) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 49c00bcd52..c6a4d28e89 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -70,6 +70,15 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "kinvey-nativescript-sdk", verifiedVersion: "4.2.1" }, { packageName: "nativescript-plugin-firebase", verifiedVersion: "9.0.2" }, { packageName: "nativescript-vue", verifiedVersion: "2.3.0" }, + { + packageName: "nativescript-angular", verifiedVersion: "8.0.2", + shouldMigrateAction: async (projectData: IProjectData, allowInvalidVersions: boolean) => { + const dependency = { packageName: "nativescript-angular", verifiedVersion: "8.0.2", isDev: false }; + const result = this.hasDependency(dependency, projectData) && await this.shouldMigrateDependencyVersion(dependency, projectData, allowInvalidVersions); + return result; + }, + migrateAction: this.migrateNativeScriptAngular.bind(this) + }, { packageName: "nativescript-permissions", verifiedVersion: "1.3.0" }, { packageName: "nativescript-cardview", verifiedVersion: "3.2.0" }, { @@ -81,7 +90,7 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; }, migrateAction: this.migrateUnitTestRunner.bind(this) }, - { packageName: MigrateController.typescriptPackageName, isDev: true, getVerifiedVersion: this.getAngularTypeScriptVersion.bind(this) }, + { packageName: MigrateController.typescriptPackageName, isDev: true, verifiedVersion: "3.4.5" }, { packageName: "nativescript-localize", verifiedVersion: "4.2.0" }, { packageName: "nativescript-dev-babel", verifiedVersion: "0.2.1" }, { packageName: "nativescript-nfc", verifiedVersion: "4.0.1" } @@ -179,31 +188,6 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; } } - private async getAngularTypeScriptVersion(projectData: IProjectData): Promise { - let verifiedVersion = "3.4.1"; - try { - const ngcPackageName = "@angular/compiler-cli"; - // e.g. ~8.0.0 - let ngcVersion = projectData.dependencies[ngcPackageName] || projectData.devDependencies[ngcPackageName]; - if (ngcVersion) { - // e.g. 8.0.3 - ngcVersion = await this.$packageInstallationManager.maxSatisfyingVersion(ngcPackageName, ngcVersion); - const ngcManifest = await this.getPackageManifest(ngcPackageName, ngcVersion); - // e.g. >=3.4 <3.5 - verifiedVersion = (ngcManifest && ngcManifest.peerDependencies && - ngcManifest.peerDependencies[MigrateController.typescriptPackageName]) || verifiedVersion; - - // e.g. 3.4.4 - verifiedVersion = await this.$packageInstallationManager.maxSatisfyingVersion( - MigrateController.typescriptPackageName, verifiedVersion); - } - } catch (error) { - this.$logger.warn(`Unable to determine the TypeScript version based on the Angular packages. Error is: '${error}'.`); - } - - return verifiedVersion; - } - private async migrateOldAndroidAppResources(projectData: IProjectData, backupDir: string) { const appResourcesPath = projectData.getAppResourcesDirectoryPath(); if (!this.$androidResourcesMigrationService.hasMigrated(appResourcesPath)) { @@ -329,33 +313,23 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; this.$errors.failWithoutHelp("Failed to find replacement dependency."); } - const replacementDepVersion = await this.getDependencyVerifiedVersion(replacementDep, projectData); this.$logger.info(`Replacing '${dependency.packageName}' with '${replacementDep.packageName}'.`); - this.$pluginsService.addToPackageJson(replacementDep.packageName, replacementDepVersion, replacementDep.isDev, projectData.projectDir); + this.$pluginsService.addToPackageJson(replacementDep.packageName, replacementDep.verifiedVersion, replacementDep.isDev, projectData.projectDir); } return; } - const dependencyVersion = await this.getDependencyVerifiedVersion(dependency, projectData); if (hasDependency && await this.shouldMigrateDependencyVersion(dependency, projectData, allowInvalidVersions)) { - this.$logger.info(`Updating '${dependency.packageName}' to compatible version '${dependencyVersion}'`); - this.$pluginsService.addToPackageJson(dependency.packageName, dependencyVersion, dependency.isDev, projectData.projectDir); + this.$logger.info(`Updating '${dependency.packageName}' to compatible version '${dependency.verifiedVersion}'`); + this.$pluginsService.addToPackageJson(dependency.packageName, dependency.verifiedVersion, dependency.isDev, projectData.projectDir); return; } if (!hasDependency && dependency.shouldAddIfMissing) { - this.$logger.info(`Adding '${dependency.packageName}' with version '${dependencyVersion}'`); - this.$pluginsService.addToPackageJson(dependency.packageName, dependencyVersion, dependency.isDev, projectData.projectDir); - } - } - - private async getDependencyVerifiedVersion(dependency: IMigrationDependency, projectData: IProjectData): Promise { - if (!dependency.verifiedVersion && dependency.getVerifiedVersion) { - dependency.verifiedVersion = await dependency.getVerifiedVersion(projectData); + this.$logger.info(`Adding '${dependency.packageName}' with version '${dependency.verifiedVersion}'`); + this.$pluginsService.addToPackageJson(dependency.packageName, dependency.verifiedVersion, dependency.isDev, projectData.projectDir); } - - return dependency.verifiedVersion; } private async shouldMigrateDependencyVersion(dependency: IMigrationDependency, projectData: IProjectData, allowInvalidVersions: boolean): Promise { @@ -364,7 +338,7 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; const packageName = dependency.packageName; const referencedVersion = dependencies[packageName] || devDependencies[packageName]; const installedVersion = await this.getMaxDependencyVersion(dependency.packageName, referencedVersion); - const requiredVersion = await this.getDependencyVerifiedVersion(dependency, projectData); + const requiredVersion = dependency.verifiedVersion; return this.isOutdatedVersion(installedVersion, requiredVersion, allowInvalidVersions); } @@ -410,6 +384,23 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; return dependencies; } + + private async migrateNativeScriptAngular(): Promise { + const dependencies = [ + { packageName: "@angular/platform-browser-dynamic", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/common", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/compiler", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/core", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/forms", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/http", verifiedVersion: "8.0.0-beta.10", shouldAddIfMissing: true }, + { packageName: "@angular/platform-browser", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "@angular/router", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, + { packageName: "rxjs", verifiedVersion: "6.3.3", shouldAddIfMissing: true }, + { packageName: "zone.js", verifiedVersion: "0.9.1", shouldAddIfMissing: true } + ]; + + return dependencies; + } } $injector.register("migrateController", MigrateController); diff --git a/lib/definitions/migrate.d.ts b/lib/definitions/migrate.d.ts index 1931d4fc88..81ce7da475 100644 --- a/lib/definitions/migrate.d.ts +++ b/lib/definitions/migrate.d.ts @@ -19,7 +19,6 @@ interface IMigrationDependency extends IDependency { replaceWith?: string; warning?: string; verifiedVersion?: string; - getVerifiedVersion?: (projectData: IProjectData) => Promise; shouldAddIfMissing?: boolean; shouldMigrateAction?: (projectData: IProjectData, allowInvalidVersions: boolean) => Promise; migrateAction?: (projectData: IProjectData, migrationBackupDirPath: string) => Promise; From c2b1448fd0eecf2ed383aaf45ab583749f113b15 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Tue, 16 Jul 2019 09:49:58 +0300 Subject: [PATCH 05/38] fix: support node <= 8.9.4 (lookbehind is supported only with the `harmony` flag) https://node.green/#ES2018-features--RegExp-Lookbehind-Assertions --- lib/services/webpack/webpack-compiler-service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 58110df109..b004566a4f 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -1,5 +1,6 @@ import * as path from "path"; import * as child_process from "child_process"; +import * as semver from "semver"; import { EventEmitter } from "events"; import { performanceLog } from "../../common/decorators"; import { WEBPACK_COMPILATION_COMPLETE } from "../../constants"; @@ -130,8 +131,10 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp private async startWebpackProcess(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise { const envData = this.buildEnvData(platformData.platformNameLowerCase, projectData, prepareData); const envParams = this.buildEnvCommandLineParams(envData, platformData, prepareData); + const additionalNodeArgs = semver.major(process.version) <= 8 ? ["--harmony"] : []; const args = [ + ...additionalNodeArgs, path.join(projectData.projectDir, "node_modules", "webpack", "bin", "webpack.js"), "--preserve-symlinks", `--config=${path.join(projectData.projectDir, "webpack.config.js")}`, From 811b406295b7a0e1b0fbb76cdff31a47c38850f5 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Tue, 16 Jul 2019 14:37:34 +0300 Subject: [PATCH 06/38] docs: add package.json change effect to run, debug, test docs --- docs/man_pages/project/testing/debug.md | 6 +++++- docs/man_pages/project/testing/run.md | 4 ++++ docs/man_pages/project/testing/test.md | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/man_pages/project/testing/debug.md b/docs/man_pages/project/testing/debug.md index 2b3270c72c..c37a49c4e6 100644 --- a/docs/man_pages/project/testing/debug.md +++ b/docs/man_pages/project/testing/debug.md @@ -14,17 +14,21 @@ Initiates a debugging session for your project on a connected device or native e With HMR (Hot Module Replacement): * Changes in `.js`, `.ts`, `.less`, `.sass` and other file types that are accepted will cause a refresh of the application. * Changes in `App_Resources` will cause a rebuild of the application. +* Changes in any `package.json` file inside the project will cause a rebuild of the application. * Changes in `node_modules/somePlugin` if accepted will cause a refresh of the application. * Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application. * Changes that are not accepted and HMR fails will cause a restart of the native application. With **no** HMR: * Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. * Changes in `App_Resources` will cause a rebuild of the application. +* Changes in any `package.json` file inside the project will cause a rebuild of the application. * Changes in `node_modules/somePlugin` will cause a restart of the native application. * Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application. -When running this command with `--debug-brk` any file change will cause a restart of the native application. Changes in `App_Resources` and `node_modules/somePlugin/platforms` will cause a rebuild of the application. +When running this command with `--debug-brk` any file change will cause a restart of the native application (HMR is disabled). Changes in `App_Resources` and `node_modules/somePlugin/platforms` will cause a rebuild of the application. <% } %> ### Commands diff --git a/docs/man_pages/project/testing/run.md b/docs/man_pages/project/testing/run.md index 07772ceb52..99c6d1a8e5 100644 --- a/docs/man_pages/project/testing/run.md +++ b/docs/man_pages/project/testing/run.md @@ -16,15 +16,19 @@ When running this command without passing `--release` flag, the HMR (Hot Module With HMR (Hot Module Replacement): * Changes in `.js`, `.ts`, `.less`, `.sass` and other file types that are accepted will cause a refresh of the application. * Changes in `App_Resources` will cause a rebuild of the application. +* Changes in any `package.json` file inside the project will cause a rebuild of the application. * Changes in `node_modules/somePlugin` if accepted will cause a refresh of the application. * Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application. * Changes that are not accepted and HMR fails will cause a restart of the native application. With **no** HMR: * Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. * Changes in `App_Resources` will cause a rebuild of the application. +* Changes in any `package.json` file inside the project will cause a rebuild of the application. * Changes in `node_modules/somePlugin` will cause a restart of the native application. * Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application. <% } %> ### Commands diff --git a/docs/man_pages/project/testing/test.md b/docs/man_pages/project/testing/test.md index 0e20fd85cd..59edac7c60 100644 --- a/docs/man_pages/project/testing/test.md +++ b/docs/man_pages/project/testing/test.md @@ -13,8 +13,10 @@ Runs unit tests on the selected mobile platform.<% if(isConsole) { %> Your proje #### How file changes are handled * Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application. * Changes in `App_Resources` will cause a rebuild of the application. +* Changes in any `package.json` file inside the project will cause a rebuild of the application. * Changes in `node_modules/somePlugin` will cause a restart of the native application. * Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application. +* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application. <% } %> ### Commands From 94a434499a380b95120c99cb074a6cbc8e8a22c5 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Tue, 16 Jul 2019 10:13:43 +0300 Subject: [PATCH 07/38] docs: update `tns migrate` docs based on the latest changes --- docs/man_pages/general/migrate.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/man_pages/general/migrate.md b/docs/man_pages/general/migrate.md index b33a19f87a..9f68873ee4 100644 --- a/docs/man_pages/general/migrate.md +++ b/docs/man_pages/general/migrate.md @@ -37,6 +37,17 @@ The following dependencies will be updated if needed: * kinvey-nativescript-sdk * nativescript-plugin-firebase * nativescript-vue +* nativescript-angular +* @angular/platform-browser-dynamic +* @angular/common +* @angular/compiler +* @angular/core +* @angular/forms +* @angular/http +* @angular/platform-browser +* @angular/router +* rxjs +* zone.js * nativescript-unit-test-runner * karma-webpack * karma-jasmine From 649c579ad217d6e174054e6b33ec2fe0a17902d6 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Tue, 16 Jul 2019 15:13:33 +0300 Subject: [PATCH 08/38] docs: describe the `--force` flag in the docs --- docs/man_pages/project/configuration/prepare.md | 1 + docs/man_pages/project/testing/build-android.md | 1 + docs/man_pages/project/testing/build-ios.md | 1 + docs/man_pages/project/testing/build.md | 1 + docs/man_pages/project/testing/debug-android.md | 1 + docs/man_pages/project/testing/debug-ios.md | 1 + docs/man_pages/project/testing/preview.md | 1 + docs/man_pages/project/testing/run-android.md | 1 + docs/man_pages/project/testing/run-ios.md | 1 + docs/man_pages/project/testing/run.md | 1 + docs/man_pages/project/testing/test-android.md | 1 + docs/man_pages/project/testing/test-ios.md | 1 + 12 files changed, 12 insertions(+) diff --git a/docs/man_pages/project/configuration/prepare.md b/docs/man_pages/project/configuration/prepare.md index 7749afa15d..211773f3ed 100644 --- a/docs/man_pages/project/configuration/prepare.md +++ b/docs/man_pages/project/configuration/prepare.md @@ -30,6 +30,7 @@ Usage | Synopsis ### Options * `--hmr` - Enables the hot module replacement (HMR) feature. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/build-android.md b/docs/man_pages/project/testing/build-android.md index 835e62e254..e4041c7ecb 100644 --- a/docs/man_pages/project/testing/build-android.md +++ b/docs/man_pages/project/testing/build-android.md @@ -33,6 +33,7 @@ General | `$ tns build android [--compileSdk ] [--key-store-path diff --git a/docs/man_pages/project/testing/build-ios.md b/docs/man_pages/project/testing/build-ios.md index 6478e20d6d..f782c96c97 100644 --- a/docs/man_pages/project/testing/build-ios.md +++ b/docs/man_pages/project/testing/build-ios.md @@ -34,6 +34,7 @@ General | `$ tns build ios [--for-device] [--release] [--copy-to ] [- * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% } %> diff --git a/docs/man_pages/project/testing/build.md b/docs/man_pages/project/testing/build.md index eb4e7d7954..eada1e13b0 100644 --- a/docs/man_pages/project/testing/build.md +++ b/docs/man_pages/project/testing/build.md @@ -39,6 +39,7 @@ Usage | Synopsis * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/debug-android.md b/docs/man_pages/project/testing/debug-android.md index 706ad97259..5aeae09a3d 100644 --- a/docs/man_pages/project/testing/debug-android.md +++ b/docs/man_pages/project/testing/debug-android.md @@ -29,6 +29,7 @@ Attach the debug tools to a running app in the native emulator | `$ tns debug an * `--no-watch` - If set, changes in your code will not be reflected during the execution of this command. * `--clean` - If set, forces the complete rebuild of the native application. * `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/debug-ios.md b/docs/man_pages/project/testing/debug-ios.md index c7fd745f7f..0b1a8ffa0a 100644 --- a/docs/man_pages/project/testing/debug-ios.md +++ b/docs/man_pages/project/testing/debug-ios.md @@ -36,6 +36,7 @@ Attach the debug tools to a running app in the iOS simulator | `$ tns debug ios * `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. * `--chrome` - Deprecated - default behavior uses '--chrome' implicitly. Allows debugging in Chrome Developer Tools. If set, Safari Web Inspector is not started and debugging is attached to Chrome Developer Tools. * `--inspector` - If set, the developer tools in the Safari Web Inspector are used for debugging the application. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% } %> <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/preview.md b/docs/man_pages/project/testing/preview.md index e7d6063309..1d3a5268c8 100644 --- a/docs/man_pages/project/testing/preview.md +++ b/docs/man_pages/project/testing/preview.md @@ -24,6 +24,7 @@ Generates a QR code that can be scanned by the NativeScript PlayGround app | `tn ### Options * `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/run-android.md b/docs/man_pages/project/testing/run-android.md index f95712f7e8..7572159672 100644 --- a/docs/man_pages/project/testing/run-android.md +++ b/docs/man_pages/project/testing/run-android.md @@ -41,6 +41,7 @@ Start a default emulator if none are running, or run application on all connecte * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/run-ios.md b/docs/man_pages/project/testing/run-ios.md index 3e30c3f4c9..343c0e7395 100644 --- a/docs/man_pages/project/testing/run-ios.md +++ b/docs/man_pages/project/testing/run-ios.md @@ -44,6 +44,7 @@ Start an emulator with specified device identifier and sdk | `$ tns run ios [--d * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% } %> <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/run.md b/docs/man_pages/project/testing/run.md index 99c6d1a8e5..87e87ea5eb 100644 --- a/docs/man_pages/project/testing/run.md +++ b/docs/man_pages/project/testing/run.md @@ -52,6 +52,7 @@ Run on a selected connected device or running emulator. Will start emulator with * `--env.report` - creates a Webpack report inside a `report` folder in the root folder. * `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app). * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if((isConsole && isMacOS) || isHtml) { %>### Arguments diff --git a/docs/man_pages/project/testing/test-android.md b/docs/man_pages/project/testing/test-android.md index 21b301f4b2..2c5e984959 100644 --- a/docs/man_pages/project/testing/test-android.md +++ b/docs/man_pages/project/testing/test-android.md @@ -21,6 +21,7 @@ Run tests on a selected device | `$ tns test android --device [--wat * `--watch` - If set, when you save changes to the project, changes are automatically synchronized to the connected device and tests are re-run. * `--device` - Specifies the serial number or the index of the connected device on which to run the tests. To list all connected devices, grouped by platform, run `$ tns device`. `` is the device index or identifier as listed by the `$ tns device` command. * `--debug-brk` - Runs the tests under the debugger. The debugger will break just before your tests are executed, so you have a chance to place breakpoints. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% if(isHtml) { %> diff --git a/docs/man_pages/project/testing/test-ios.md b/docs/man_pages/project/testing/test-ios.md index 32efa9a325..727a69d669 100644 --- a/docs/man_pages/project/testing/test-ios.md +++ b/docs/man_pages/project/testing/test-ios.md @@ -27,6 +27,7 @@ Run tests in the iOS Simulator | `$ tns test ios --emulator [--watch] [--debug-b * `--device` - Specifies the serial number or the index of the connected device on which you want to run tests. To list all connected devices, grouped by platform, run `$ tns device`. You cannot set `--device` and `--emulator` simultaneously. `` is the device index or identifier as listed by the `$ tns device` command. * `--emulator` - Runs tests on the iOS Simulator. You cannot set `--device` and `--emulator` simultaneously. * `--debug-brk` - Runs the tests under the debugger. The debugger will break just before your tests are executed, so you have a chance to place breakpoints. +* `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. <% } %> From 214311f495868bd1b0322ffc0b76e8a6cb5baf61 Mon Sep 17 00:00:00 2001 From: fatme Date: Mon, 15 Jul 2019 13:01:33 +0300 Subject: [PATCH 09/38] fix: respect correctly `hmr: false` from command's dashed options NativeScript CLI doesn't respect correctly `hmr: false` when the option is provided through dashed options from command. This led to the exception when the application is built using CLI and deployed on device using Xcode as the `hmr` is included in app's bundle. Fixes: https://github.com/NativeScript/nativescript-cli/issues/4846 https://github.com/NativeScript/nativescript-cli/issues/4814 --- lib/common/definitions/yargs.d.ts | 100 ------------------------ lib/common/services/commands-service.ts | 12 +-- lib/options.ts | 28 +++---- npm-shrinkwrap.json | 15 ++++ package.json | 1 + test/options.ts | 38 +++++++++ 6 files changed, 70 insertions(+), 124 deletions(-) delete mode 100644 lib/common/definitions/yargs.d.ts diff --git a/lib/common/definitions/yargs.d.ts b/lib/common/definitions/yargs.d.ts deleted file mode 100644 index aafee6b841..0000000000 --- a/lib/common/definitions/yargs.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Type definitions for yargs -// Project: https://github.com/chevex/yargs -// Definitions by: Martin Poelstra -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module "yargs" { - - module yargs { - interface Argv { - argv: any; - (...args: any[]): any; - parse(...args: any[]): any; - - alias(shortName: string, longName: string): Argv; - alias(aliases: { [shortName: string]: string }): Argv; - alias(aliases: { [shortName: string]: string[] }): Argv; - - default(key: string, value: any): Argv; - default(defaults: { [key: string]: any}): Argv; - - demand(key: string, msg: string): Argv; - demand(key: string, required?: boolean): Argv; - demand(keys: string[], msg: string): Argv; - demand(keys: string[], required?: boolean): Argv; - demand(positionals: number, required?: boolean): Argv; - demand(positionals: number, msg: string): Argv; - - require(key: string, msg: string): Argv; - require(key: string, required: boolean): Argv; - require(keys: number[], msg: string): Argv; - require(keys: number[], required: boolean): Argv; - require(positionals: number, required: boolean): Argv; - require(positionals: number, msg: string): Argv; - - required(key: string, msg: string): Argv; - required(key: string, required: boolean): Argv; - required(keys: number[], msg: string): Argv; - required(keys: number[], required: boolean): Argv; - required(positionals: number, required: boolean): Argv; - required(positionals: number, msg: string): Argv; - - requiresArg(key: string): Argv; - requiresArg(keys: string[]): Argv; - - describe(key: string, description: string): Argv; - describe(descriptions: { [key: string]: string }): Argv; - - option(key: string, options: IDashedOption): Argv; - option(options: { [key: string]: IDashedOption }): Argv; - options(key: string, options: IDashedOption): Argv; - options(options: { [key: string]: IDashedOption }): Argv; - - usage(message: string, options?: { [key: string]: IDashedOption }): Argv; - usage(options?: { [key: string]: IDashedOption }): Argv; - - example(command: string, description: string): Argv; - - check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => boolean): Argv; - check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => string): Argv; - - boolean(key: string): Argv; - boolean(keys: string[]): Argv; - - string(key: string): Argv; - string(keys: string[]): Argv; - - config(key: string): Argv; - config(keys: string[]): Argv; - - wrap(columns: number): Argv; - - strict(): Argv; - - help(): string; - help(option: string, description?: string): Argv; - - version(version: string, option?: string, description?: string): Argv; - - showHelpOnFail(enable: boolean, message?: string): Argv; - - showHelp(func?: (message: string) => any): Argv; - - /* Undocumented */ - - normalize(key: string): Argv; - normalize(keys: string[]): Argv; - - implies(key: string, value: string): Argv; - implies(implies: { [key: string]: string }): Argv; - - count(key: string): Argv; - count(keys: string[]): Argv; - - fail(func: (msg: string) => any): void; - } - } - - var yargs: yargs.Argv; - export = yargs; -} \ No newline at end of file diff --git a/lib/common/services/commands-service.ts b/lib/common/services/commands-service.ts index b4bb6566d0..5b2bd90d5d 100644 --- a/lib/common/services/commands-service.ts +++ b/lib/common/services/commands-service.ts @@ -27,8 +27,7 @@ export class CommandsService implements ICommandsService { private $staticConfig: Config.IStaticConfig, private $helpService: IHelpService, private $extensibilityService: IExtensibilityService, - private $optionsTracker: IOptionsTracker, - private $projectDataService: IProjectDataService) { + private $optionsTracker: IOptionsTracker) { } public allCommands(opts: { includeDevCommands: boolean }): string[] { @@ -106,15 +105,8 @@ export class CommandsService implements ICommandsService { private async tryExecuteCommandAction(commandName: string, commandArguments: string[]): Promise { const command = this.$injector.resolveCommand(commandName); if (!command || !command.isHierarchicalCommand) { - let projectData = null; - try { - projectData = this.$projectDataService.getProjectData(); - } catch (err) { - this.$logger.trace(`Error while trying to get project data. More info: ${err}`); - } - const dashedOptions = command ? command.dashedOptions : null; - this.$options.validateOptions(dashedOptions, projectData); + this.$options.validateOptions(dashedOptions); } return this.canExecuteCommand(commandName, commandArguments); diff --git a/lib/options.ts b/lib/options.ts index f370b093ef..d352b62bf8 100644 --- a/lib/options.ts +++ b/lib/options.ts @@ -6,7 +6,7 @@ export class Options { private static NONDASHED_OPTION_REGEX = /(.+?)[-]([a-zA-Z])(.*)/; private optionsWhiteList = ["ui", "recursive", "reporter", "require", "timeout", "_", "$0"]; // These options shouldn't be validated - public argv: IYargArgv; + private yargsArgv: yargs.Argv; private globalOptions: IDictionary = { log: { type: OptionType.String, hasSensitiveValue: false }, verbose: { type: OptionType.Boolean, alias: "v", hasSensitiveValue: false }, @@ -19,24 +19,23 @@ export class Options { _: { type: OptionType.String, hasSensitiveValue: false } }; + public argv: yargs.Arguments; public options: IDictionary; - public setupOptions(projectData: IProjectData, commandSpecificDashedOptions?: IDictionary): void { + public setupOptions(commandSpecificDashedOptions?: IDictionary): void { if (commandSpecificDashedOptions) { _.extend(this.options, commandSpecificDashedOptions); this.setArgv(); } - if (this.argv.release && this.argv.hmr) { + this.argv.bundle = "webpack"; + + // Check if the user has explicitly provide --hmr and --release options from command line + if (this.yargsArgv.argv.release && this.yargsArgv.argv.hmr) { this.$errors.failWithoutHelp("The options --release and --hmr cannot be used simultaneously."); } - this.argv.bundle = "webpack"; - - const parsed = require("yargs-parser")(process.argv.slice(2), { 'boolean-negation': false }); - // --no-hmr -> hmr: false or --hmr false -> hmr: 'false' - const noHmr = parsed && (parsed.hmr === false || parsed.hmr === 'false'); - if (!noHmr) { + if (this.argv.hmr) { this.argv.hmr = !this.argv.release; } @@ -111,7 +110,7 @@ export class Options { pluginName: { type: OptionType.String, hasSensitiveValue: false }, includeTypeScriptDemo: { type: OptionType.String, hasSensitiveValue: false }, includeAngularDemo: { type: OptionType.String, hasSensitiveValue: false }, - hmr: { type: OptionType.Boolean, hasSensitiveValue: false }, + hmr: { type: OptionType.Boolean, hasSensitiveValue: false, default: true }, collection: { type: OptionType.String, alias: "c", hasSensitiveValue: false }, json: { type: OptionType.Boolean, hasSensitiveValue: false }, avd: { type: OptionType.String, hasSensitiveValue: true }, @@ -159,8 +158,8 @@ export class Options { return this.argv[optionName]; } - public validateOptions(commandSpecificDashedOptions?: IDictionary, projectData?: IProjectData): void { - this.setupOptions(projectData, commandSpecificDashedOptions); + public validateOptions(commandSpecificDashedOptions?: IDictionary): void { + this.setupOptions(commandSpecificDashedOptions); const parsed = Object.create(null); // DO NOT REMOVE { } as when they are missing and some of the option values is false, the each stops as it thinks we have set "return false". _.each(_.keys(this.argv), optionName => { @@ -251,12 +250,13 @@ export class Options { opts[this.getDashedOptionName(key)] = value; }); - this.argv = yargs(process.argv.slice(2)).options(opts).argv; + this.yargsArgv = yargs(process.argv.slice(2)); + this.argv = this.yargsArgv.options(opts).argv; // For backwards compatibility // Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result. // Now the profileDir should be used from $settingsService, but ensure the `this.$options.profileDir` returns the same value. - this.$settingsService.setSettings({ profileDir: this.argv.profileDir }); + this.$settingsService.setSettings({ profileDir: this.argv.profileDir }); this.argv.profileDir = this.argv["profile-dir"] = this.$settingsService.getProfileDir(); // if justlaunch is set, it takes precedence over the --watch flag and the default true value diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5c7e81c9fc..48fc5298fd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -405,6 +405,21 @@ "@types/node": "*" } }, + "@types/yargs": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.0.tgz", + "integrity": "sha512-hY0o+kcz9M6kH32NUeb6VURghqMuCVkiUx+8Btsqhj4Hhov/hVGUx9DmBJeIkzlp1uAQK4wngQBCjqWdUUkFyA==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-wBlsw+8n21e6eTd4yVv8YD/E3xq0O6nNnJIquutAsFGE7EyMKz7W6RNT6BRu1SmdgmlCZ9tb0X+j+D6HGr8pZw==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", diff --git a/package.json b/package.json index aeac11d9b9..6c53726f4d 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "@types/universal-analytics": "0.4.1", "@types/ws": "4.0.1", "@types/xml2js": "0.4.3", + "@types/yargs": "13.0.0", "chai": "4.0.2", "chai-as-promised": "7.0.0", "grunt": "1.0.1", diff --git a/test/options.ts b/test/options.ts index e45bdbcb9d..2ad685f0f0 100644 --- a/test/options.ts +++ b/test/options.ts @@ -286,6 +286,44 @@ describe("options", () => { assert.deepEqual(actualError, testCase.expectedError); }); }); + + describe("hmr option", () => { + const testCases = [{ + name: "should set hmr to true by default", + expectedHmrValue: true + }, { + name: "set set hmr to false when --no-hmr is provided", + args: ["--no-hmr"], + expectedHmrValue: false + }, { + name: "should set hmr to false when provided through dashed options from command", + commandSpecificDashedOptions: { + hmr: { type: OptionType.Boolean, default: false, hasSensitiveValue: false }, + }, + expectedHmrValue: false + }, { + name: "should set hmr to false by default when --release option is provided", + args: ["--release"], + expectedHmrValue: false + }, { + name: "should set hmr to false by default when --debug-brk option is provided", + args: ["--debugBrk"], + expectedHmrValue: false + }]; + + _.each(testCases, testCase => { + it(testCase.name, () => { + (testCase.args || []).forEach(arg => process.argv.push(arg)); + + const options: any = createOptions(testInjector); + options.setupOptions(testCase.commandSpecificDashedOptions); + + assert.equal(testCase.expectedHmrValue, options.argv.hmr); + + (testCase.args || []).forEach(arg => process.argv.pop()); + }); + }); + }); }); }); From d10acd713c865ef4a6edd1d2fa2a6cda08989202 Mon Sep 17 00:00:00 2001 From: fatme Date: Tue, 16 Jul 2019 16:43:42 +0300 Subject: [PATCH 10/38] fix: don't override `--env.production` and `--env.verbose` when provided from user --- lib/services/webpack/webpack-compiler-service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index b004566a4f..e0af115380 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -173,8 +173,9 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp appResourcesPath && { appResourcesPath }, ); - envData.verbose = this.$logger.isVerbose(); - envData.production = prepareData.release; + envData.verbose = envData.verbose || this.$logger.isVerbose(); + envData.production = envData.production || prepareData.release; + if (prepareData.env && (prepareData.env.sourceMap === false || prepareData.env.sourceMap === 'false')) { delete envData.sourceMap; } else if (!prepareData.release) { From e0768b47bfc0c3b43764e97ba7eed9705785beee Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Tue, 16 Jul 2019 17:38:06 +0300 Subject: [PATCH 11/38] docs: update outdated docs --- docs/man_pages/index.md | 1 - docs/man_pages/lib-management/plugin-add.md | 2 +- docs/man_pages/lib-management/plugin-create.md | 5 ++++- docs/man_pages/lib-management/plugin-remove.md | 2 +- docs/man_pages/lib-management/plugin-update.md | 2 +- docs/man_pages/project/configuration/platform-add.md | 12 +++++------- docs/man_pages/project/configuration/prepare.md | 3 +-- docs/man_pages/project/creation/create.md | 1 - docs/man_pages/project/testing/build-android.md | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/man_pages/index.md b/docs/man_pages/index.md index 0d86ade439..50996a387f 100644 --- a/docs/man_pages/index.md +++ b/docs/man_pages/index.md @@ -29,7 +29,6 @@ Command | Description ---|--- [create](project/creation/create.html) | Creates a new project for native development with NativeScript. [preview](project/testing/preview.html) | Generates a QR code that can be scanned by the NativeScript PlayGround app. -[init](project/creation/init.html) | Initializes an existing project for native development with NativeScript. [platform add ``](project/configuration/platform-add.html) | Configures the current project to target the selected platform. [platform list](project/configuration/platform.html) | Lists all platforms that the project currently targets. [platform remove ``](project/configuration/platform-remove.html) | Removes the selected platform from the platforms that the project currently targets. This operation deletes all platform-specific files and subdirectories from your project. diff --git a/docs/man_pages/lib-management/plugin-add.md b/docs/man_pages/lib-management/plugin-add.md index 400b8706ee..5aac7e8a0b 100644 --- a/docs/man_pages/lib-management/plugin-add.md +++ b/docs/man_pages/lib-management/plugin-add.md @@ -8,7 +8,7 @@ position: 1 ### Description <% if(isConsole) { %>Installs the specified plugin and any packages that it depends on.<% } %> -<% 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).<% } %> +<% 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.<% } %> ### Commands diff --git a/docs/man_pages/lib-management/plugin-create.md b/docs/man_pages/lib-management/plugin-create.md index b267887ade..d574329b1f 100644 --- a/docs/man_pages/lib-management/plugin-create.md +++ b/docs/man_pages/lib-management/plugin-create.md @@ -10,9 +10,12 @@ position: 1 Creates a new project for NativeScript plugin development. The project uses the [NativeScript Plugin Seed](https://github.com/NativeScript/nativescript-plugin-seed) as a base and contains the following directories: * `src` - source code of the plugin -* `demo` - simple NativeScript application used to test and show plugin features * `publish` - shell scripts used to build and pack the plugin source code and publish it in [NPM](https://www.npmjs.com/) +The command will also propose you to setup demo applications and if you accept them, it will create the following additional directories: +* `demo` - simple NativeScript application used to test and show plugin features +* `demo-angular` - simple Angular application used to test and show plugin features + The project is setup for easy commit in Github, which is why the command will ask you for your Github username. <% if(isHtml) { %>Before starting to code your first plugin, you can visit the NativeScript documentation page for [building plugins](https://docs.nativescript.org/plugins/building-plugins#step-2-set-up-a-development-workflow) or the [plugin seed repository](https://github.com/NativeScript/nativescript-plugin-seed/blob/master/README.md).<% } %> diff --git a/docs/man_pages/lib-management/plugin-remove.md b/docs/man_pages/lib-management/plugin-remove.md index b00e19e3bd..543e695878 100644 --- a/docs/man_pages/lib-management/plugin-remove.md +++ b/docs/man_pages/lib-management/plugin-remove.md @@ -8,7 +8,7 @@ position: 4 ### Description <% if(isConsole) { %>Uninstalls a plugin by its name.<% } %> -<% if(isHtml) { %>Removes the specified plugin and its dependencies from the local `node_modules` folder and the `dependencies` section in `package.json`. This operation does not remove the plugin from the installed platforms and you need to run `$ tns prepare` to finish uninstalling the plugin. For more information about working with plugins, see [NativeScript Plugins](https://github.com/NativeScript/nativescript-cli/blob/master/PLUGINS.md).<% } %> +<% if(isHtml) { %>Removes the specified plugin and its dependencies from the local `node_modules` folder and the `dependencies` section in `package.json`. This operation does not remove the plugin from the installed platforms and you need to run `$ tns prepare` to finish uninstalling the plugin.<% } %> ### Commands diff --git a/docs/man_pages/lib-management/plugin-update.md b/docs/man_pages/lib-management/plugin-update.md index 9ba3a5f9dc..05607ba5f5 100644 --- a/docs/man_pages/lib-management/plugin-update.md +++ b/docs/man_pages/lib-management/plugin-update.md @@ -8,7 +8,7 @@ position: 7 ### Description <% if(isConsole) { %>Uninstalls and installs the specified plugin(s) and any packages that it depends on.<% } %> -<% if(isHtml) { %>Uninstalls and installs the specified plugin(s) and its dependencies in the local `node_modules` folder, adds it to the `dependencies` section in `package.json`, and prepares the plugin(s) for all installed platforms. If you have not configured any platforms for the project, the NativeScript CLI will prepare the plugin(s) 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).<% } %> +<% if(isHtml) { %>Uninstalls and installs the specified plugin(s) and its dependencies in the local `node_modules` folder, adds it to the `dependencies` section in `package.json`, and prepares the plugin(s) for all installed platforms. If you have not configured any platforms for the project, the NativeScript CLI will prepare the plugin(s) when you add a platform.<% } %> ### Commands diff --git a/docs/man_pages/project/configuration/platform-add.md b/docs/man_pages/project/configuration/platform-add.md index fb5b23281c..3af417fd26 100644 --- a/docs/man_pages/project/configuration/platform-add.md +++ b/docs/man_pages/project/configuration/platform-add.md @@ -13,16 +13,14 @@ Configures the current project to target the selected platform. <% if(isHtml) { Usage | Synopsis ------|------- -Android latest runtime | `$ tns platform add android [--framework-path ] [--symlink] [--sdk ] [--platform-template ]` -Android selected runtime | `$ tns platform add android[@] [--framework-path ] [--symlink] [--sdk ] [--platform-template ]` -<% if (isMacOS) { %>iOS latest runtime | `$ tns platform add ios [--framework-path ] [--symlink]` -iOS selected runtime | `$ tns platform add ios[@] [--framework-path ] [--symlink] [--platform-template ]`<% } %> +Android latest runtime | `$ tns platform add android [--framework-path ] [--sdk ] [--platform-template ]` +Android selected runtime | `$ tns platform add android[@] [--framework-path ] [--sdk ] [--platform-template ]` +<% if (isMacOS) { %>iOS latest runtime | `$ tns platform add ios [--framework-path ]` +iOS selected runtime | `$ tns platform add ios[@] [--framework-path ] [--platform-template ]`<% } %> ### Options -* `--framework-path` - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If `--symlink` is specified, `` is the complete path to a valid npm package or a directory that contains a NativeScript runtime for the selected platform and must point to directory in which the runtime is already extracted. If `--symlink` is not specified, `` must point to a valid npm package. -* `--symlink` - Creates a symlink to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If `--frameworkPath` is specified, creates a symlink to the specified directory. If `--frameworkPath` is not specified, creates a symlink to platform runtime installed with your current version of NativeScript. -* `--sdk` - Sets the target Android SDK for the project. `` is a valid Android API level. For example: 17, 19, MNC.<% if(isHtml) { %> For a complete list of the Android API levels and their corresponding Android versions, click [here](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#platform).<% } %> +* `--framework-path` - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. `` must point to a valid npm package. * `--platform-template` - Sets the platform template that will be used for the native application. `` is a valid npm package, path to directory, .tgz or GitHub URL that contains a native Android or iOS template. ### Arguments diff --git a/docs/man_pages/project/configuration/prepare.md b/docs/man_pages/project/configuration/prepare.md index 211773f3ed..b68a662d79 100644 --- a/docs/man_pages/project/configuration/prepare.md +++ b/docs/man_pages/project/configuration/prepare.md @@ -7,8 +7,7 @@ position: 7 ### Description -Copies common and relevant platform-specific content from the `app` directory to the subdirectory for the selected target platform -in the `platforms` directory. This lets you build the project with the SDK for the selected platform. <% if(isMacOS) { %>You must specify the target platform for which you want to prepare your project.<% } %> +Starts a Webpack compilation and prepares the app's `App_Resources` and the plugins `platforms` directories. The output is generated in a subdirectory for the selected target platform in the `platforms` directory. This lets you build the project for the selected platform. <% if(isMacOS) { %>You must specify the target platform for which you want to prepare your project.<% } %> When running this command the HMR (Hot Module Replacement) is not enabled by default. In case you want to enable HMR, you can pass `--hmr` flag. diff --git a/docs/man_pages/project/creation/create.md b/docs/man_pages/project/creation/create.md index 1bc0a7ecf9..1f920a84c7 100644 --- a/docs/man_pages/project/creation/create.md +++ b/docs/man_pages/project/creation/create.md @@ -58,6 +58,5 @@ Template | Command Command | Description ----------|---------- -[init](init.html) | Initializes a project for development. The command prompts you to provide your project configuration interactively and uses the information to create a new package.json file or update the existing one. [install](/lib-management/install.html) | Installs all platforms and dependencies described in the `package.json` file in the current directory. <% } %> diff --git a/docs/man_pages/project/testing/build-android.md b/docs/man_pages/project/testing/build-android.md index e4041c7ecb..ad054ea51f 100644 --- a/docs/man_pages/project/testing/build-android.md +++ b/docs/man_pages/project/testing/build-android.md @@ -17,7 +17,7 @@ General | `$ tns build android [--compileSdk ] [--key-store-path ` is a valid Android API level. For example: 22, 23.<% if(isHtml) { %> For a complete list of the Android API levels and their corresponding Android versions, click [here](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#platform).<% } %> +* `--compileSdk` - Sets the Android SDK that will be used to build the project. `` is a valid Android API level. For example: 28, 29. The minimum supported SDK is 28. <% if(isHtml) { %> For a complete list of the Android API levels and their corresponding Android versions, click [here](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#platform).<% } %> * `--clean` - If set, forces the complete rebuild of the native application. * `--release` - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the `--key-store-*` options. * `--key-store-path` - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options. From db2163caa8535f3f0b5c565b7aa18bcaf7db4420 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Tue, 16 Jul 2019 18:12:28 +0300 Subject: [PATCH 12/38] docs: remove --sdk flag from documentation --- docs/man_pages/project/configuration/platform-add.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/man_pages/project/configuration/platform-add.md b/docs/man_pages/project/configuration/platform-add.md index 3af417fd26..5bd0f50b91 100644 --- a/docs/man_pages/project/configuration/platform-add.md +++ b/docs/man_pages/project/configuration/platform-add.md @@ -13,8 +13,8 @@ Configures the current project to target the selected platform. <% if(isHtml) { Usage | Synopsis ------|------- -Android latest runtime | `$ tns platform add android [--framework-path ] [--sdk ] [--platform-template ]` -Android selected runtime | `$ tns platform add android[@] [--framework-path ] [--sdk ] [--platform-template ]` +Android latest runtime | `$ tns platform add android [--framework-path ] [--platform-template ]` +Android selected runtime | `$ tns platform add android[@] [--framework-path ] [--platform-template ]` <% if (isMacOS) { %>iOS latest runtime | `$ tns platform add ios [--framework-path ]` iOS selected runtime | `$ tns platform add ios[@] [--framework-path ] [--platform-template ]`<% } %> From 69782ea12925de395fbbdf52c5637e5dd79c1314 Mon Sep 17 00:00:00 2001 From: Kristian Dimitrov Date: Tue, 16 Jul 2019 18:35:22 +0300 Subject: [PATCH 13/38] fix: preview for app downloaded from playground fails --- lib/controllers/preview-app-controller.ts | 4 +++- test/services/playground/preview-app-livesync-service.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/controllers/preview-app-controller.ts b/lib/controllers/preview-app-controller.ts index bedfde8326..9634718d99 100644 --- a/lib/controllers/preview-app-controller.ts +++ b/lib/controllers/preview-app-controller.ts @@ -19,6 +19,7 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon private $hmrStatusService: IHmrStatusService, private $logger: ILogger, public $hooksService: IHooksService, + private $pluginsService: IPluginsService, private $prepareController: PrepareController, private $previewAppFilesService: IPreviewAppFilesService, private $previewAppPluginsService: IPreviewAppPluginsService, @@ -48,6 +49,8 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon } private async previewCore(data: IPreviewAppLiveSyncData): Promise { + const projectData = this.$projectDataService.getProjectData(data.projectDir); + await this.$pluginsService.ensureAllDependenciesAreInstalled(projectData); await this.$previewSdkService.initialize(data.projectDir, async (device: Device) => { try { if (!device) { @@ -71,7 +74,6 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon }); } - const projectData = this.$projectDataService.getProjectData(data.projectDir); await this.$hooksService.executeBeforeHooks("preview-sync", { hookArgs: { ...data, platform: device.platform, projectData } }); if (data.useHotModuleReload) { diff --git a/test/services/playground/preview-app-livesync-service.ts b/test/services/playground/preview-app-livesync-service.ts index a93d4a7562..105789a1ab 100644 --- a/test/services/playground/preview-app-livesync-service.ts +++ b/test/services/playground/preview-app-livesync-service.ts @@ -184,6 +184,9 @@ function createTestInjector(options?: { executeBeforeHooks: () => ({}), executeAfterHooks: () => ({}) }); + injector.register("pluginsService", { + ensureAllDependenciesAreInstalled: () => { return Promise.resolve(); } + }); return injector; } From f33fe1ed1b8cc272cc1672ffa9a7e0a2d09709eb Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 17 Jul 2019 07:42:37 +0300 Subject: [PATCH 14/38] chore: update required deps for 6.0 Update nativescirpt-dev-webpack and ios-runtime to their latest versions. We'll require at least these versions when running the application. --- lib/controllers/migrate-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index c6a4d28e89..86de6e5bac 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -54,7 +54,7 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "nativescript-dev-sass", isDev: true, replaceWith: "node-sass" }, { packageName: "nativescript-dev-typescript", isDev: true, replaceWith: MigrateController.typescriptPackageName }, { packageName: "nativescript-dev-less", isDev: true, shouldRemove: true, warning: "LESS CSS is not supported out of the box. In order to enable it, follow the steps in this feature request: https://github.com/NativeScript/nativescript-dev-webpack/issues/967" }, - { packageName: constants.WEBPACK_PLUGIN_NAME, isDev: true, shouldAddIfMissing: true, verifiedVersion: "1.0.0" }, + { packageName: constants.WEBPACK_PLUGIN_NAME, isDev: true, shouldAddIfMissing: true, verifiedVersion: "1.0.1" }, { packageName: "nativescript-camera", verifiedVersion: "4.5.0" }, { packageName: "nativescript-geolocation", verifiedVersion: "5.1.0" }, { packageName: "nativescript-imagepicker", verifiedVersion: "6.2.0" }, @@ -99,7 +99,7 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; get verifiedPlatformVersions(): IDictionary { return { [this.$devicePlatformsConstants.Android.toLowerCase()]: "6.0.0", - [this.$devicePlatformsConstants.iOS.toLowerCase()]: "6.0.0" + [this.$devicePlatformsConstants.iOS.toLowerCase()]: "6.0.1" }; } From 363bf0f09457b87f6766937c6cc4657a91f2c423 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 17 Jul 2019 09:52:17 +0300 Subject: [PATCH 15/38] fix: stop livesync on initial sync when there is an error --- lib/controllers/run-controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index 259a44b99f..8eb5a28a9c 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -330,6 +330,8 @@ export class RunController extends EventEmitter implements IRunController { applicationIdentifier: projectData.projectIdentifiers[device.deviceInfo.platform.toLowerCase()], error: err, }); + + await this.stop({ projectDir: projectData.projectDir, deviceIdentifiers: [device.deviceInfo.identifier] }); } }; From d26948fb6cbcc91bf3c46662d81660d2419c98fb Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 17 Jul 2019 11:45:08 +0300 Subject: [PATCH 16/38] chore: update Changelog for 6.0 release --- CHANGELOG.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbeea8c5f..0ca0242a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,66 @@ NativeScript CLI Changelog ================ +6.0.0 (2019, July 17) +== + +### Breaking changes + +* Applications can be build only with bundle workflow - in previous versions there were two ways to build your application - `bundle` and `legacy` workflow. With this release CLI allows building your app only in case you are using the bundle workflow. More information is available [in this blopost](https://www.nativescript.org/blog/the-future-of-building-nativescript-apps) +* With older CLI versions you were able to run `tns debug android` and continue debugging after the command exits. In this release, when CLI exits, it clears all used resources, so you will not be able to continue the debug session. More information is available in [this issue](https://github.com/NativeScript/nativescript-cli/issues/4219) for more information. +* `--syncAllFiles` option is not supported anymore - this option was added to force CLI to watch all files in `node_modules`. In 6.0 this is the default and only behavior - webpack watches all required files and CLI watches the `platforms` directories and `package.json` files of the plugins added as dependencies of the application. +* Drop support for Xcode versions below 10 - new features for iOS require the latest Xcode versions, so we decided to require at least Xcode 10 for building the applications +* Drop support for Node.js below 8 - Node.js 8 does not support [these version anymore](https://github.com/nodejs/Release) and so does our CLI. In case you are using such Node.js version, CLI will not allow you to execute any command, so you should upgrade to latest LTS version. +* `--platformTemplate` option has been deleted. More information can be found in [this issue](https://github.com/NativeScript/nativescript-cli/issues/4867). +* `tns init` command has been deleted +* `tns clean app` command has been deleted +* Improved plugin development workflow may require changes in your daily work when creating plugins. More information can be found in [this issue](https://github.com/NativeScript/nativescript-cli/issues/4865) +* When you pass `--release`, CLI will switch webpack in production mode. More information can be found in [this issue](https://github.com/NativeScript/nativescript-cli/issues/4497) +* CLI now forces sourceMap generation by default when building in debug mode. You can disable them by passing `--env.sourceMap false`. souceMaps are disabled by default in release builds, you can enable them by passing `--env.sourceMap`. + +### New +* [Implemented #2368](https://github.com/NativeScript/nativescript-cli/issues/2368): Compiling in other path (dist), no in same path (src/app) +* [Implemented #2417](https://github.com/NativeScript/nativescript-cli/issues/2417): Show TypeScript line numbers in stack traces +* [Implemented #2776](https://github.com/NativeScript/nativescript-cli/issues/2776): Add ability to ignore files from final package when build in release +* [Implemented #3378](https://github.com/NativeScript/nativescript-cli/issues/3378): Running app with locally installed plugin should transpile the plugin's TypeScript files +* [Implemented #4497](https://github.com/NativeScript/nativescript-cli/issues/4497): Ability to detect within webpack if app is being built for release +* [Implemented #4604](https://github.com/NativeScript/nativescript-cli/issues/4604): Logs and errors from devices always point to bundle/vendor files +* [Implemented #4646](https://github.com/NativeScript/nativescript-cli/issues/4646): Introduce command (`tns migrate`) to migrate old project to 6.0.0 requirements +* [Implemented #4648](https://github.com/NativeScript/nativescript-cli/issues/4648): Drop support for Node.js < 8 +* [Implemented #4649](https://github.com/NativeScript/nativescript-cli/issues/4649): Deprecate support for Node.js < 10 +* [Implemented #4650](https://github.com/NativeScript/nativescript-cli/issues/4650): Add official support for Node.js 12 +* [Implemented #4651](https://github.com/NativeScript/nativescript-cli/issues/4651): Add drawer navigation prompt when vue flavor is selected on `tns create` +* [Implemented #4667](https://github.com/NativeScript/nativescript-cli/issues/4667): Support yarn hoisted packages in a workspace context +* [Implemented #4692](https://github.com/NativeScript/nativescript-cli/issues/4692): CLI should watch package.json files in the application +* [Implemented #4731](https://github.com/NativeScript/nativescript-cli/issues/4731): Drop support for Xcode < 10 +* [Implemented #4863](https://github.com/NativeScript/nativescript-cli/issues/4863): Delete `tns init` command +* [Implemented #4863](https://github.com/NativeScript/nativescript-cli/issues/4863): Delete `tns clean app` command +* [Implemented #4865](https://github.com/NativeScript/nativescript-cli/issues/4865): Improve plugin development workflow +* [Implemented #4867](https://github.com/NativeScript/nativescript-cli/issues/4867): Delete `--platformTemplate` option + +### Fixed +* [Fixed #2739](https://github.com/NativeScript/nativescript-cli/issues/2739): Unit test runner do not work in --watch mode +* [Fixed #2963](https://github.com/NativeScript/nativescript-cli/issues/2963): Confusing messages on preparing plugin +* [Fixed #3028](https://github.com/NativeScript/nativescript-cli/issues/3028): Local dependency brakes build +* [Fixed #3146](https://github.com/NativeScript/nativescript-cli/issues/3146): `tns run ios` shows "No reachable hosts" after running unit tests +* [Fixed #3351](https://github.com/NativeScript/nativescript-cli/issues/3351): If you delete the whole css data or the css file itself the changes are not going to be applied to the app +* [Fixed #3546](https://github.com/NativeScript/nativescript-cli/issues/3546): Your project have installed babel-traverse version null but Android platform requires version ^6.4.5 +* [Fixed #3568](https://github.com/NativeScript/nativescript-cli/issues/3568): EXPORT FAILED fse.node has conflicting provisioning settings +* [Fixed #3630](https://github.com/NativeScript/nativescript-cli/issues/3630): cp: copyFileSync: could not write to dest file (code=EPERM) +* [Fixed #3767](https://github.com/NativeScript/nativescript-cli/issues/3767): Exception when delete a file from `/platforms/android` +* [Fixed #3849](https://github.com/NativeScript/nativescript-cli/issues/3849): The livesync check if a file has modifications doesn't work as expected +* [Fixed #4219](https://github.com/NativeScript/nativescript-cli/issues/4219): Android debugging is leaking the debug session +* [Fixed #4239](https://github.com/NativeScript/nativescript-cli/issues/4239): Copy `App_Resources` directly to `platforms/.../res` (Android) or `platforms/.../Resources` (iOS) instead of copying them with Webpack +* [Fixed #4264 ](https://github.com/NativeScript/nativescript-cli/issues/4264 ): When using `--syncAllFiles` on Android frequently crashes with error +* [Fixed #4480](https://github.com/NativeScript/nativescript-cli/issues/4480): [TypeScript & Vue project] When using `--bundle` changes made to a platform specific file in `node_modules` does not start a new build process +* [Fixed #4500](https://github.com/NativeScript/nativescript-cli/issues/4500): Changes to `.js` files located in `node_modules` causes the `livesync` to take upto 30 sec +* [Fixed #4513](https://github.com/NativeScript/nativescript-cli/issues/4513): Error when building for Android and using `bcryptjs` +* [Fixed #4607](https://github.com/NativeScript/nativescript-cli/issues/4607): Image replacement is not respected during tns run with hmr +* [Fixed #4647](https://github.com/NativeScript/nativescript-cli/issues/4647): CLI's checkForChanges method should not check all `node_modules` +* [Fixed #4658](https://github.com/NativeScript/nativescript-cli/issues/4658): [iOS] tns preview is including tns-core-modules in vendor.js +* [Fixed #4770](https://github.com/NativeScript/nativescript-cli/issues/4770): Incorrect execution of hooks where there is unresolved injected dependency + + 5.4.2 (2019, June 19) == From 6149d32d91c4fac3695cadcec180dd78f7b2c392 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 17 Jul 2019 13:14:42 +0300 Subject: [PATCH 17/38] fix: bump the version of `nativescript-unit-test-runner` from migrate --- lib/controllers/migrate-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 86de6e5bac..b3c1c8c929 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -82,9 +82,9 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "nativescript-permissions", verifiedVersion: "1.3.0" }, { packageName: "nativescript-cardview", verifiedVersion: "3.2.0" }, { - packageName: "nativescript-unit-test-runner", verifiedVersion: "0.6.4", + packageName: "nativescript-unit-test-runner", verifiedVersion: "0.7.0", shouldMigrateAction: async (projectData: IProjectData, allowInvalidVersions: boolean) => { - const dependency = { packageName: "nativescript-unit-test-runner", verifiedVersion: "0.6.4", isDev: false }; + const dependency = { packageName: "nativescript-unit-test-runner", verifiedVersion: "0.7.0", isDev: false }; const result = this.hasDependency(dependency, projectData) && await this.shouldMigrateDependencyVersion(dependency, projectData, allowInvalidVersions); return result; }, From 0fffc6458a52da9c7cdafa6eabb46dbd32dc57ce Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Wed, 17 Jul 2019 11:18:55 +0300 Subject: [PATCH 18/38] fix: add forgotten migrate dependencies for Vue and Angular apps --- lib/controllers/migrate-controller.ts | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 86de6e5bac..62091598ab 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -69,7 +69,15 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "nativescript-datetimepicker", verifiedVersion: "1.1.0" }, { packageName: "kinvey-nativescript-sdk", verifiedVersion: "4.2.1" }, { packageName: "nativescript-plugin-firebase", verifiedVersion: "9.0.2" }, - { packageName: "nativescript-vue", verifiedVersion: "2.3.0" }, + { + packageName: "nativescript-vue", verifiedVersion: "2.3.0", + shouldMigrateAction: async (projectData: IProjectData, allowInvalidVersions: boolean) => { + const dependency = { packageName: "nativescript-vue", verifiedVersion: "2.3.0", isDev: false }; + const result = this.hasDependency(dependency, projectData) && await this.shouldMigrateDependencyVersion(dependency, projectData, allowInvalidVersions); + return result; + }, + migrateAction: this.migrateNativeScriptVue.bind(this) + }, { packageName: "nativescript-angular", verifiedVersion: "8.0.2", shouldMigrateAction: async (projectData: IProjectData, allowInvalidVersions: boolean) => { @@ -396,7 +404,18 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "@angular/platform-browser", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, { packageName: "@angular/router", verifiedVersion: "8.0.0", shouldAddIfMissing: true }, { packageName: "rxjs", verifiedVersion: "6.3.3", shouldAddIfMissing: true }, - { packageName: "zone.js", verifiedVersion: "0.9.1", shouldAddIfMissing: true } + { packageName: "zone.js", verifiedVersion: "0.9.1", shouldAddIfMissing: true }, + { packageName: "@angular/animations", verifiedVersion: "8.0.0" }, + { packageName: "@angular/compiler-cli", verifiedVersion: "8.0.0", isDev: true }, + { packageName: "@ngtools/webpack", verifiedVersion: "8.0.0", isDev: true } + ]; + + return dependencies; + } + + private async migrateNativeScriptVue(): Promise { + const dependencies = [ + { packageName: "nativescript-vue-template-compiler", verifiedVersion: "2.3.0", isDev: true } ]; return dependencies; From fc331780bfae91a98ff020c149544d882143c4d3 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 17 Jul 2019 17:51:32 +0300 Subject: [PATCH 19/38] chore: set version to 6.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5c7e81c9fc..9bc7ad6b0f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "6.0.0", + "version": "6.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index aeac11d9b9..57ee54babe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "6.0.0", + "version": "6.0.1", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From 14fb58bd8fa2690656856e949d0d1fc5c60562e1 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 17 Jul 2019 17:59:16 +0300 Subject: [PATCH 20/38] fix: don't hangs livesync process when there is an error on initial sync or on change --- lib/controllers/run-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index 8eb5a28a9c..3c801c24dd 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -331,7 +331,7 @@ export class RunController extends EventEmitter implements IRunController { error: err, }); - await this.stop({ projectDir: projectData.projectDir, deviceIdentifiers: [device.deviceInfo.identifier] }); + await this.stop({ projectDir: projectData.projectDir, deviceIdentifiers: [device.deviceInfo.identifier], stopOptions: { shouldAwaitAllActions: false }}); } }; @@ -410,7 +410,7 @@ export class RunController extends EventEmitter implements IRunController { error: err, }); - await this.stop({ projectDir: projectData.projectDir, deviceIdentifiers: [device.deviceInfo.identifier] }); + await this.stop({ projectDir: projectData.projectDir, deviceIdentifiers: [device.deviceInfo.identifier], stopOptions: { shouldAwaitAllActions: false } }); } }; From 06f92acb19d7462afa0540d10ebd1ae7def98811 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 17 Jul 2019 14:27:58 +0300 Subject: [PATCH 21/38] fix: fix the behavior when ddi is not installed on iOS device --- lib/controllers/run-controller.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index 259a44b99f..acfc946424 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -141,10 +141,10 @@ export class RunController extends EventEmitter implements IRunController { return this.$liveSyncProcessDataService.getDeviceDescriptors(data.projectDir); } - protected async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, filesChangeEventData: IFilesChangeEventData, deviceDescriptor: ILiveSyncDeviceDescriptor, settings?: IRefreshApplicationSettings): Promise { + protected async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, filesChangeEventData: IFilesChangeEventData, deviceDescriptor: ILiveSyncDeviceDescriptor): Promise { const result = deviceDescriptor.debuggingEnabled ? - await this.refreshApplicationWithDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, settings) : - await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, settings); + await this.refreshApplicationWithDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor) : + await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor); const device = liveSyncResultInfo.deviceAppData.device; @@ -159,12 +159,12 @@ export class RunController extends EventEmitter implements IRunController { return result; } - protected async refreshApplicationWithDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, filesChangeEventData: IFilesChangeEventData, deviceDescriptor: ILiveSyncDeviceDescriptor, settings?: IRefreshApplicationSettings): Promise { + protected async refreshApplicationWithDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, filesChangeEventData: IFilesChangeEventData, deviceDescriptor: ILiveSyncDeviceDescriptor): Promise { const debugOptions = deviceDescriptor.debugOptions || {}; liveSyncResultInfo.waitForDebugger = !!debugOptions.debugBrk; - const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, settings); + const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true }); // we do not stop the application when debugBrk is false, so we need to attach, instead of launch // if we try to send the launch request, the debugger port will not be printed and the command will timeout From c5dec2123aed81c864079af99c2ec6291805831a Mon Sep 17 00:00:00 2001 From: Rosen Vladimirov Date: Wed, 17 Jul 2019 20:57:37 +0300 Subject: [PATCH 22/38] docs: remove --platform-template from CLI's help The option has been deleted in CLI 6.0, but it is still available in the help. --- docs/man_pages/project/configuration/platform-add.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/man_pages/project/configuration/platform-add.md b/docs/man_pages/project/configuration/platform-add.md index 5bd0f50b91..08d68a6520 100644 --- a/docs/man_pages/project/configuration/platform-add.md +++ b/docs/man_pages/project/configuration/platform-add.md @@ -13,15 +13,14 @@ Configures the current project to target the selected platform. <% if(isHtml) { Usage | Synopsis ------|------- -Android latest runtime | `$ tns platform add android [--framework-path ] [--platform-template ]` -Android selected runtime | `$ tns platform add android[@] [--framework-path ] [--platform-template ]` +Android latest runtime | `$ tns platform add android [--framework-path ]` +Android selected runtime | `$ tns platform add android[@] [--framework-path ] ` <% if (isMacOS) { %>iOS latest runtime | `$ tns platform add ios [--framework-path ]` -iOS selected runtime | `$ tns platform add ios[@] [--framework-path ] [--platform-template ]`<% } %> +iOS selected runtime | `$ tns platform add ios[@] [--framework-path ] `<% } %> ### Options * `--framework-path` - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. `` must point to a valid npm package. -* `--platform-template` - Sets the platform template that will be used for the native application. `` is a valid npm package, path to directory, .tgz or GitHub URL that contains a native Android or iOS template. ### Arguments From 172c7a7f5b8531f7ea1131ec036c376e20e6573b Mon Sep 17 00:00:00 2001 From: fatme Date: Thu, 18 Jul 2019 08:50:09 +0300 Subject: [PATCH 23/38] fix: parse options correctly Currently `tns run android --release` throws an error that `--hmr` and `--release` cannot be used simultaneously. After parsing `this.yargsArgv = yargs(process.argv.slice(2))` command line options, only `--release` option is true as it is expected to be. For some reason after calling `this.argv = this.yargsArgv.options(opts).argv`, `this.yargsArgv` is modified and `this.yargsArgv.hmr` is true which is not the expected behavior. It seems like a strange behavior of yargs. In order to fix it, we parse the command line only once and persist the `argv` object of initial parsed command line. --- lib/options.ts | 9 +++++---- test/options.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/options.ts b/lib/options.ts index d352b62bf8..4c9d1fa83f 100644 --- a/lib/options.ts +++ b/lib/options.ts @@ -6,7 +6,6 @@ export class Options { private static NONDASHED_OPTION_REGEX = /(.+?)[-]([a-zA-Z])(.*)/; private optionsWhiteList = ["ui", "recursive", "reporter", "require", "timeout", "_", "$0"]; // These options shouldn't be validated - private yargsArgv: yargs.Argv; private globalOptions: IDictionary = { log: { type: OptionType.String, hasSensitiveValue: false }, verbose: { type: OptionType.Boolean, alias: "v", hasSensitiveValue: false }, @@ -19,6 +18,7 @@ export class Options { _: { type: OptionType.String, hasSensitiveValue: false } }; + private initialArgv: yargs.Arguments; public argv: yargs.Arguments; public options: IDictionary; @@ -31,7 +31,7 @@ export class Options { this.argv.bundle = "webpack"; // Check if the user has explicitly provide --hmr and --release options from command line - if (this.yargsArgv.argv.release && this.yargsArgv.argv.hmr) { + if (this.initialArgv.release && this.initialArgv.hmr) { this.$errors.failWithoutHelp("The options --release and --hmr cannot be used simultaneously."); } @@ -250,8 +250,9 @@ export class Options { opts[this.getDashedOptionName(key)] = value; }); - this.yargsArgv = yargs(process.argv.slice(2)); - this.argv = this.yargsArgv.options(opts).argv; + const parsed = yargs(process.argv.slice(2)); + this.initialArgv = parsed.argv; + this.argv = parsed.options(opts).argv; // For backwards compatibility // Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result. diff --git a/test/options.ts b/test/options.ts index 2ad685f0f0..92363d685d 100644 --- a/test/options.ts +++ b/test/options.ts @@ -292,7 +292,7 @@ describe("options", () => { name: "should set hmr to true by default", expectedHmrValue: true }, { - name: "set set hmr to false when --no-hmr is provided", + name: "should set hmr to false when --no-hmr is provided", args: ["--no-hmr"], expectedHmrValue: false }, { @@ -319,6 +319,7 @@ describe("options", () => { options.setupOptions(testCase.commandSpecificDashedOptions); assert.equal(testCase.expectedHmrValue, options.argv.hmr); + assert.isFalse(isExecutionStopped); (testCase.args || []).forEach(arg => process.argv.pop()); }); From 9bb2a65b5ec8687ad6f198dc6f107c50733a562e Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 18 Jul 2019 10:35:05 +0300 Subject: [PATCH 24/38] docs: update migrate help --- docs/man_pages/general/migrate.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/man_pages/general/migrate.md b/docs/man_pages/general/migrate.md index 9f68873ee4..583756a301 100644 --- a/docs/man_pages/general/migrate.md +++ b/docs/man_pages/general/migrate.md @@ -15,7 +15,7 @@ The following folders will be removed: **"hooks"**, **"platforms"** and **"node_ The **"nativescript-dev-sass"** and **"nativescript-dev-typescript"** dependencies will be replaced with **"node-sass"** and **"typescript"** respectively. The **"nativescript-dev-less"** dependency will be removed, but to enable LESS CSS support the user should follow the steps in this<% if(isConsole) { %> feature request: https://github.com/NativeScript/nativescript-dev-webpack/issues/967.<% } %><% if(isHtml) { %> [feature request](https://github.com/NativeScript/nativescript-dev-webpack/issues/967).<% } %> -The following dependencies will be updated if needed: +The following dependencies will be updated if needed: * tns-core-modules * tns-core-modules-widgets * tns-platform-declarations @@ -37,15 +37,19 @@ The following dependencies will be updated if needed: * kinvey-nativescript-sdk * nativescript-plugin-firebase * nativescript-vue +* nativescript-vue-template-compiler * nativescript-angular +* @angular/animiations * @angular/platform-browser-dynamic * @angular/common * @angular/compiler +* @angular/compiler-cli * @angular/core * @angular/forms * @angular/http * @angular/platform-browser * @angular/router +* @ngtools/webpack * rxjs * zone.js * nativescript-unit-test-runner From 4688fc58ddf3ba2c49a9e2f2bd3f4ca04874b419 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 18 Jul 2019 11:11:00 +0300 Subject: [PATCH 25/38] docs: update Changelog for 6.0.1 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca0242a61..9888707241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ NativeScript CLI Changelog ================ +6.0.1 (2019, July 18) +== +* [Fixed #4814](https://github.com/NativeScript/nativescript-cli/issues/4814): Missing `yargs-parser` dependency +* [Fixed #4846](https://github.com/NativeScript/nativescript-cli/issues/4846): Xcode running on devices crashes with error `Unable to create file *.hot-update.json` +* [Fixed #4871](https://github.com/NativeScript/nativescript-cli/pull/4871): Issues when stopping the LiveSync process +* [Fixed #4872](https://github.com/NativeScript/nativescript-cli/pull/4872): Sidekick: debug operation fails on iOS when Developer Disk Image is not installed on device +* [Fixed #4873](https://github.com/NativeScript/nativescript-cli/issues/4873): `tns migrate` should update `nativescript-vue-template-compiler` +* [Fixed #4874](https://github.com/NativeScript/nativescript-cli/issues/4874): After `tns migrate` preview/build/run commands fail with `ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.4.5 was found instead.` +* [Fixed #4876](https://github.com/NativeScript/nativescript-cli/issues/4876):`tns migrate` does not update @ngtools/webpack +* [Fixed #4878](https://github.com/NativeScript/nativescript-cli/issues/4878): `tns migrate` does not update @angular/animations +* [Fixed #4879](https://github.com/NativeScript/nativescript-cli/issues/4879): `--platform-template` option is still shown in CLI's help + 6.0.0 (2019, July 17) == From 5085b783a4a8ff311a9187255fe39dc8e7d77fee Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 19 Jul 2019 14:44:37 +0300 Subject: [PATCH 26/38] fix: migrate and update exit with code 0 when everything is up-to-date --- lib/commands/migrate.ts | 17 +++++++---------- lib/commands/update.ts | 10 ++++++---- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/commands/migrate.ts b/lib/commands/migrate.ts index e40cfd8651..9442c2d200 100644 --- a/lib/commands/migrate.ts +++ b/lib/commands/migrate.ts @@ -5,28 +5,25 @@ export class MigrateCommand implements ICommand { private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $migrateController: IMigrateController, private $projectData: IProjectData, - private $errors: IErrors) { + private $logger: ILogger) { this.$projectData.initializeProjectData(); } public async execute(args: string[]): Promise { - await this.$migrateController.migrate({ - projectDir: this.$projectData.projectDir, - platforms: [this.$devicePlatformsConstants.Android, this.$devicePlatformsConstants.iOS] - }); - } - - public async canExecute(args: string[]): Promise { const shouldMigrateResult = await this.$migrateController.shouldMigrate({ projectDir: this.$projectData.projectDir, platforms: [this.$devicePlatformsConstants.Android, this.$devicePlatformsConstants.iOS] }); if (!shouldMigrateResult) { - this.$errors.failWithoutHelp('Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".'); + this.$logger.printMarkdown('__Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".__'); + return; } - return true; + await this.$migrateController.migrate({ + projectDir: this.$projectData.projectDir, + platforms: [this.$devicePlatformsConstants.Android, this.$devicePlatformsConstants.iOS] + }); } } diff --git a/lib/commands/update.ts b/lib/commands/update.ts index 0dddf6a07f..28b8ee1302 100644 --- a/lib/commands/update.ts +++ b/lib/commands/update.ts @@ -9,11 +9,17 @@ export class UpdateCommand implements ICommand { private $migrateController: IMigrateController, private $options: IOptions, private $errors: IErrors, + private $logger: ILogger, private $projectData: IProjectData) { this.$projectData.initializeProjectData(); } public async execute(args: string[]): Promise { + if (!await this.$updateController.shouldUpdate({ projectDir: this.$projectData.projectDir, version: args[0] })) { + this.$logger.printMarkdown(`__${UpdateCommand.PROJECT_UP_TO_DATE_MESSAGE}__`); + return; + } + await this.$updateController.update({ projectDir: this.$projectData.projectDir, version: args[0], frameworkPath: this.$options.frameworkPath }); } @@ -27,10 +33,6 @@ export class UpdateCommand implements ICommand { this.$errors.failWithoutHelp(UpdateCommand.SHOULD_MIGRATE_PROJECT_MESSAGE); } - if (!await this.$updateController.shouldUpdate({ projectDir: this.$projectData.projectDir, version: args[0] })) { - this.$errors.failWithoutHelp(UpdateCommand.PROJECT_UP_TO_DATE_MESSAGE); - } - return args.length < 2 && this.$projectData.projectDir !== ""; } } From 2af7be58e37a14782ace9ce151e945a3daf65809 Mon Sep 17 00:00:00 2001 From: Dimitar Tachev Date: Fri, 19 Jul 2019 14:56:03 +0300 Subject: [PATCH 27/38] chore: fix pr comments --- lib/commands/migrate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/migrate.ts b/lib/commands/migrate.ts index 9442c2d200..9f22b42972 100644 --- a/lib/commands/migrate.ts +++ b/lib/commands/migrate.ts @@ -16,7 +16,7 @@ export class MigrateCommand implements ICommand { }); if (!shouldMigrateResult) { - this.$logger.printMarkdown('__Project is compatible with NativeScript "v6.0.0". To get the latest NativesScript packages execute "tns update".__'); + this.$logger.printMarkdown('__Project is compatible with NativeScript "v6.0.0". To get the latest NativeScript packages execute "tns update".__'); return; } From 62aecdd83167108d5b98ad110b46e3546169ecfb Mon Sep 17 00:00:00 2001 From: fatme Date: Thu, 18 Jul 2019 22:46:21 +0300 Subject: [PATCH 28/38] fix(cloud, sidekick): don't stop livesync on iOS device without developer disk image when app is built in cloud on windows The livesync process is stopped when a native change is made in app built in cloud on windows OS. This happens as CLI builds the app and after that tries to restart it. As the `platformLiveSyncService.restartApplication` is without try/catch, the CLI is not able to start the application due to missing developer disk image mounted on device. After that an error is thrown and the livesync process is stopped. This PR replaces `platformLiveSyncService.restartApplication` with `this.refreshApplication`. The `this.refreshApplication` method has try/catch and shows a warning `Unable to start application...` when an error is thrown during restart process. On the other side, this method has a check if a naive change occurs, so no additional checks will be executed from the method in order to determine if the application should be refreshed or restarted. (https://github.com/NativeScript/nativescript-cli/blob/24b21c4c3ec46ecf05f3b3aa1d2ed5b7d2301424/lib/controllers/run-controller.ts#L187) --- lib/controllers/run-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index e4a0c637d2..fdb07e6557 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -199,7 +199,7 @@ export class RunController extends EventEmitter implements IRunController { result.didRestart = true; } } catch (err) { - this.$logger.info(`Error while trying to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Error is: ${err.message || err}`); + this.$logger.trace(`Error while trying to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Error is: ${err.message || err}`); const msg = `Unable to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Try starting it manually.`; this.$logger.warn(msg); @@ -377,7 +377,7 @@ export class RunController extends EventEmitter implements IRunController { await this.$deviceInstallAppService.installOnDevice(device, deviceDescriptor.buildData, rebuiltInformation[platformData.platformNameLowerCase].packageFilePath); await platformLiveSyncService.syncAfterInstall(device, watchInfo); - await platformLiveSyncService.restartApplication(projectData, { deviceAppData, modifiedFilesData: [], isFullSync: false, useHotModuleReload: liveSyncInfo.useHotModuleReload }); + await this.refreshApplication(projectData, { deviceAppData, modifiedFilesData: [], isFullSync: false, useHotModuleReload: liveSyncInfo.useHotModuleReload }, data, deviceDescriptor); } else { const isInHMRMode = liveSyncInfo.useHotModuleReload && data.hmrData && data.hmrData.hash; if (isInHMRMode) { From b7a32dab5b5b0b09217306da3775f49a7c170769 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:17:45 +0300 Subject: [PATCH 29/38] fix(run): remove prepareReadyEvent handler correctly on run `tns run` (and using SK) should remove its handler for prepareControllers' `prepareReadyEvent` handler. However, this does not happend due to two reasons: - we try to remove the handler from runControllers' event, but this handler is attached to `preparController`, so it actually remains and causes multiple issues in long living processes, when CLI is used as a library - the event handler is not cached correctly as we attach its bound version, but cache it without the binding. So you cannot remove it. This causes issues when running on device in Sidekick, closing the current app, open it again and try to livesync a change - we have many handlers for prepareReadyEvent and this causes multiple livesync operations. --- lib/controllers/run-controller.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/controllers/run-controller.ts b/lib/controllers/run-controller.ts index fdb07e6557..d6cc35912e 100644 --- a/lib/controllers/run-controller.ts +++ b/lib/controllers/run-controller.ts @@ -51,7 +51,7 @@ export class RunController extends EventEmitter implements IRunController { } if (!this.prepareReadyEventHandler) { - this.prepareReadyEventHandler = async (data: IFilesChangeEventData) => { + const handler = async (data: IFilesChangeEventData) => { if (data.hasNativeChanges) { const platformData = this.$platformsDataService.getPlatformData(data.platform, projectData); const prepareData = this.$prepareDataService.getPrepareData(liveSyncInfo.projectDir, data.platform, { ...liveSyncInfo, watch: !liveSyncInfo.skipWatcher }); @@ -63,7 +63,9 @@ export class RunController extends EventEmitter implements IRunController { await this.syncChangedDataOnDevices(data, projectData, liveSyncInfo); } }; - this.$prepareController.on(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler.bind(this)); + + this.prepareReadyEventHandler = handler.bind(this); + this.$prepareController.on(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); } await this.syncInitialDataOnDevices(projectData, liveSyncInfo, deviceDescriptorsForInitialSync); @@ -113,7 +115,7 @@ export class RunController extends EventEmitter implements IRunController { liveSyncProcessInfo.deviceDescriptors = []; if (this.prepareReadyEventHandler) { - this.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); + this.$prepareController.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); this.prepareReadyEventHandler = null; } @@ -199,7 +201,7 @@ export class RunController extends EventEmitter implements IRunController { result.didRestart = true; } } catch (err) { - this.$logger.trace(`Error while trying to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Error is: ${err.message || err}`); + this.$logger.info(`Error while trying to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Error is: ${err.message || err}`); const msg = `Unable to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Try starting it manually.`; this.$logger.warn(msg); From 713a8174a6d3604f1f436b0545fdc61a67858151 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:23:51 +0300 Subject: [PATCH 30/38] fix(preview): remove prepareReadyEvent handler correctly on preview `tns preview` (and using SK) should remove its handler for prepareControllers' `prepareReadyEvent` handler. However, this does not happend due to two reasons: - we try to remove the handler from prepareControllers' event, but this handler is attached to `preparController`, so it actually remains and causes multiple issues in long living processes, when CLI is used as a library - the event handler is not cached correctly as we attach its bound version, but cache it without the binding. So you cannot remove it. This causes issues when using preview in Sidekick, closing the current app, open it again and try to livesync a change - we have many handlers for prepareReadyEvent and this causes multiple livesync operations. --- lib/controllers/preview-app-controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/controllers/preview-app-controller.ts b/lib/controllers/preview-app-controller.ts index 9634718d99..74f522467d 100644 --- a/lib/controllers/preview-app-controller.ts +++ b/lib/controllers/preview-app-controller.ts @@ -43,7 +43,7 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon this.$previewSdkService.stop(); this.$previewDevicesService.updateConnectedDevices([]); if (this.prepareReadyEventHandler) { - this.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); + this.$prepareController.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); this.prepareReadyEventHandler = null; } } @@ -83,10 +83,12 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon await this.$previewAppPluginsService.comparePluginsOnDevice(data, device); if (!this.prepareReadyEventHandler) { - this.prepareReadyEventHandler = async (currentPrepareData: IFilesChangeEventData) => { + const handler = async (currentPrepareData: IFilesChangeEventData) => { await this.handlePrepareReadyEvent(data, currentPrepareData); }; - this.$prepareController.on(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler.bind(this)); + + this.prepareReadyEventHandler = handler.bind(this); + this.$prepareController.on(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); } data.env = data.env || {}; From b7595b5ccfcb388635b4e902d30b3de4514fe7b7 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:26:12 +0300 Subject: [PATCH 31/38] fix: remove webpackCompilationComplete handler correctly on prepare Commands using prepare of project (and using SK) should remove their handlers for webpackCompilerService's `webpackCompilationComplete` event. This is not happening and whenever we start new prepartion of the project, we attach new handler. This causes issues when running on device in Sidekick, closing the current app, open it again and try to livesync a change - we have many handlers for prepareReadyEvent and this causes multiple livesync operations. --- lib/controllers/prepare-controller.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/controllers/prepare-controller.ts b/lib/controllers/prepare-controller.ts index 8361c686c0..9d6a85195d 100644 --- a/lib/controllers/prepare-controller.ts +++ b/lib/controllers/prepare-controller.ts @@ -14,6 +14,7 @@ export class PrepareController extends EventEmitter { private watchersData: IDictionary> = {}; private isInitialPrepareReady = false; private persistedData: IFilesChangeEventData[] = []; + private webpackCompilerHandler: any = null; constructor( private $platformController: IPlatformController, @@ -46,7 +47,8 @@ export class PrepareController extends EventEmitter { } if (this.watchersData && this.watchersData[projectDir] && this.watchersData[projectDir][platformLowerCase] && this.watchersData[projectDir][platformLowerCase].hasWebpackCompilerProcess) { - await this.$webpackCompilerService.stopWebpackCompiler(platform); + await this.$webpackCompilerService.stopWebpackCompiler(platformLowerCase); + this.$webpackCompilerService.removeListener(WEBPACK_COMPILATION_COMPLETE, this.webpackCompilerHandler); this.watchersData[projectDir][platformLowerCase].hasWebpackCompilerProcess = false; } } @@ -110,11 +112,14 @@ export class PrepareController extends EventEmitter { private async startJSWatcherWithPrepare(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise { if (!this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].hasWebpackCompilerProcess) { - this.$webpackCompilerService.on(WEBPACK_COMPILATION_COMPLETE, data => { + const handler = (data: any) => { if (data.platform.toLowerCase() === platformData.platformNameLowerCase) { this.emitPrepareEvent({ ...data, hasNativeChanges: false }); } - }); + }; + + this.webpackCompilerHandler = handler.bind(this); + this.$webpackCompilerService.on(WEBPACK_COMPILATION_COMPLETE, this.webpackCompilerHandler); this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].hasWebpackCompilerProcess = true; await this.$webpackCompilerService.compileWithWatch(platformData, projectData, prepareData); From f0e79b3cfed004debab806153e39b3553313bdc0 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:28:11 +0300 Subject: [PATCH 32/38] fix: webpackCompilerService should not cache childProcesses forever Currently the webpackCompilerService caches the started webpack processes, but it removes them from the cache only when someone calls `stopWebpackCompiler` method. This is a major problem as we cache the first instance of the child process and we do not remove it, even when the process dies. For example, when you run just build, we start the webpack process without watch mode, the webpackCompilerService caches the child process, it exits, but the instance remains cached. Trying to run the application on device does not start new webpack process and different failures occur. --- lib/services/webpack/webpack-compiler-service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index e0af115380..6a6fbcb94a 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -72,6 +72,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp childProcess.on("error", (err) => { this.$logger.trace(`Unable to start webpack process in watch mode. Error is: ${err}`); + delete this.webpackProcesses[platformData.platformNameLowerCase]; reject(err); }); @@ -82,6 +83,7 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp this.$logger.trace(`Webpack process exited with code ${exitCode} when we expected it to be long living with watch.`); const error = new Error(`Executing webpack failed with exit code ${exitCode}.`); error.code = exitCode; + delete this.webpackProcesses[platformData.platformNameLowerCase]; reject(error); }); }); @@ -97,12 +99,14 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp const childProcess = await this.startWebpackProcess(platformData, projectData, prepareData); childProcess.on("error", (err) => { this.$logger.trace(`Unable to start webpack process in non-watch mode. Error is: ${err}`); + delete this.webpackProcesses[platformData.platformNameLowerCase]; reject(err); }); childProcess.on("close", async (arg: any) => { await this.$cleanupService.removeKillProcess(childProcess.pid.toString()); + delete this.webpackProcesses[platformData.platformNameLowerCase]; const exitCode = typeof arg === "number" ? arg : arg && arg.code; if (exitCode === 0) { resolve(); From 7c83e3c52c6d463d28b5a219f6330d00d75bf919 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:32:33 +0300 Subject: [PATCH 33/38] fix: stopPreview does not stop running webpack compilers `stopPreview` method does not stop running webpack compilers, so it is no longer possible to run the same application on device (no matter preview, build or run). This happens in long living processes, like Sidekick. To fix this, add new parameter to the method - an object containing the projectDir and use it to stop the processes. --- lib/controllers/preview-app-controller.ts | 7 ++++++- lib/definitions/preview-app-livesync.d.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/controllers/preview-app-controller.ts b/lib/controllers/preview-app-controller.ts index 74f522467d..b53ca164e3 100644 --- a/lib/controllers/preview-app-controller.ts +++ b/lib/controllers/preview-app-controller.ts @@ -15,6 +15,7 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon constructor( private $analyticsService: IAnalyticsService, + private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $errors: IErrors, private $hmrStatusService: IHmrStatusService, private $logger: ILogger, @@ -39,9 +40,13 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon return result; } - public async stopPreview(): Promise { + public async stopPreview(data: IProjectDir): Promise { this.$previewSdkService.stop(); this.$previewDevicesService.updateConnectedDevices([]); + + await this.$prepareController.stopWatchers(data.projectDir, this.$devicePlatformsConstants.Android); + await this.$prepareController.stopWatchers(data.projectDir, this.$devicePlatformsConstants.iOS); + if (this.prepareReadyEventHandler) { this.$prepareController.removeListener(PREPARE_READY_EVENT_NAME, this.prepareReadyEventHandler); this.prepareReadyEventHandler = null; diff --git a/lib/definitions/preview-app-livesync.d.ts b/lib/definitions/preview-app-livesync.d.ts index 414b4cffe7..6c8f125aed 100644 --- a/lib/definitions/preview-app-livesync.d.ts +++ b/lib/definitions/preview-app-livesync.d.ts @@ -77,6 +77,6 @@ declare global { interface IPreviewAppController { startPreview(data: IPreviewAppLiveSyncData): Promise; - stopPreview(): Promise; + stopPreview(data: IProjectDir): Promise; } } \ No newline at end of file From a55591dbaab9e0db55a902de227d7ce66805e2aa Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:51:03 +0300 Subject: [PATCH 34/38] chore: fix run-controllers unit tests --- test/controllers/run-controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/controllers/run-controller.ts b/test/controllers/run-controller.ts index e33fbc4688..6b0c200278 100644 --- a/test/controllers/run-controller.ts +++ b/test/controllers/run-controller.ts @@ -96,7 +96,8 @@ function createTestInjector() { prepareData = currentPrepareData; return { platform: prepareData.platform, hasNativeChanges: false }; }, - on: () => ({}) + on: () => ({}), + removeListener: (): void => undefined }); injector.register("prepareNativePlatformService", {}); injector.register("projectChangesService", {}); From 99676a4ee792ecfdfb7aaf2236d215de44bb9637 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 19 Jul 2019 17:51:45 +0300 Subject: [PATCH 35/38] chore: set version to 6.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index fa4d54cd5c..2aeebbccc8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "6.0.1", + "version": "6.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 63c06551b4..468664b837 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "6.0.1", + "version": "6.0.2", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From c403047419bd53ae8893f4634fc060a65f41d0c6 Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Fri, 19 Jul 2019 16:51:24 +0300 Subject: [PATCH 36/38] fix(migrate): include forgotten Angular dependency from the code-sharing apps --- docs/man_pages/general/migrate.md | 1 + lib/controllers/migrate-controller.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/man_pages/general/migrate.md b/docs/man_pages/general/migrate.md index 583756a301..fb8ca8e235 100644 --- a/docs/man_pages/general/migrate.md +++ b/docs/man_pages/general/migrate.md @@ -50,6 +50,7 @@ The following dependencies will be updated if needed: * @angular/platform-browser * @angular/router * @ngtools/webpack +* @angular-devkit/build-angular * rxjs * zone.js * nativescript-unit-test-runner diff --git a/lib/controllers/migrate-controller.ts b/lib/controllers/migrate-controller.ts index 5850d86e8f..838eeffb68 100644 --- a/lib/controllers/migrate-controller.ts +++ b/lib/controllers/migrate-controller.ts @@ -407,7 +407,8 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`; { packageName: "zone.js", verifiedVersion: "0.9.1", shouldAddIfMissing: true }, { packageName: "@angular/animations", verifiedVersion: "8.0.0" }, { packageName: "@angular/compiler-cli", verifiedVersion: "8.0.0", isDev: true }, - { packageName: "@ngtools/webpack", verifiedVersion: "8.0.0", isDev: true } + { packageName: "@ngtools/webpack", verifiedVersion: "8.0.0", isDev: true }, + { packageName: "@angular-devkit/build-angular", verifiedVersion: "0.800.3", isDev: true } ]; return dependencies; From d25168af0ce62e78517887694916f67ce4977822 Mon Sep 17 00:00:00 2001 From: fatme Date: Mon, 22 Jul 2019 09:36:00 +0300 Subject: [PATCH 37/38] docs: changelog for 6.0.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9888707241..59a079ef84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ NativeScript CLI Changelog ================ +6.0.2 (2019, July 22) +== +* [Fixed #4885](https://github.com/NativeScript/nativescript-cli/issues/4885): `migrate` and `update` commands are failing where everything is up-to-date +* [Fixed #4887](https://github.com/NativeScript/nativescript-cli/pull/4887): Include forgotten Angular dependency from the code-sharing apps +* [Fixed #4888](https://github.com/NativeScript/nativescript-cli/pull/4888): Sidekick: multiple errors in Sidekick + 6.0.1 (2019, July 18) == * [Fixed #4814](https://github.com/NativeScript/nativescript-cli/issues/4814): Missing `yargs-parser` dependency From ab71a5b7124584d37c84e0b21b17612a28f9fb2f Mon Sep 17 00:00:00 2001 From: DimitarTachev Date: Mon, 22 Jul 2019 13:28:39 +0300 Subject: [PATCH 38/38] chore: bump version --- npm-shrinkwrap.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2aeebbccc8..07aa7df832 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "6.0.2", + "version": "6.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8313,4 +8313,4 @@ "integrity": "sha512-99p+ohUBZ2Es0AXrw/tpazMcJ0/acpdQXr0UPrVWF0p7i8XiOYvjiXTdwXUVCTPopBGCSDtWBzOoYNPtF3z/8w==" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 468664b837..9b934c7cfb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "6.0.2", + "version": "6.1.0", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { @@ -139,4 +139,4 @@ "engines": { "node": ">=10.0.0 <13.0.0" } -} +} \ No newline at end of file