Skip to content

Commit

Permalink
chore: use bun and biomejs (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
phorcys420 authored Aug 10, 2024
2 parents cee9af5 + 3c6a72f commit 17e4238
Show file tree
Hide file tree
Showing 22 changed files with 175 additions and 1,502 deletions.
20 changes: 18 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm"
"name": "Codercord",
"image": "oven/bun:debian",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {}
},
"customizations": {
"vscode": {
"extensions": ["oven.bun-vscode", "biomejs.biome"],
"settings": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
}
}
},
"postCreateCommand": "bun install",
"remoteUser": "codercord"
}
9 changes: 0 additions & 9 deletions .dockerignore

This file was deleted.

9 changes: 9 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
commit-message:
prefix: "chore:"
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ci

on:
push:
branches: ["main"]
pull_request:

jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: format and lint
run: |
bun install --frozen-lockfile
bun format:ci
bun lint:ci
90 changes: 0 additions & 90 deletions .github/workflows/docker-publish.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .markdownlint.json

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

14 changes: 0 additions & 14 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["oven.bun-vscode", "biomejs.biome"]
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
"editor.defaultFormatter": "biomejs.biome"
}
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
# Codercord

A Discord bot for the Coder community server written in JavaScript.
A Discord bot for the Coder community server written in Typescript.

## How to run

1. Get the [Dart SDK](https://dart.dev/get-dart)
2. Clone the repository
1. Clone the repository

```sh
git clone [email protected]:coder/codercord.git
cd codercord
```

3. Run the project
2. Run the project

```sh
dart run
```

You can also pre-compile the binary instead of using `dart run` everytime

```sh
dart compile exe bin/codercord.dart -o codercord
./codercord
```
TODO: Add instructions to run the project

## Configuration

Expand All @@ -34,3 +24,7 @@ Environment variables :
(relative to process working directory if no absolute path is provided)
Example `config.toml` provided [here](https://github.com/coder/codercord/blob/main/config.toml.example)
## Contributing
Use the `.devcontainer` to develop in a containerized environment.
4 changes: 2 additions & 2 deletions assets/tags.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"no_programming": "This is is **NOT** a programming help server !\nYou are looking at the <https://coder.com> discord server, which is a product that lets you use remote machines as development environments.\n\nyou can ask programming-related questions at <https://discord.gg/code> or <https://discord.gg/programming>",
"post_status": "You can close posts by running ``/close`` or reopen them by runing ``/reopen``"
"no_programming": "This is is **NOT** a programming help server !\nYou are looking at the <https://coder.com> discord server, which is a product that lets you use remote machines as development environments.\n\nyou can ask programming-related questions at <https://discord.gg/code> or <https://discord.gg/programming>",
"post_status": "You can close posts by running ``/close`` or reopen them by runing ``/reopen``"
}
29 changes: 29 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
"organizeImports": {
"enabled": true
},

"files": {
"ignore": ["package.json", "bun.lockb", "*.md"]
},

"formatter": {
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 80
},

"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},

"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
Binary file added bun.lockb
Binary file not shown.
19 changes: 0 additions & 19 deletions eslint.config.js

This file was deleted.

29 changes: 12 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@
"main": "dist/index.js",
"type": "module",
"scripts": {
"start": "pnpm build && node .",
"build": "rimraf dist && tsc",
"lint": "eslint .",
"lint:fix": "pnpm lint --fix",
"format": "prettier --check --write ."
"start": "bun .",
"format": "biome format --write",
"format:ci": "biome format --reporter=github --verbose",
"lint": "biome lint --write",
"lint:ci": "biome lint --reporter=github --verbose"
},
"keywords": [],
"author": "",
"author": "github.com/coder",
"license": "CC0-1.0",
"devDependencies": {
"@eslint/compat": "^1.1.0",
"@eslint/js": "^9.5.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.14.2",
"eslint": "^9.5.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"typescript-eslint": "^7.13.0"
"@biomejs/biome": "1.8.2",
"typescript": "5.5.2"
},
"dependencies": {
"@uwu/configmasher": "^2.0.0",
"discord.js": "^14.15.3"
}
"@uwu/configmasher": "2.0.0",
"discord.js": "14.15.3"
},
"trustedDependencies": ["@biomejs/biome"]
}
Loading

0 comments on commit 17e4238

Please sign in to comment.