Skip to content

Commit cc09d60

Browse files
authored
Merge branch 'develop' into ci/optimize/autofix
2 parents aa67223 + 35e1c21 commit cc09d60

11 files changed

Lines changed: 124 additions & 40 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
- "tdesign-component/pubspec.yaml"
99
issue_comment:
1010
types: [edited]
11-
push:
12-
tags:
13-
- "*"
1411

1512
jobs:
1613
generator:
@@ -98,13 +95,3 @@ jobs:
9895
git config --local user.name "github-actions[bot]"
9996
git tag ${{ steps.tag-action.outputs.version }}
10097
git push origin ${{ steps.tag-action.outputs.version }}
101-
102-
close-release-issue:
103-
runs-on: ubuntu-latest
104-
if: startsWith(github.ref, 'refs/tags/')
105-
steps:
106-
- uses: TDesignOteam/workflows/actions/close-release-issue@rss1102/flutter/issue-close
107-
with:
108-
version: ${{ github.ref_name }}
109-
label: ${{ github.ref_name }}
110-
token: ${{ secrets.PERSONAL_TOKEN }}

.github/workflows/autofix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ jobs:
4747
echo "Documentation should have been generated"
4848
}
4949
50+
- name: Sync README files
51+
run: node scripts/sync-readme.mjs
52+
5053
- uses: autofix-ci/action@v1

.github/workflows/tag-push.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,22 @@ jobs:
1414
with:
1515
ref: main
1616
fetch-depth: 0
17-
token: ${{ secrets.PERSONAL_TOKEN }}
17+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
1818
- run: |
19-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
20-
git config --local user.name "github-actions[bot]"
19+
git config --local user.email "tdesign@tencent.com"
20+
git config --local user.name "tdesign-bot"
2121
git status
2222
git fetch origin
2323
git merge origin/develop
2424
git push origin main
25+
26+
27+
close-release-issue:
28+
runs-on: ubuntu-latest
29+
if: github.event.ref_type == 'tag'
30+
steps:
31+
- uses: TDesignOteam/workflows/actions/close-release-issue@main
32+
with:
33+
version: ${{ github.ref_name }}
34+
label: ${{ github.ref_name }}
35+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ English | [简体中文](./README_zh_CN.md)
3737

3838
<img width="200" src="https://tdesign.tencent.com/flutter/assets/qrcode/td_apk_qrcode_0_2_7.png" />
3939

40-
Download link: [https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
40+
Download link: [tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
4141

4242
**iOS**: Run the project to preview
4343

@@ -245,14 +245,14 @@ For more usage examples, refer to [example/lib/page/](https://github.com/Tencent
245245

246246
TDesign provides component libraries for other platforms and frameworks:
247247

248-
| Platform | Repository |
249-
|----------|------------|
250-
| Vue 2.x | [tdesign-vue](https://github.com/Tencent/tdesign-vue) |
251-
| Vue 3.x | [tdesign-vue-next](https://github.com/Tencent/tdesign-vue-next) |
252-
| React | [tdesign-react](https://github.com/Tencent/tdesign-react) |
253-
| Vue 3.x Mobile | [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) |
254-
| React Mobile | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) |
255-
| WeChat Miniprogram | [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) |
248+
| Platform | Repository |
249+
| ------------------ | ----------------------------------------------------------------------- |
250+
| Vue 2.x | [tdesign-vue](https://github.com/Tencent/tdesign-vue) |
251+
| Vue 3.x | [tdesign-vue-next](https://github.com/Tencent/tdesign-vue-next) |
252+
| React | [tdesign-react](https://github.com/Tencent/tdesign-react) |
253+
| Vue 3.x Mobile | [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) |
254+
| React Mobile | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) |
255+
| WeChat Miniprogram | [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) |
256256

257257
## 🤝 Contributing
258258

README_zh_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
<img width="200" src="https://tdesign.tencent.com/flutter/assets/qrcode/td_apk_qrcode_0_2_7.png" />
3939

40+
下载链接:[tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
41+
4042
**iOS**:运行项目预览
4143

4244
[https://github.com/Tencent/tdesign-flutter/tree/main/tdesign-component](https://github.com/Tencent/tdesign-flutter/tree/main/tdesign-component)

scripts/sync-readme.mjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { readFileSync, writeFileSync, existsSync } from 'fs';
2+
import { dirname } from 'path';
3+
import { fileURLToPath } from 'url';
4+
5+
const __dirname = dirname(fileURLToPath(import.meta.url));
6+
const rootDir = `${__dirname}/..`;
7+
8+
// ============================================================
9+
// 同步配置
10+
// ============================================================
11+
// source: 被监听的源文件
12+
// targets: 同步目标列表
13+
// - path: 目标文件路径
14+
// - transform: 可选,内容转换函数名
15+
// ============================================================
16+
17+
const transforms = {
18+
// 移除语言切换链接: [English](./README.md) | 简体中文
19+
removeLangLink: (content) => {
20+
return content.replace(/\[English\]\(\.\/README\.md\) \| \n?/g, '');
21+
},
22+
};
23+
24+
const syncConfig = [
25+
{
26+
source: 'README.md',
27+
targets: [
28+
{ path: 'tdesign-component/README.md' },
29+
],
30+
},
31+
{
32+
source: 'README_zh_CN.md',
33+
targets: [
34+
{ path: 'tdesign-component/README_zh_CN.md' },
35+
{ path: 'tdesign-site/site/docs/getting-started.md', transform: 'removeLangLink' },
36+
],
37+
},
38+
];
39+
40+
// ============================================================
41+
// 同步逻辑
42+
// ============================================================
43+
44+
function sync() {
45+
for (const { source, targets } of syncConfig) {
46+
const sourcePath = `${rootDir}/${source}`;
47+
48+
if (!existsSync(sourcePath)) {
49+
console.log(`[Skip] Source not found: ${source}`);
50+
continue;
51+
}
52+
53+
const sourceContent = readFileSync(sourcePath, 'utf-8');
54+
console.log(`[Read] ${source}`);
55+
56+
for (const { path, transform } of targets) {
57+
let content = sourceContent;
58+
59+
if (transform) {
60+
const transformFn = transforms[transform];
61+
if (transformFn) {
62+
content = transformFn(content);
63+
console.log(` [Transform: ${transform}]`);
64+
} else {
65+
console.log(` [Warn] Unknown transform: ${transform}`);
66+
}
67+
}
68+
69+
writeFileSync(`${rootDir}/${path}`, content, 'utf-8');
70+
console.log(` [Sync] -> ${path}`);
71+
}
72+
}
73+
74+
console.log('\nDone!');
75+
}
76+
77+
sync();

tdesign-component/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ English | [简体中文](./README_zh_CN.md)
3737

3838
<img width="200" src="https://tdesign.tencent.com/flutter/assets/qrcode/td_apk_qrcode_0_2_7.png" />
3939

40-
Download link: [https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
40+
Download link: [tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
4141

4242
**iOS**: Run the project to preview
4343

@@ -245,14 +245,14 @@ For more usage examples, refer to [example/lib/page/](https://github.com/Tencent
245245

246246
TDesign provides component libraries for other platforms and frameworks:
247247

248-
| Platform | Repository |
249-
|----------|------------|
250-
| Vue 2.x | [tdesign-vue](https://github.com/Tencent/tdesign-vue) |
251-
| Vue 3.x | [tdesign-vue-next](https://github.com/Tencent/tdesign-vue-next) |
252-
| React | [tdesign-react](https://github.com/Tencent/tdesign-react) |
253-
| Vue 3.x Mobile | [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) |
254-
| React Mobile | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) |
255-
| WeChat Miniprogram | [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) |
248+
| Platform | Repository |
249+
| ------------------ | ----------------------------------------------------------------------- |
250+
| Vue 2.x | [tdesign-vue](https://github.com/Tencent/tdesign-vue) |
251+
| Vue 3.x | [tdesign-vue-next](https://github.com/Tencent/tdesign-vue-next) |
252+
| React | [tdesign-react](https://github.com/Tencent/tdesign-react) |
253+
| Vue 3.x Mobile | [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) |
254+
| React Mobile | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) |
255+
| WeChat Miniprogram | [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) |
256256

257257
## 🤝 Contributing
258258

tdesign-component/README_zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<img width="200" src="https://tdesign.tencent.com/flutter/assets/qrcode/td_apk_qrcode_0_2_7.png" />
3939

40-
下载链接:[https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
40+
下载链接:[tdesign-flutter-0.2.7-314.apk](https://oteam-tdesign-1258344706.cos.ap-guangzhou.tencentcos.cn/flutter/tdesign-flutter-0.2.7-314.apk)
4141

4242
**iOS**:运行项目预览
4343

tdesign-component/lib/src/components/form/td_form_item.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class _TDFormItemState extends State<TDFormItem> {
234234

235235
/// 遍历校验规则并执行
236236
String? validate() {
237-
String? value = widget.formItemNotifier?.formVal;
237+
dynamic value = widget.formItemNotifier?.formVal;
238238
String name = widget.name!;
239239
if (name == null) {
240240
return null;
@@ -622,9 +622,9 @@ class _TDFormItemState extends State<TDFormItem> {
622622

623623
class FormItemNotifier with ChangeNotifier {
624624
bool isDisposed = false;
625-
String _formVal = '';
625+
dynamic _formVal = '';
626626

627-
String get formVal => _formVal;
627+
dynamic get formVal => _formVal;
628628

629629
upDataForm(val) {
630630
_formVal = val;

tdesign-component/lib/src/components/form/td_form_validation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TDFormValidation {
2020
final TDFormItemType type;
2121

2222
/// 执行校验逻辑
23-
String? check(String? value) {
23+
String? check(dynamic value) {
2424
if (validate(value) != null) {
2525
return errorMessage;
2626
}

0 commit comments

Comments
 (0)