facebook / facebook/docusaurus

Canary versions are treated as older than the latest stable version

Đang mở
#11,013 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug status: needs triage
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.