-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Conversation
lib/nativescript-cli.ts
Outdated
@@ -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; |
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.
${EOL}${macOSWarning.message}${EOL}
warnings.push(macOSWarningMessage); | ||
} | ||
|
||
const nodeWarning = getNodeWarning(); | ||
if (nodeWarning) { | ||
nodeWarning.toString = function() { return this.message; }; |
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.
nodeWarning.toString = () => this.message
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 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; }; |
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.
macOSWarningMessage.toString = () => this.message
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 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; |
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.
Why we need .toString
method? Can we just use warning.message
?
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.
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]
.
lib/common/verify-node-version.ts
Outdated
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); |
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.
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.
85d288f
to
8545629
Compare
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