Skip to content

Commit

Permalink
refactor: keep it simple (#181)
Browse files Browse the repository at this point in the history
* refactor: keep it simple

* chore: nuke website

* fix: linting

* fix: ci

* chore: simplify imports

* chore: more linting

* chore: cleanup types

* chore: bump version
  • Loading branch information
killbasa authored Dec 10, 2023
1 parent 29bb5c4 commit cf6144f
Show file tree
Hide file tree
Showing 396 changed files with 3,261 additions and 12,196 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dotfiles.installCommand": "~/dotfiles/install.sh"
},
"extensions": [
"bufbuild.vscode-buf",
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"yzhang.markdown-all-in-one",
Expand Down
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ coverage/
dist/
build/
infra/
k8s/
node_modules/
tests/
protos/
Expand All @@ -22,8 +21,6 @@ scripts/*.sh
.env*
.gitattributes
.gitignore
go.work
go.work.sum
LICENSE
README.md
vitest.config.ts
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
assets/
coverage/
dist/
build/
infra/
node_modules/
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line tsdoc/syntax
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ['@kbotdev/eslint-config', 'turbo'],
Expand Down
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ $ cd kbot

```bash
$ cp apps/bot/.env.example apps/bot/.env
$ cp apps/web/.env.example apps/web/.env
```

### 3. Install dependencies
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
patreon: kbot
ko_fi: killbasa
13 changes: 0 additions & 13 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@
- "apps/bot/**"
- "protos/**"

"apps:discord-status":
- "apps/discord-status/**"

"apps:docs":
- "apps/docs/**"

"apps:web":
- "apps/web/**"
- "protos/**"

"kubernetes":
- "k8s/**"

"packages":
- "packages/**"

"protos":
- "protos/**"
10 changes: 3 additions & 7 deletions .github/workflows/bot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
paths:
- "apps/bot/**"
- "packages/**"
- "protos/**"
- "!**/README.md"

jobs:
Expand All @@ -20,19 +19,16 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4.0.0

- name: Set up Buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}

- name: Set up NodeJS
uses: actions/setup-node@v4.0.0
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn workspaces focus @kbotdev/apps @kbotdev/bot
run: |
yarn workspaces focus @kbotdev/apps @kbotdev/bot
yarn turbo db:generate
- name: Lint
run: yarn turbo lint --filter=@kbotdev/bot
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/proto-ci.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/proto-push.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/web-build.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/web-ci.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## Builds ##
dist/
build/

## Development ##
infra/
Expand Down
9 changes: 9 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
'*.{mjs,cjs,js,ts}': [
'eslint --fix --ext js,ts', //
'prettier --write --log-level=warn "**/*.{mjs,cjs,js,ts}"'
],
'*.{json,yml,yaml,md}': [
'prettier --write --log-level=warn "**/*.{json,yml,yaml,md}"' //
]
};
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ node_modules/
.all-contributorsrc
.nvmrc
yarn.lock
buf.lock
LICENSE
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.tsdk": "./node_modules/typescript/lib",
"eslint.format.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "typescript", "svelte"],
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"eslint.validate": ["javascript", "typescript"],
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
Expand Down
670 changes: 335 additions & 335 deletions .yarn/releases/yarn-4.0.1.cjs → .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

npmScopes:
buf:
npmRegistryServer: "https://buf.build/gen/npm/v1"

yarnPath: .yarn/releases/yarn-4.0.1.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ A fill list of features can be found in the [documentation](https://docs.kbot.ca
- `/apps`
- `/apps/bot` - Discord bot
- `/apps/docs` - Documentation for the bot
- `/apps/web` - Dashboard to edit bot settings
- `/packages` - Shared packages
- `/protos` - Protobuf files

## Links 🔗

Expand All @@ -42,7 +40,6 @@ A fill list of features can be found in the [documentation](https://docs.kbot.ca

- [Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/)
- [Docker](https://www.docker.com/community-edition)
- [Buf](https://github.com/bufbuild/buf)
- [Redis](https://redis.io/)
- [PostgreSQL](https://www.postgresql.org/)
- [Meilisearch](https://www.meilisearch.com/)
Expand Down
2 changes: 0 additions & 2 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@

- `/apps`
- `/apps/bot` - Discord bot
- `/apps/discord-status` - Service to send alerts about Discord incidents
- `/apps/docs` - Documentation for the bot
- `/apps/web` - Dashboard to edit bot settings
8 changes: 8 additions & 0 deletions apps/bot/.lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const config = require('../../.lintstagedrc.js');

module.exports = {
...config,
'*.prisma': [
'prisma format' //
]
};
8 changes: 2 additions & 6 deletions apps/bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ ENV NODE_ENV=production
WORKDIR /temp

RUN apk add -q --no-cache openssl libc6-compat cairo-dev jpeg-dev pango-dev giflib-dev python3 g++ make curl && \
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v1.21.0/buf-$(uname -s)-$(uname -m)" \
-o "/usr/local/bin/buf" && \
chmod +x "/usr/local/bin/buf" && \
apk update

COPY .yarn .yarn/
Expand Down Expand Up @@ -51,8 +47,8 @@ USER kbot

COPY --from=deps /temp/node_modules node_modules/
COPY --from=deps /temp/apps/bot/assets assets/
COPY --from=deps /temp/packages/prisma/prisma/migrations prisma/migrations/
COPY --from=deps /temp/packages/prisma/prisma/schema.prisma prisma/schema.prisma
COPY --from=deps /temp/apps/bot/prisma/migrations prisma/migrations/
COPY --from=deps /temp/apps/bot/prisma/schema.prisma prisma/schema.prisma
COPY --from=deps /temp/apps/bot/dist dist/
COPY --from=deps /temp/apps/bot/package.json ./

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ services:
- "127.0.0.1:5432:5432"

redis:
image: redis:7.0.11-alpine
image: redis:7.0.9-alpine
container_name: redis_kbot
command: ["redis-server", "--requirepass password"]
ports:
- "127.0.0.1:6379:6379"

meili:
image: getmeili/meilisearch:v1.1.1
image: getmeili/meilisearch:v1.0.2
container_name: meili_kbot
ports:
- "127.0.0.1:7700:7700"
Loading

0 comments on commit cf6144f

Please sign in to comment.