Skip to content
Open
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
11 changes: 11 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["@commitlint/config-angular"],
"rules": {
"type-enum": [
2,
"always",
["chore", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "types", "typings"]
],
"scope-case": [0]
}
}
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.git
.github
.idea
.vscode
compose
coverage
migrations
**/node_modules

**/types
!**/src/types
**/dist

babel.config.cjs
jest-setup.ts
jest.config.cjs
ley.config.mjs
.eslintrc.json
.gitattributes
.gitignore

a.ci.sh
a.sh

LICENSE
**/README.md
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHAT_CHANNEL=channel_id
DECREE_CHANNEL=channel_id
DISCORD_TOKEN=token
EVENT_ROLE=role_id
GUILD_ID=guild_id
PREFIX=!
STAFF_ROLE=role_id
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier", "neon/module"],
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"env": {
"jest": true
},
"globals": {
"NodeJS": "readonly"
},
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-extraneous-class": "off",
"curly": ["error", "all"],
"eqeqeq": ["error", "always", { "null": "ignore" }],
"no-eq-null": "off",
"no-unused-vars": "off",
"import/extensions": "off",
"no-useless-constructor": "off",
"unicorn/require-post-message-target-origin": "off"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
5 changes: 5 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
addReviewers: true
reviewers:
- didinele
numberOfReviewers: 0
runOnDraft: true
48 changes: 48 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- name: 'backlog'
color: '7ef7ef'
- name: 'bug'
color: 'd73a4a'
- name: 'chore'
color: 'ffffff'
- name: 'ci'
color: '0075ca'
- name: 'dependencies'
color: '276bd1'
- name: 'documentation'
color: '0075ca'
- name: 'duplicate'
color: 'cfd3d7'
- name: 'feature request'
color: 'fcf95a'
- name: 'good first issue'
color: '7057ff'
- name: 'has PR'
color: '4b1f8e'
- name: 'help wanted'
color: '008672'
- name: 'in progress'
color: 'ffccd7'
- name: 'in review'
color: 'aed5fc'
- name: 'invalid'
color: 'e4e669'
- name: 'need repro'
color: 'c66037'
- name: 'performance'
color: '80c042'
- name: 'priority:high'
color: 'fc1423'
- name: 'refactor'
color: '1d637f'
- name: 'regression'
color: 'ea8785'
- name: 'semver:major'
color: 'c10f47'
- name: 'semver:minor'
color: 'e4f486'
- name: 'semver:patch'
color: 'e8be8b'
- name: 'tests'
color: 'f06dff'
- name: 'wontfix'
color: 'ffffff'
10 changes: 10 additions & 0 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'PR Automation'
on:
pull_request_target:
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Automatically assign reviewers
if: github.event.action == 'opened'
uses: kentaro-m/auto-assign-action@v1.2.1
22 changes: 22 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync Labels
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/labels.yml'
jobs:
synclabels:
name: Sync Labels
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Sync labels
uses: crazy-max/ghaction-github-labeler@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Quality Check
on: [push, pull_request]
jobs:
quality:
name: Quality Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'yarn'
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn --immutable

- name: Build
run: yarn build

- name: ESLint
run: yarn lint
32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
node_modules/
dist/
types/
coverage/
.nyc_output/
data/
volumes/
worker/
min/
node_modules
.env

.npmrc
*.tsbuildinfo
coverage/*
dist

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
logs
*.log

.vscode/
.idea/
*.env
docs/
*.log
.turbo

tsconfig.tsbuildinfo
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build && yarn lint
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/*
coverage/*
**/dist/*
**/types/*
docs
.yarn/*
.turbo
10 changes: 6 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"endOfLine": "auto",
"printWidth": 150,
"semi": true,
"tabWidth": 4
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

786 changes: 786 additions & 0 deletions .yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: '@yarnpkg/plugin-version'

yarnPath: .yarn/releases/yarn-3.2.1.cjs
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:16-alpine
LABEL name "kingsdecree"

WORKDIR /usr/kingsdecree

RUN apk add --update \
&& apk add --no-cache ca-certificates \
&& apk add --no-cache --virtual .build-deps curl git python3 alpine-sdk

COPY package.json tsconfig.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn

RUN yarn --immutable

COPY src ./src

RUN yarn build

COPY .env ./

CMD ["yarn", "start"]
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.9"
services:
bot:
build: ./
image: kingsdecree:latest
container_name: bot
restart: unless-stopped
stdin_open: true
tty: true
6 changes: 0 additions & 6 deletions nodemon.json

This file was deleted.

58 changes: 43 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,55 @@
{
"name": "tommy-thing-2",
"name": "@chatsift/kingsdecree",
"packageManager": "yarn@3.2.1",
"version": "1.0.0",
"main": "index.js",
"main": "./dist/index.js",
"type": "module",
"license": "MIT",
"scripts": {
"prettier": "npx prettier --write **/*.{ts,js,json,yml,yaml,md}",
"build": "npx tsc",
"dev": "npx nodemon",
"prod": "yarn build && pm2 start ./dist/index.js --name king"
"lint": "eslint src --ext .ts",
"build": "tsc",
"dev-build": "tsc --watch",
"format": "prettier --write src/*.{ts,json}",
"start": "dotenv -e .env -- node --es-module-specifier-resolution=node --enable-source-maps ./dist/index.js",
"prepare": "is-ci || husky install",
"update": "yarn upgrade-interactive"
},
"dependencies": {
"@discordjs/builders": "0.13.0-dev.1648515278-ac4bc3a",
"@discordjs/rest": "^0.3.0",
"common-tags": "^1.8.2",
"discord.js": "^13.6.0",
"dotenv": "^16.0.0",
"winston": "^3.6.0"
"discord.js": "^14.8.0",
"dotenv": "^16.0.3",
"undici": "^5.21.0",
"winston": "^3.8.2"
},
"devDependencies": {
"@commitlint/cli": "^17.5.0",
"@commitlint/config-angular": "^17.4.4",
"@types/common-tags": "^1.8.1",
"nodemon": "^2.0.15",
"prettier": "^2.6.1",
"ts-node": "^10.7.0",
"typescript": "^4.6.3"
"@types/node": "^18.15.10",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"dotenv-cli": "^7.1.0",
"eslint": "^8.36.0",
"eslint-config-neon": "^0.1.41",
"eslint-plugin-typescript-sort-keys": "^2.3.0",
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"prettier": "^2.8.7",
"prettier-eslint": "^15.0.1",
"rimraf": "^4.4.1",
"typescript": "^4.9.5"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.ts": [
"eslint --fix"
],
"*.tsx": [
"eslint --fix"
]
}
}
Loading