dufu1991 3 жил өмнө
parent
commit
a2528a4d82

+ 13 - 2
doc/guide/contribution.md

@@ -15,7 +15,15 @@
 
 调试 STDF 必须要有个工程环境,为此提供了一个简单的 Demo 工程。STDF 本身不受 Node 版本限制,Demo 使用 Vite 开发,所以请确保你的 Node.js 版本 >= 14.18+,参考 [Vite 官网](https://cn.vitejs.dev/guide/#scaffolding-your-first-vite-project)。
 
-> 推荐:使用 [pnpm](https://pnpm.io/zh) 进行包管理;安装针对 Svelte 的 [VSCode 插件](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) 或者 [WebStorm 插件](https://plugins.jetbrains.com/plugin/12375-svelte) 进行开发;安装针对 Tailwind 的 [VSCode 插件](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss),WebStorm 默认集成,[了解更多](https://www.jetbrains.com/help/webstorm/tailwind-css.html)。
+当你修改完成代码之后,提交 PR 之前请确保对代码进行了格式化并通过代码格式检查,可安装相关编辑器插件或通过命令行进行格式化。
+
+推荐安装:
+
+- [pnpm](https://pnpm.io/zh):包管理工具。
+- [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) 或者 [Svelte](https://plugins.jetbrains.com/plugin/12375-svelte):Svelte 开发插件。
+- [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/tailwind-css.html):Tailwind CSS 开发插件。
+- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/eslint.html):代码格式检查插件。
+- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/prettier.html):代码格式化插件。
 
 按照下面的步骤操作,即可在本地快速启动 STDF Demo。
 
@@ -67,8 +75,11 @@ npm run dev
 - 克隆你的仓库至本地。
 - 修改组件源码并在 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)。
+- 到仓库根目录,执行 `pnpm i` 或 `npm i` 安装依赖。
+- 利用编辑器格式化你修改过的代码,或者执行 `pnpm run format` 或 `npm run format` 命令行格式化代码。
+- 执行 `pnpm run lint` 或 `npm run lint` 检查代码格式。
 - 提交修改内容至你的仓库,然后提 Pull Request 到主仓库。
-- Pull Request 会在 Review 通过后被合并到主仓库,并发布新版本至 npm。
+- Pull Request 会在 Review 通过后被合并到主仓库,后续发布新版
 
 ### 注意事项
 

+ 13 - 4
doc/guide/contribution_en.md

@@ -15,9 +15,15 @@ Before local development, please make sure that Git and Node.js are installed in
 
 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/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).
+Before submitting a PR after you have made code modifications, please ensure that you have formatted the code and passed the code formatting check. You can install relevant editor plugins or use the command line for code formatting.
 
-Follow the steps below to quickly start the STDF Demo locally.
+Recommended installations:
+
+- [pnpm](https://pnpm.io/zh): Package management tool.
+- [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) or [Svelte](https://plugins.jetbrains.com/plugin/12375-svelte): Svelte development plugin.
+- [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/tailwind-css.html): Tailwind CSS development plugin.
+- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/eslint.html): Code formatting check plugin.
+- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/prettier.html): Code formatting plugin.
 
 > Because the stdf and rollup-plugin-stdf-icon packages that the demo depends on are locally built, please build these two packages first.
 
@@ -67,8 +73,11 @@ If you are submitting a Pull Request on GitHub for the first time, you can read
 - 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.
+- Go to the root directory of the repository and execute `pnpm i` or `npm i` to install dependencies.
+- Use your editor to format the modified code or execute `pnpm run format` or `npm run format` in the command line to format the code.
+- Execute `pnpm run lint` or `npm run lint` to check the code formatting.
+- Commit 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 it passes the review and a new version will be released subsequently.
 
 ### Notes