Coder Social home page Coder Social logo

nativescript / nativescript-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0K 86.0 194.0 172.05 MB

Command-line interface for building NativeScript apps

Home Page: https://www.npmjs.com/package/nativescript

License: Apache License 2.0

Shell 0.01% JavaScript 72.93% TypeScript 26.97% Batchfile 0.01% HTML 0.01% CSS 0.08%
nativescript cli mobile android ios cross-platform hacktoberfest

nativescript-cli's Issues

Command `hooks`

Implement before and after hooks for each command. Those should be scripts that will be loaded and executed before and after each command gets executed. We will need to have a set of default hooks and move our platform-specific files logic as such hook. Custom project hooks will live in the hooks folder of the project.

'$ tns platform list' message is misleading if all available platforms are installed

Current msg: No available platforms found
It should be something else (e.g "All available platforms are installed(added)")

Case 1: No platforms are added
Current:
$ tns platform list Available platforms: android No installed platforms found.
Expected:
$ tns platform list Available platforms for this OS: android No installed platforms found. Use $ tns platform add

Case 2: Platform is added, but the project is not prepared
Current:
$ tns platform list No available platforms found. Installed platforms: android
Expected:
$ tns platform list The project is not prepared for any platform Installed platforms: android

Case 3: Platform is prepared
Current:
$ tns platform list No available platforms found. Installed platforms: android
Expected:
$ tns platform list The project is prepared for: <platform> Installed platforms: android

`Deploy` command

Implement deploy command for all platforms. It should deploy the built application on all connected devices or emulators\simulators.

If the --device option is specified it should deploy only to the connected devices.

If the --emulator option is specific it should deploy only to the target emulator. If there is no running emulator it should be launched and then deployed to.

`platform update` command

Implement platform update command which will update the given platform to the latest (or specified) version.

Executing `$ tns platform` should display the help of 'platform' command

it should be:
$ tns platform
Usage:
$ tns platform

is a related command that extends the platform command. You can run the following related commands:
list - Lists all available and installed platforms.
add - Creates a new platform specific project
{MIsssing} Remove - Removes the platform specific project

Autocompletion with [TAB][TAB] on command's arguments, throws exception

$ tns platform add [TAB][TAB]
- - - - -
at CommandDispatcher.completeCommand (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\lib\common\dispatchers.js:38:59)
at FiberFuture.Future.wait (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:415:10)
at FiberFuture.Future.wait (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:416:15)
at Function.settle (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\node_modules\fibers\future.js:148:26)
at Object.complete (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\node_modules\tabtab\lib\completion.js:68:3)
at c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\lib\common\dispatchers.js:92:35
at c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\commands-service.js:136:20
at completeCallback (c:\Users\tytodorov\AppData\Roaming\npm\node_modules\nativescript\lib\common\services\commands-service.js:108:34)
TypeError: undefined is not a function

'tns emulate android --emulator' fails if real device is also attached

Steps to reproduce:

Start one emulator and connect one real device
So that devices list looks like this:

$ adb devices
List of devices attached
device
emulator-5554 device

tns create TNS_Javascript
tns platform add android --path TNS_Javascript
tns prepare android --path TNS_Javascript
tns emulate android --emulator --path TNS_Javascript

Result:
BUILD SUCCESSFUL
Total time: 1 second
Project successfully built
Using /private/var/lib/jenkins/workspace/CLI-stable-tests-osx/TNS_Javascript/platforms/android/bin/TNS_Javascript-debug.apk
execFile: /private/var/lib/jenkins/workspace/CLI-stable-tests-osx/node_modules/nativescript/resources/platform-tools/android/darwin/adb devices
execFile: /private/var/lib/jenkins/workspace/CLI-stable-tests-osx/node_modules/nativescript/resources/platform-tools/android/darwin/adb devices
waiting for the emulator device to appear
spawn: /private/var/lib/jenkins/workspace/CLI-stable-tests-osx/node_modules/nativescript/resources/platform-tools/android/darwin/adb wait-for-device
Command /private/var/lib/jenkins/workspace/CLI-stable-tests-osx/node_modules/nativescript/resources/platform-tools/android/darwin/adb exited with code 1

Note: Everything works fine if real device is disconnected.

Error when adding ios platform

./tns create TNS_JS
n
./tns platform add ios --path TNS_JS

Copying template files...
Installing  tns-ios@<0.4.0
[email protected] TNS_JS/platforms/ios/node_modules/tns-ios
Installed  tns-ios@<0.4.0
cp: no such file or directory: /Users/jzhekov/Desktop/Trash/tns-cli/node_modules/.bin/TNS_JS/platforms/ios/node_modules/.DS_Store/framework/*

ENOTDIR, open '/Users/jzhekov/Desktop/Trash/tns-cli/node_modules/.bin/TNS_JS/platforms/ios/node_modules/.DS_Store/package.json'

The .DS_Store file is created by opening the TNS_JS/platforms/ios/node_modules/ in Finder.

Info command

Info command should print more detailed information for project:

  • current runtime's version
  • commit sha for runtimes and modules
  • more specified information for each platform (for example apilevel for android)
  • debug information about user's machine setup (useful for debugging purposes)

Build iOS project fails because of missing icons

Log:

The following build commands failed:
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/Default-Landscape.png UnitTestApp/Resources/icons/Default-Landscape.png
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/[email protected] UnitTestApp/Resources/icons/[email protected]
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/[email protected] UnitTestApp/Resources/icons/[email protected]
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/Default-Portrait.png UnitTestApp/Resources/icons/Default-Portrait.png
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/[email protected] UnitTestApp/Resources/icons/[email protected]
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/Default.png UnitTestApp/Resources/icons/Default.png
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/[email protected] UnitTestApp/Resources/icons/[email protected]
CopyPNGFile /private/var/lib/jenkins/workspace/tns-modules-stable-build-unittests-ipa/UnitTestApp/platforms/ios/build/device/UnitTestApp.app/icon-40.png UnitTestApp/Resources/icons/icon-40.png

Prepare android project fail to copy some resources

$ tns platform add android --frameworkPath tns-android-stable-latest.tgz --path CutenessIO
Copying template files...
Installing tns-android-stable-latest.tgz
[email protected] CutenessIO/platforms/android/node_modules/tns-android
Installed tns-android-stable-latest.tgz
cp: no such file or directory: /private/var/lib/jenkins/workspace/CutenessIO/platforms/android/node_modules/tns-android/framework/gen

cp: no such file or directory: /private/var/lib/jenkins/workspace/CutenessIO/platforms/android/node_modules/tns-android/framework/.project

sed: no such file or directory: /private/var/lib/jenkins/workspace/CutenessIO/platforms/android/.project

Prepare ios project fail to copy some resources

Here is what happens when I try to prepare ios:

$ node_modules/.bin/tns prepare ios --path UnitTestApp
cp: copyFileSync: could not write to dest file (code=ENOENT):/private/var/lib/jenkins/workspace/CLI-stable-tests-osx/UnitTestApp/platforms/ios/UnitTestApp/Resources/icons
Project successfully prepared

Executing "$ tns platform add ios" throws exception

Xcode: Version 5.0.2 (5A3005)

TYTODOROVMAC:kolcho tytodorov$ tns platform add ios --log trace
Starting watch on killswitch /Users/tytodorov/.nativescript-cli/KillSwitches/cli
Looking for project in '/Users/tytodorov/nativeclitest/kolcho'
Project directory is '/Users/tytodorov/nativeclitest/kolcho'.
exec: which xcodebuild
exec: xcodebuild -version | head -n 1 | sed -e 's/Xcode //'
Version strings are not in the same format
Usage:
$ tns platform add

Platform-specific usage:
$ tns platform add android
$ tns platform add ios

Creates a new platform specific project. In this version of Telerik NativeScript you can create only ios and android projects.
You can create Android projects on windows and Mac machine. You can create ios projects only on Mac machine.

'tns run android --emulator' does not work if emulator is not started before that

Description:
'tns run android --emulator' does not work if emulator is not started before that
Expected:
'tns run android --emulator' should start new emulator if emulator is not running

Steps to reproduce:
tns create TNSApp
tns platform add andorid --path TNSApp
tns prepare android --path TNSApp
tns run android --emulator --path TNSApp

Android emulator is not started, last command does not finish, output is:

BUILD SUCCESSFUL
Total time: 4 seconds
Project successfully built
Using c:\Workspaces\cli-tests\TNSApp\platforms\android\bin\TNSApp-debug.apk
Starting Android emulator with image true

More Details:
In task manager I see that "adb wait-for-device" is running
Found on Windows 8.1

Workaround:
Start some existing avd before 'tns run android --emulator --path TNSApp' command and it will deploy and run the app successfully.

Wrong error messages

Case 1:
This command:
"tns deploy android --device fakeDevice --path TNS_Javascript"
returns following error:
Cannot resolve the specified connected device by the provided index or identifier. To list currently connected devices and verify that the specified index or identifier exists, run 'appbuilder device'.

'appbuilder device' is wrong, it should be replaced with 'tns list-devices'

Case 2:
When all Android devices are disconnected and you call "tns list-devices android" then you see:
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again

Then message does not end with '.'.

Support node.js API

Hello, I think it would be nice if you supported Node.js apis out of the box so that you could easily share all the modules that exist in the npm ecosystem.

Research iOS8

Research how would we react to the iOS8 release.
We may need to support versioning (e.g. builds for iOS7.0 or iOS8.0)
We may need to support two versions of xcode during the migration from iOS7 to iOS8.
The iOS runtime should support iOS8, do we need two builds of the runtime?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.