Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: upgrade to v3 #3

Merged
merged 9 commits into from
Feb 6, 2024
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.ts]
quote_type = single
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
/lib
/resources
/website
109 changes: 109 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/no-cycle": ["error", { "maxDepth": "∞" }],
"prettier/prettier": "error",
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value=/^\\./][source.value!=/\\.(js(on(c)?)?|(s)?css|svg|ico)$/]",
"message": "Local imports must have the explicit extension"
}
],
"max-len": [
"error",
{
"code": 80,
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"eol-last": ["error", "always"],
"import/no-default-export": "error",
"eqeqeq": [2, "always"],
"no-var": 2,
"block-scoped-var": 2,
"no-async-promise-executor": 2,
"no-bitwise": [2, { "allow": ["~"] }],
"no-duplicate-imports": [2, { "includeExports": true }],
"no-eq-null": 2,
"no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 0 }],
"no-template-curly-in-string": 2,
"no-unneeded-ternary": 2,
"quote-props": [2, "as-needed"],
"require-await": 2,
"rest-spread-spacing": [2, "never"],
"semi-spacing": 2,
"space-before-function-paren": [
2,
{ "anonymous": "always", "named": "never", "asyncArrow": "always" }
],
"space-unary-ops": 2,
"yoda": 2,
"no-const-assign": 2,
"no-extra-semi": 2,
"for-direction": 2,
"no-eval": 2,
"no-empty": ["error", { "allowEmptyCatch": true }]
},
"env": {
"browser": false,
"node": true
},
"overrides": [
{
"files": ["*.ts"],
"rules": {
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"@typescript-eslint/no-empty-function": [
"error",
{ "allow": ["arrowFunctions"] }
]
}
},
{
"files": ["*.js"],
"parserOptions": {
"project": null
},
"rules": {
"semi": ["error", "always"],
"quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"no-unused-vars": 2
}
}
],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"extensions": [".js", ".ts"]
}
}
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
website/* linguist-vendored
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [wellwelwel]
20 changes: 0 additions & 20 deletions .github/assets/readme/mysql2.svg

This file was deleted.

20 changes: 0 additions & 20 deletions .github/assets/readme/orm.svg

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ci-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'CI - Website'
on:
pull_request:
paths:
- 'website/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Actions - Checkout
uses: actions/checkout@v3

- name: Actions - Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Installing Dependencies
run: cd website && npm ci

- name: Lint Checking
run: cd website && npm run lintcheck

- name: Checking Types
run: cd website && npm run typecheck

- name: Run Unit Tests
run: cd website && npm run test:unit

- name: Checking Build
run: cd website && npm run build
76 changes: 9 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: ➕ Actions - Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'

- name: ➕ Cache dependencies
uses: actions/cache@v3
Expand All @@ -26,75 +26,17 @@ jobs:
- name: 📦 Installing Dependencies
run: npm ci

- name: 🐳 Building MySQL Container Container
run: docker-compose -f ./.github/workflows/docker/docker-compose.yml up -d

- name: 🤹🏻‍♀️ Building the Project
run: npm run build

- name: 🤹🏻‍♀️ Building Tests
run: npm run test:build

- name: 🥷🏻 Waiting for MySQL to be Ready for Connections
run: sleep 8

- name: 🧪 Testing Services - Insert
run: npm run test:insert

- name: 🧪 Testing Services - Delete
run: npm run test:delete
- name: 🤹🏻‍♀️ ESLint Check
run: npm run eslint:checker

- name: 🧪 Testing Services - Update
run: npm run test:update
- name: 🤹🏻‍♀️ Prettier Check
run: npm run prettier:checker

- name: 🧪 Testing Services - Select
run: npm run test:select

- name: 🧪 Testing Services - Original Connection
run: npm run test:original

Publish:
runs-on: ubuntu-latest
needs: [CI]
if: github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'v')
steps:
- name: ➕ Actions - Checkout
uses: actions/checkout@v3

- name: ➕ Actions - Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: ➕ Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: 📦 Installing Dependencies
run: npm ci
- name: 🐳 Building MySQL Container Container
run: docker-compose -f ./test/docker-compose.yml up -d

- name: 🤹🏻‍♀️ Building the Project
run: npm run build

- name: 📂 Checking "lib"
run: |
if [ ! -d "./lib" ]; then
echo "Directory ./lib doesn't exist"
exit 1
fi

- name: 📂 Checking "lib/index.js"
run: |
if [ ! -f "./lib/index.js" ]; then
echo "File ./lib.index.js doesn't exist"
exit 1
fi

- name: 📥 Publishing Package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 🧪 Testing
run: npm run test
6 changes: 0 additions & 6 deletions .github/workflows/docker/database/pokemons.sql

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/docker/docker-compose.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'GitHub Pages'
on:
push:
branches:
- main
paths:
- 'website/**'
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Actions - Checkout
uses: actions/checkout@v3

- name: Actions - Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Installing Dependencies
run: cd website && npm ci

- name: Checking Types
run: cd website && npm run typecheck

- name: Run Unit Tests
run: cd website && npm run test:unit

- name: Building Site
run: cd website && npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
Loading
Loading