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

Specific Angular Upgrade #1357

Open
3 tasks done
JosephLteif opened this issue Dec 8, 2023 · 3 comments
Open
3 tasks done

Specific Angular Upgrade #1357

JosephLteif opened this issue Dec 8, 2023 · 3 comments
Labels

Comments

@JosephLteif
Copy link

  • I have searched for similar issues
  • I am using the latest version of npm-check-updates
  • I am using node >= 14.14

Current Behavior

I want to angular version to latest of 16 and all my other dependencies respecting constraints with angular version 16.
I tried upgrading only angular to 16 then upgrading all the others while excluding angular (thinking it will resort to only package versions that are compatble with angular 16) but this wasn't the case, (used --peer).
It gave me the latest version of all the dependencies other than angular (Because it got excluded)

Expected Behavior

A way to specify specific version of dependencies to have (Mainly angular version) and have all other dependencies resort to the latest compatible version available to them while respecting other constraints

@raineorshine
Copy link
Owner

Hi, thanks for reporting. Please provide a sample package.json so that I can be sure I am running npm-check-updates on the same packages as you.

@JosephLteif
Copy link
Author

"dependencies": {
"@angular/animations": "^9.1.0",
"@angular/common": "^9.1.0",
"@angular/compiler": "^9.1.0",
"@angular/core": "^9.1.0",
"@angular/flex-layout": "^9.0.0-beta.29",
"@angular/forms": "^9.1.0",
"@angular/platform-browser": "^9.1.0",
"@angular/platform-browser-dynamic": "^9.1.0",
"@angular/router": "^9.1.0",
"@auth0/angular-jwt": "^5.0.2",
"@ngxs/store": "^3.6.2",
"@nrwl/angular": "9.2.2",
"ag-grid-angular": "^23.0.3",
"ag-grid-community": "^23.0.2",
"angular-oauth2-oidc": "^10.0.3",
"angular-oauth2-oidc-jwks": "^9.0.0",
"angular-resizable-element": "^3.3.0",
"angular-resize-event": "^1.2.1",
"angular-split": "^3.0.3",
"core-js": "^2.5.4",
"immer": "^6.0.3",
"lodash.isequal": "^4.5.0",
"monaco-editor": "^0.20.0",
"ng-zorro-antd": "9.2.0",
"ngx-matomo": "^0.1.4",
"ngx-monaco-editor": "^9.0.0",
"ngx-spinner": "^9.0.2",
"rxjs": "~6.5.4",
"zone.js": "^0.10.2",
"npm-check-updates": "^16.14.11"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.8",
"@angular/cli": "9.1.0",
"@angular/compiler-cli": "^9.1.0",
"@angular/language-service": "^9.1.0",
"@ngxs/devtools-plugin": "^3.6.2",
"@nrwl/jest": "9.2.2",
"@nrwl/workspace": "9.2.2",
"@types/jest": "25.1.4",
"@types/node": "~8.9.4",
"codelyzer": "~5.0.1",
"dotenv": "6.2.0",
"eslint": "6.8.0",
"husky": "^4.2.5",
"jest": "25.2.3",
"jest-auto-spies": "^1.0.2",
"jest-html-reporter": "^3.1.3",
"jest-preset-angular": "8.1.2",
"lint-staged": "^10.5.4",
"npm-run-all": "^4.1.5",
"prettier": "1.19.1",
"reload": "^3.1.1",
"ts-jest": "25.2.1",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"typescript": "~3.8.3",
"webpack": "^4.42.0",
"webpack-dev-server": "^3.11.2"
}

This is a sample of a package.json file that I am using

@raineorshine
Copy link
Owner

I tried it out on an abbreviated package.json:

{
  "dependencies": {
    "@angular/animations": "^9.1.0",
    "@angular/common": "^9.1.0",
    "@angular/compiler": "^9.1.0",
    "@angular/core": "^9.1.0",
    "@angular/router": "^9.1.0",
    "ag-grid-angular": "^23.0.3",
    "ag-grid-community": "^23.0.2"
  },
  "devDependencies": {
    "@angular/cli": "^16.2.10",
    "@angular/compiler-cli": "^9.1.0"
  }
}

I manually updated @angular/cli to v16 and then ran ncu -x "@angular/cli". This gives the unconstrained updates.

image

Running ncu --peer -x "@angular/cli" gives the following:

image

It constrains some of the versions, but strangely not all of them. It tries to upgrade @angular/animations to v17, even though it clearly has a peerDependency of @angular/core v17.

I didn't build the --peer feature and I don't have time to maintain it unfortunately. However I am happy to support a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants