NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Feat: Quality of life improvements #5757

Closed ammarahm-ed closed 1 year ago

ammarahm-ed commented 1 year ago

This PR adds some quality of life improvements to NativeScript CLI.

One thing still missing is ability to connect to an exisiting app on a device without rebuilding, just connecting HMR and reloading the app that I really want to add.

Also for the ns start command, there could be a way to toggle logging and show minimum logs other than those from the app with the option to enable complete logs.

Here's the new look:

Screenshot 2023-08-27 at 5 07 10 PM

PR Checklist

NathanWalker commented 1 year ago

Couple initial comments:

Debug with Chrome DevTools Enabled:
a — Debug Android app 
i — Debug iOS app

Dev Workflow:
 r — Rebuild native app if needed and restart
 R — Force rebuild native app and restart
 w — Toggle file watcher (Disables/Enables webpack/native changes watch etc)

Open Platform Projects:
 A — Open Android project in Android Studio
 I — Open iOS project in Xcode

Project Management:
 c — Clean project
 n — Install dependencies
ammarahm-ed commented 1 year ago

The prompt order and grouping

We can improve the order but I am not sure if it's a good idea to group them. I understand that we want to make things more clear but it will make the initial header + key command help quick long and take more space. Maybe just keeping the relevant commands together is good enough.

Changing 'run' to 'debug' since run/debug have different meanings and uses in CLI. This start menu can use debug as default since most useful. One could still ns run on their own - it's more advanced and would argue less used command but allows multiples connected devices to be run at same time. Whereas debug always enabled chrome debugger and uses a targeted device.

I personally have been using run command most of the time. I think you aren't always in the debug mode and needing a chrome tab opened to debug the app. Most of the time console.log does it's job until you hit something that needs debugging in chrome. A key command like press "d" to start debugging can work too for that case.