Skip to content

chore: merge release into master #4685

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 11 commits into from
Jun 6, 2019
Merged

chore: merge release into master #4685

merged 11 commits into from
Jun 6, 2019

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jun 6, 2019

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

KristianDD and others added 11 commits May 22, 2019 13:20
…con-rgba

fix: generated App Store icon has alpha channel
Currently when you run `tns cloud run ...` the command executes local prepare without taking into account the value of `useLegacyWorkflow` value in nsconfig.json file.
The problem is that cloud commands have specific `--` options, which are set as `dashedOptions` on command level. During command execution the following actions happen:
1. CLI starts its execution and via `$injector` constructs new instance of `$options`.
2. In the constructor of `$options` we call `this.setArgv()`, which calls `yargs` package and constructs values based on the user input of `--` options.
3. `$injector` resolves `$commandsService` and constructs new object from it.
4. In the constructor of `CommandsService`, we call `$options.setupOptions` and pass the current projectData. `setupOptions` takes into account the projectData and again calls `this.setArgv()`. After that it overwrites some of the values set by yargs based on the projectData.
5. `CommandsService` starts execution of the command by resolving new instance of it and calling its own `tryExecuteCommandAction` method.
6. `tryExecuteCommandAction` method internally calls `this.$options.validateOptions` by passing the command specific options(`dashedOptions`). The `validateOptions` method modifies the internal structure based on which yargs constructs the passed options and calls `this.setArgv()` again.

At this point we overwrite the internal values of `$options` based on the user's input and taking into account the command's `dashedOptions`. However, this way we've overwritten the values set by `setupOptions` in step 4 which are based on the current project dir.

To fix the behavior, make `setupOptions` private in `$options` and call it internally in the `validateOptions` method. So the new workflow is:
1. CLI starts its execution and via `$injector` constructs new instance of `$options`.
2. In the constructor of `$options` we call `this.setArgv()`, which calls `yargs` package and constructs values based on the user input of `--` options.
3. `$injector` resolves `$commandsService` and constructs new object from it.
4. `CommandsService` starts execution of the command by resolving new instance of it and calling its own `tryExecuteCommandAction` method.
5. `tryExecuteCommandAction` method internally calls `this.$options.validateOptions` by passing the command specific options(`dashedOptions`). The `validateOptions` method calls `this.setupOptions` and pass the current projectData and command specific options. After that it calls `this.setArgv()` and the internal structure that contains the passed options is overwritten based on the command specific options. After that the method overwrites some of the values based on the passed projectData.
In case you are using unsupported Node.js version CLI must show you error that this version is not supported and to inform you which is the supported range. Currently this is not working and CLI shows error for `Unexpected token`.
The problem is that CLI has some specific logic to check the Node.js version and the code should be pure ES5 syntax in order to work with old Node.js versions (by default CLI's code is ES6).
The current issue is caused by using string interpolation in the mentioned code. Fix the message to fix the problem.
fix: cloud run command does not respect useLegacyWorkflow flag
Several logger methods have been deprecated, but their usage had been broken. Fix it until we delete them.
The current problem arises when we pass several args to the `logger.out` (or any deprecated method).
…logger-apis

fix: pass correct args when using deprecated logger API
…error

fix: incorrect error for non-supported Node.js version
In case you try printing the following:
```
const obj1 = null;
this.$logger.info("value %s", obj1);
```
Our implementation fails with error: `Cannot read property hasOwnProperty of null`.
The problem is in the way we check for passed logger options in the args passed to `logger` methods. The `typeof null` returns object, so next parts of the code fail.

Also passed logger options are handled by priority, i.e. the first passed option should be used. This allows callers of methods that specify some logger options internaly, to overwrite their values. Add unit tests for this behavior.
Fix the case when same logger option is passed multiple times in different objects - currently only one of the instances is removed and the other one is included in the message visible to the user. Now all such objects are removed.
Add unit tests for all of the described cases.
@cla-bot cla-bot bot added the cla: yes label Jun 6, 2019
@Fatme Fatme merged commit 8b72f12 into master Jun 6, 2019
@Fatme Fatme deleted the fatme/merge-release-541 branch June 6, 2019 06:27
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.

4 participants