-
-
Notifications
You must be signed in to change notification settings - Fork 196
fix: validate bundle version on tns preview --bundle
and tns run --hmr
commands
#3956
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
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.
Please add tests with some prerelease versions of nativescript-dev-webpack, for example:
0.17.0-2018-09-28-173604-01
, 0.18.0-2018-09-28-173604-01
, etc.
} | ||
|
||
if (minSupportedVersion) { | ||
const currentVersion = hasBundlerPluginAsDependency || hasBundlerPluginAsDevDependency; |
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.
the names of the properties seems incorrect, maybe bundlerVersionInDependencies
and bundlerVersionInDevDependencies
seems more appropriate
const currentVersion = hasBundlerPluginAsDependency || hasBundlerPluginAsDevDependency; | ||
const isBundleSupported = semver.gte(semver.coerce(currentVersion), semver.coerce(minSupportedVersion)); | ||
if (!isBundleSupported) { | ||
this.$errors.fail(util.format(BundleValidatorMessages.NotSupportedVersion, minSupportedVersion)); |
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.
failWithoutHelp maybe, the command help may not help here
0ad4f6b
to
f6e6532
Compare
expectedError: null | ||
}, | ||
{ | ||
name: `should not throw an error when webpack's version is grather than minSupportedVersion when webpack is installed as ${key}`, |
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.
is greater
f6e6532
to
1502957
Compare
PR Checklist
What is the current behavior?
No error message is shown when installeld
nativescript-dev-webpack
plugin does not supporthmr
option orpreview-sync
hook.What is the new behavior?
An error message is shown when installeld
nativescript-dev-webpack
plugin does not supporthmr
option orpreview-sync
hook.