-
-
Notifications
You must be signed in to change notification settings - Fork 197
Fix installation of tns-core-modules during project creation #2790
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
CLI tries to install `tns-core-modules` during project creation. In case the template does not have `tns-core-modules` in it, CLI will install latest version of `tns-core-modules` which may (and most probably is) be incompatible with the runtime and other dependencies of the project. In such cases ensure the CLI installs version of tns-core-modules that matches its own version, i.e. when CLI is 2.5.2, it should install latest 2.5.x core modules. Also ensure exact versions are installed and persisted by `npmInstallationManager`.
let templatePackageJsonData = this.getDataFromJson(templatePath); | ||
|
||
if (!(templatePackageJsonData && templatePackageJsonData.dependencies && templatePackageJsonData.dependencies[constants.TNS_CORE_MODULES_NAME])) { |
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.
@rosen-vladimirov Isn't it more correct to install the correct version of the Template? I.e. if you install 3.0.0 template and you override the tns_core_modules, won't still there be a possibility that this 3.0.0 template doesn't work with them? For pure NS I don't know, but for NS+Angular I think it's likely?
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.
@yyosifov the template versioning may differ and we also do not have control over the templates - basically everything is template.
Also the current code will install tns-core-modules
only in case they are not defined in the template itself.
let templatePackageJsonData = this.getDataFromJson(templatePath); | ||
|
||
if (!(templatePackageJsonData && templatePackageJsonData.dependencies && templatePackageJsonData.dependencies[constants.TNS_CORE_MODULES_NAME])) { |
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.
What if the Template contains the tns-core-modules-widgets
package? Shall we add it to the list of specific dependencies.
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 tns-core-modules-widgets
are dependency of the tns-core-modules
. In case they exist in the template, it means someone has a very good reason to add them. I suggest to skip checks for them until we find a proper use-case.
CLI tries to install
tns-core-modules
during project creation. In case the template does not havetns-core-modules
in it, CLI will install latest version oftns-core-modules
which may (and most probably is) be incompatible with the runtime and other dependencies of the project.In such cases ensure the CLI installs version of tns-core-modules that matches its own version, i.e. when CLI is 2.5.2, it should install latest 2.5.x core modules.
Also ensure exact versions are installed and persisted by
npmInstallationManager
.