Skip to content
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

yarn update upgrades to Angular 8.1.0-rc.0 release 🤔 #1540

Closed
4 tasks done
juristr opened this issue Jun 30, 2019 · 5 comments
Closed
4 tasks done

yarn update upgrades to Angular 8.1.0-rc.0 release 🤔 #1540

juristr opened this issue Jun 30, 2019 · 5 comments

Comments

@juristr
Copy link
Member

juristr commented Jun 30, 2019

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

I'm currently working on #1110 (having a local fix I'll push soon) and while doing so I tried to upgrade an NX 7 workspace I have to the latest version of NX. Strangely it results in getting Angular v8.1.0-rc.0 instead 🤔. I observed the upgrade process and first it upgrades to v8 correctly, but when the process comes at the point of upgrading the Angular CLI, it looks like it upgrades the Angular core deps again, now from v8 to v8 RC.

Steps to Reproduce & Failure Information (for bugs)

To reproduce:

  1. Create a v7 repo: npx --ignore-existing [email protected] nxupgradetest
  2. Add a publishable lib which adds ng-packagr as dep (ng g lib core --publishable=true)
  3. Execute the upgrade script yarn update

Here's an example JSON with which I'm able to reproduce the bug:

{
  "name": "nxupgradetest",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "./node_modules/.bin/nx lint && ng lint",
    "e2e": "ng e2e",
    "affected:apps": "./node_modules/.bin/nx affected:apps",
    "affected:libs": "./node_modules/.bin/nx affected:libs",
    "affected:build": "./node_modules/.bin/nx affected:build",
    "affected:e2e": "./node_modules/.bin/nx affected:e2e",
    "affected:test": "./node_modules/.bin/nx affected:test",
    "affected:lint": "./node_modules/.bin/nx affected:lint",
    "affected:dep-graph": "./node_modules/.bin/nx affected:dep-graph",
    "affected": "./node_modules/.bin/nx affected",
    "format": "./node_modules/.bin/nx format:write",
    "format:write": "./node_modules/.bin/nx format:write",
    "format:check": "./node_modules/.bin/nx format:check",
    "update": "ng update @nrwl/schematics",
    "update:check": "ng update",
    "workspace-schematic": "./node_modules/.bin/nx workspace-schematic",
    "dep-graph": "./node_modules/.bin/nx dep-graph",
    "help": "./node_modules/.bin/nx help"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.0.0",
    "@angular/cdk": "~7.3.7",
    "@angular/common": "^7.0.0",
    "@angular/compiler": "^7.0.0",
    "@angular/core": "^7.0.0",
    "@angular/forms": "^7.0.0",
    "@angular/material": "7.3.7",
    "@angular/platform-browser": "^7.0.0",
    "@angular/platform-browser-dynamic": "^7.0.0",
    "@angular/router": "^7.0.0",
    "core-js": "^2.5.4",
    "hammerjs": "^2.0.8",
    "rxjs": "6.3.3",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "jest-preset-angular": "7.0.0",
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular-devkit/build-ng-packagr": "~0.13.0",
    "@angular/cli": "7.3.1",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "^7.0.0",
    "@nrwl/builders": "7.8.6",
    "@nrwl/schematics": "7.8.6",
    "@types/jest": "24.0.9",
    "@types/jquery": "3.3.6",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "cypress": "3.1.0",
    "dotenv": "6.2.0",
    "jest": "24.1.0",
    "ng-packagr": "^4.2.0",
    "prettier": "1.16.4",
    "ts-node": "~7.0.0",
    "tsickle": ">=0.34.0",
    "tslib": "^1.9.0",
    "tslint": "~5.11.0",
    "typescript": "3.2.2"
  }
}

It looks like this happens due to the 2-step upgrade and only if ng-packagr is included (which I cannot explain to myself why this is the case, I'd have to dig further). With the Angular CLI, normally the update command is something like ng update @angular/cli @angular/core, which means in 1 step both are being updated.

In NX though, first the @angular/core deps are updated (using --force --allow-dirty), which upgrades all deps successfully to v8, but then when the update for @angular/cli is done, it upgrades the already upgraded v8 deps to the latest RC.

@juristr
Copy link
Member Author

juristr commented Jul 1, 2019

Just updated the original description to better reflect my latest findings.

@vsavkin
Copy link
Member

vsavkin commented Aug 7, 2019

It appears to be an issue with ng-packagr peer dependencies.

    "@angular/compiler": "^6.0.0 || ^7.0.0 || ^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9",
    "@angular/compiler-cli": "^6.0.0 || ^7.0.0 || ^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9",

ng packagr needs to be updated, there is not much we can do on the Nx side.

@vsavkin vsavkin removed their assignment Aug 7, 2019
@vsavkin
Copy link
Member

vsavkin commented Dec 5, 2019

I'm going to close this one. Since we can't do much with the way ng update works, we have built a different ways to keep your projects up to date: nx migrate. It's a lot more straightforward and doesn't rely on peer dependencies.

@vsavkin vsavkin closed this as completed Dec 5, 2019
@juristr
Copy link
Member Author

juristr commented Dec 5, 2019

@vsavkin 👍

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants