This repository was archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… installing version of nativescript-dev-webpack plugin and in case when they are different print a warning message.
sis0k0
reviewed
Apr 4, 2018
projectFilesManager.js
Outdated
const newTemplate = fs.readFileSync(newTemplatePath).toString(); | ||
if (newTemplate !== currentTemplate) { | ||
const message = `The current project contains a ${path.basename(currentTemplatePath)} file located at ${currentTemplatePath} that differs from the one in the new version of the nativescript-dev-webpack plugin located at ${newTemplatePath}. Some of the plugin features may not work as expected until you manually update the ${path.basename(currentTemplatePath)} file.`; | ||
console.info(`\x1B[33;1m${message}\x1B[0m` ); |
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.
Developers can also use this script to overwrite the existing configuration files:
./node_modules/.bin/update-ns-webpack --configs
rosen-vladimirov
approved these changes
Apr 4, 2018
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.
after handling comment
projectFilesManager.js
Outdated
@@ -37,6 +37,21 @@ function forceUpdateProjectFiles(projectDir, appDir) { | |||
addProjectFiles(projectDir, appDir); | |||
} | |||
|
|||
function compareProjectFiles(projectDir) { | |||
const projectTemplates = getProjectTemplates(projectDir); | |||
Object.keys(projectTemplates).forEach(function(newTemplatePath){ |
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.
you can use lamda syntax here:
Object.keys(projectTemplates).forEach( newTemplatePath => {
sis0k0
approved these changes
Apr 4, 2018
run ci |
test |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compare current webpack.config.js and the one that will come from the installing version of nativescript-dev-webpack plugin and in case when they are different print a warning message.
PR Checklist
What is the current behavior?
When the user has a project with already generated
webpack.config.js
and updatenativescript-dev-webpack
plugin to newer version,webpack.config.js
is not replaced and this way if the newer version ofnativescript-dev-webpack
has changes inwebpack.config.js
file they are not respected in user project.What is the new behavior?
When the user has a project with already generated
webpack.config.js
and updatenativescript-dev-webpack
plugin to newer version which has changes inwebpack.config.js
file, a warning message if printed to ask the user to manually update the file.