Start contributing to Project AIRI
Hello! Thank you for your interest in contributing to this project. This guide will help you get started.
Windows setup
-
Download Visual Studio and follow the instructions here: https://rust-lang.github.io/rustup/installation/windows-msvc.html#walkthrough-installing-visual-studio-2022
Make sure to install Windows SDK and C++ build tools when installing Visual Studio.
-
Open PowerShell
-
Install
scoopSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
-
Install
git, Node.js,rustup,msvcthroughscoopscoop install git nodejs rustup # For Rust dependencies # Not required if you are not going to develop on either crates or apps/tamagotchi scoop install main/rust-msvc # Rust & Windows specific rustup toolchain install stable-x86_64-pc-windows-msvc rustup default stable-x86_64-pc-windows-msvc
-
Install
pnpmthroughcorepackcorepack enable corepack prepare pnpm@latest --activate
macOS setup
-
Open Terminal (or iTerm2, Ghostty, Kitty, etc.)
-
Install
git,nodethroughbrewbrew install git node
-
Install
pnpmthroughcorepackcorepack enable corepack prepare pnpm@latest --activate
Linux setup
-
Open terminal
-
Follow nodesource/distributions: NodeSource Node.js Binary Distributions to install
node -
Follow Git to install
git -
Install
pnpmthroughcorepackcorepack enable corepack prepare pnpm@latest --activate -
If you would love to help to develop the desktop version, you will need those dependencies:
sudo apt install \ libssl-dev \ libglib2.0-dev \ libgtk-3-dev \ libjavascriptcoregtk-4.1-dev \ libwebkit2gtk-4.1-dev
Warning
If you haven't cloned this repository, skip this section.
Make sure your local repository is up to date with the upstream repository:
git fetch --all
git checkout main
git pull upstream main --rebaseIf you have a working branch, to make your branch up to date with the upstream repository:
git checkout <your-branch-name>
git rebase mainClick on the Fork button on the top right corner of the moeru-ai/airi page.
git clone https://github.com/<your-github-username>/airi.git
cd airigit checkout -b <your-branch-name>corepack enable
pnpm install
# For Rust dependencies
# Not required if you are not going to develop on either crates or apps/tamagotchi
cargo fetchNote
We would recommend to install @antfu/ni to make your script simpler.
corepack enable
npm i -g @antfu/niOnce installed, you can
- use
niforpnpm install,npm installandyarn install. - use
nrforpnpm run,npm runandyarn run.
You don't need to care about the package manager, ni will help you choose the right one.
pnpm dev:tamagotchiStage Web (Browser version for airi.moeru.ai)
pnpm devpnpm dev:docsA Postgres database is required.
cd services/telegram-bot
docker compose up -dConfigure .env
cp .env .env.localEdit the credentials in .env.local.
Migrate the database
pnpm -F @proj-airi/telegram-bot db:generate
pnpm -F @proj-airi/telegram-bot db:pushRun the bot
pnpm -F @proj-airi/telegram-bot startcd services/discord-botConfigure .env
cp .env .env.localEdit the credentials in .env.local.
Run the bot
pnpm -F @proj-airi/discord-bot startcd services/minecraftStart a Minecraft client, export your world with desired port, and fill-in the port number in .env.local.
Configure .env
cp .env .env.localEdit the credentials in .env.local.
Run the bot
pnpm -F @proj-airi/minecraft-bot startPlease make sure lint (static checkers) and TypeScript compilers are satisfied:
pnpm lint && pnpm typecheckIf you are committing images, consider using AVIF format instead of PNG, JPG etc. You can convert existing images to AVIF by running:
pnpm to-avif <PATH_TO_IMAGE_OR_DIRECTORY1> <PATH_2> <PATH_3> ...git add .
git commit -m "<your-commit-message>"git push origin <your-branch-name> -uYou should be able to browse the branch on your fork repository.
Note
If this is your first time contributing to this project, you need to add the upstream repository too:
git remote add upstream https://github.com/moeru-ai/airi.gitNavigate to moeru-ai/airi page, click on the Pull requests tab, and click on the New pull request button, click on the Compare across forks link, and select your fork repository.
Review the changes, and click on the Create pull request button.
Congratulations! You made your first contribution to this project. You can now wait for the maintainers to review your pull request.