voidzero-dev / voidzero-dev/vite-plus
Revert bundling Vitest directly inside Vite+
- Ngôn ngữ chính
- Rust
- Star
- 5.8k
- Fork
- 262
- Merge trung bình
- 23 giờ 41 phút
- Pull request đã merge (30 ngày)
- 138
Mô tả
### Description
Currently, there is no way to add an import subpath as a package override (example below)
```jsonc
{
"devDependencies": {
"vitest": "npm:vite-plus@0.2.8/test" // doesn't work!
}
}
```
This means that, despite supposedly being compatible with Vitest, packages and integrations may break now due to the absence of a `vitest` package to import from.
### Suggested solution
The old setup of overriding `vitest` with `@voidzero-dev/vite-plus-test` worked fine for this purpose. I propose that we bring it back, at least temporarily, if the Vite+ core team is dead set on bundling it. This way, integrations that check for the `vitest` package still work with Vite+.
### Alternative
Alternatives include migrating the entire ecosystem to use the `vite-plus/test` export which seems unlikely to happen (and also would break compatibility with vanilla Vitest unless packages have to check for both exports, which is another optional peer dependency required to be declared).
### Additional context
This isn't as much of a problem for Vite, tsdown, Rolldown, and Oxlint because their requirements are type-level imports or (in the case of Vite) is already bypassed by overriding the `vite` package. On the other hand, some Vitest reporters rely on extending existing reporters or programmatically running Vitest, which isn't covered in the current export model.
### Validations
- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- [x] Check that there isn't already an issue requesting the same feature.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi cấu hình export package và override dependency của Vite+, sau đó so sánh với ví dụ npm alias và thiết lập @voidzero-dev/vite-plus-test trước đây. Công việc được xem là hoàn tất khi các integration import hoặc sử dụng package vitest theo cách lập trình được resolve dưới Vite+ mà không yêu cầu migration sang vite-plus/test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100