Skip to content

feat: drop support for macOS Sierra and below #3982

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 1 commit into from
Oct 8, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

Drop support for macOS Sierra and below as we are no longer testing this OS. Drop a line on stderr on each CLI command and inform the user that this OS is not supported.

Change the public API (getSystemWarnings) to return objects with information about the severity of the warnings. This way the consumer can decide how to handle the warnings.

Fix an issue when getting macOS version from System Profile - the code was not working when version has two numbers (10.14 for example).

Add new method in logger that allows printing to stderr. It should be used instead of console.error, so we can make the code testable.

In case tns debug ios --inspector is called on macOS Sierra, stop the command with error, as the NativeScript Inspector package will no longer provide a built version for macOS Sierra.

PR Checklist

What is the current behavior?

Users see yellow warning when they execute commands on macOS Sierra and below.

What is the new behavior?

Red message is printed on stderr.

Fixes issue #3886

@rosen-vladimirov rosen-vladimirov added this to the 5.0.0 milestone Oct 5, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this Oct 5, 2018
@rosen-vladimirov rosen-vladimirov requested a review from Fatme October 5, 2018 11:22
@@ -26,8 +26,12 @@ import { settlePromises } from "./common/helpers";
const $sysInfo = $injector.resolve<ISysInfo>("sysInfo");
const macOSWarning = await $sysInfo.getMacOSWarningMessage();
if (macOSWarning) {
const message = EOL + macOSWarning + EOL ;
logger.warn(message);
const message = EOL + macOSWarning.message + EOL;
Copy link
Contributor

Choose a reason for hiding this comment

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

${EOL}${macOSWarning.message}${EOL}

warnings.push(macOSWarningMessage);
}

const nodeWarning = getNodeWarning();
if (nodeWarning) {
nodeWarning.toString = function() { return this.message; };
Copy link
Contributor

Choose a reason for hiding this comment

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

nodeWarning.toString = () => this.message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not work - the current class does not have message property and in case I use lambda, the current this will be used inside it. That's why I need function.

const macOSWarningMessage = await this.getMacOSWarningMessage();
if (macOSWarningMessage) {
macOSWarningMessage.toString = function() { return this.message; };
Copy link
Contributor

Choose a reason for hiding this comment

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

macOSWarningMessage.toString = () => this.message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not work - the current class does not have message property and in case I use lambda, the current this will be used inside it. That's why I need function.

interface ISystemWarning {
message: string;
severity: SystemWarningsSeverity;
toString?: () => string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need .toString method? Can we just use warning.message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to mention this in the PR description - the toString is required for a minimal backwards compatibility. With the old code, you were able to use the result of getSystemWarnings() and join it with EOL for example and print it. In case we do not have the toString implementation here, the join operation will use the default toString, which returns [Object object].

if (nodeWarning) {
console.warn((os.EOL + nodeWarning + os.EOL).yellow.bold);
if (nodeWarning && nodeWarning.message) {
console.warn((os.EOL + nodeWarning.message + os.EOL).yellow.bold);
Copy link
Contributor

Choose a reason for hiding this comment

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

console.warn(`${os.EOL}${nodeWarning.message}${os.EOL}`.yellow.bold);

Drop support for macOS Sierra and below as we are no longer testing this OS. Drop a line on stderr on each CLI command and inform the user that this OS is not supported.

Change the public API (getSystemWarnings) to return objects with information about the severity of the warnings. This way the consumer can decide how to handle the warnings.

Fix an issue when getting macOS version from System Profile - the code was not working when version has two numbers (10.14 for example).

Add new method in logger that allows printing to stderr. It should be used instead of `console.error`, so we can make the code testable.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/drop-support-macos-sierra branch from 85d288f to 8545629 Compare October 8, 2018 08:49
@rosen-vladimirov rosen-vladimirov merged commit 77f5cb1 into master Oct 8, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/drop-support-macos-sierra branch October 8, 2018 09:29
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.

2 participants