杜府 3 роки тому
батько
коміт
27afbda872
2 змінених файлів з 36 додано та 40 видалено
  1. 10 12
      doc/guide/contribution.md
  2. 26 28
      doc/guide/contribution_en.md

+ 10 - 12
doc/guide/contribution.md

@@ -20,11 +20,11 @@
 按照下面的步骤操作,即可在本地快速启动 STDF Demo。
 按照下面的步骤操作,即可在本地快速启动 STDF Demo。
 
 
 ```bash
 ```bash
-## 克隆 STDF Demo 仓库
-git clone git@github.com:dufu1991/demo-stdf.git
+## 克隆 STDF 仓库
+git clone git@github.com:dufu1991/stdf.git
 
 
-## 进入项目目录
-cd demo-stdf
+## 进入项目 demo 目录
+cd stdf/demo
 
 
 ## 安装依赖
 ## 安装依赖
 pnpm i
 pnpm i
@@ -37,9 +37,7 @@ npm run dev
 
 
 启动成功之后,可在浏览器中打开 `http://localhost:8888` 查看效果,请将浏览器的开发者工具切换为移动端模式。
 启动成功之后,可在浏览器中打开 `http://localhost:8888` 查看效果,请将浏览器的开发者工具切换为移动端模式。
 
 
-针对 Demo 内的组件,可以在 `node_modules/stdf/src` 目录下找到对应文件进行修改并实时查看修改效果。注意,VS Code 与 WebStorm 都支持在调用组件时直接跳转到组件源码。
-
-> 如果此仓库的 STDF 不是最新版本,请先升级到最新版本。
+可对 `components/src` 目录下组件源码进行修改并实时查看修改效果。注意,VS Code 与 WebStorm 都支持在调用组件时直接跳转到组件源码。
 
 
 如果不想本地开发,可以选择使用 StackBlitz 在线简单调试。直接打开 [STDF Demo](https://stackblitz.com/github/dufu1991/demo-stdf) 即可开始在线调试。
 如果不想本地开发,可以选择使用 StackBlitz 在线简单调试。直接打开 [STDF Demo](https://stackblitz.com/github/dufu1991/demo-stdf) 即可开始在线调试。
 
 
@@ -52,11 +50,11 @@ npm run dev
 
 
 ### 流程
 ### 流程
 
 
--   请先 fork 一份 STDF (https://github.com/dufu1991/stdf) 到自己的仓库,如果已经 fork 过,请同步主仓库的最新代码。
--   基于 fork 后仓库的 main 分支新建一个分支,比如 `feature/add_Loading_type`,克隆至本地。
--   将上述 Demo 工程中内 `node_modules/stdf/src` 下修改并验证通过的组件文件复制到新分支中 `components/src` 对应目录下
--   补充此次修改的中英文档中,文档位于 `doc/components` 目录下。根据具体修改内容可能需要修改 api、FAQ、guide、version 等文档。对 version 的修改请增加 tag,具体参考 [STDF Version tag](https://github.com/dufu1991/stdf/blob/main/doc/components/button/version.md?plain=1)。
--   提 Pull Request 到主仓库的 main 分支
+-   请先 fork 一份 [STDF](https://github.com/dufu1991/stdf) 代码到自己的仓库,如果已经 fork 过,请同步主仓库的最新代码。
+-   克隆你的仓库至本地。
+-   修改组件源码并在 Demo 中验证通过
+-   「可选」补充此次修改的中英文档中,文档位于 `doc/components` 目录下。根据具体修改内容可能需要修改 api、FAQ、guide、version 等文档。对 version 的修改请增加 tag,具体参考 [STDF Version tag](https://github.com/dufu1991/stdf/blob/main/doc/components/button/version.md?plain=1)。
+-   提交修改内容至你的仓库,然后提 Pull Request 到主仓库。
 -   Pull Request 会在 Review 通过后被合并到主仓库,并发布新版本至 npm。
 -   Pull Request 会在 Review 通过后被合并到主仓库,并发布新版本至 npm。
 
 
 ### 注意事项
 ### 注意事项

+ 26 - 28
doc/guide/contribution_en.md

@@ -2,29 +2,29 @@
 
 
 Thank you for using STDF.
 Thank you for using STDF.
 
 
-Below are guidelines for submitting feedback or code to STDF. Before submitting an issue or PR to STDF, please take a few minutes to read the following content.
+Below are guidelines for submitting feedback or code to STDF. Before submitting an issue or PR to STDF, please take a few minutes to read the following.
 
 
 ## Issue Guidelines
 ## Issue Guidelines
 
 
--   When encountering problems, please first confirm whether the problem has been recorded in the issue or has been fixed.
--   When submitting an issue, describe the problem briefly and add information about the environment and reproduction steps when the problem occurs.
+-   When encountering an issue, please first confirm whether the issue has already been recorded in the issue or has been fixed.
+-   When submitting an issue, please describe the issue briefly in language and add the environment and replication steps when the issue occurs.
 
 
 ## Local Development
 ## Local Development
 
 
-22Before local development, make sure that Git and Node.js are installed in your development environment.
+Before local development, please make sure that Git and Node.js are installed in your development environment.
 
 
-Debugging of STDF requires a project environment. Therefore, we provide a simple Demo project. The version of Node.js used by STDF is not limited; however, Vite is used for developing Demo projects. Therefore, ensure that your Node.js version >= 14.18+ (refer to [Vite official website](https://vitejs.dev/guide/#scaffolding-your-first-vite-project)).
+Debugging STDF requires an engineering environment. For this purpose, a simple Demo project is provided. STDF itself is not limited by the Node version, and the Demo uses Vite for development, so please ensure that your Node.js version >= 14.18+, refer to the [Vite official website](https://cn.vitejs.dev/guide/#scaffolding-your-first-vite-project).
 
 
-> Recommended: Use [pnpm](https://pnpm.io) for package management. Install [VSCode plugin](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) or [WebStorm plugin](https://plugins.jetbrains.com/plugin/12375-svelte) specifically designed for Svelte development. Install [VSCode plugin](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) specifically designed for Tailwind CSS. WebStorm integrates it by default ([learn more here](https://www.jetbrains.com/help/webstorm/tailwind-css.html)).
+> Recommended: Use [pnpm](https://pnpm.io/zh) for package management; install [VSCode plugin](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) or [WebStorm plugin](https://plugins.jetbrains.com/plugin/12375-svelte) for Svelte development; install [VSCode plugin](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) for Tailwind, WebStorm is integrated by default, [learn more](https://www.jetbrains.com/help/webstorm/tailwind-css.html).
 
 
-Follow these steps below to quickly start up STDF Demo locally:
+Follow the steps below to quickly start the STDF Demo locally.
 
 
 ```bash
 ```bash
-## Clone repository of STDF Demo
-git clone git@github.com:dufu1991/demo-stdf.git
+## Clone STDF repository
+git clone git@github.com:dufu1991/stdf.git
 
 
-## Enter the project directory
-cd demo-stdf
+## Enter the project demo directory
+cd stdf/demo
 
 
 ## Install dependencies
 ## Install dependencies
 pnpm i
 pnpm i
@@ -35,34 +35,32 @@ npm i
 npm run dev
 npm run dev
 ```
 ```
 
 
-After successful startup, you can open `http://localhost:8888` in your browser to view the effect. Please switch your browser's developer tools to mobile mode.
+After the startup is successful, you can open `http://localhost:8888` in the browser to view the effect. Please switch the developer tools of the browser to the mobile mode.
 
 
-For components within Demo, you can find corresponding files under `node_modules/stdf/src` and modify them to see real-time modification effects. Note that both VS Code and WebStorm support jumping directly to component source code when calling components.
+You can modify the component source code under the `components/src` directory and view the modification effect in real-time. Note that both VS Code and WebStorm support directly jumping to the component source code when calling the component.
 
 
-> If STDF in this repository is not the latest version, please upgrade it first.
+If you don't want to develop locally, you can choose to use StackBlitz to debug online. Just open [STDF Demo](https://stackblitz.com/github/dufu1991/demo-stdf) to start online debugging.
 
 
-If you do not want local development, you can choose to use StackBlitz for simple online debugging. Simply open [STDF Demo](https://stackblitz.com/github/dufu1991/demo-stdf) to start online debugging.
+## Submitting PR
 
 
-## Submitting PRs
-
-If this is your first time submitting a Pull Request on GitHub, read these two articles:
+If you are submitting a Pull Request on GitHub for the first time, you can read the following two articles to learn:
 
 
 -   [First Contributions](https://github.com/firstcontributions/first-contributions/blob/main/translations/README.zh-cn.md)
 -   [First Contributions](https://github.com/firstcontributions/first-contributions/blob/main/translations/README.zh-cn.md)
--   [How To Contribute To Open Source Without Being A Jerk](https://segmentfault.com/a/1190000000736629)
+-   [How to contribute code elegantly on GitHub](https://segmentfault.com/a/1190000000736629)
 
 
 ### Process
 ### Process
 
 
--   Fork STDF (https://github.com/dufu1991/stdf) into your own repository; if already forked before, synchronize with the latest code from main repository.
--   Create a new branch based on main branch of forked repository such as `feature/add_Loading_type`, clone it locally.
--   Copy modified component files under `node_modules/stdf/src` in above mentioned Demo project and verify them successfully onto corresponding directories under `components/src`.
--   In the Chinese and English documents updated this time, the document is located in the `doc/components` directory. Depending on the specific modifications, it may be necessary to modify documents such as api, FAQ, guide, and version. When modifying the version, please add a tag. For details, refer to [STDF Version tag](https://github.com/dufu1991/stdf/blob/main/doc/components/button/version_en.md?plain=1).
--   Submit a Pull Request to main branch of primary repository.
--   After the Pull Request is approved in Review, it will be merged into the main repository and a new version will be released to npm.
+-   Please fork a copy of [STDF](https://github.com/dufu1991/stdf) to your own repository. If you have already forked, please synchronize the latest code from the main repository.
+-   Clone your repository to your local machine.
+-   Modify the component source code and verify it in the Demo.
+-   「Optional」Supplement the Chinese and English documentation for this modification, which is located in the `doc/components` directory. Depending on the specific modification content, you may need to modify the api, FAQ, guide, version, and other documents. For modifications to version, please add tags. Please refer to the [STDF Version tag](https://github.com/dufu1991/stdf/blob/main/doc/components/button/version.md?plain=1) for specific details.
+-   Submit the modified content to your repository, and then submit a Pull Request to the main repository.
+-   The Pull Request will be merged into the main repository after review and a new version will be released to npm.
 
 
 ### Notes
 ### Notes
 
 
 When submitting a Pull Request, please note:
 When submitting a Pull Request, please note:
 
 
--   Keep your PR small enough. Generally, one PR only solves a single component file or adds a single feature to solve a single problem for ease of review.
--   When adding or modifying components, remember to verify them successfully in Demo project to ensure code stability.
--   Please add appropriate descriptions in PRs. If there are related issues, please indicate them.
+-   Keep your PR small enough, generally one PR only solves a single component file, solves a single problem, or adds a single function, to facilitate review.
+-   When adding or modifying existing components, remember to verify it in the Demo to ensure the stability of the code.
+-   Please add a suitable description in the PR. If there is a related issue, please indicate it.