Skip to content

Commit

Permalink
feat: create config packages
Browse files Browse the repository at this point in the history
  • Loading branch information
killbasa committed Jun 7, 2023
1 parent c9f9b52 commit 73bfe9e
Show file tree
Hide file tree
Showing 49 changed files with 3,908 additions and 3,280 deletions.
4 changes: 1 addition & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,ts}]
indent_size = 4
indent_style = tab

[*.{yml,yaml}]
indent_size = 2
indent_style = space
indent_size = 2
7 changes: 7 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ['@kbotdev/eslint-config'],
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname
}
};
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

22 changes: 0 additions & 22 deletions .github/THIRD_PARTY_LICENSES.md

This file was deleted.

15 changes: 4 additions & 11 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"group:allNonMajor"
],
"schedule": [
"before 10am on Saturday"
],
"labels": [
"dependencies"
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "group:allNonMajor"],
"schedule": ["before 10am on Saturday"],
"labels": ["dependencies"]
}
16 changes: 10 additions & 6 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CD
on:
push:
tags:
- '@kbotdev/*@[0-9]+.[0-9]+.[0-9]+'
- "@kbotdev/*@[0-9]+.[0-9]+.[0-9]+"

jobs:
release:
Expand All @@ -22,13 +22,13 @@ jobs:
- name: Create archive
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'release.zip'
type: "zip"
filename: "release.zip"

- name: Create release
uses: ncipollo/[email protected]
with:
artifacts: 'release.zip'
artifacts: "release.zip"
token: ${{ secrets.GITHUB_TOKEN }}

publish:
Expand All @@ -41,8 +41,12 @@ jobs:
fail-fast: false
matrix:
include:
- package: '@kbotdev/menus'
folder: 'menus'
- package: "@kbotdev/eslint-config"
folder: "eslint-config"
- package: "@kbotdev/prettier-config"
folder: "prettier-config"
- package: "@kbotdev/ts-config"
folder: "ts-config"

steps:
- name: Check out Git repository
Expand Down
90 changes: 5 additions & 85 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
name: Lint
check:
name: Check
runs-on: ubuntu-latest

steps:
Expand All @@ -25,27 +25,7 @@ jobs:
- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Run lint
run: yarn lint

build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: yarn

- name: Install dependencies
Expand All @@ -54,72 +34,12 @@ jobs:
- name: Run build
run: yarn build

docs:
name: Documentation
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Generate documentation
run: yarn docs

test:
name: Test
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn --immutable
- name: Run lint
run: yarn lint

- name: Run tests
run: yarn test

# - name: Save coverage report
# uses: actions/upload-artifact@v3
# with:
# name: nodejs-coverage
# path: coverage/

#coverage:
# name: Coverage
# needs: test
# runs-on: ubuntu-latest

# steps:
# - name: Check out Git repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 2

# - name: Download NodeJS Unit Test Coverage report
# uses: actions/download-artifact@v3
# with:
# name: nodejs-coverage
# path: coverage/

# - name: Codecov upload
# uses: codecov/[email protected]
# with:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ package-lock.json
## intellij ##
.idea/

## VSCode ##
.vscode

## Logs ##
logs
*.log
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
yarn lint-staged
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
...require('@kbotdev/prettier-config'),
overrides: [
{
files: '*.{yml,yaml}',
options: {
singleQuote: false,
useTabs: false
}
}
]
};
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.format.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
823 changes: 0 additions & 823 deletions .yarn/releases/yarn-3.3.1.cjs

This file was deleted.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.0.cjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ nodeLinker: node-modules

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

yarnPath: .yarn/releases/yarn-3.3.1.cjs
yarnPath: .yarn/releases/yarn-3.6.0.cjs
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://gitlab.com/kbotdev/utilities/-/blob/main/LICENSE)

[![npm](https://img.shields.io/npm/v/@kbotdev/menus?color=crimson&logo=npm&label=@kbotdev/menus)](https://www.npmjs.com/package/@kbotdev/menus)
[![npm](https://img.shields.io/npm/v/@kbotdev/eslint-config?color=crimson&logo=npm&label=@kbotdev/eslint-config)](https://www.npmjs.com/package/@kbotdev/eslint-config)

[![npm](https://img.shields.io/npm/v/@kbotdev/prettier-config?color=crimson&logo=npm&label=@kbotdev/prettier-config)](https://www.npmjs.com/package/@kbotdev/prettier-config)

[![npm](https://img.shields.io/npm/v/@kbotdev/ts-config?color=crimson&logo=npm&label=@kbotdev/ts-config)](https://www.npmjs.com/package/@kbotdev/ts-config)

</div>
85 changes: 41 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
{
"name": "@kbotdev/utilities",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "turbo run build --no-daemon",
"test": "turbo run ci:test --no-daemon",
"lint": "turbo run ci:lint --no-daemon",
"format": "turbo run format --no-daemon",
"docs": "turbo run docs --no-daemon"
},
"devDependencies": {
"@microsoft/tsdoc": "^0.14.2",
"@sapphire/eslint-config": "^4.4.1",
"@sapphire/framework": "^4.4.0",
"@sapphire/prettier-config": "^1.4.5",
"@sapphire/ts-config": "^3.3.4",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitest/coverage-c8": "^0.30.1",
"discord-api-types": "^0.37.38",
"discord.js": "^14.9.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.1",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"turbo": "^1.9.1",
"typedoc": "^0.24.4",
"typescript": "^4.9.5",
"vitest": "^0.30.1"
},
"lint-staged": {
"*.{mjs,ts,js}": [
"eslint --fix --ext mjs,js,ts",
"prettier --write --loglevel=warn \"{src,tests}/**/*.{js,ts,json}\""
]
},
"prettier": "@sapphire/prettier-config",
"packageManager": "[email protected]"
"name": "@kbotdev/utilities",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"update": "yarn upgrade-interactive",
"build": "turbo run build",
"test": "turbo run test",
"lint": "turbo run lint",
"format": "turbo run format"
},
"devDependencies": {
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
"@kbotdev/eslint-config": "workspace:^",
"@kbotdev/prettier-config": "workspace:^",
"@kbotdev/ts-config": "workspace:^",
"eslint": "^8.42.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"turbo": "^1.10.2",
"typescript": "^5.1.3",
"vitest": "^0.32.0"
},
"lint-staged": {
"*.{mjs,cjs,js,ts}": [
"eslint --fix --ext js,ts",
"prettier --write --loglevel=warn \"**/*.{mjs,cjs,js,ts}\""
],
"*.{json,yml,yaml,md}": [
"prettier --write --loglevel=warn \"**/*.{json,yml,yaml,md}\""
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 73bfe9e

Please sign in to comment.