next.js
85d043a6 - Create-next-app update message (#88706)

Commit
129 days ago
Create-next-app update message (#88706) ### What? This PR fixes `create-next-app` update notifications for prerelease versions by checking against the correct npm dist-tag. ### Why? Users running `pnpx create-next-app@canary` were incorrectly prompted to update to the stable version because: 1. The `update-check` library queries npm's `latest` dist-tag by default 2. Version comparison using `localeCompare` considers `16.1.1-canary.32` less than `16.1.3` (since base version `16.1.1 < 16.1.3`) 3. This incorrectly triggered an update notification ### How? Instead of skipping the update check entirely for prerelease versions, this PR: 1. Extracts the dist-tag from the current version (e.g., `canary` from `16.1.1-canary.32`) 2. Passes this as the `distTag` option to `update-check` 3. Updates the suggested command to include the correct tag (e.g., `pnpm add -g create-next-app@canary`) This ensures: - Stable users are notified about newer stable releases - Canary users are notified about newer canary releases - Beta/RC users are notified about newer versions of their respective channels Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Author
Parents
Loading