Skip to content

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

Merged
merged 1 commit into from
May 9, 2017

Conversation

rosen-vladimirov
Copy link
Contributor

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.

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])) {
Copy link
Contributor

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?

Copy link
Contributor Author

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])) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@rosen-vladimirov rosen-vladimirov merged commit 6ab0cfe into release May 9, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-install-latest branch May 9, 2017 17:15
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.

3 participants