Skip to content

chore: merge 'release' into 'master' #4414

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

Merged
merged 32 commits into from
Mar 1, 2019

Conversation

DimitarTachev
Copy link
Contributor

PR Checklist

rosen-vladimirov and others added 30 commits February 15, 2019 15:54
In NativeScript 5.2.0 we've deprecated support for short imports. Add ability in CLI to check if there are such imports in the application's code and report them to users. The logic will be executed whenever application is prepared for build/livesync or when `tns doctor` is executed inside project dir.
Create class with static variables for ProjectTypes. These values must not be changed as they are used in Analytics, so changing them will break the current reports.
When removing platforms section, fix the regexp, so the removal procedure will keep the file the same as before the platform section was added. Currently, after removing the platform section, the file had additional empty lines inside it.
…ms-pod

fix: remove duplicated platforms from project's podfile
feat: detect and report short imports used in application
Steps to reproduce:
1. `tns create myPodApp --js`
2. `tns plugin add nativescript-imagepicker`
3. `tns plugin add nativescript-facebook`
4. Open `node_modules/nativescript-facebook/platforms/ios/Podfile` and replace the file's content with `platform :ios`
5. Open `node_modules/nativescript-imagepicker/platforms/ios/Podfile` and replace the file's content with `platform :ios, '9.0'`
…ll be replaced with another platform's version
…ning

fix: show warning when the platform's version in project's podfile will be replaced with another platform's version
…platform-version

fix: process correctly podfiles without platform's version
fix: validate test init before executing the test command
…move it correctly

Steps to reproduce:
1. `tns create myApp --js`
2. `tns plugin add nativescript-imagepicker` && `tns plugin add nativescript-facebook`
3. Replace the content of `./node_modules/nativescript-imagepicker/platforms/ios/Podfile` with `platform: ios, '9.0'`
4. Replace the content of `./node_modules/nativescript-facebook/platforms/ios/Podfile` with `platform: ios, '10.0'`
5. Add Podfile in `./app/App_Resources/iOS` with the following content `platform: ios: '8.0'`
6. Execute `tns prepare ios`
7. Remove `./app/App_Resources/iOS/Podfile`
8. Execute `tns prepare ios`

Expected behavior: Is should pass correctly and the content of `platforms/ios/Podfile` should be
```
...
# NativeScriptPlatformSection /node_modules/nativescript-facebook/platforms/ios/Podfile with 10.0
       platform :ios, '10.0'
# End NativeScriptPlatformSection
end
```

Actual behavior: It fails with `[!] Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end.` error and the the content of `platforms/ios/Podfile` is:
```
...
# NativeScriptPlatformSection /node_modules/nativescript-facebook/platforms/ios/Podfile with 10.0
       platform :ios, '10.0'
# End NativeScriptPlatformSectionend
```
fix: add new line at the end of the platform's section in order to remove it correctly
There are 4 tests marked as `npm support tests`, which are in fact e2e tests - they create project, add dependencies and prepare the project. These tests are executed for around 1 minute.
Rewrite them as unit tests, so they take around 20ms now.
There are some extremely slow integration tests for project creation. They mock the prompter and try to validate different use-cases when user enters invalid name and CLI prompts for correct name.
However, this is already handled in `project-name-service` tests. So, remove the slow integration tests for project creation and replace them with unit tests that ensure the project creation will fail in case projectNameService fails.
fix: ensure a single web client connected for debugging
When `tns doctor` detects errors in the configuration, it should print them to stdout and prompt the user to select how to resolve them.
In non-interactive terminal, it should just print the errors and fails as the prompter are not meaningful in non-interactive terminal - there's noone to answer them.

The logic works fine when you pipe the output of `tns doctor` to file for example (`tns doctor > out.txt`). CLI correctly detects the terminal as non-interactive, prints the errors and exits.
However, most of the CI environments are determined as interactive terminals by CLI. That's because CLI checks if the stdout and stdin of the current process are text terminal (TTY). CI environments set required flags, so the process seems like running in such text terminal.
When CLI thinks the process is running in text terminal, it uses some external package (ora) to print pretty lines. However, `ora` package also checks if the process is running in text terminal (which both CLI and `ora` think is true), but it also checks if the environment variable `CI` is set.
When it is set, `ora` package decides that it cannot print colored messages and just doesn't print anything.

To resolve this, improve the check if interactive terminal in CLI to respect the known environment variables that define the process as running in CI:
- for Travis the environment varible `CI` is set.
- for CircleCI the environment variable `CI` is set
- for Jenkins the environment variable `JENKINS_HOME` is set

Whenever one of those environment variables is set, CLI will decide it is running in non-interactive terminal and will not use `ora` (for `tns doctor`). It will also not show any prompters in this case.
fix: errors from `tns doctor` are not visible in CI environment
fix: increase the debugger port timeout in order to support bigger apps
…nstead of `created` when checking the `stale` locks

Replacing the lock package, we are able to keep smaller `stale` values (e.g. 10 seconds) and avoid losing the lock during long-running operations. In this way, when the CLI process crashes (or is killed with SIGKILL), we won't have leaked lock files for more than 10 seconds.
fix: avoid leaked lock files for more than 10 seconds
@cla-bot cla-bot bot added the cla: yes label Mar 1, 2019
@ghost ghost assigned DimitarTachev Mar 1, 2019
@ghost ghost added the new PR label Mar 1, 2019
@rosen-vladimirov rosen-vladimirov merged commit 896f143 into master Mar 1, 2019
@ghost ghost removed the new PR label Mar 1, 2019
@DimitarTachev DimitarTachev deleted the tachev/marge-release-into-master branch March 7, 2019 10:02
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