From 483f3df35162e7f7321881f381bbc88143d9ef9f Mon Sep 17 00:00:00 2001 From: Chatnoir Miki Date: Wed, 2 Apr 2025 17:32:33 +0800 Subject: [PATCH] chore: several doc fixes and enhancements (#110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update instructions for development flow * feat: add devenv profile for nix/devenv environment setup * chore: update .gitignore to ignore stage-tamagotchi-tauri fonts * docs: add instructions to use devenv * docs: fix note asides * fix: missing bracket * chore: ignore devenv related files * chore: update ignore pattern * chore: update .gitignore to include a newline at the end --------- Co-authored-by: 藍+85CD <50108258+kwaa@users.noreply.github.com> --- .gitignore | 9 + .../docs/references/Contributing/guide.md | 187 ++++++++++-------- 2 files changed, 112 insertions(+), 84 deletions(-) diff --git a/.gitignore b/.gitignore index 6c19287ce..c10dace1c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ coverage/ **/public/assets/vrm/models/* packages/stage-ui/public/assets/fonts/ apps/stage-tamagotchi/public/assets/fonts/ +apps/stage-tamagotchi-tauri/public/assets/fonts/ apps/stage-web/public/assets/fonts/ *.pcm @@ -40,3 +41,11 @@ apps/stage-web/public/assets/fonts/ *.mp3 twitter-session.json + +# Make it easy for devenv users to override their local environment. +# See: https://github.com/moeru-ai/airi/pull/110#discussion_r2024378953 +.direnv +.pre-commit-config.yaml +.envrc +.devenv* +devenv.* diff --git a/docs/src/content/docs/references/Contributing/guide.md b/docs/src/content/docs/references/Contributing/guide.md index e0141bb99..20d72566f 100644 --- a/docs/src/content/docs/references/Contributing/guide.md +++ b/docs/src/content/docs/references/Contributing/guide.md @@ -74,9 +74,9 @@ Hello! Thank you for your interest in contributing to this project. This guide w ## If you have already contributed to this project before -> [!WARNING] -> -> If you haven't clone this repository, skip this section. +:::caution +If you haven't clone this repository, skip this section. +::: Make sure your local repository is up to date with the upstream repository: @@ -117,65 +117,72 @@ corepack enable pnpm install ``` -> [!NOTE] -> -> We would recommend to install [@antfu/ni](https://github.com/antfu-collective/ni) to make your script simpler. -> -> ```shell -> corepack enable -> npm i -g @antfu/ni -> ``` -> -> Once installed, you can -> -> - use `ni` for `pnpm install`, `npm install` and `yarn install`. -> - use `nr` for `pnpm run`, `npm run` and `yarn run`. -> -> You don't need to care about the package manager, `ni` will help you choose the right one. +:::note + +We would recommend to install [@antfu/ni](https://github.com/antfu-collective/ni) to make your script simpler. + +```shell +corepack enable +npm i -g @antfu/ni +``` + +Once installed, you can + +- use `ni` for `pnpm install`, `npm install` and `yarn install`. +- use `nr` for `pnpm run`, `npm run` and `yarn run`. + +You don't need to care about the package manager, `ni` will help you choose the right one. +::: ## Choose the application you want to develop on ### Documentation site ```shell -pnpm -F @proj-airi/docs... dev +pnpm -F @proj-airi/docs dev ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/docs... dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/docs dev +``` + +::: ### Stage web (Frontend for [airi.moeru.ai](https://airi.moeru.ai), or [airi.ayaka.io](https://airi.ayaka.io)) ```shell -pnpm -F @proj-airi/stage-web... dev +pnpm -F @proj-airi/stage-web dev ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/stage-web... dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/stage-web dev +``` + +::: ### Stage Tamagotchi (Electron app for アイリ VTuber) ```shell -pnpm -F @proj-airi/stage-tamagotchi... dev +pnpm -F @proj-airi/stage-tamagotchi dev ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/stage-tamagotchi... dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/stage-tamagotchi dev +``` + +::: ### Telegram bot integration @@ -213,13 +220,15 @@ Run the bot pnpm -F @proj-airi/telegram-bot start ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/telegram-bot... dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/telegram-bot dev +``` + +::: ### Discord bot integration @@ -247,13 +256,15 @@ Run the bot pnpm -F @proj-airi/discord-bot start ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/discord-bot dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/discord-bot dev +``` + +::: ### Minecraft agent @@ -283,33 +294,39 @@ Run the bot pnpm -F @proj-airi/minecraft-bot start ``` -> [!NOTE] -> -> For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can -> -> ```shell -> nr -F @proj-airi/minecraft-bot dev -> ``` +:::note + +For [@antfu/ni](https://github.com/antfu-collective/ni) users, you can + +```shell +nr -F @proj-airi/minecraft-bot dev +``` + +::: ## Commit ### Before commit -> [!CAUTION] -> -> Please make sure lint (static checkers) and TypeScript compilers are satisfied: -> -> ```shell -> pnpm packages:stub && pnpm lint && pnpm typecheck -> ``` +:::caution -> [!NOTE] -> -> If you have [@antfu/ni](https://github.com/antfu-collective/ni) installed, you can use `nr` to run the commands: -> -> ```shell -> nr packages:stub && nr lint && nr typecheck -> ``` +Please make sure lint (static checkers) and TypeScript compilers are satisfied: + +```shell +pnpm packages:stub && pnpm lint && pnpm typecheck +``` + +::: + +:::note + +If you have [@antfu/ni](https://github.com/antfu-collective/ni) installed, you can use `nr` to run the commands: + +```shell +nr packages:stub && nr lint && nr typecheck +``` + +::: ### Commit @@ -326,13 +343,15 @@ git push origin -u You should be able to browse the branch on your fork repository. -> [!NOTE] -> -> If this is your first time contributing with this project, you need to add the upstream repository too: -> -> ```shell -> git remote add upstream https://github.com/moeru-ai/airi.git -> ``` +:::note + +If this is your first time contributing with this project, you need to add the upstream repository too: + +```shell +git remote add upstream https://github.com/moeru-ai/airi.git +``` + +::: ## Creating Pull Request