Poor/broken monorepo DX: can't specify .contentlayer/ output path, no docs for custom config path
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
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- nextjs, typescript
- Lĩnh vực
- build-system, documentation, tooling
Hướng nghiên cứu
Bắt đầu với createContentlayerPlugin() và tài liệu next-contentlayer, bao gồm tùy chọn configPath và hành vi liên quan đến tsconfig.json. Tái hiện kịch bản monorepo apps/my-nextjs-app bằng pnpm nx serve, sau đó xác định việc hoàn thành là có cấu hình được ghi tài liệu cho các đường dẫn cấu hình và đầu ra, cùng với khả năng hỗ trợ rõ ràng cho nhiều app mà không có đầu ra console gây nhầm lẫn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I tried getting Contentlayer rolling in an nx monorepo and found the developer experience to be poor.
I'm creating an issue to potentially influence the roadmap per the project website.
Contentlayer seems like a decent approach to supporting mdx that covers many use-cases so it'd be great to use it.
If you want to make this issue about one thing: developers should be able to configure the .contentlayer output location such that multiple sites/apps can be cleanly supported.
Context
In a monorepo a developer may have a nextjs blog/website/app at apps/my-app-name or packages/my-app-name.
(or even in an even deeper nested path in really large projects)
A given monorepo may house many different apps and libraries.
Developer Requirements
Contentlayer should not "take over" a project's root folder unless configured to do so, and it should support a monorepo where there may be several apps that use it and others that do not. An organization might have respective blog, product documentation, and marketing websites, each with their own MDX content; an individual might have multiple blogs.
- a way to specify the path to the
.contentlayeroutput dir for a given website/app that uses it - a straightforward and documented way to specify where the contentlayer config file is
- contentlayer to consider where
tsconfig.jsonis based on the path to its config (and/or specify a custom path to tsconfig)- right now contentlayer looks in the root of the project folder vs. where the config file is
- nx apps have a
tsconfig.jsonin their respective folders (it extendstsconfig.base.jsonin monorepo root)
Its ok if that's the default behaviour / happy path is no monorepo however I think there should be ways to support them far more elegantly.
In many cases would be best to be best to house everything together in each app's respective folder: the website content mdx, the contentlayer output, and the app itself.
In other cases a dev might prefer paths for content at the root of the project folder e.g. .contentlayer/ with subfolders for each app, content/ with subfolders for each app's content, etc off the project root.
Acceptance
Consider the scenario where a dev runs pnpm nx serve my-nextjs-app that's housed in apps/my-nextjs-app and everything is clean, organized, and plays nice and the console output isn't filled with confused contentlayer barf.
Documentation Issues
It is not well-documented that I can use createContentlayerPlugin() in next config to specify a configPath.
The docs at https://www.contentlayer.dev/docs/reference/next-contentlayer don't mention any of the "non default configuration options" but mention the existence. I had to find that out from looking at issue comments and PR's e.g. https://github.com/contentlayerdev/contentlayer/pull/248
- Ngôn ngữ chính
- TypeScript
- Star
- 3.5k
- Fork
- 192
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 contentlayerdev/contentlayer
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
contentlayerdev/contentlayer#506 · 84 bình luận · 47 reaction ·
-
State of the project Đang mởmeta: never-stale
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
contentlayerdev/contentlayer#429 · 49 bình luận · 83 reaction ·
-
meta: never-stale topic: markdown/mdx
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
contentlayerdev/contentlayer#421 · 4 reaction ·
-
meta: never-stale needs-research topic: schema
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
contentlayerdev/contentlayer#420 ·
-
Derived documents Đang mởneeds-research
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
contentlayerdev/contentlayer#414 · 1 reaction ·
Tất cả issue của contentlayerdev/contentlayer
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ontola/atomic-server#1625 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
melgarafael/DeskcommCRM#1451 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
midnightntwrk/midnight-sdk#403 ·