From 5738a9f834446b89b10beeda211d7862c7e110ec Mon Sep 17 00:00:00 2001 From: Kuingsmile <96409857+Kuingsmile@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:35:29 +0800 Subject: [PATCH] :pencil: Docs(custom): update comtributing guide --- CONTRIBUTING.md | 14 +++++++++----- CONTRIBUTING_EN.md | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7be5994..540b366e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,11 @@ ## 安装与启动 +最低要求: + +- Node.js >= 20 +- Yarn >= 1.22 + 1. 使用 [yarn](https://yarnpkg.com/) 安装依赖 ```bash @@ -16,12 +21,11 @@ yarn dev 启动项目。 -1. 只跟 Electron 主进程相关的代码请在 `src/main` 目录下添加。只跟渲染进程相关的代码请在 `src/renderer` 目录下添加。两个进程都能使用的代码请在 `src/universal` 目录下添加。 -2. 所有的跨进程事件名请在 `src/universal/events/constants.ts` 里添加。 -3. 所有的全局类型定义请在 `src/universal/types/` 里添加,如果是 `enum`,请在 `src/universal/types/enum.ts` 里添加。 -4. 与图床管理功能相关的代码请在 `src/main/manage`和 `src/renderer/manage`目录下添加。 +1. 只跟 Electron 主进程相关的代码请在 `src/main` 目录下添加。只跟渲染进程相关的代码请在 `src/renderer` 目录下添加。需要暴露到渲染进程的代码请在 `src/preload` 目录下添加。 +2. 所有的全局类型定义请在 `src/universal/types/` 里添加。 +3. 与图床管理功能相关的代码请在 `src/main/manage`和 `src/renderer/manage`目录下添加。 -## i18n +## i18n-主进程 1. 在 `public/i18n/` 下面创建一种语言的 `yml` 文件,例如 `zh-Hans.yml`。然后参考 `zh-CN.yml` 或者 `en.yml` 编写语言文件。并注意,PicList 会通过语言文件中的 `LANG_DISPLAY_LABEL` 向用户展示该语言的名称。 2. 在 `src/universal/i18n/index.ts` 里添加一种默认语言。其中 `label` 就是语言文件中 `LANG_DISPLAY_LABEL` 的值,`value` 是语言文件名。 diff --git a/CONTRIBUTING_EN.md b/CONTRIBUTING_EN.md index 26bae6c9..b7006637 100644 --- a/CONTRIBUTING_EN.md +++ b/CONTRIBUTING_EN.md @@ -2,6 +2,11 @@ ## Installation and startup +Minimum requirements: + +- Node.js >= 20 +- Yarn >= 1.22 + 1. Use [yarn](https://yarnpkg.com/) to install dependencies ```bash @@ -16,12 +21,11 @@ yarn dev Startup project. -1. Please add code only related to the main process of Electron in the `src/main` directory. Code only related to the rendering process should be added in the `src/renderer` directory. Add code that can be used by both processes in the `src/universal` directory. -2. Please add all cross-process event names in `src/universal/events/constants.ts`. -3. Please add all global type definitions in `src/universal/types/`, if it is `enum`, please add it in `src/universal/types/enum.ts`. -4. Code related to the management function of the picture bed should be added in the `src/main/manage` and `src/renderer/manage` directory. +1. Please add code only related to the main process of Electron in the `src/main` directory. Code only related to the rendering process should be added in the `src/renderer` directory. Add code that needs to be exposed to the rendering process in the `src/preload` directory. +2. Please add all global type definitions in `src/universal/types/`, if it is `enum`, please add it in `src/universal/types/enum.ts`. +3. Code related to the management function of the picture bed should be added in the `src/main/manage` and `src/renderer/manage` directory. -## i18n +## i18n-Main Process 1. Create a language `yml` file under `public/i18n/`, for example `zh-Hans.yml`. Then refer to `zh-CN.yml` or `en.yml` to write language files. Also note that PicList will display the name of the language to the user via `LANG_DISPLAY_LABEL` in the language file. 2. Add a default language to `src/universal/i18n/index.ts`. where `label` is the value of `LANG_DISPLAY_LABEL` in the language file, and `value` is the name of the language file.