facebook / facebook/docusaurus

Canary versions are treated as older than the latest stable version

Abierto
#11,013 8 comentarios 0 reacciones 0 asignados Ver en GitHub
bug status: needs triage
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### Have you read the Contributing Guidelines on issues?

- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [x] I'm using the latest version of Docusaurus.
- [x] I have tried the `npm run clear` or `yarn clear` command.
- [x] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [x] I have tried creating a repro with https://new.docusaurus.io.
- [x] I have read the console error message carefully (if applicable).

### Description

In the semver, unstable versions v3.7.0-\* is treated as older than v3.7.0.
We must bump the patch version before adding a Canary verssion suffix. e.g. v3.7.1-canary-6264.

### Reproducible demo

https://codesandbox.io/p/devbox/angry-antonelli-w9v59m?workspaceId=ws_5geAx947TkSAXN4qahDJMt

### Steps to reproduce

1. Create a project
2. Upgrade Docusaurus to a Canary version by e.g. the following command:

```bash
yarn upgrade @docusaurus/core@3.7.0-canary-6264 @docusauru/preset-classic@3.7.0-canary-6264 @docusaurus/module-type-aliases@3.7.0-canary-6264 @docusaurus/types@3.7.0-canary-6264
```

3. Then run `yarn dev`

### Expected behavior

No upgrade recommendation banner

### Actual behavior

```
------------------------------------------------------------------------------
Update available 3.7.0-canary-6264 → 3.7.0
To upgrade Docusaurus packages with the latest version, run the
following command:
`yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest
@docusaurus/module-type-aliases@latest @docusaurus/types@latest`
------------------------------------------------------------------------------
```

### Your environment

- Public source code:
- Public site URL:
- Docusaurus version used: canary version
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js v20.9.0/22
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows / CodeSandbox

### Self-service

- [ ] I'd be willing to fix this bug myself.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.