Contributing
Hello! Thank you for your interest in contributing to this project. This guide will help you get started.
Prerequisites
Windows setup
-
Open PowerShell
-
Install
scoop
Terminal window Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression -
Install
git
,node
throughscoop
Terminal window scoop install git nodejs -
Install
pnpm
throughcorepack
Terminal window corepack enablecorepack prepare pnpm@latest --activate
macOS setup
-
Open Terminal, (or iTerm2, Ghostty, Kitty, etc.)
-
Install
git
,node
throughbrew
Terminal window brew install git node -
Install
pnpm
throughcorepack
Terminal window corepack enablecorepack 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
pnpm
throughcorepack
Terminal window corepack enablecorepack prepare pnpm@latest --activate
If you have already contributed to this project before
[!WARNING]
If you haven’t clone this repository, skip this section.
Make sure your local repository is up to date with the upstream repository:
git fetch -allgit checkout maingit pull upstream main --rebase
If you have a working branch, to make your branch up to date with the upstream repository:
git checkout <your-branch-name>git rebase main
Fork this project
Click on the Fork button on the top right corner of the moeru-ai/airi page.
Clone
git clone https://github.com/<your-github-username>/airi.gitcd airi
Create your working branch
git checkout -b <your-branch-name>
Install dependencies
corepack enablepnpm install
[!NOTE]
We would recommend to install @antfu/ni to make your script simpler.
Terminal window
corepack enablenpm i -g @antfu/niOnce installed, you can
- use
ni
forpnpm install
,npm install
andyarn install
.- use
nr
forpnpm run
,npm run
andyarn 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
pnpm -F @proj-airi/docs... dev
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/docs... dev
Stage web (Frontend for airi.moeru.ai, or airi.ayaka.io)
pnpm -F @proj-airi/stage-web... dev
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/stage-web... dev
Stage Tamagotchi (Electron app for アイリ VTuber)
pnpm -F @proj-airi/stage-tamagotchi... dev
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/stage-tamagotchi... dev
Telegram bot integration
A Postgres database is required.
cd services/telegram-botdocker compose up -d
Configure .env
cp .env .env.local
Edit the credentials in .env.local
.
Migrate the database
pnpm -F @proj-airi/telegram-bot db:generatepnpm -F @proj-airi/telegram-bot db:push
Generate bundles for Monorepo packages
pnpm packages:stub
Run the bot
pnpm -F @proj-airi/telegram-bot start
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/telegram-bot... dev
Discord bot integration
cd services/discord-bot
Configure .env
cp .env .env.local
Edit the credentials in .env.local
.
Generate bundles for Monorepo packages
pnpm packages:stub
Run the bot
pnpm -F @proj-airi/discord-bot start
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/discord-bot dev
Minecraft agent
cd services/minecraft
Start a Minecraft client, export your world with desired port, and fill-in the port number in .env.local
.
Configure .env
cp .env .env.local
Edit the credentials in .env.local
.
Generate bundles for Monorepo packages
pnpm packages:stub
Run the bot
pnpm -F @proj-airi/minecraft-bot start
[!NOTE]
For @antfu/ni users, you can
Terminal window
nr -F @proj-airi/minecraft-bot dev
Commit
Before commit
[!CAUTION]
Please make sure lint (static checkers) and TypeScript compilers are satisfied:
Terminal window
pnpm packages:stub && pnpm lint && pnpm typecheck
[!NOTE]
If you have @antfu/ni installed, you can use
nr
to run the commands:Terminal window
nr packages:stub && nr lint && nr typecheck
Commit
git add .git commit -m "<your-commit-message>"
Push to your fork repository
git push origin <your-branch-name> -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:
Terminal window
git remote add upstream https://github.com/moeru-ai/airi.git
Creating Pull Request
Navigate 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.
Whooo-ya! You made it!
Congratulations! You made your first contribution to this project. You can now wait for the maintainers to review your pull request.