voidzero-dev / voidzero-dev/vite-plus

vp create fails when creating application within monorepo

Đang mở
#820 1 bình luận 2 reaction 1 người được giao Được @fengmk2 nhận Xem trên GitHub
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ả

### Describe the bug

I created a monorepo with `vp create`. Then I opened a terminal within the monorepo and wanted to create an application within. However, that fails

```
~\Desktop\temp\religion-pursue> vp create
VITE+ - The Unified Toolchain for the Web

Vite+ Application

◇ Where should the new package be added to
the monorepo:
apps/

◇ Package name:
temperature-symbol

◇ Which agents are you using?
none

◑ Generating project (0s)
ENOENT: no such file or directory, open 'C:\Users\Stefnotch\Desktop\temp\religion-pursue\apps\temperature-symbol\package.json'
Error: ENOENT: no such file or directory, open 'C:\Users\Stefnotch\Desktop\temp\religion-pursue\apps\temperature-symbol\package.json'
at Object.readFileSync (node:fs:440:20)
at readJsonFile (file:///C:/Users/Stefnotch/Desktop/temp/religion-pursue/node_modules/.pnpm/vite-plus@0.1.11_@types+nod_56901132907ec8649d648f911ba150e8/node_modules/vite-plus/dist/global/json-BRdVJ52a.js:130:21)
at editJsonFile (file:///C:/Users/Stefnotch/Desktop/temp/religion-pursue/node_modules/.pnpm/vite-plus@0.1.11_@types+nod_56901132907ec8649d648f911ba150e8/node_modules/vite-plus/dist/global/json-BRdVJ52a.js:144:27)
at setPackageName (file:///C:/Users/Stefnotch/Desktop/temp/religion-pursue/node_modules/.pnpm/vite-plus@0.1.11_@types+nod_56901132907ec8649d648f911ba150e8/node_modules/vite-plus/dist/global/create.js:3232:2)
at executeBuiltinTemplate (file:///C:/Users/Stefnotch/Desktop/temp/religion-pursue/node_modules/.pnpm/vite-plus@0.1.11_@types+nod_56901132907ec8649d648f911ba150e8/node_modules/vite-plus/dist/global/create.js:3488:2)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async main (file:///C:/Users/Stefnotch/Desktop/temp/religion-pursue/node_modules/.pnpm/vite-plus@0.1.11_@types+nod_56901132907ec8649d648f911ba150e8/node_modules/vite-plus/dist/global/create.js:4130:12) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\Stefnotch\\Desktop\\temp\\religion-pursue\\apps\\temperature-symbol\\package.json'
}
Failed to generate code: ENOENT: no such file or directory, open 'C:\Users\Stefnotch\Desktop\temp\religion-pursue\apps\temperature-symbol\package.json'

■ Canceled (0s)
```

### Reproduction

-

### Steps to reproduce

`vp create`
select the monorepo stuff
`cd path-to-monorepo`
`vp create`
select the "Vite+ Application" option

And then it should fail, at least on Windows systems. It seems to create a folder named `appstemperature-symbol` instead of actually creating the directory hierarchy of `apps/temperature-symbol `.

Interestingly enough, creating "Vite+" libraries does work

### System Info

```shell
VITE+ - The Unified Toolchain for the Web

Environment:
Version 24.14.0
Source lts

Tool Paths:
node C:\Users\Stefnotch\.vite-plus\js_runtime\node\24.14.0\node.exe
npm C:\Users\Stefnotch\.vite-plus\js_runtime\node\24.14.0\npm.cmd
npx C:\Users\Stefnotch\.vite-plus\js_runtime\node\24.14.0\npx.cmd

VITE+ - The Unified Toolchain for the Web

vp v0.1.11

Local vite-plus:
vite-plus Not found

Tools:
vite Not found
rolldown Not found
vitest Not found
oxfmt Not found
oxlint Not found
oxlint-tsgolint Not found
tsdown Not found
```

### Used Package Manager

bun

### Logs

```shell

```

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

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.