publish to store using issue form (#2010)

This commit is contained in:
Ju4tCode 2023-05-13 15:32:28 +08:00 committed by GitHub
parent a5e634319a
commit a8b06aa7c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 209 additions and 103 deletions

View File

@ -0,0 +1,57 @@
name: 发布适配器
title: "Adapter: {name}"
description: 发布适配器到 NoneBot 官方商店
labels: ["Adapter"]
body:
- type: input
id: name
attributes:
label: 适配器名称
description: 适配器名称
validations:
required: true
- type: input
id: description
attributes:
label: 适配器描述
description: 适配器描述
validations:
required: true
- type: input
id: pypi
attributes:
label: PyPI 项目名
description: PyPI 项目名
placeholder: e.g. nonebot-adapter-xxx
validations:
required: true
- type: input
id: module
attributes:
label: 适配器 import 包名
description: 适配器 import 包名
placeholder: e.g. nonebot_adapter_xxx
validations:
required: true
- type: input
id: homepage
attributes:
label: 适配器项目仓库/主页链接
description: 适配器项目仓库/主页链接
placeholder: e.g. https://github.com/xxx/xxx
validations:
required: true
- type: input
id: tags
attributes:
label: 标签
description: 标签
placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]'
value: "[]"
validations:
required: true

37
.github/ISSUE_TEMPLATE/bot_publish.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: 发布机器人
title: "Bot: {name}"
description: 发布机器人到 NoneBot 官方商店
labels: ["Bot"]
body:
- type: input
id: name
attributes:
label: 机器人名称
description: 机器人名称
validations:
required: true
- type: input
id: description
attributes:
label: 机器人描述
description: 机器人描述
validations:
required: true
- type: input
id: homepage
attributes:
label: 机器人项目仓库/主页链接
description: 机器人项目仓库/主页链接
placeholder: e.g. https://github.com/xxx/xxx
- type: input
id: tags
attributes:
label: 标签
description: 标签
placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]'
value: "[]"
validations:
required: true

View File

@ -1,14 +1,5 @@
blank_issues_enabled: true
blank_issues_enabled: false
contact_links:
- name: Question
- name: NoneBot 论坛
url: https://discussions.nonebot.dev/
about: Ask questions about nonebot
- name: Plugin Publish
url: https://v2.nonebot.dev/store
about: Publish your plugin to nonebot homepage and nb-cli
- name: Adapter Publish
url: https://v2.nonebot.dev/store
about: Publish your adapter to nonebot homepage and nb-cli
- name: Bot Publish
url: https://v2.nonebot.dev/store
about: Publish your bot to nonebot homepage and nb-cli
about: 前往 NoneBot 论坛提问

View File

@ -0,0 +1,57 @@
name: 发布插件
title: "Plugin: {name}"
description: 发布插件到 NoneBot 官方商店
labels: ["Plugin"]
body:
- type: input
id: name
attributes:
label: 插件名称
description: 插件名称
validations:
required: true
- type: input
id: description
attributes:
label: 插件描述
description: 插件描述
validations:
required: true
- type: input
id: pypi
attributes:
label: PyPI 项目名
description: PyPI 项目名
placeholder: e.g. nonebot-plugin-xxx
validations:
required: true
- type: input
id: module
attributes:
label: 插件 import 包名
description: 插件 import 包名
placeholder: e.g. nonebot_plugin_xxx
validations:
required: true
- type: input
id: homepage
attributes:
label: 插件项目仓库/主页链接
description: 插件项目仓库/主页链接
placeholder: e.g. https://github.com/xxx/xxx
validations:
required: true
- type: input
id: tags
attributes:
label: 标签
description: 标签
placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]'
value: "[]"
validations:
required: true

View File

@ -41,42 +41,27 @@ export default function Adapter(): JSX.Element {
const [label, setLabel] = useState<string>("");
const [color, setColor] = useState<string>("#ea5252");
const urlEncode = (str: string) =>
encodeURIComponent(str).replace(/%2B/gi, "+");
const onSubmit = () => {
setModalOpen(false);
const title = encodeURIComponent(`Adapter: ${form.name}`).replace(
/%2B/gi,
"+"
);
const body = encodeURIComponent(
`
****
${form.name}
****
${form.desc}
**PyPI **
${form.projectLink}
** import **
${form.moduleName}
**/**
${form.homepage}
****
${JSON.stringify(tags)}
`.trim()
).replace(/%2B/gi, "+");
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Adapter`
);
const queries: { key: string; value: string }[] = [
{ key: "template", value: "adapter_publish.yml" },
{ key: "title", value: form.name && `Adapter: ${form.name}` },
{ key: "labels", value: "Adapter" },
{ key: "name", value: form.name },
{ key: "description", value: form.desc },
{ key: "pypi", value: form.projectLink },
{ key: "module", value: form.moduleName },
{ key: "homepage", value: form.homepage },
{ key: "tags", value: JSON.stringify(tags) },
];
const urlQueries = queries
.filter((query) => !!query.value)
.map((query) => `${query.key}=${urlEncode(query.value)}`)
.join("&");
window.open(`https://github.com/nonebot/nonebot2/issues/new?${urlQueries}`);
};
const onChange = (event) => {
const target = event.target;

View File

@ -39,31 +39,25 @@ export default function Bot(): JSX.Element {
const [label, setLabel] = useState<string>("");
const [color, setColor] = useState<string>("#ea5252");
const urlEncode = (str: string) =>
encodeURIComponent(str).replace(/%2B/gi, "+");
const onSubmit = () => {
setModalOpen(false);
const title = encodeURIComponent(`Bot: ${form.name}`).replace(/%2B/gi, "+");
const body = encodeURIComponent(
`
****
${form.name}
****
${form.desc}
**/**
${form.homepage}
****
${JSON.stringify(tags)}
`.trim()
).replace(/%2B/gi, "+");
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Bot`
);
const queries: { key: string; value: string }[] = [
{ key: "template", value: "bot_publish.yml" },
{ key: "title", value: form.name && `Bot: ${form.name}` },
{ key: "labels", value: "Bot" },
{ key: "name", value: form.name },
{ key: "description", value: form.desc },
{ key: "homepage", value: form.homepage },
{ key: "tags", value: JSON.stringify(tags) },
];
const urlQueries = queries
.filter((query) => !!query.value)
.map((query) => `${query.key}=${urlEncode(query.value)}`)
.join("&");
window.open(`https://github.com/nonebot/nonebot2/issues/new?${urlQueries}`);
};
const onChange = (event) => {
const target = event.target;

View File

@ -41,42 +41,27 @@ export default function Plugin(): JSX.Element {
const [label, setLabel] = useState<string>("");
const [color, setColor] = useState<string>("#ea5252");
const urlEncode = (str: string) =>
encodeURIComponent(str).replace(/%2B/gi, "+");
const onSubmit = () => {
setModalOpen(false);
const title = encodeURIComponent(`Plugin: ${form.name}`).replace(
/%2B/gi,
"+"
);
const body = encodeURIComponent(
`
****
${form.name}
****
${form.desc}
**PyPI **
${form.projectLink}
** import **
${form.moduleName}
**/**
${form.homepage}
****
${JSON.stringify(tags)}
`.trim()
).replace(/%2B/gi, "+");
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Plugin`
);
const queries: { key: string; value: string }[] = [
{ key: "template", value: "plugin_publish.yml" },
{ key: "title", value: form.name && `Plugin: ${form.name}` },
{ key: "labels", value: "Plugin" },
{ key: "name", value: form.name },
{ key: "description", value: form.desc },
{ key: "pypi", value: form.projectLink },
{ key: "module", value: form.moduleName },
{ key: "homepage", value: form.homepage },
{ key: "tags", value: JSON.stringify(tags) },
];
const urlQueries = queries
.filter((query) => !!query.value)
.map((query) => `${query.key}=${urlEncode(query.value)}`)
.join("&");
window.open(`https://github.com/nonebot/nonebot2/issues/new?${urlQueries}`);
};
const onChange = (event) => {
const target = event.target;