Skip to content

Commit

Permalink
add feature tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Sep 29, 2019
1 parent 73d62ed commit 2b751d6
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .script/genBlockConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ const genBlockTags = name =>
.map(key => tagsKey[key] || key)
.filter(key => key !== 'remove');

const getFeature = filePath => {
const feature = ['antd'];
const srcPath = join(filePath, 'src');

const localesPath = join(srcPath, 'locales');
if (fs.existsSync(localesPath)) {
feature.push('i18n');
}

const modalTsxPath = join(srcPath, 'model.tsx');
const modalTsPath = join(srcPath, 'model.ts');
const modalJsPath = join(srcPath, 'model.js');
const modalJsxPath = join(srcPath, 'model.jsx');
if (
fs.existsSync(modalTsxPath) ||
fs.existsSync(modalTsPath) ||
fs.existsSync(modalJsPath) ||
fs.existsSync(modalJsxPath)
) {
feature.push('dva');
}
return feature;
};

/**
* 遍历文件地址
* @param path
Expand All @@ -124,6 +148,7 @@ const getFolderTreeData = filePath => {
description: pkg.description,
url: `${gitUrl}/tree/master/${fileName}`,
path: fileName,
feature: getFeature(join(filePath, fileName)),
img: `https://raw.githubusercontent.com/ant-design/pro-blocks/master/${fileName}/snapshot.png?raw=true`,
tags: genBlockTags(fileName),
previewUrl: `https://preview.pro.ant.design/${genBlockName(fileName)}`,
Expand Down
118 changes: 118 additions & 0 deletions umi-block.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"description": "个人中心一般用于暂时用户的基本信息,已经相关的信息展示。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/AccountCenter",
"path": "AccountCenter",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/AccountCenter/snapshot.png?raw=true",
"tags": [
"个人中心"
Expand All @@ -18,6 +22,11 @@
"description": "通常是用于用户设置名称、头像、用途、私密性等信息。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/AccountSettings",
"path": "AccountSettings",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/AccountSettings/snapshot.png?raw=true",
"tags": [
"个人设置"
Expand All @@ -30,6 +39,11 @@
"description": "将同一主题下的多种下钻维度呈现在页面中,让用户能够研究多组数据并发现趋势,用户可操作数据,调整数据范围满足更精准的分析需求。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/DashboardAnalysis",
"path": "DashboardAnalysis",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/DashboardAnalysis/snapshot.png?raw=true",
"tags": [
"dashboard"
Expand All @@ -42,6 +56,11 @@
"description": "常用于数据报表细节信息的展示,根据业务诉求可配置文本、列表、可视化图表等。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/DashboardMonitor",
"path": "DashboardMonitor",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/DashboardMonitor/snapshot.png?raw=true",
"tags": [
"dashboard"
Expand All @@ -54,6 +73,10 @@
"description": "工作台将应用中每个部分最关键的数据提取出来,在一个页面呈现,便于全局分析和决策。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/DashboardWorkplace",
"path": "DashboardWorkplace",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/DashboardWorkplace/snapshot.png?raw=true",
"tags": [
"dashboard"
Expand All @@ -66,6 +89,10 @@
"description": "千言万语不如一张图,流程图是表示算法思路的最好方法。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/EditorFlow",
"path": "EditorFlow",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/EditorFlow/snapshot.png?raw=true",
"tags": [
"图形编辑"
Expand All @@ -78,6 +105,10 @@
"description": "拓扑结构图可以清晰展示网络节点和通信介质构成的网络结构。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/EditorKoni",
"path": "EditorKoni",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/EditorKoni/snapshot.png?raw=true",
"tags": [
"图形编辑"
Expand All @@ -90,6 +121,10 @@
"description": "脑图是表达发散性思维的有效工具,它简单却又很有效,是一种非常实用展示工具。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/EditorMind",
"path": "EditorMind",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/EditorMind/snapshot.png?raw=true",
"tags": [
"图形编辑"
Expand All @@ -102,6 +137,10 @@
"description": "403 Forbidden 代表客户端错误,指的是服务器端有能力处理该请求,但是拒绝授权访问,一般是权限异常导致。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/Exception403",
"path": "Exception403",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/Exception403/snapshot.png?raw=true",
"tags": [
"异常"
Expand All @@ -114,6 +153,10 @@
"description": "404 Not Found 代表请求失败,请求所希望得到的资源未被在服务器上发现",
"url": "https://github.com/ant-design/pro-blocks/tree/master/Exception404",
"path": "Exception404",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/Exception404/snapshot.png?raw=true",
"tags": [
"异常"
Expand All @@ -126,6 +169,10 @@
"description": "500 Internal Server Error,是表示服务器端错误的响应状态码。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/Exception500",
"path": "Exception500",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/Exception500/snapshot.png?raw=true",
"tags": [
"异常"
Expand All @@ -138,6 +185,10 @@
"description": "高级表单常适用于一次性输入和提交大批量数据的场景。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/FormAdvancedForm",
"path": "FormAdvancedForm",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/FormAdvancedForm/snapshot.png?raw=true",
"tags": [
"表单",
Expand All @@ -151,6 +202,11 @@
"description": "表单页用于向用户收集或验证信息,基础表单常用于数据项较少的表单场景。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/FormBasicForm",
"path": "FormBasicForm",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/FormBasicForm/snapshot.png?raw=true",
"tags": [
"表单",
Expand All @@ -164,6 +220,11 @@
"description": "分布表单使用与将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成的场景。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/FormStepForm",
"path": "FormStepForm",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/FormStepForm/snapshot.png?raw=true",
"tags": [
"表单"
Expand All @@ -176,6 +237,10 @@
"description": "用于陈列一类事务性主题,用户常常将这个页面当做开始事务的入口,主要以浏览方式寻找条目。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListBasicList",
"path": "ListBasicList",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListBasicList/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -189,6 +254,10 @@
"description": "卡片组成的列表,一般用于展示有图的列表,更加美观。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListCardList",
"path": "ListCardList",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListCardList/snapshot.png?raw=true",
"tags": [
"列表"
Expand All @@ -201,6 +270,9 @@
"description": "一个基本多标签页面,用于展示搜索列表。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListSearch",
"path": "ListSearch",
"feature": [
"antd"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListSearch/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -214,6 +286,10 @@
"description": "常用于陈列某一主题下的大量条目,并提供丰富的数据筛选功能帮助用户匹配出需要的数据自己。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListSearchApplications",
"path": "ListSearchApplications",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListSearchApplications/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -227,6 +303,10 @@
"description": "常用于陈列某一主题下的大量条目,并提供丰富的数据筛选功能帮助用户匹配出需要的数据自己。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListSearchArticles",
"path": "ListSearchArticles",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListSearchArticles/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -240,6 +320,10 @@
"description": "常用于陈列某一主题下的大量条目,并提供丰富的数据筛选功能帮助用户匹配出需要的数据自己。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListSearchProjects",
"path": "ListSearchProjects",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListSearchProjects/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -253,6 +337,10 @@
"description": "一个标准的表格增删改查页面,可以派生出百分之八十的后台页面。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ListTableList",
"path": "ListTableList",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ListTableList/snapshot.png?raw=true",
"tags": [
"列表",
Expand All @@ -266,6 +354,10 @@
"description": "一个复杂的详情页,可以展示一个对象的基本信息和其相关的新息和操作。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ProfileAdvanced",
"path": "ProfileAdvanced",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ProfileAdvanced/snapshot.png?raw=true",
"tags": [
"详情",
Expand All @@ -279,6 +371,10 @@
"description": "详情页可以向用户展示一个对象完整的描述信息,并且可以对一个对象进行编辑操作。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ProfileBasic",
"path": "ProfileBasic",
"feature": [
"antd",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ProfileBasic/snapshot.png?raw=true",
"tags": [
"详情",
Expand All @@ -292,6 +388,10 @@
"description": "告知用户操作后所产生的失败结果,引导用户接下来的行动。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ResultFail",
"path": "ResultFail",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ResultFail/snapshot.png?raw=true",
"tags": [
"结果"
Expand All @@ -304,6 +404,10 @@
"description": "告知用户操作后所产生的成功结果,引导用户接下来的行动。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/ResultSuccess",
"path": "ResultSuccess",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/ResultSuccess/snapshot.png?raw=true",
"tags": [
"结果"
Expand All @@ -316,6 +420,11 @@
"description": "用户登录界面,支持用户名密码和手机号登录。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/UserLogin",
"path": "UserLogin",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/UserLogin/snapshot.png?raw=true",
"tags": [
"用户",
Expand All @@ -329,6 +438,11 @@
"description": "用户注册是使用,用于填写基本的账号信息。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/UserRegister",
"path": "UserRegister",
"feature": [
"antd",
"i18n",
"dva"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/UserRegister/snapshot.png?raw=true",
"tags": [
"用户",
Expand All @@ -342,6 +456,10 @@
"description": "用于展示注册的结果。",
"url": "https://github.com/ant-design/pro-blocks/tree/master/UserRegisterResult",
"path": "UserRegisterResult",
"feature": [
"antd",
"i18n"
],
"img": "https://raw.githubusercontent.com/ant-design/pro-blocks/master/UserRegisterResult/snapshot.png?raw=true",
"tags": [
"用户",
Expand Down

0 comments on commit 2b751d6

Please sign in to comment.