facebook / facebook/docusaurus

Make it possible for third party cli extensions to use `[siteDir]` and `--config`

Đang mở
#8,903 5 bình luận 1 reaction 0 người được giao Xem trên GitHub
difficulty: advanced proposal
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).

### Motivation

For some use cases, it would be nice to have a possibility for a third party to extend the CLI in a way so that those two options can be passed for custom setups.

As an example, look at [this](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/490) issue, where you would want to use their extendCli functionality, but can't as your config is in a subfolder or named differently.

Obviously plugins could also "just" add siteDir and --config to their extendCli, but that seems weird to me as most get that from the context they get on initialization.

Maybe it would be possible to make those two arguments part of the "main" docusaurus cli, so it can be parsed before and be passed to the plugin. Something like https://www.npmjs.com/package/commander#parsing-configuration

I'm not a plugin dev so maybe I understood something wrong here.
So would be nice to hear your opinion on that topic.

### Self-service

- [ ] I'd be willing to do some initial work on this proposal 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.