Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0c91bc6
ci: 更新 GitHub Actions 依赖及新增 Web Components 预览构建
RSS1102 May 7, 2026
f4e98ce
fix: add build script to playground/site
RSS1102 May 7, 2026
3feeaa2
fix: correct artifact names to _site and pr for reusable workflow
RSS1102 May 7, 2026
2a5396f
refactor(ci): 统一 artifact 命名并修复 workflow 参数
RSS1102 May 7, 2026
b8e7d25
fix(ci): 移除 call-preview 并修复 workflow 参数
RSS1102 May 7, 2026
a6d9b90
fix(ci): 添加 200.html 支持 Surge.sh SPA 路由回退
RSS1102 May 7, 2026
fe48c87
Merge pull request #2 from RSS1102/chore/ci-test-1778180531
RSS1102 May 7, 2026
9317cc1
ci(publish): 重构预览发布工作流以支持多站点统一部署
RSS1102 May 8, 2026
73ec5bd
ci(workflow): 优化工作流注释与结构
RSS1102 May 8, 2026
436dfe5
rss1102/fix/ci-workflow: 重构 PR 预览工作流,从根源修复 No jobs were run 问题
RSS1102 May 8, 2026
5778b07
ci: 动态生成预览域名并重构工作流
RSS1102 May 8, 2026
e9ffb74
refactor: 优化评论内容的拼接方式
RSS1102 May 8, 2026
427a045
refactor: 重构包名为 @tdesign 命名空间
RSS1102 May 8, 2026
9981fe0
refactor: 更新依赖导入路径并配置ESLint规则
RSS1102 May 8, 2026
cbcc674
ci: 更新 GitHub Actions 依赖版本
RSS1102 May 8, 2026
d10b4ea
docs: 更新开发文档目录结构和包路径
RSS1102 May 9, 2026
dc695ec
refactor: 修改 monorepo 层级
RSS1102 May 9, 2026
0c0fce4
refactor: 重构包结构与构建配置
RSS1102 May 9, 2026
0c8a26f
chore: 指定包管理器版本为 pnpm@10.33.0
liweijie0812 May 9, 2026
4a669e4
chore: 优化 git submodule 初始化命令
liweijie0812 May 9, 2026
2e3b30c
ci: 更新 pkg-pr-new 发布路径为通配符
liweijie0812 May 9, 2026
375ddce
ci: 移除工作流中的 node 版本设置并添加仓库信息
liweijie0812 May 9, 2026
924b4c9
ci: 优化 pkg-pr-new 发布配置
liweijie0812 May 9, 2026
7804ea8
ci(pkg-pr-new): 禁用紧凑模式
liweijie0812 May 9, 2026
9d0ca25
ci: 重构预览构建与发布工作流
liweijie0812 May 9, 2026
b479a8e
ci: 修改预览构建的工作流名称和分支配置
liweijie0812 May 9, 2026
8814e6e
build(site): 更新构建配置和脚本
liweijie0812 May 9, 2026
0c9ddf7
fix: 修正组件名称匹配正则表达式路径
liweijie0812 May 9, 2026
af2ce4f
ci(pr): 简化 PR 工作流并修复 test 脚本
liweijie0812 May 9, 2026
308ba7b
ci: 规范工作流命名
liweijie0812 May 9, 2026
528f7e5
ci: 添加 PR 压缩体积检查工作流
liweijie0812 May 9, 2026
5e3ba9a
ci: 移除 auto-import-resolver 压缩大小检查
liweijie0812 May 9, 2026
cfb3d5a
ci: 添加 pnpm install --no-frozen-lockfile 安装脚本
liweijie0812 May 9, 2026
5091c05
ci: 更新压缩大小检查的文件匹配模式
liweijie0812 May 9, 2026
a1707ea
ci: 补全压缩大小检测的文件匹配模式
liweijie0812 May 9, 2026
208c54e
chore(deps): 移除 _common 多余依赖并清理锁文件
liweijie0812 May 9, 2026
c8bb933
chore(workspace): 添加组件站点到工作区
liweijie0812 May 9, 2026
a78a039
chore: 启用 pnpm shamefullyHoist
liweijie0812 May 9, 2026
71e6f91
chore: 移除 repository 字段
liweijie0812 May 9, 2026
f3b5326
chore(ci): 升级 GitHub Actions 版本
RSS1102 May 10, 2026
2583ec7
refactor: 重命名 web-components 包名为 @tdesign 作用域
RSS1102 May 10, 2026
690ef72
fix(site): 修正站点路由路径为 kebab-case
RSS1102 May 10, 2026
d7a18a0
refactor(pkg): 精简导出配置并更新仓库目录
RSS1102 May 10, 2026
84e48c1
refactor: 更新包名为web-components-ui并调整文档
RSS1102 May 10, 2026
2410162
chore: 移除冗余包属性并调整字段顺序
liweijie0812 May 11, 2026
a293ea7
ci: 替换 maintain-one-comment action 引用
liweijie0812 May 19, 2026
ff12f8f
refactor: 重命名包名为 @tdesign/web-components
liweijie0812 May 20, 2026
730b5a0
fix(build): 添加组件直接引用路径别名
RSS1102 May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ module.exports = {
},
},
overrides: [
{
files: ['packages/ui/src/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [],
patterns: ['@tdesign/web-components-ui/*'],
},
],
},
},
{
files: ['packages/chat/src/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [],
patterns: ['@tdesign/web-components-chat/*'],
},
],
},
},
{
files: ['packages/*/src/**/_example/**/*.{ts,tsx}', 'site/**/*.{ts,tsx}'],
rules: {
Expand Down Expand Up @@ -102,10 +126,6 @@ module.exports = {
message: 'Please use lodash-es instead.',
},
],
patterns: [
'tdesign-web-components/*',
'tdesign-web-components-chat/*',
],
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
startsWith(github.head_ref, 'release/')
steps:
- run: echo "The head of this PR starts with 'release/'"
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.2
- uses: TDesignOteam/tdesign-changelog-action@main
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
uses: peter-evans/create-or-update-comment@v5.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Expand All @@ -50,7 +50,7 @@ jobs:
fi
echo "::set-output name=branch::${BASH_REMATCH[1]}"
# zsh $match[1]
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.2
with:
ref: ${{ steps.comment.outputs.branch }}
- name: Commit and push if needed
Expand All @@ -72,7 +72,7 @@ jobs:
github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'release/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.2
with:
ref: develop
token: ${{ secrets.PERSONAL_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6.0.2
with:
submodules: recursive

- uses: pnpm/action-setup@v5
- uses: pnpm/action-setup@v6.0.5

- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version-file: .node-version
cache: pnpm
Expand All @@ -23,7 +23,7 @@ jobs:

- run: pnpm run "/^build:/"

- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 24

Expand Down
209 changes: 161 additions & 48 deletions .github/workflows/preview-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# 文件名建议统一为 preview-publish
# 应用 preview.yml 的 demo
name: PREVIEW_PUBLISH

on:
Expand All @@ -8,68 +6,183 @@ on:
types:
- completed

jobs:
call-preview:
uses: TDesignOteam/workflows/.github/workflows/reusable-pr-preview.yml@main
secrets:
TDESIGN_SURGE_TOKEN: ${{ secrets.TDESIGN_SURGE_TOKEN }}
concurrency:
group: preview-publish-${{ github.event.workflow_run.head_branch }}-${{ github.event.workflow_run.head_repository.full_name }}
cancel-in-progress: true

permissions:
contents: read
actions: read
pull-requests: write

deploy-vue-next-chat:
jobs:
preflight:
runs-on: ubuntu-latest
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request'
outputs:
pr_id: ${{ steps.pr.outputs.id }}
web_components_domain: ${{ steps.domains.outputs.web_components_domain }}
chat_domain: ${{ steps.domains.outputs.chat_domain }}
steps:
- name: Download PR ID artifact
uses: dawidd6/action-download-artifact@v8
- name: Download PR metadata
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: vue-next-chat-pr-id
name: pr-id
path: ./pr-id

- name: Set PR ID
- name: Extract PR number
id: pr
run: echo "id=$(cat ./pr-id/vue-next-chat-pr-id.txt)" >> $GITHUB_OUTPUT
run: |
PR_ID=$(cat ./pr-id/pr-id.txt)
if [ -z "$PR_ID" ]; then
echo "::error::Failed to extract PR id from artifact"
exit 1
fi
echo "id=$PR_ID" >> "$GITHUB_OUTPUT"

- name: Download chat site artifact
uses: dawidd6/action-download-artifact@v8
- name: Compute preview domains
id: domains
env:
PR_ID: ${{ steps.pr.outputs.id }}
OWNER: ${{ github.repository_owner }}
run: |
OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]')
{
echo "web_components_domain=https://preview-pr-${PR_ID}-${OWNER_LOWER}-tdesign-web-components.surge.sh"
echo "chat_domain=https://preview-pr-${PR_ID}-${OWNER_LOWER}-tdesign-vue-next-chat.surge.sh"
} >> "$GITHUB_OUTPUT"

tdesign-web-components:
needs: preflight
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: vue-next-chat-site
path: ./chat-site
name: tdesign-web-components-site
path: ./site

- name: Prepare SPA fallback
run: cp ./site/index.html ./site/200.html

- name: Deploy to Surge.sh
id: deploy
run: |
export DEPLOY_DOMAIN=https://preview-pr-${{ steps.pr.outputs.id }}-tdesign-webc-chat.surge.sh
npx surge --project ./chat-site --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
echo "url=$DEPLOY_DOMAIN" >> $GITHUB_OUTPUT
npx surge --project ./site \
--domain ${{ needs.preflight.outputs.web_components_domain }} \
--token ${{ secrets.TDESIGN_SURGE_TOKEN }}

- name: Comment preview URL on PR
if: success()
uses: actions-cool/maintain-one-comment@v3
tdesign-vue-next-chat:
needs: preflight
runs-on: ubuntu-latest
steps:
- name: Download artifact
id: download
uses: dawidd6/action-download-artifact@v21
with:
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
number: ${{ steps.pr.outputs.id }}
body: |-
## 🤖 Vue Next Chat Site Preview
| Component | Preview |
| --------- | :--: |
| @tdesign/web-components-chat (vue-next) | [🟢 Online](${{ steps.deploy.outputs.url }}) |

<!-- AUTO_VUE_NEXT_CHAT_PREVIEW_HOOK -->
body-include: '<!-- AUTO_VUE_NEXT_CHAT_PREVIEW_HOOK -->'

- name: Comment failure on PR
if: failure()
workflow: ${{ github.event.workflow_run.name }}
run_id: ${{ github.event.workflow_run.id }}
name: tdesign-vue-next-chat-site
path: ./site
if_no_artifact_found: warn

- name: Skip if artifact missing
if: steps.download.outputs.found_artifact != 'true'
run: echo "::notice::chat artifact not found, skipping chat deployment"

- name: Prepare SPA fallback
if: steps.download.outputs.found_artifact == 'true'
run: cp ./site/index.html ./site/200.html

- name: Deploy to Surge.sh
if: steps.download.outputs.found_artifact == 'true'
run: |
npx surge --project ./site \
--domain ${{ needs.preflight.outputs.chat_domain }} \
--token ${{ secrets.TDESIGN_SURGE_TOKEN }}

preview-comment:
if: always() && needs.preflight.result == 'success'
needs:
- preflight
- tdesign-web-components
- tdesign-vue-next-chat
runs-on: ubuntu-latest
steps:
- name: Collect job results
id: report
uses: actions/github-script@v7
env:
WEB_COMPONENTS_DOMAIN: ${{ needs.preflight.outputs.web_components_domain }}
CHAT_DOMAIN: ${{ needs.preflight.outputs.chat_domain }}
with:
script: |
const { WEB_COMPONENTS_DOMAIN, CHAT_DOMAIN } = process.env;

const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
per_page: 100,
});

const components = {
'tdesign-web-components': {
package_name: '@tdesign/web-components-ui<br>@tdesign/web-components-chat',
domain: WEB_COMPONENTS_DOMAIN,
status: '',
report_url: '',
},
'tdesign-vue-next-chat': {
package_name: '@tdesign-vue-next/chat',
domain: CHAT_DOMAIN,
status: '',
report_url: '',
},
};

const previewSuccess = `<img width="300" alt="完成" src="https://user-images.githubusercontent.com/15634204/150816437-9f5bb788-cd67-4cbc-9897-b82d74e9aa65.png" />`;
const previewFailure = `<img width="300" alt="失败" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png" />`;

jobs
.filter((job) => Object.prototype.hasOwnProperty.call(components, job.name))
.forEach((job) => {
const entry = components[job.name];
if (job.conclusion === 'success') {
entry.status = previewSuccess;
entry.report_url = entry.domain;
} else {
entry.status = previewFailure;
entry.report_url = job.html_url;
}
});

const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;

const rows = Object.values(components)
.map((c) => `| ${c.package_name} | [${c.status}](${c.report_url}) |`)
.join('\n');

const comment = [
`# TDesign Component Site Preview [Open](${runUrl})`,
'| Component | Preview |',
'| --------- | :--: |',
rows,
'',
'<!-- AUTO_PREVIEW_HOOK -->',
].join('\n');

core.setOutput('comment', comment);

- name: Post comment
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
number: ${{ steps.pr.outputs.id }}
body: |-
## 🤖 Vue Next Chat Site Preview
| Component | Preview |
| --------- | :--: |
| @tdesign/web-components-chat (vue-next) | [🔴 Failed](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |

<!-- AUTO_VUE_NEXT_CHAT_PREVIEW_HOOK -->
body-include: '<!-- AUTO_VUE_NEXT_CHAT_PREVIEW_HOOK -->'
number: ${{ needs.preflight.outputs.pr_id }}
body: ${{ steps.report.outputs.comment }}
body-include: '<!-- AUTO_PREVIEW_HOOK -->'
Loading
Loading