Skip to content

Conversation

@Logikgate
Copy link
Contributor

If you are working in multiple nativescript projects all with different versions of nativescript installed it is currently not possible to use this plugin because it uses the globally installed nativescript cli.

It is possible to specify the tnsPath using the workspace setting nativescript.tnsPath but currently that path must be absolute so it is not possible to share that setting amongst a team.

This pull request modifies the plugin to allow the vscode workspace nativescript.tnsPath setting to be a relative path so that the setting can be shared amongst team members.

@cla-bot cla-bot bot added the cla: yes label Feb 13, 2020
@Logikgate Logikgate requested a review from ivanovit February 13, 2020 18:27
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution. I've tested your PR and currently it still uses the global CLI when running one of the Run commands. To reproduce it, just open any project, where local CLI is installed and then use the command palette to find NativeScript: Run Android or iOS commands.
Can you try fixing this as well, I think it should be handled in main.ts where the commands are registered.

@Logikgate
Copy link
Contributor Author

@rosen-vladimirov Thanks for the review! Did you set the nativescript.tnsPath in the project you tested?

This pull request doesn't automatically detect if a local Nativescript is installed it just adds the ability for a user to specify a path that is relative to the project root. So something like:

{ 
    "nativescript.tnsPath": "./node_modules/.bin/tns"
}

That being said, I do think that it would be good for it to automatically use the local cli if a tnsPath isn't specified in the workspace settings. So the order of precedence will be:

  1. tnsPath specified in workspace settings
  2. if no tnsPath, use locally installed cli if it exists
  3. if no locally installed cli, use globally installed cli

Let me know if you agree and I will make the change 😄

@NathanWalker
Copy link
Member

@Logikgate We were looking at getting this merged finally - curious if you had a moment for a brief zoom call? If so could you shoot email to support@nativescript.org - just want to make sure the changes don't have side effects.

@NathanWalker NathanWalker merged commit f042ba2 into nativescript-community:master Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants