Running `dev:prepare` in the root of a module behaves differently than preparing in the playground
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- nuxt, typescript
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Bắt đầu với lệnh dev:prepare và luồng prepare của @nuxt/module-builder, sau đó tái hiện lỗi bằng dự án nuxt-module-layers-repro được liên kết. Theo dõi cách hàm thiết lập module được chạy lần đầu và cách nuxi prepare playground được chạy sau đó. Công việc được hoàn tất khi việc prepare từ thư mục gốc của module xử lý việc tìm các tệp layer nhất quán với việc prepare trong playground.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@lewebsimple pointed out an edge case where, if a module checks for the existence of a certain file, running the dev:prepare script will fail when executed from the root of the module (via @nuxt/module-builder).
Reproduction
https://github.com/lewebsimple/nuxt-module-layers-repro
const rootDirs = getLayerDirectories().map(({ root }) => root)
let discoverMePath
for (const rootDir of rootDirs) {
if (existsSync(`${rootDir}/discover-me.txt`)) {
discoverMePath = `${rootDir}/discover-me.txt`
logger.info(`Found discover-me.txt in layer: ${rootDir}`)
break
}
}
if (!discoverMePath) {
throw new Error('Required file discover-me.txt not found in any layer directories.')
}
Steps to reproduce
- run
pnpm dev:preparein the root of the project - see that it fails
Additional context
This happens because the module's setup function runs initially without taking the playground directory into account, and only afterward does it run separately for the playground.
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
- Ngôn ngữ chính
- TypeScript
- Star
- 277
- Fork
- 36
- Merge trung bình
- 4 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nuxt/module-builder
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
nuxt/module-builder#801 ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
nuxt/module-builder#764 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
nuxt/module-builder#754 ·
-
Conflict between folder structure in readme (src/runtime) and TypeScript config (src/module/runtime)Có thể đã có người làm @dword-design đã nhận 137 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
nuxt/module-builder#749 ·
-
Tsdown/obuild migrationCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
nuxt/module-builder#726 · 1 bình luận · 1 reaction ·
Tất cả issue của nuxt/module-builder
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Pet submission: Sleepwing / 眠翼鸟Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenPetsHQ/openpets#273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fritzprix/libr-agent#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: clicking a menu item that has a submenu closes the menu instead of opening the submenuĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
LucasSantana-Dev/Lucky#2862 ·
Maintainer thường phản hồi trong vòng 1 ngày