├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.zh-CN.yml │ ├── config.yml │ └── feature-report.zh-CN.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── auto-release.yml │ ├── issue-assignees.temp.yml │ ├── issue-help-wanted.temp.yml │ ├── issue-mark-duplicate.temp.yml │ ├── issue-reply.temp.yml │ ├── issue-stale-close.temp.yml │ ├── preview.yml │ └── tag-push.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.js ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README-zh_CN.md ├── README.md ├── package.json ├── publish.sh ├── rollup.config.js ├── scripts └── deploy.ts ├── src ├── core │ ├── CoreGitDownloader.ts │ ├── CoreIndex.ts │ ├── CoreInquirer.ts │ ├── CoreParsedConfig.ts │ ├── CoreSelector.ts │ ├── CoreTemplate.ts │ ├── core-js-transform │ │ ├── CoreCodeReplace.ts │ │ ├── CoreJsTransformInquirer.ts │ │ ├── CoreJsTransformer.ts │ │ ├── CoreSfcCompiler.ts │ │ ├── CoreTsCompiler.ts │ │ └── README.md │ ├── core-lite │ │ ├── CoreBuildToolInquirer.ts │ │ ├── CoreLiteDownloader.ts │ │ └── CoreLiteInquirer.ts │ ├── core-options │ │ ├── CoreOptionsFilterForReact.ts │ │ ├── CoreOptionsFilterForVue2.ts │ │ └── CoreOptionsFilterForVue3.ts │ └── core-template │ │ ├── CoreTemplateReactConfig.ts │ │ ├── CoreTemplateVue2Config.ts │ │ └── CoreTemplateVue3Config.ts ├── main.ts ├── types │ ├── index.d.ts │ └── type.d.ts └── utils │ ├── UtilsFile.ts │ └── UtilsIndex.ts ├── templates ├── farm │ ├── react-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── farm.config.ts │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── tdesign-logo.svg │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── assets │ │ │ │ └── svg │ │ │ │ │ └── farm-logo.png │ │ │ ├── main.tsx │ │ │ └── typings.d.ts │ │ ├── tsconfig.json │ │ └── tsconfig.node.json │ ├── vue-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── farm.config.ts │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── tdesign-logo.svg │ │ ├── src │ │ │ ├── App.vue │ │ │ ├── assets │ │ │ │ └── svg │ │ │ │ │ └── farm-logo.png │ │ │ └── main.js │ │ └── tsconfig.json │ └── vue-next-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── farm.config.ts │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ └── tdesign-logo.svg │ │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── svg │ │ │ │ └── farm-logo.png │ │ ├── main.ts │ │ └── vite-env.d.ts │ │ ├── tsconfig.json │ │ └── tsconfig.node.json ├── vite │ ├── react-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── tdesign-logo.svg │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── assets │ │ │ │ └── svg │ │ │ │ │ └── vite-logo.svg │ │ │ ├── main.tsx │ │ │ └── vite-env.d.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ ├── vue-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── tdesign-logo.svg │ │ ├── src │ │ │ ├── App.vue │ │ │ ├── assets │ │ │ │ └── svg │ │ │ │ │ └── vite-logo.svg │ │ │ └── main.js │ │ └── vite.config.js │ └── vue-next-lite │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ └── tdesign-logo.svg │ │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── svg │ │ │ │ └── vite-logo.svg │ │ ├── main.ts │ │ └── vite-env.d.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts └── webpack │ ├── react-lite │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── tdesign-logo.svg │ ├── src │ │ ├── App.css │ │ ├── App.tsx │ │ ├── assets │ │ │ └── svg │ │ │ │ ├── tdesign-logo.svg │ │ │ │ └── webpack-logo.svg │ │ ├── index.tsx │ │ └── react-app-env.d.ts │ └── tsconfig.json │ ├── vue-lite │ ├── .gitignore │ ├── README copy.md │ ├── README.md │ ├── babel.config.js │ ├── jsconfig.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── svg │ │ │ │ ├── tdesign-logo.svg │ │ │ │ └── webpack-logo.svg │ │ └── main.js │ └── vue.config.js │ └── vue-next-lite │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── jsconfig.json │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── svg │ │ │ ├── tdesign-logo.svg │ │ │ └── webpack-logo.svg │ └── main.js │ └── vue.config.js └── tsconfig.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env", 4 | "@babel/preset-typescript" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | 13 | [*.{ts,js,vue,css}] 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | lib 4 | bin 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | plugins: ['@typescript-eslint'], 5 | extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended'], 6 | env: { 7 | node: true 8 | }, 9 | rules: { 10 | // 'no-console': 'error' 11 | '@typescript-eslint/no-explicit-any': 'off', 12 | '@typescript-eslint/explicit-module-boundary-types': 'off', 13 | '@typescript-eslint/ban-ts-comment': 'off' 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml: -------------------------------------------------------------------------------- 1 | name: 反馈 Bug 2 | description: 通过 github 模板进行 Bug 反馈。 3 | title: "[组件名称] 描述问题的标题" 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | # 欢迎你的参与 9 | tdesign-starter-cli 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区: 10 | 11 | 在发布一个 Issue 前,请确保: 12 | - 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/Tencent/tdesign-starter-cli/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正) 13 | - 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。 14 | 15 | - type: input 16 | id: version 17 | attributes: 18 | label: tdesign-starter-cli 版本 19 | description: 请检查在最新项目版本中能否重现此 issue。 20 | placeholder: 请填写 21 | validations: 22 | required: true 23 | 24 | - type: input 25 | id: reproduce 26 | attributes: 27 | label: 重现链接 28 | description: 请提供尽可能精简的 CodePen、CodeSandbox 或 GitHub 仓库的链接。请不要填无关链接,否则你的 Issue 将被关闭。 29 | placeholder: 请填写 30 | 31 | - type: textarea 32 | id: reproduceSteps 33 | attributes: 34 | label: 重现步骤 35 | description: 请清晰的描述重现该 Issue 的步骤,这能帮助我们快速定位问题。没有清晰重现步骤将不会被修复,标有 'need reproduction' 的 Issue 在 7 天内不提供相关步骤,将被关闭。 36 | placeholder: 请填写 37 | 38 | - type: textarea 39 | id: expect 40 | attributes: 41 | label: 期望结果 42 | placeholder: 请填写 43 | 44 | - type: textarea 45 | id: actual 46 | attributes: 47 | label: 实际结果 48 | placeholder: 请填写 49 | 50 | - type: input 51 | id: frameworkVersion 52 | attributes: 53 | label: 框架版本 54 | placeholder: Vue(3.2.0) 55 | 56 | - type: input 57 | id: browsersVersion 58 | attributes: 59 | label: 浏览器版本 60 | placeholder: Chrome(8.213.231.123) 61 | 62 | - type: input 63 | id: systemVersion 64 | attributes: 65 | label: 系统版本 66 | placeholder: MacOS(11.2.3) 67 | 68 | - type: input 69 | id: nodeVersion 70 | attributes: 71 | label: Node版本 72 | placeholder: 请填写 73 | 74 | - type: textarea 75 | id: remarks 76 | attributes: 77 | label: 补充说明 78 | description: 可以是遇到这个 bug 的业务场景、上下文等信息。 79 | placeholder: 请填写 80 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: 使用 issue-helper 新建 4 | url: https://Tencent.github.io/tdesign/issue-helper/?lang=zh-CN&repo=Tencent/tdesign 5 | about: 使用 https://Tencent.github.io/tdesign/issue-helper/ 创建 issue,其中包含 bug 和 feature,表单提交更加严格。 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml: -------------------------------------------------------------------------------- 1 | name: 反馈新功能 2 | description: 通过 github 模板进行新功能反馈。 3 | title: "[组件名称] 描述问题的标题" 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | # 欢迎你的参与 9 | tdesign-starter-cli 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区: 10 | 11 | 在发布一个 Issue 前,请确保: 12 | - 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/Tencent/tdesign-starter-cli/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正) 13 | - 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。 14 | 15 | - type: textarea 16 | id: functionContent 17 | attributes: 18 | label: 这个功能解决了什么问题 19 | description: 请详尽说明这个需求的用例和场景。最重要的是:解释清楚是怎样的用户体验需求催生了这个功能上的需求。我们将考虑添加在现有 API 无法轻松实现的功能。新功能的用例也应当足够常见。 20 | placeholder: 请填写 21 | validations: 22 | required: true 23 | 24 | - type: textarea 25 | id: functionalExpectations 26 | attributes: 27 | label: 你建议的方案是什么 28 | placeholder: 请填写 29 | validations: 30 | required: true 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ### 🤔 这个 PR 的性质是? 8 | 9 | - [ ] 日常 bug 修复 10 | - [ ] 新特性提交 11 | - [ ] 文档改进 12 | - [ ] 演示代码改进 13 | - [ ] 组件样式/交互改进 14 | - [ ] CI/CD 改进 15 | - [ ] 重构 16 | - [ ] 代码风格优化 17 | - [ ] 测试用例 18 | - [ ] 分支合并 19 | - [ ] 其他 20 | 21 | ### 🔗 相关 Issue 22 | 23 | 26 | 27 | ### 💡 需求背景和解决方案 28 | 29 | 34 | 35 | ### 📝 更新日志 36 | 37 | 40 | 41 | - fix(组件名称): 处理问题或特性描述 ... 42 | 43 | - [ ] 本条 PR 不需要纳入 Changelog 44 | 45 | ### ☑️ 请求合并前的自查清单 46 | 47 | ⚠️ 请自检并全部**勾选全部选项**。⚠️ 48 | 49 | - [ ] 文档已补充或无须补充 50 | - [ ] 代码演示已提供或无须提供 51 | - [ ] TypeScript 定义已补充或无须补充 52 | - [ ] Changelog 已提供或无须提供 53 | -------------------------------------------------------------------------------- /.github/workflows/auto-release.yml: -------------------------------------------------------------------------------- 1 | name: Auto Release 2 | 3 | on: 4 | pull_request: 5 | branches: [develop] 6 | types: [opened, synchronize, reopened, closed] 7 | paths: 8 | - 'package.json' 9 | issue_comment: 10 | types: [edited] 11 | 12 | jobs: 13 | generator: 14 | runs-on: ubuntu-latest 15 | if: > 16 | github.event_name == 'pull_request' && 17 | github.event.pull_request.merged == false && 18 | startsWith(github.head_ref, 'release/') 19 | steps: 20 | - run: echo "The head of this PR starts with 'release/'" 21 | - uses: actions/checkout@v3 22 | - uses: TDesignOteam/tdesign-changelog-action@main 23 | id: changelog 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | - name: Add comment 27 | uses: peter-evans/create-or-update-comment@v1 28 | with: 29 | issue-number: ${{ github.event.pull_request.number }} 30 | body: | 31 | ${{ steps.changelog.outputs.changelog }} 32 | comment_add_log: 33 | runs-on: ubuntu-latest 34 | if: > 35 | github.event_name == 'issue_comment' 36 | && github.event.issue.pull_request 37 | && github.event.sender.login == github.event.issue.user.login 38 | && startsWith(github.event.comment.body, '## 🌈 ') 39 | steps: 40 | - id: comment 41 | shell: bash 42 | run: | 43 | result=$(curl ${{github.event.issue.pull_request.url}} -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}") 44 | headrefreg='"ref": "(release/[[:digit:]]{1,2}\.[[:digit:]]{1,2}\.[[:digit:]]{1,2})",' 45 | if [[ $result =~ $headrefreg ]] 46 | then 47 | echo "属于 release pr 的 comment ${BASH_REMATCH[1]}" 48 | else 49 | echo "不属于 release pr 的 comment" && exit 1 50 | fi 51 | echo "::set-output name=branch::${BASH_REMATCH[1]}" 52 | # zsh $match[1] 53 | - uses: actions/checkout@v3 54 | with: 55 | ref: ${{ steps.comment.outputs.branch }} 56 | - name: Commit and push if needed 57 | env: 58 | BODY: ${{ github.event.comment.body }} 59 | run: | 60 | txt=$(cat CHANGELOG.md) 61 | echo "${txt%%##*}$BODY${txt##*---}" > CHANGELOG.md 62 | git add . 63 | git config --local user.email "github-actions[bot]@users.noreply.github.com" 64 | git config --local user.name "github-actions[bot]" 65 | git commit -m "chore: changelog's changes" 66 | git push 67 | echo "💾 pushed changelog's changes" 68 | merge_tag: 69 | runs-on: ubuntu-latest 70 | if: > 71 | github.event_name == 'pull_request' && 72 | github.event.pull_request.merged == true && 73 | startsWith(github.head_ref, 'release/') 74 | steps: 75 | - uses: actions/checkout@v3 76 | with: 77 | ref: develop 78 | token: ${{ secrets.PERSONAL_TOKEN }} 79 | - name: tag and push if needed 80 | run: | 81 | data=$(cat package.json) 82 | re="\"version\": \"([^\"]*)\"" 83 | [[ $data =~ $re ]] 84 | echo "${BASH_REMATCH[1]}" 85 | git config --local user.email "github-actions[bot]@users.noreply.github.com" 86 | git config --local user.name "github-actions[bot]" 87 | git tag ${BASH_REMATCH[1]} 88 | git push origin ${BASH_REMATCH[1]} 89 | echo "pushed tag ${BASH_REMATCH[1]}" 90 | -------------------------------------------------------------------------------- /.github/workflows/issue-assignees.temp.yml: -------------------------------------------------------------------------------- 1 | # force copy from tencent/tdesign 2 | name: Issue Add Assigness 3 | 4 | on: 5 | issues: 6 | types: [opened, edited] 7 | 8 | jobs: 9 | mark-duplicate: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: wow-actions/auto-comment@v1 13 | with: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 15 | issuesOpened: | 16 | 👋 @{{ author }},感谢给 TDesign 提出了 issue。 17 | 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。 18 | 19 | # https://docs.github.com/cn/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues 20 | - uses: 94dreamer/issue-assignees@main 21 | id: assignees 22 | with: 23 | project_name: ${{github.event.repository.name}} 24 | issue_title: ${{github.event.issue.title}} 25 | 26 | - run: echo ${{ steps.assignees.outputs.contributors }} 27 | - name: Add assigness 28 | if: steps.assignees.outputs.contributors != '' 29 | uses: actions-cool/issues-helper@v3 30 | with: 31 | actions: 'add-assignees' 32 | token: ${{ secrets.GITHUB_TOKEN }} 33 | issue-number: ${{ github.event.issue.number }} 34 | assignees: ${{ steps.assignees.outputs.contributors }} 35 | 36 | - run: | 37 | contributors=${{ steps.assignees.outputs.contributors }} 38 | contributorstring=${contributors//,/ @} 39 | echo "::set-output name=string::@$contributorstring" 40 | id: contributors 41 | 42 | - name: 通知贡献者 43 | if: steps.assignees.outputs.contributors != '' 44 | uses: actions-cool/maintain-one-comment@v2.0.0 45 | with: 46 | token: ${{ secrets.GITHUB_TOKEN }} 47 | body: | 48 | ♥️ 有劳 ${{ steps.contributors.outputs.string }} 尽快确认问题。 49 | 确认有效后将下一步计划和可能需要的时间回复给 @${{ github.event.issue.user.login }} 。 50 | 51 | number: ${{ github.event.issue.number }} 52 | body-include: "" 53 | -------------------------------------------------------------------------------- /.github/workflows/issue-help-wanted.temp.yml: -------------------------------------------------------------------------------- 1 | # force copy from tencent/tdesign 2 | name: Issue Help wanted 3 | on: 4 | issues: 5 | types: 6 | - labeled 7 | jobs: 8 | add-comment: 9 | if: github.event.label.name == 'help wanted' 10 | runs-on: ubuntu-latest 11 | permissions: 12 | issues: write 13 | steps: 14 | - name: Add comment 15 | uses: peter-evans/create-or-update-comment@v1 16 | with: 17 | issue-number: ${{ github.event.issue.number }} 18 | body: | 19 | 任何人都可以处理此问题。 20 | **请务必在您的 `pull request` 中引用此问题。** :sparkles: 21 | 感谢你的贡献! :sparkles: 22 | reactions: heart -------------------------------------------------------------------------------- /.github/workflows/issue-mark-duplicate.temp.yml: -------------------------------------------------------------------------------- 1 | # force copy from tencent/tdesign 2 | # 当在 issue 的 comment 回复类似 `Duplicate of #111` 这样的话,issue 将被自动打上 重复提交标签 并且 cloese 3 | name: Issue Mark Duplicate 4 | 5 | on: 6 | issue_comment: 7 | types: [created, edited] 8 | 9 | jobs: 10 | mark-duplicate: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: mark-duplicate 14 | uses: actions-cool/issues-helper@v2 15 | with: 16 | actions: "mark-duplicate" 17 | token: ${{ secrets.GITHUB_TOKEN }} 18 | duplicate-labels: "duplicate" 19 | close-issue: true 20 | -------------------------------------------------------------------------------- /.github/workflows/issue-reply.temp.yml: -------------------------------------------------------------------------------- 1 | # force copy from tencent/tdesign 2 | # 当被打上 Need Reproduce 标签时候,自动提示需要重现实例 3 | 4 | name: ISSUE_REPLY 5 | 6 | on: 7 | issues: 8 | types: [labeled] 9 | 10 | jobs: 11 | issue-reply: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Need Reproduce 15 | if: github.event.label.name == 'Need Reproduce' 16 | uses: actions-cool/issues-helper@v2 17 | with: 18 | actions: 'create-comment' 19 | issue-number: ${{ github.event.issue.number }} 20 | body: | 21 | 你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://codesandbox.io/) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。 22 | -------------------------------------------------------------------------------- /.github/workflows/issue-stale-close.temp.yml: -------------------------------------------------------------------------------- 1 | # force copy from tencent/tdesign 2 | # 国际标准时间+8 3 | name: Close stale issues and PRs 4 | on: 5 | schedule: 6 | - cron: "50 5 * * *" 7 | 8 | jobs: 9 | close-issues: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | issues: write 13 | pull-requests: write 14 | steps: 15 | - uses: actions/stale@v4 16 | with: 17 | stale-issue-message: "这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。" 18 | stale-pr-message: '这个 PR 已经过时了,因为它已经持续 45 天没有任何活动了。 删除 stale 的标签或评论,否则将在 10 天内关闭。' 19 | close-issue-message: "此 Issue 被自动关闭,因为它自被标记为过时 stale 以来已闲置 7 天。" 20 | close-pr-message: "此 PR 被自动关闭,因为它已经 stable 停滞了 10 天,没有任何活动。" 21 | days-before-stale: 30 22 | days-before-close: 7 23 | days-before-pr-stale: 45 24 | days-before-pr-close: 10 25 | repo-token: ${{ secrets.GITHUB_TOKEN }} 26 | exempt-issue-labels: 'WIP' 27 | exempt-pr-labels: 'WIP' -------------------------------------------------------------------------------- /.github/workflows/preview.yml: -------------------------------------------------------------------------------- 1 | name: Build & deploy 2 | on: 3 | pull_request: 4 | branches: 5 | - develop 6 | jobs: 7 | build: 8 | name: Build 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: "20" 16 | - uses: oven-sh/setup-bun@v2 17 | with: 18 | bun-version: latest 19 | - run: npm install pnpm -g && pnpm install && pnpm build 20 | - run: bun scripts/deploy.ts 21 | - run: sleep 3s 22 | - run: | 23 | npx surge --project ./dist --domain tdesign-starter-cli.surge.sh --token ${{ secrets.TDESIGN_SURGE_TOKEN }} 24 | ls dist 25 | -------------------------------------------------------------------------------- /.github/workflows/tag-push.yml: -------------------------------------------------------------------------------- 1 | # 文件名建议统一为 tag-push.yml 2 | # 应用 publish.yml 的 demo 3 | 4 | name: TAG_PUSH 5 | 6 | on: create 7 | 8 | jobs: 9 | call-publish: 10 | uses: Tencent/tdesign/.github/workflows/publish.yml@main 11 | secrets: 12 | TDESIGN_SURGE_TOKEN: ${{ secrets.TDESIGN_SURGE_TOKEN }} 13 | TDESIGN_NPM_TOKEN: ${{ secrets.TDESIGN_NPM_TOKEN }} 14 | PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /tests/**/coverage/ 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | #.vscode 19 | .history 20 | .ionide 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | yarn.lock 27 | package-lock.json 28 | pnpm-lock.yaml 29 | .temp 30 | .auth 31 | .env.development 32 | .env.test 33 | src/config/ConfigDev.ts 34 | /test 35 | /bin/* 36 | 37 | # 测试文件 38 | template-vite-* 39 | template-webpack-* 40 | template-farm-* -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | bin 4 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 一行最多 120 字符 3 | printWidth: 150, 4 | // 使用 2 个空格缩进 5 | tabWidth: 2, 6 | // 不使用缩进符,而使用空格 7 | useTabs: false, 8 | // 行尾需要有分号 9 | semi: true, 10 | // 使用单引号 11 | singleQuote: true, 12 | // 对象的 key 仅在必要时用引号 13 | quoteProps: 'as-needed', 14 | // jsx 不使用单引号,而使用双引号 15 | jsxSingleQuote: false, 16 | // 末尾需要有逗号 17 | trailingComma: 'none', 18 | // 大括号内的首尾需要空格 19 | bracketSpacing: true, 20 | // jsx 标签的反尖括号需要换行 21 | jsxBracketSameLine: false, 22 | // 箭头函数,只有一个参数的时候,也需要括号 23 | arrowParens: 'always', 24 | // 每个文件格式化的范围是文件的全部内容 25 | rangeStart: 0, 26 | rangeEnd: Infinity, 27 | // 不需要写文件开头的 @prettier 28 | requirePragma: false, 29 | // 不需要自动在文件开头插入 @prettier 30 | insertPragma: false, 31 | // 使用默认的折行标准 32 | proseWrap: 'preserve', 33 | // 根据显示样式决定 html 要不要折行 34 | htmlWhitespaceSensitivity: 'css', 35 | // vue 文件中的 script 和 style 内不用缩进 36 | vueIndentScriptAndStyle: false, 37 | // 换行符使用 lf 38 | endOfLine: 'lf' 39 | }; 40 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "streetsidesoftware.code-spell-checker"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.preferences.importModuleSpecifier": "relative", 3 | "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], 4 | "[html]": { 5 | "editor.formatOnSave": true, 6 | "editor.defaultFormatter": "vscode.html-language-features" 7 | }, 8 | "[typescript]": { 9 | "editor.formatOnSave": true, 10 | "editor.defaultFormatter": "vscode.typescript-language-features" 11 | }, 12 | "[javascript]": { 13 | "editor.formatOnSave": true, 14 | "editor.defaultFormatter": "esbenp.prettier-vscode" 15 | }, 16 | "editor.codeActionsOnSave": { 17 | "source.fixAll.eslint": "explicit" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## 🌈 0.5.3 `2024-09-05` 3 | ### 🚧 Others 4 | - docs: 添加`tdesign-starter-cli`的使用说明 @RSS1102 ([#84](https://github.com/Tencent/tdesign-starter-cli/pull/84)) 5 | ## 🌈 0.5.2 `2024-08-19` 6 | ### 🚀 Features 7 | - style: 统一模板页面样式 @RSS1102 ([#78](https://github.com/Tencent/tdesign-starter-cli/pull/78)) 8 | ### 🐞 Bug Fixes 9 | - fix: 修复 `cli` 命令行中构建工具类型 (buildToolType) 缺少 `farm` 参数的问题 @RSS1102 ([#74](https://github.com/Tencent/tdesign-starter-cli/pull/74)) 10 | 11 | ## 🌈 0.5.1 `2024-06-05` 12 | ### 🚀 Features 13 | - 新增`farm`模版 @RSS1102 ([#61](https://github.com/Tencent/tdesign-starter-cli/pull/61)) 14 | - 新增命令行创建具体模版的功能支持 @RSS1102 ([#63](https://github.com/Tencent/tdesign-starter-cli/pull/63)) 15 | 16 | ## 0.5.0 `2024-05-09` 17 | 18 | ### Breaking Change 19 | 20 | - 依赖项目升级至最新版本,要求 Node 版本高于 `16` 使用 21 | 22 | ### Features 23 | 24 | - 优化 Vite Lite 模板内容 25 | 26 | ## 0.4.2 `2023-11-10` 27 | 28 | ### Bug Fixes 29 | 30 | - 修复部分用户按照脚手架冲突的问题 31 | 32 | ## 0.4.1 `2023-07-19` 33 | 34 | ### Features 35 | 36 | - Lite 默认使用最新版本的组件库 37 | - Lite 版本新增 .gitignore 文件 38 | 39 | ## 0.4.0 `2023-05-30` 40 | 41 | ### Features 42 | 43 | - 新增小程序`零售电商`模版下载 44 | - 新增移动端 vue3`即时通讯`模版下载 45 | 46 | ## 0.3.3 `2023-02-22` 47 | 48 | ### Bug Fixes 49 | 50 | - 修复下载 Vue3 版本指定页面选项功能失效的问题 51 | 52 | ## 0.3.2 `2022-09-26` 53 | 54 | ### Features 55 | 56 | - Lite 模板新增 webpack 版本 @sscode02 in #34 57 | 58 | ## 0.3.1 `2022-08-23` 59 | 60 | ### Bug Fixes 61 | 62 | - 修复下载 `Lite` 版本指令在 windows 系统的使用问题 63 | 64 | ## 0.3.0 `2022-08-22` 65 | 66 | ### Features 67 | 68 | - 新增 `Lite` 版本模板下载,只包含基本的 TDesign 引入及使用 69 | 70 | ## 0.2.5 `2022-08-03` 71 | 72 | ### Bug Fixes 73 | 74 | - 修复国内托管平台权限策略变更导致拉取模板失败的问题 75 | 76 | ## 0.2.4 `2022-06-27` 77 | 78 | ### Features 79 | 80 | - 自定义模式下移除无效的引用 81 | 82 | ## 0.2.3 `2022-06-02` 83 | 84 | ### Bug Fixes 85 | 86 | - 修复自定义创建项目时图标加载的问题 87 | 88 | ## 0.2.2 `2022-05-08` 89 | 90 | ### Features 91 | 92 | - 配合模板新增维护中页面升级 93 | 94 | ## 0.2.1 `2022-04-22` 95 | 96 | ### Features 97 | 98 | - 支持 React 模板选择指定页面模块的功能 99 | 100 | ## 0.2.0 `2022-03-08` 101 | 102 | ### Features 103 | 104 | - 新增 React 选项,支持下载 react starter kit 105 | 106 | ## 0.1.0 `2022-02-21` 107 | 108 | ### Features 109 | 110 | - 新增通过 CLI 选择指定页面模块的功能 111 | 112 | ## 0.0.7 `2022-02-14` 113 | 114 | ### Features 115 | 116 | - 使用 coding 平台托管的代码取代 github 代理的镜像用于拉取代码 117 | 118 | ## 0.0.6 `2022-01-20` 119 | 120 | ### Bug Fixes 121 | 122 | 1. 替换请求模板镜像,处理部分国内用户请求问题 123 | 2. 增加请求失败的错误提示 124 | 125 | ## 0.0.5 `2021-12-29` 126 | 127 | ### Bug Fixes 128 | 129 | 1. 修复国内用户请求问题 130 | 2. 修复 windows 系统下的使用问题 131 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-present TDesign 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README-zh_CN.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

6 | 7 | License 8 | 9 | 10 | Version 11 | 12 | 13 | Node 14 | 15 | 16 | Downloads 17 | 18 |

19 | 20 | [English](./README.md) | 简体中文 21 | 22 | > 注意您的本机安装的Node版本需要`>=16`。 23 | 24 | ## 安装 25 | 26 | ```shell 27 | npm install tdesign-starter-cli -g 28 | ``` 29 | 30 | ## 使用 31 | 32 | ### 交互式操作 33 | 34 | ```sh 35 | 36 | # 初始化项目 37 | td-starter init 38 | 39 | # 填写 项目名称、项目描述 40 | ? 请输入项目名称: [project-name] 41 | ? 请输入项目描述: Base on tdesign-starter-cli 42 | ... 43 | 44 | cd [project-name] 45 | 46 | # 安装依赖 47 | npm install 48 | 49 | # 运行 50 | npm run dev 51 | 52 | ``` 53 | 54 | ### Command Operation 55 | 56 | ```sh 57 | 58 | # 初始化项目 59 | td-starter init [project name] [root] 60 | 61 | cd [project-name] 62 | 63 | # 安装依赖 64 | npm install 65 | 66 | # 运行 67 | npm run dev 68 | 69 | ``` 70 | 71 | #### 示例 72 | 73 | ``` sh 74 | td-starter init tdesign-vue3-farm --type vue3 --buildToolType farm 75 | ``` 76 | 77 | ``` sh 78 | td-starter init tdesign-vue3-farm -type vue3 -bt farm 79 | ``` 80 | 81 | ### 选项 82 | 83 | | 选项 | 描述 | 84 | |-------------------------------------|-----------------------------------------------------------------------------| 85 | | -d, --description \ | 项目描述 (默认: "Base on tdesign-starter-cli") | 86 | | -type, --type \ | 项目框架 vue2 \| vue3 \| react \| miniProgram \| mobileVue (默认: "vue2") | 87 | | -temp, --template \