mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-06-18 10:28:23 +00:00
📝 Docs: 插件发布表单描述优化 (#3520)
This commit is contained in:
parent
a0ecd63e7c
commit
6d35481209
7
.github/ISSUE_TEMPLATE/adapter_publish.yml
vendored
7
.github/ISSUE_TEMPLATE/adapter_publish.yml
vendored
@ -3,6 +3,13 @@ title: "Adapter: {name}"
|
|||||||
description: 发布适配器到 NoneBot 官方商店
|
description: 发布适配器到 NoneBot 官方商店
|
||||||
labels: ["Adapter", "Publish"]
|
labels: ["Adapter", "Publish"]
|
||||||
body:
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
# 发布须知
|
||||||
|
|
||||||
|
非特殊情况下,请通过 [NoneBot 适配器商店](https://nonebot.dev/store/adapters) 的发布表单进行插件发布信息填写。
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: name
|
id: name
|
||||||
attributes:
|
attributes:
|
||||||
|
7
.github/ISSUE_TEMPLATE/bot_publish.yml
vendored
7
.github/ISSUE_TEMPLATE/bot_publish.yml
vendored
@ -3,6 +3,13 @@ title: "Bot: {name}"
|
|||||||
description: 发布机器人到 NoneBot 官方商店
|
description: 发布机器人到 NoneBot 官方商店
|
||||||
labels: ["Bot", "Publish"]
|
labels: ["Bot", "Publish"]
|
||||||
body:
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
# 发布须知
|
||||||
|
|
||||||
|
非特殊情况下,请通过 [NoneBot 机器人商店](https://nonebot.dev/store/bots) 的发布表单进行插件发布信息填写。
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: name
|
id: name
|
||||||
attributes:
|
attributes:
|
||||||
|
14
.github/ISSUE_TEMPLATE/plugin_publish.yml
vendored
14
.github/ISSUE_TEMPLATE/plugin_publish.yml
vendored
@ -3,6 +3,14 @@ title: "Plugin: {name}"
|
|||||||
description: 发布插件到 NoneBot 官方商店
|
description: 发布插件到 NoneBot 官方商店
|
||||||
labels: ["Plugin", "Publish"]
|
labels: ["Plugin", "Publish"]
|
||||||
body:
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
# 发布须知
|
||||||
|
|
||||||
|
非特殊情况下,请通过 [NoneBot 插件商店](https://nonebot.dev/store/plugins) 的发布表单进行插件发布信息填写。
|
||||||
|
在发布前请阅读 [NoneBot 插件发布流程指导](https://nonebot.dev/docs/developer/plugin-publishing) 并确保满足其中所述条件。
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: pypi
|
id: pypi
|
||||||
attributes:
|
attributes:
|
||||||
@ -15,9 +23,9 @@ body:
|
|||||||
- type: input
|
- type: input
|
||||||
id: module
|
id: module
|
||||||
attributes:
|
attributes:
|
||||||
label: 插件 import 包名
|
label: 插件模块名
|
||||||
description: 插件 import 包名
|
description: 加载插件时所使用的模块名称
|
||||||
placeholder: e.g. nonebot_plugin_xxx
|
placeholder: e.g. nonebot_plugin_apscheduler
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
import Link from "@docusaurus/Link";
|
||||||
|
|
||||||
import { Form } from ".";
|
import { Form } from ".";
|
||||||
|
|
||||||
export default function PluginForm(): React.ReactNode {
|
export default function PluginForm(): React.ReactNode {
|
||||||
@ -8,7 +10,7 @@ export default function PluginForm(): React.ReactNode {
|
|||||||
name: "包信息",
|
name: "包信息",
|
||||||
items: [
|
items: [
|
||||||
{ type: "text", name: "pypi", labelText: "PyPI 项目名" },
|
{ type: "text", name: "pypi", labelText: "PyPI 项目名" },
|
||||||
{ type: "text", name: "module", labelText: "插件 import 包名" },
|
{ type: "text", name: "module", labelText: "插件模块名" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -29,7 +31,25 @@ export default function PluginForm(): React.ReactNode {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const description = (
|
||||||
|
<p>
|
||||||
|
请在发布前阅读{" "}
|
||||||
|
<Link
|
||||||
|
className="text-primary"
|
||||||
|
href="https://nonebot.dev/docs/developer/plugin-publishing"
|
||||||
|
>
|
||||||
|
NoneBot 插件发布流程指导
|
||||||
|
</Link>
|
||||||
|
,并确保满足其中所述条件。
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form type="plugin" formItems={formItems} handleSubmit={handleSubmit} />
|
<Form
|
||||||
|
type="plugin"
|
||||||
|
formItems={formItems}
|
||||||
|
handleSubmit={handleSubmit}
|
||||||
|
description={description}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ export type FormItemGroup = {
|
|||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
description?: React.ReactNode;
|
||||||
type: Resource["resourceType"];
|
type: Resource["resourceType"];
|
||||||
formItems: FormItemGroup[];
|
formItems: FormItemGroup[];
|
||||||
handleSubmit: (result: Record<string, string>) => void;
|
handleSubmit: (result: Record<string, string>) => void;
|
||||||
@ -32,6 +33,7 @@ export type Props = {
|
|||||||
export function Form({
|
export function Form({
|
||||||
type,
|
type,
|
||||||
children,
|
children,
|
||||||
|
description,
|
||||||
formItems,
|
formItems,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
}: Props): React.ReactNode {
|
}: Props): React.ReactNode {
|
||||||
@ -65,7 +67,6 @@ export function Form({
|
|||||||
);
|
);
|
||||||
if (currentStepNames.every((name) => result[name])) {
|
if (currentStepNames.every((name) => result[name])) {
|
||||||
setCurrentStep(currentStep + 1);
|
setCurrentStep(currentStep + 1);
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onPrev = () => currentStep > 0 && setCurrentStep(currentStep - 1);
|
const onPrev = () => currentStep > 0 && setCurrentStep(currentStep - 1);
|
||||||
@ -86,6 +87,9 @@ export function Form({
|
|||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
{description && currentStep === 0 && (
|
||||||
|
<div className="form-description">{description}</div>
|
||||||
|
)}
|
||||||
<div className="form-control w-full min-h-[300px]">
|
<div className="form-control w-full min-h-[300px]">
|
||||||
{children ||
|
{children ||
|
||||||
formItems[currentStep].items.map((item) => (
|
formItems[currentStep].items.map((item) => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user