-
-
Notifications
You must be signed in to change notification settings - Fork 197
fix (getting started): Improve behaviour when nativescript-cloud is installed #3495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
private getExtensionData(): IExtensionData { | ||
return this.$extensibilityService.getInstalledExtensionsData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use _.find instead of array.find
, it is safer to use Lodash methods
|
||
return `${PlatformEnvironmentRequirements.MISSING_LOCAL_AND_CLOUD_SETUP_MESSAGE}` + EOL | ||
+ "Run $ tns setup command to run the setup script to try to automatically configure your environment for local builds." + EOL | ||
+ `Run $ tns cloud setup command to install the ${constants.NATIVESCRIPT_CLOUD_EXTENSION_NAME} extension to configure your environment for cloud builds.` + EOL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line of the message is the only difference between this message and the one used in the if above. I suggest extrating the cloud message in a const and use it in the message here. This way you'll not duplicate all other messages:
const cloudBuildMessage = this.$nativescriptCloudExtensionService.isInstalled() ? this.getCloudBuildsMessage(platform) :
`Run $ tns cloud setup command to install the ${constants.NATIVESCRIPT_CLOUD_EXTENSION_NAME} extension to configure your environment for cloud builds.`;
+ `Select "Configure for Cloud Builds" to install the ${constants.NATIVESCRIPT_CLOUD_EXTENSION_NAME} extension and automatically configure your environment for cloud builds.` + EOL | ||
+ `Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.` | ||
+ `Select "Configure for Both Local and Cloud Builds" to automatically configure your environment for both options.` | ||
+ `Select "Skip Step and Configure Manually" to disregard these options and install any required components manually.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, some of the messages are duplicated, can you extract them in const variables.
@@ -6,7 +6,8 @@ import { assert } from "chai"; | |||
const platform = "android"; | |||
const cloudBuildsErrorMessage = `In order to test your application use the $ tns login command to log in with your account and then $ tns cloud build command to build your app in the cloud.`; | |||
const manuallySetupErrorMessage = `To be able to build for ${platform}, verify that your environment is configured according to the system requirements described at `; | |||
const nonInteractiveConsoleErrorMessage = `You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nRun $ tns setup command to run the setup script to try to automatically configure your environment for local builds.\nRun $ tns cloud setup command to install the nativescript-cloud extension to configure your environment for cloud builds.\nVerify that your environment is configured according to the system requirements described at `; | |||
const nonInteractiveConsoleMessageWhenExtensionIsNotInstalled = `You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nRun $ tns setup command to run the setup script to try to automatically configure your environment for local builds.\nRun $ tns cloud setup command to install the nativescript-cloud extension to configure your environment for cloud builds.\nVerify that your environment is configured according to the system requirements described at `; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use os.EOL
instead of \n
Also can you please wrap the calls to command in quotes, for example ``Run '$ tns setup' command to run the...`
@@ -6,7 +6,8 @@ import { assert } from "chai"; | |||
const platform = "android"; | |||
const cloudBuildsErrorMessage = `In order to test your application use the $ tns login command to log in with your account and then $ tns cloud build command to build your app in the cloud.`; | |||
const manuallySetupErrorMessage = `To be able to build for ${platform}, verify that your environment is configured according to the system requirements described at `; | |||
const nonInteractiveConsoleErrorMessage = `You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nRun $ tns setup command to run the setup script to try to automatically configure your environment for local builds.\nRun $ tns cloud setup command to install the nativescript-cloud extension to configure your environment for cloud builds.\nVerify that your environment is configured according to the system requirements described at `; | |||
const nonInteractiveConsoleMessageWhenExtensionIsNotInstalled = `You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nRun $ tns setup command to run the setup script to try to automatically configure your environment for local builds.\nRun $ tns cloud setup command to install the nativescript-cloud extension to configure your environment for cloud builds.\nVerify that your environment is configured according to the system requirements described at `; | |||
const nonInteractiveConsoleMessageWhenExtensionIsInstalled = `Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nRun $ tns setup command to run the setup script to try to automatically configure your environment for local builds.\nIn order to test your application use the $ tns login command to log in with your account and then $ tns cloud build command to build your app in the cloud.\nVerify that your environment is configured according to the system requirements described at .`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
private static NOT_CONFIGURED_ENV_MESSAGE = "To continue, choose one of the following options: "; | ||
private static NOT_CONFIGURED_ENV_AFTER_SETUP_SCRIPT_MESSAGE = "The setup script was not able to configure your environment for local builds. To execute local builds, you have to set up your environment manually. To continue, choose one of the following options:"; | ||
private static NOT_CONFIGURED_ENV_AFTER_SETUP_SCRIPT_MESSAGE = "The setup script was not able to configure your environment for local builds. To execute local builds, you have to set up your environment manually. In case you have any issues, you can ask in our forum. To continue, choose one of the following options:"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need the actual link to the forum here: http://forum.nativescript.org
c5457ea
to
97f550e
Compare
…lready installed. Fixes messages when console is non-interactive. Add `In case you have any issues, you can ask in our forum.` message when env is not configured after setup script. Refactor unit tests
97f550e
to
9940fdd
Compare
run ci |
2168c55
to
50bbfb6
Compare
run ci |
Fixes the behaviour of getting started when
nativescript-cloud
is already installed.Fixes messages when console is non-interactive.
Add
In case you have any issues, you can ask in our forum.
message when env is not configured after setup script.Refactor unit tests