Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# # Autobot secrets
DISCORD_BOT_TOKEN=
BOT_ID=
BOT_SECRET=


# # GFC secrets
GFC_INTRO_SURVEY_LINK=


# # Sirrele
ADMIN_1_DISCORD_ID=
# # Pratik
ADMIN_2_DISCORD_ID=


# # Discord; Digital Junkyard
DISCORD_SERVER_ID=
ADMIN_ROLE_ID=
GENERAL_CHAT_CHANNEL_ID=
CHECKINS_VOICE_CHANNEL_ID=
VIRTUAL_OFFICE_VOICE_CHANNEL_ID=
FIRST_RESPONDERS_ROLE_ID=
EMPIRIC_ROLE_ID=
EMPIRIC_DEVS_ROLE_ID=
EMPIRIC_DAILY_REMINDER_THREAD_ID=


# # Notion; GitFitCode's Notion
NOTION_KEY=
NOTION_SUPPORT_TICKETS_DATABASE_ID=
NOTION_SUPPORT_TICKETS_DATABASE_STATUS_ID=
NOTION_SUPPORT_TICKETS_DATABASE_LINK=
NOTION_BACKLOG_DATABASE_ID=
NOTION_BACKLOG_DATABASE_LINK=


# # Open AI
OPENAI_API_KEY=

# # Supabase
SUPABASE_URL=
SUPABASE_ANON_KEY=
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
reviewers:
- "GitFitCode/admins"
- 'GitFitCode/admins'
35 changes: 33 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,43 @@ name: Release
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: 🧹 Lint
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: ⎔ Setup node
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 22

- name: Install pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: 10
run_install: true

- name: 🔬 Lint
run: pnpm lint:strict

- name: 🔎 Type check
run: pnpm typecheck

- name: 💅 Prettier check
run: pnpm format:check

release:
# create a release if the head commit's commit message does NOT starts with `bump:`
if: ${{ ! startsWith(github.event.head_commit.message , 'bump:') }}
# run release if event is push and the head commit's commit message does NOT starts with `bump:`
if: ${{ github.event_name == 'push' && ! startsWith(github.event.head_commit.message , 'bump:') }}
name: ⬆️ Bump version and create changelog with a GitHub release
needs: lint
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm typecheck
pnpm exec lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.13.0
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist
dist
CHANGELOG.md
pnpm-lock.yaml
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"plugins": ["prettier-plugin-organize-imports"],
"printWidth": 100,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"singleQuote": true
"trailingComma": "all"
}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ pnpm i

### Setting up .env

- Create a `.env` file at the root of your project.
```sh
cp .env.example .env
```

```pwsh
copy .env.example .env # pwsh
```

- Populate fields in the `.env` file.

- Sign up on [Keybase](https://keybase.io/)!
- Ask Sirrele, Pratik, or Robert for an invite to the GitFitCode Team in Keybase.
- Ask Sirrele or Pratik for an invite to the GitFitCode Team in Keybase.
- Upon receiving the invite, navigate to the Files section in Keybase.
- Inside Files, look for team -> gitfitcode -> discord bot secrets -> autobot -> `.env`.
- Download or copy contents into your local `.env` file.
Expand All @@ -46,7 +53,7 @@ pnpm i
### Run the bot

```shell
pnpm dev
pnpm dev # the bot is online in the Digital Junkyard discord server
```

## Development
Expand Down
29 changes: 29 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable indent */

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// TODO Add Scope Enum Here
// 'scope-enum': [2, 'always', ['yourscope', 'yourscope']],
'subject-case': [0, 'always', ['sentence-case', 'start-case', 'pascal-case']],
'type-enum': [
2,
'always',
[
'build',
'bump',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'release',
'style',
'test',
],
],
},
};
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

60 changes: 60 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* eslint-disable indent */

import pkg from '@eslint/js';

const { configs } = pkg;

export default [
{
ignores: ['dist/', 'node_modules/', 'eslint.config.js'],
},
configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
},
rules: {
'arrow-spacing': ['warn', { before: true, after: true }],
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'comma-style': 'error',
curly: ['error', 'multi-line', 'consistent'],
'dot-location': ['error', 'property'],
'handle-callback-err': 'off',
indent: ['error', 'tab'],
'keyword-spacing': 'error',
'max-nested-callbacks': ['error', { max: 4 }],
'max-statements-per-line': ['error', { max: 2 }],
'no-console': 'off',
'no-empty-function': 'error',
'no-floating-decimal': 'error',
'no-inline-comments': 'error',
'no-lonely-if': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1, maxBOF: 0 }],
'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
'no-trailing-spaces': ['error'],
'no-var': 'error',
'no-undef': 'off',
'object-curly-spacing': ['error', 'always'],
'prefer-const': 'error',
quotes: ['error', 'single'],
semi: ['error', 'always'],
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'space-in-parens': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': 'error',
yoda: 'error',
},
},
];
25 changes: 20 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@
"clear-commands": "pnpm build && node ./dist/src/scripts/clearRegisteredCommands.js",
"clear-events": "pnpm build && node ./dist/src/scripts/clearScheduledEvents.js",
"dev": "pnpm i && ts-node ./src/index.ts",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint .",
"lint:fix": "eslint . --fix && pnpm format",
"lint:strict": "eslint --max-warnings=0 .",
"pm2": "pnpm build && pm2 start ./dist/src/index.js --name gitfitbot",
"pre-build": "rm -rf ./dist",
"prepare": "husky",
"start": "node ./dist/src/index.js",
"test": "echo 'No tests yet'."
"typecheck": "tsc --pretty --noEmit --incremental false"
},
"author": "GitFitCode",
"license": "GNU GPLv3",
"dependencies": {
"@langchain/core": "latest",
"@langchain/openai": "latest",
"@notionhq/client": "latest",
"@supabase/supabase-js": "latest",
"cron": "latest",
"dayjs": "latest",
"discord-tictactoe": "latest",
Expand All @@ -32,18 +37,28 @@
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"@eslint/js": "latest",
"@types/node": "latest",
"@types/pouchdb-node": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-airbnb-base": "latest",
"eslint-config-airbnb-typescript": "latest",
"husky": "latest",
"lint-staged": "latest",
"prettier": "latest",
"prettier-eslint": "latest",
"prettier-plugin-organize-imports": "latest",
"ts-node": "latest",
"tslib": "latest",
"typescript": "latest"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": [
"eslint --max-warnings=0",
"prettier -w"
],
"**/*.{json,css,scss,md,webmanifest}": [
"prettier -w"
]
},
"engines": {
"node": "22.x",
"pnpm": "10.x"
Expand Down
Loading