facebook / facebook/docusaurus

Canary versions are treated as older than the latest stable version

Aperta
#11,013 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug status: needs triage
Lingua principale
TypeScript
Stelle
66.2k
Fork
10k
Merge medio
1g 3h
PR unite (30g)
52

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.