Skip to content

Commit

Permalink
feat(ci): add pr spell check (#322)
Browse files Browse the repository at this point in the history
* feat: add pr spell check

* chore: fix typo

* chore: fix typo
  • Loading branch information
liweijie0812 authored Jul 5, 2024
1 parent 376f0a0 commit 69d3a76
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 60 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pr-spelling.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pr-spell-check
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
with:
config: .github/workflows/typos-config.toml
8 changes: 8 additions & 0 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
default.check-filename = true

[default.extend-words]
actived = "actived"
destory = "destory"

[files]
extend-exclude = ["packages/frontend/_site"]
Binary file modified db/TDesign.db
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/frontend/src/pages/api/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</div>
</template>

<div class="t-form-item" v-show="isShowSuger">
<div class="t-form-item" v-show="isShowSugar">
<label>语法糖(Vue):</label>
<div class="t-form-content">
<t-radio-group v-model="formData.syntacticSugar">
Expand All @@ -75,7 +75,7 @@
</div>
</div>

<div class="t-form-item" v-if="isShowSuger">
<div class="t-form-item" v-if="isShowSugar">
<label></label>
<div class="t-form-content">
<t-checkbox v-model="formData.supportDefaultValue">是否支持非受控属性</t-checkbox>
Expand Down Expand Up @@ -356,7 +356,7 @@ export default {
currentApiCategory () {
return API_CATEGORY_MAP[this.formData.apiCategory] || { placeholder: {} }
},
isShowSuger () {
isShowSugar () {
const intersection = this.formData.platform.filter(item => [P_VUE_PC, P_VUE_MOBILE].includes(Number(item)))
const platformAllow = !!intersection.length
const categoryAllow = [
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend/src/pages/api/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
<div>
<div class="t-demo-table-btns">
<!-- <t-popup showArrow placement='top'>
<t-button variant="text" @click="() => onCodePreivew(data, 'Vue(PC)')">代码</t-button>
<t-button variant="text" @click="() => onCodePreview(data, 'Vue(PC)')">代码</t-button>
<div slot="content">
<t-button variant="text" @click="() => onCodePreivew(data, 'Vue(PC)')">Vue(PC)</t-button>
<t-button variant="text" @click="() => onCodePreivew(data, 'React(PC)')">React(PC)</t-button>
<t-button variant="text" @click="() => onCodePreivew(data, 'Miniprogram')">Miniprogram</t-button>
<t-button variant="text" @click="() => onCodePreivew(data, 'Vue(Mobile)')">Vue(Mobile)</t-button>
<t-button variant="text" @click="() => onCodePreview(data, 'Vue(PC)')">Vue(PC)</t-button>
<t-button variant="text" @click="() => onCodePreview(data, 'React(PC)')">React(PC)</t-button>
<t-button variant="text" @click="() => onCodePreview(data, 'Miniprogram')">Miniprogram</t-button>
<t-button variant="text" @click="() => onCodePreview(data, 'Vue(Mobile)')">Vue(Mobile)</t-button>
</div>
</t-popup> -->
<t-button variant="text" theme="primary" @click="() => onEditClick(data)">Edit</t-button>
Expand Down Expand Up @@ -205,7 +205,7 @@ export default {
onTestsEditClick (data) {
this.$emit('click-test-edit-btn', data)
},
onCodePreivew (data, framework) {
onCodePreview (data, framework) {
this.$emit('code-preview', data, framework)
},
isTestedPC(test) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ name | params | description
-- | -- | --
cancel | \- | \-
change | `(value: DateValue)` | \-
close | `(trigger: TriggerSource)` | `1.0.1`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confrim-btn'`<br/>
close | `(trigger: TriggerSource)` | `1.0.1`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`<br/>
confirm | `(value: DateValue)` | `1.0.1`
pick | `(value: DateValue)` | \-
### DateTimePicker External Classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ visible | Boolean | false | 是否显示 | N
-- | -- | --
cancel | \- | 取消按钮点击时触发
change | `(value: DateValue)` | 确认按钮点击时触发
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confrim-btn'`<br/>
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`<br/>
confirm | `(value: DateValue)` | `1.0.1`。确认按钮点击时触发
pick | `(value: DateValue)` | 选中值发生变化时触发
### DateTimePicker External Classes
Expand Down
26 changes: 15 additions & 11 deletions packages/products/tdesign-miniprogram/src/date-time-picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const props: TdDateTimePickerProps = {
type: String,
value: '',
},
/** 组件国际化语言,目前支持: 简体中文(zh)、(tc)、英文(en)、日语(ja)、韩语(ko)、俄语(ru)等六种语言 */
customLocale: {
type: String,
value: 'zh',
},
/** 选择器的最大可选时间,默认为当前时间+10年 */
end: {
type: null,
Expand All @@ -24,17 +29,12 @@ const props: TdDateTimePickerProps = {
externalClasses: {
type: Array,
},
/** 底部内容 */
footer: {
type: Boolean,
value: true,
},
/** 用于pick、change、confirm事件参数格式化[详细文档](https://day.js.org/docs/en/display/format) */
/** 用于格式化 pick、change、confirm 事件返回的值,[详细文档](https://day.js.org/docs/en/display/format) */
format: {
type: String,
value: 'YYYY-MM-DD HH:mm:ss',
},
/** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容 */
/** 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容 */
header: {
type: Boolean,
value: true,
Expand All @@ -44,6 +44,11 @@ const props: TdDateTimePickerProps = {
type: null,
value: 'date',
},
/** 透传 `Popup` 组件全部属性 */
popupProps: {
type: Object,
value: {},
},
/** 【开发中】是否在日期旁边显示周几(如周一,周二,周日等) */
showWeek: {
type: Boolean,
Expand All @@ -53,10 +58,9 @@ const props: TdDateTimePickerProps = {
start: {
type: null,
},
/** 自定义组件样式 */
style: {
type: String,
value: '',
/** 时间间隔步数,示例:`{ minute: 5 }` */
steps: {
type: Object,
},
/** 标题 */
title: {
Expand Down
41 changes: 24 additions & 17 deletions packages/products/tdesign-miniprogram/src/date-time-picker/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode } from '../common/common';
import { PopupProps } from '../popup/index';

export interface TdDateTimePickerProps {
/**
Expand All @@ -23,6 +23,14 @@ export interface TdDateTimePickerProps {
type: StringConstructor;
value?: string;
};
/**
* 组件国际化语言,目前支持: 简体中文(zh)、(tc)、英文(en)、日语(ja)、韩语(ko)、俄语(ru)等六种语言
* @default zh
*/
customLocale?: {
type: StringConstructor;
value?: string;
};
/**
* 选择器的最大可选时间,默认为当前时间+10年
*/
Expand All @@ -38,23 +46,15 @@ export interface TdDateTimePickerProps {
value?: ['t-class', 't-class-confirm', 't-class-cancel', 't-class-title'];
};
/**
* 底部内容
* @default true
*/
footer?: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 用于pick、change、confirm事件参数格式化[详细文档](https://day.js.org/docs/en/display/format)
* 用于格式化 pick、change、confirm 事件返回的值,[详细文档](https://day.js.org/docs/en/display/format)
* @default 'YYYY-MM-DD HH:mm:ss'
*/
format?: {
type: StringConstructor;
value?: string;
};
/**
* 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 TNode 表示自定义头部内容
* 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容
* @default true
*/
header?: {
Expand All @@ -69,6 +69,14 @@ export interface TdDateTimePickerProps {
type: null;
value?: DateTimePickerMode;
};
/**
* 透传 `Popup` 组件全部属性
* @default {}
*/
popupProps?: {
type: ObjectConstructor;
value?: PopupProps;
};
/**
* 【开发中】是否在日期旁边显示周几(如周一,周二,周日等)
* @default false
Expand All @@ -85,16 +93,15 @@ export interface TdDateTimePickerProps {
value?: string | number;
};
/**
* 自定义组件样式
* @default ''
* 时间间隔步数,示例:`{ minute: 5 }`
*/
style?: {
type: StringConstructor;
value?: string;
steps?: {
type: ObjectConstructor;
value?: object;
};
/**
* 标题
* @default '选择时间'
* @default ''
*/
title?: {
type: StringConstructor;
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-miniprogram/src/navbar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ background | String | - | 已废弃。背景 | N
capsule | Slot | - | 左侧胶囊区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
delta | Number | 1 | 后退按钮后退层数,含义参考 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html),特殊的,传入 0 不会发生执行 wx.navigateBack | N
fixed | Boolean | true | 是否固定在顶部 | N
home-icon | String | - | 已废弃。首页图标地址。值为 '' 或者 undefiend 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址 | N
home-icon | String | - | 已废弃。首页图标地址。值为 '' 或者 undefined 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址 | N
left | Slot | - | `0.26.0`。左侧内容区域。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
left-arrow | Boolean | false | `0.26.0`。是否展示左侧箭头 | N
left-icon | String | - | 已废弃。左侧图标地址,值为 '' 或者 undefiend 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址 | N
left-icon | String | - | 已废弃。左侧图标地址,值为 '' 或者 undefined 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址 | N
title | String / Slot | - | 页面标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
title-max-length | Number | - | 标题文字最大长度,超出的范围使用 `...` 表示 | N
visible | Boolean | true | 是否显示 | N
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -36410,7 +36410,7 @@
"field_desc_zh": "关闭时触发",
"field_desc_en": null,
"field_required": 0,
"event_input": "(trigger: TriggerSource)【type TriggerSource = 'overlay' | 'cancel-btn' | 'confrim-btn'】",
"event_input": "(trigger: TriggerSource)【type TriggerSource = 'overlay' | 'cancel-btn' | 'confirm-btn'】",
"create_time": "2023-02-28 12:33:00",
"update_time": "2023-02-28 12:33:00",
"event_output": null,
Expand Down Expand Up @@ -73707,7 +73707,7 @@
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "首页图标地址。值为 '' 或者 undefiend 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
"field_desc_zh": "首页图标地址。值为 '' 或者 undefined 则表示不显示返回图标,值为 'circle' 表示显示默认图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
"field_desc_en": "homeIcon",
"field_required": 0,
"event_input": "",
Expand Down Expand Up @@ -73902,7 +73902,7 @@
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "左侧图标地址,值为 '' 或者 undefiend 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
"field_desc_zh": "左侧图标地址,值为 '' 或者 undefined 则表示不显示返回图标,值为 'arrow-left' 表示显示返回图标,值为 'slot' 表示使用插槽渲染,值为其他则表示图标地址",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/config/const.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// const dayjs = require('dayjs');
const path = require('path');
const VUE_TITILE_MAP = require('./language/api-docs-title');
const VUE_TITLE_MAP = require('./language/api-docs-title');
const { COMPONENT_API_MD_MAP, TYPES_COMBINE_MAP, GLOBAL_COMPONENTS_CONFIG } = require('./files-combine');

// common 数据类型,用于引入具体的组件类型定义文件中
Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = {
BASE_PATH_URL_LOCAL: path.resolve(process.cwd(), '../'),
// 开发或者测试路径
// BASE_PATH_URL: '.',
VUE_TITILE_MAP,
VUE_TITLE_MAP,
COMPONENT_API_MD_MAP,
TYPES_COMBINE_MAP,
GLOBAL_COMPONENTS_CONFIG,
Expand Down
14 changes: 7 additions & 7 deletions packages/scripts/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getVueApiDocs = require('../docs/vue');
const { BASE_PATH_URL, VUE_TITILE_MAP, TNode, TYPES_COMBINE_MAP, COMPONENT_API_MD_MAP } = require('./const');
const { BASE_PATH_URL, VUE_TITLE_MAP, TNode, TYPES_COMBINE_MAP, COMPONENT_API_MD_MAP } = require('./const');
const path = require('path');

/**
Expand Down Expand Up @@ -40,7 +40,7 @@ const FRAMEWORK_MAP = {
commonRelativePath: '../common',
componentRelativiePath: '../',
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
vscodePath: `${BASE_PATH_URL}/vscode-tdesign/document/vue2`,
helperPath: `${BASE_PATH_URL}/tdesign-vue/helper`,
volarPath: `${BASE_PATH_URL}/tdesign-vue/global.d.ts`,
Expand All @@ -64,7 +64,7 @@ const FRAMEWORK_MAP = {
commonRelativePath: '../common',
componentRelativiePath: '../',
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
vscodePath: `${BASE_PATH_URL}/vscode-tdesign/document/vue3`,
helperPath: `${BASE_PATH_URL}/tdesign-vue-next/helper`,
volarPath: `${BASE_PATH_URL}/tdesign-vue-next/global.d.ts`,
Expand All @@ -84,7 +84,7 @@ const FRAMEWORK_MAP = {
globalTplPath: path.resolve(__dirname, '../types/global/react.tpl'),
unitBasePath: '',
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
commonTypePath: 'https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts',
componentPath: 'https://github.com/Tencent/tdesign-react/blob/develop/src/',
commonRelativePath: '../common',
Expand Down Expand Up @@ -114,7 +114,7 @@ const FRAMEWORK_MAP = {
commonRelativePath: '../common',
componentRelativiePath: '../',
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
vscodePath: `${BASE_PATH_URL}/vscode-tdesign/document/vue_mobile`,
helperPath: `${BASE_PATH_URL}/tdesign-mobile-vue/helper`,
volarPath: `${BASE_PATH_URL}/tdesign-mobile-vue/global.d.ts`,
Expand All @@ -137,7 +137,7 @@ const FRAMEWORK_MAP = {
commonRelativePath: '../common',
componentRelativiePath: '../',
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
vscodePath: `${BASE_PATH_URL}/vscode-tdesign/document/react_mobile`,
TNode,
},
Expand All @@ -163,7 +163,7 @@ const FRAMEWORK_MAP = {
componentRelativiePath: '../',
vscodePath: `${BASE_PATH_URL}/vscode-tdesign/document/miniprogram`,
getDocs: getVueApiDocs,
titleMap: VUE_TITILE_MAP,
titleMap: VUE_TITLE_MAP,
},
};

Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/config/language/description.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
commonDefineText: '通用类型定义',
detailDefineText: '详细类型定义',
requiredText: '必需',
vmodelSugerText: {
vmodelSugarText: {
'Vue(PC)': '支持语法糖 `v-model`',
'VueNext(PC)': '支持语法糖 `v-model` 或 `v-model:name`',
'Vue(Mobile)': '支持语法糖 `v-model` 或 `v-model:name`',
Expand All @@ -31,7 +31,7 @@ module.exports = {
commonDefineText: 'see more ts definition',
detailDefineText: 'see more ts definition',
requiredText: 'required',
vmodelSugerText: {
vmodelSugarText: {
'Vue(PC)': '`v-model` is supported',
'VueNext(PC)': '`v-model` and `v-model:name` is supported',
'Vue(Mobile)': '`v-model` and `v-model:name` is supported',
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/configurable-props/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function generateProps(baseData, framework) {
);
const apiInfos = getApiInfos(baseData, current);
const basePath = current.propsBasePath;
// 输出至 exmaples 目录
// 输出至 examples 目录
const outputPath = path.resolve(current.usageDemoBasePath);
Object.keys(apiInfos).forEach((cmp) => {
const folder = getFolderPath(basePath, kebabCase(cmp));
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/docs/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function formatDesc(
// 语法糖
if (framework.indexOf('Vue') !== -1 && api.syntactic_sugar && !isUncontrol) {
if (api.syntactic_sugar === 'v-model') {
desc.push(curLanguage.vmodelSugerText[framework].replace('name', api.field_name));
desc.push(curLanguage.vmodelSugarText[framework].replace('name', api.field_name));
} else if (api.syntactic_sugar === 'sync') {
desc.push(curLanguage.syntaxSugarText[framework].replace('name', api.field_name));
}
Expand Down
Loading

0 comments on commit 69d3a76

Please sign in to comment.