diff --git a/.eslintrc b/.eslintrc index 4c54be6..7467fd5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,10 @@ "jest": true, "es6": true }, + "globals": { + "defineProps": "readonly", + "defineEmits": "readonly" + }, "plugins": [ "vue", "@typescript-eslint" diff --git a/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml b/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml new file mode 100644 index 0000000..549408b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml @@ -0,0 +1,79 @@ +name: 反馈 Bug +description: 通过 github 模板进行 Bug 反馈。 +title: "[组件名称] 描述问题的标题" +body: + - type: markdown + attributes: + value: | + # 欢迎你的参与 + tdesign-vue-next-starter 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区: + + 在发布一个 Issue 前,请确保: + - 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://github.com/Tencent/tdesign-vue-next-starter/blob/main/CHANGELOG.md) 和 [旧Issue列表](https://github.com/Tencent/tdesign-vue-next-starter/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正) + - 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。 + + - type: input + id: version + attributes: + label: tdesign-vue-next-starter 版本 + description: 请检查在最新项目版本中能否重现此 issue。 + placeholder: 请填写 + validations: + required: true + + - type: input + id: reproduce + attributes: + label: 重现链接 + description: 请提供尽可能精简的 CodePen、CodeSandbox 或 GitHub 仓库的链接。请不要填无关链接,否则你的 Issue 将被关闭。 + placeholder: 请填写 + + - type: textarea + id: reproduceSteps + attributes: + label: 重现步骤 + description: 请清晰的描述重现该 Issue 的步骤,这能帮助我们快速定位问题。没有清晰重现步骤将不会被修复,标有 'need reproduction' 的 Issue 在 7 天内不提供相关步骤,将被关闭。 + placeholder: 请填写 + + - type: textarea + id: expect + attributes: + label: 期望结果 + placeholder: 请填写 + + - type: textarea + id: actual + attributes: + label: 实际结果 + placeholder: 请填写 + + - type: input + id: frameworkVersion + attributes: + label: 框架版本 + placeholder: Vue(3.2.0) + + - type: input + id: browsersVersion + attributes: + label: 浏览器版本 + placeholder: Chrome(8.213.231.123) + + - type: input + id: systemVersion + attributes: + label: 系统版本 + placeholder: MacOS(11.2.3) + + - type: input + id: nodeVersion + attributes: + label: Node版本 + placeholder: 请填写 + + - type: textarea + id: remarks + attributes: + label: 补充说明 + description: 可以是遇到这个 bug 的业务场景、上下文等信息。 + placeholder: 请填写 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index f413a33..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe Environment** - -Add browser version here - -**Describe the bug** -A clear and concise description of what the bug is. - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c2d6d05 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: 使用 issue-helper 新建 + url: https://Tencent.github.io/tdesign/issue-helper/?lang=zh-CN&repo=Tencent/tdesign-vue-next-starter + about: 使用 https://Tencent.github.io/tdesign/issue-helper/ 创建 issue,其中包含 bug 和 feature,表单提交更加严格。 diff --git a/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml b/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml new file mode 100644 index 0000000..4409353 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml @@ -0,0 +1,30 @@ +name: 反馈新功能 +description: 通过 github 模板进行新功能反馈。 +title: "[组件名称] 描述问题的标题" +body: + - type: markdown + attributes: + value: | + # 欢迎你的参与 + tdesign-vue-next-starter 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区: + + 在发布一个 Issue 前,请确保: + - 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://github.com/Tencent/tdesign-vue-next-starter/blob/main/CHANGELOG.md) 和 [旧Issue列表](https://github.com/Tencent/tdesign-vue-next-starter/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正) + - 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。 + + - type: textarea + id: functionContent + attributes: + label: 这个功能解决了什么问题 + description: 请详尽说明这个需求的用例和场景。最重要的是:解释清楚是怎样的用户体验需求催生了这个功能上的需求。我们将考虑添加在现有 API 无法轻松实现的功能。新功能的用例也应当足够常见。 + placeholder: 请填写 + validations: + required: true + + - type: textarea + id: functionalExpectations + attributes: + label: 你建议的方案是什么 + placeholder: 请填写 + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a97d15e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,52 @@ + + +### 🤔 这个 PR 的性质是? + +- [ ] 日常 bug 修复 +- [ ] 新特性提交 +- [ ] 文档改进 +- [ ] 演示代码改进 +- [ ] 组件样式/交互改进 +- [ ] CI/CD 改进 +- [ ] 重构 +- [ ] 代码风格优化 +- [ ] 测试用例 +- [ ] 分支合并 +- [ ] 其他 + +### 🔗 相关 Issue + + + +### 💡 需求背景和解决方案 + + + +### 📝 更新日志 + + + +- fix(组件名称): 处理问题或特性描述 ... + +- [ ] 本条 PR 不需要纳入 Changelog + +### ☑️ 请求合并前的自查清单 + +⚠️ 请自检并全部**勾选全部选项**。⚠️ + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 diff --git a/.github/workflows/issue-assignees.temp.yml b/.github/workflows/issue-assignees.temp.yml new file mode 100644 index 0000000..83d5d6b --- /dev/null +++ b/.github/workflows/issue-assignees.temp.yml @@ -0,0 +1,52 @@ +# force copy from tencent/tdesign +name: Issue Add Assigness + +on: + issues: + types: [opened, edited] + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + - uses: wow-actions/auto-comment@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + issuesOpened: | + 👋 @{{ author }},感谢给 TDesign 提出了 issue。 + 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。 + + # https://docs.github.com/cn/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues + - uses: 94dreamer/issue-assignees@main + id: assignees + with: + project_name: ${{github.event.repository.name}} + issue_title: ${{github.event.issue.title}} + + - run: echo ${{ steps.assignees.outputs.contributors }} + - name: Add assigness + if: steps.assignees.outputs.contributors != '' + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-assignees' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignees: ${{ steps.assignees.outputs.contributors }} + + - run: | + contributors=${{ steps.assignees.outputs.contributors }} + contributorstring=${contributors//,/ @} + echo "::set-output name=string::@$contributorstring" + id: contributors + + - name: 通知贡献者 + if: steps.assignees.outputs.contributors != '' + uses: actions-cool/maintain-one-comment@v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + ♥️ 有劳 ${{ steps.contributors.outputs.string }} 尽快确认问题。 + 确认有效后将下一步计划和可能需要的时间回复给 @${{ github.event.issue.user.login }} 。 + + number: ${{ github.event.issue.number }} + body-include: "" diff --git a/.github/workflows/issue-help-wanted.temp.yml b/.github/workflows/issue-help-wanted.temp.yml new file mode 100644 index 0000000..94e9bbd --- /dev/null +++ b/.github/workflows/issue-help-wanted.temp.yml @@ -0,0 +1,22 @@ +# force copy from tencent/tdesign +name: Issue Help wanted +on: + issues: + types: + - labeled +jobs: + add-comment: + if: github.event.label.name == 'help wanted' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add comment + uses: peter-evans/create-or-update-comment@v1 + with: + issue-number: ${{ github.event.issue.number }} + body: | + 任何人都可以处理此问题。 + **请务必在您的 `pull request` 中引用此问题。** :sparkles: + 感谢你的贡献! :sparkles: + reactions: heart \ No newline at end of file diff --git a/.github/workflows/issue-mark-duplicate.temp.yml b/.github/workflows/issue-mark-duplicate.temp.yml new file mode 100644 index 0000000..3017723 --- /dev/null +++ b/.github/workflows/issue-mark-duplicate.temp.yml @@ -0,0 +1,19 @@ +# force copy from tencent/tdesign +# 当在 issue 的 comment 回复类似 `Duplicate of #111` 这样的话,issue 将被自动打上 重复提交标签 并且 cloese +name: Issue Mark Duplicate + +on: + issue_comment: + types: [created, edited] + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + - name: mark-duplicate + uses: actions-cool/issues-helper@v2 + with: + actions: "mark-duplicate" + token: ${{ secrets.GITHUB_TOKEN }} + duplicate-labels: "duplicate" + close-issue: true diff --git a/.github/workflows/issue-reply.temp.yml b/.github/workflows/issue-reply.temp.yml new file mode 100644 index 0000000..271a94f --- /dev/null +++ b/.github/workflows/issue-reply.temp.yml @@ -0,0 +1,21 @@ +# force copy from tencent/tdesign +# 当被打上 Need Reproduce 标签时候,自动提示需要重现实例 + +name: ISSUE_REPLY + +on: + issues: + types: [labeled] + +jobs: + issue-reply: + runs-on: ubuntu-latest + steps: + - name: Need Reproduce + if: github.event.label.name == 'Need Reproduce' + uses: actions-cool/issues-helper@v2 + with: + actions: 'create-comment' + issue-number: ${{ github.event.issue.number }} + body: | + 你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://codesandbox.io/) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。 diff --git a/.github/workflows/issue-stale-close.temp.yml b/.github/workflows/issue-stale-close.temp.yml new file mode 100644 index 0000000..14e04f4 --- /dev/null +++ b/.github/workflows/issue-stale-close.temp.yml @@ -0,0 +1,27 @@ +# force copy from tencent/tdesign +# 国际标准时间+8 +name: Close stale issues and PRs +on: + schedule: + - cron: "50 5 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v4 + with: + stale-issue-message: "这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。" + stale-pr-message: '这个 PR 已经过时了,因为它已经持续 45 天没有任何活动了。 删除 stale 的标签或评论,否则将在 10 天内关闭。' + close-issue-message: "此 Issue 被自动关闭,因为它自被标记为过时 stale 以来已闲置 7 天。" + close-pr-message: "此 PR 被自动关闭,因为它已经 stable 停滞了 10 天,没有任何活动。" + days-before-stale: 30 + days-before-close: 7 + days-before-pr-stale: 45 + days-before-pr-close: 10 + repo-token: ${{ secrets.GITHUB_TOKEN }} + exempt-issue-labels: 'WIP' + exempt-pr-labels: 'WIP' \ No newline at end of file diff --git a/.github/workflows/issue-synchronize.temp.yml b/.github/workflows/issue-synchronize.temp.yml new file mode 100644 index 0000000..4ca7de1 --- /dev/null +++ b/.github/workflows/issue-synchronize.temp.yml @@ -0,0 +1,17 @@ +# force copy from tencent/tdesign +name: Issue Add Assigness + +on: + issues: + types: [opened, reopened] + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + # https://docs.github.com/cn/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues + - uses: 94dreamer/create-report@main + with: + wxhook: ${{ secrets.WX_HOOK_URL }} + token: ${{ secrets.GITHUB_TOKEN }} + type: 'issue' \ No newline at end of file diff --git a/.github/workflows/preview-publish.yml b/.github/workflows/preview-publish.yml new file mode 100644 index 0000000..364f99c --- /dev/null +++ b/.github/workflows/preview-publish.yml @@ -0,0 +1,15 @@ +# 文件名建议统一为 preview-publish +# 应用 preview.yml 的 demo +name: PREVIEW_PUBLISH + +on: + workflow_run: + workflows: ["MAIN_PULL_REQUEST"] + types: + - completed + +jobs: + call-preview: + uses: Tencent/tdesign/.github/workflows/preview.yml@main + secrets: + TDESIGN_SURGE_TOKEN: ${{ secrets.TDESIGN_SURGE_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 25254a6..e456b38 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,28 +1,15 @@ +# 文件名建议统一为 pull-request.yml +# 应用 test-build.yml 的 demo + name: MAIN_PULL_REQUEST on: pull_request: branches: [develop, main] + types: [opened, synchronize, reopened] jobs: - MAIN_PULL_REQUEST: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Cache nodemodules - uses: actions/cache@v2 - env: - cache-name: cache-nodemodules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: npm install - shell: bash - - run: npm run lint + call-test-build: + uses: Tencent/tdesign/.github/workflows/test-build.yml@main + +# install lint \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index 018af6b..0000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: All_ON_PUSH - -on: push - -jobs: - All_ON_PUSH: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: npm install - shell: bash - - run: echo '${{ github.ref }} ... ${{ github.sha }}' - - name: build-site - run: npm run build - - name: upload surge service and generate preview URL - id: deploy - run: | - export GITHUB_SHA=${{ github.sha }} - export GITHUB_SHA_SUB=${GITHUB_SHA: 0: 7 } - export DEPLOY_DOMAIN=https://preview-$GITHUB_SHA_SUB-tdesign-vue-next-starter.surge.sh - npx surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }} - echo the preview URL is $DEPLOY_DOMAIN - if: ${{ success() }} - - run: echo "🚀 This job's status is ${{ job.status }}." diff --git a/.gitignore b/.gitignore index af233c0..d481268 100755 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ yarn-error.log .stylelintcache yarn.lock package-lock.json +pnpm-lock.yaml diff --git a/README.md b/README.md index 536fb1d..8ab5a7b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ### 项目简介 -TDesign Vue Next Starter 是一个基于 TDesign。使用 `Vue3`、`Vite2`、`TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。 +TDesign Vue Next Starter 是一个基于 TDesign。使用 `Vue3`、`Vite2`、`Pinia`、`TypeScript` 开发,可进行个性化主题配置,旨在提供项目开箱即用的、配置式的中后台项目。

在线预览 @@ -108,9 +108,9 @@ npm run stylelint:fix ### 兼容性 -| [IE / Edge](https://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](https://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](https://godban.github.io/browsers-support-badges/)
Chrome | [Safari](https://godban.github.io/browsers-support-badges/)
Safari | -| --------- | --------- | --------- | --------- | -| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions | +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Edge >=84 | Firefox >=83 | Chrome >=84 | Safari >=14.1 | ### License diff --git a/cache.dockerfile b/cache.dockerfile deleted file mode 100644 index bf62cd3..0000000 --- a/cache.dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# 选择一个 Base 镜像 -FROM node:16 - -# 设置工作目录 -WORKDIR /space - -# 将 by 中的文件列表 COPY 过来 -COPY . . - -# 根据 COPY 过来的文件进行依赖的安装 -RUN npm i - -# 设置好需要的环境变量 -ENV NODE_PATH=/space/node_modules - diff --git a/docker/nginx.conf b/docker/nginx.conf deleted file mode 100644 index 62b7d40..0000000 --- a/docker/nginx.conf +++ /dev/null @@ -1,20 +0,0 @@ -server { - if ($request_method = HEAD) { - return 200; - } - - location / { - alias /usr/share/nginx/html/; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - access_log /var/log/nginx/access.log main; - error_log /var/log/nginx/error.log error; - - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } -} \ No newline at end of file diff --git a/package.json b/package.json index 578021d..d8785e3 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "tdesign-vue-next-starter", - "version": "0.0.1", + "version": "0.1.0", "scripts": { "dev:mock": "vite --open --mode mock", "dev": "vite --open --mode development", + "dev:linux": "vite --mode development", "build:test": "vite build --mode test", "build": "vue-tsc --noEmit && vite build --mode release", "preview": "vite preview", @@ -11,21 +12,25 @@ "lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix", "stylelint": "stylelint src/**/*.{html,vue,sass,less}", "stylelint:fix": "stylelint --fix src/**/*.{html,vue,vss,sass,less}", - "prepare": "husky install" + "prepare": "husky install", + "site:preview": "npm run build && cp -r dist _site", + "test": "echo \"no test specified,work in process\"" }, "dependencies": { + "cz-conventional-changelog": "^3.3.0", "dayjs": "^1.10.6", "echarts": "~5.1.2", "hex-to-hsl": "^1.0.2", "nprogress": "^0.2.0", + "pinia": "^2.0.11", "qrcode.vue": "^3.2.2", - "tdesign-vue-next": "^0.5.0", + "tdesign-icons-vue-next": "^0.0.6", + "tdesign-vue-next": "0.10.1", "tvision-color": "^1.3.1", - "vue": "^3.1.5", + "vue": "^3.2.31", "vue-color-kit": "^1.0.5", "vue-router": "^4.0.11", - "vue3-clipboard": "^1.0.0", - "vuex": "^4.0.2" + "vue3-clipboard": "^1.0.0" }, "devDependencies": { "@commitlint/cli": "^15.0.0", @@ -37,7 +42,7 @@ "@vitejs/plugin-vue": "^1.3.0", "@vitejs/plugin-vue-jsx": "^1.1.7", "@vue/compiler-sfc": "^3.0.5", - "axios": "^0.24.0", + "axios": "^0.26.0", "commitizen": "^4.2.4", "compressorjs": "^1.0.7", "eslint": "^7.32.0", diff --git a/src/App.vue b/src/App.vue index 9b1bff9..dcd05a4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,22 +1,19 @@ -