Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal authored Feb 10, 2024
0 parents commit 15815bc
Show file tree
Hide file tree
Showing 44 changed files with 7,181 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.github
.vscode
dist
node_modules
29 changes: 29 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': ['off', { allowConstantExport: true }],
'react/prop-types': 'off',
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['../tsconfig.json', '../tsconfig.node.json'],
tsconfigRootDir: './src',
},
settings: {
react: {
version: 'detect',
},
},
};
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Check

on:
workflow_call:
inputs:
fail-on-error:
description: 'Fail on error'
required: false
default: false
type: boolean

workflow_dispatch:
inputs:
fail-on-error:
description: 'Fail on error'
required: false
default: false
type: boolean

jobs:
build:
name: Build Check
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Use Dev Cache
id: dev-cache
uses: actions/cache@v3
env:
cache-name: cache-dev
with:
# Path for node_modules
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{steps.dev-cache.outputs.cache-hit != 'true'}}
name: Install Dependencies
run: pnpm install

- name: Build Check
run: pnpm run build
continue-on-error: ${{ !inputs.fail-on-error }}

27 changes: 27 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Development CI/CD

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, edited, ready_for_review]

push:
branches: [main]

jobs:
build:
uses: ./.github/workflows/build.yml
with:
fail-on-error: true

prettier:
needs: build
uses: ./.github/workflows/prettier.yml
with:
fail-on-error: true

eslint:
needs: build
uses: ./.github/workflows/eslint.yml
with:
fail-on-error: true
53 changes: 53 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Eslint Check

on:
workflow_call:
inputs:
fail-on-error:
description: 'Fail on error'
required: false
default: false
type: boolean

jobs:
eslint:
name: Eslint Check
strategy:
matrix:
node-version: [18]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Use Dev Cache
id: dev-cache
uses: actions/cache@v3
env:
cache-name: cache-dev
with:
# Path for node_modules
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{steps.dev-cache.outputs.cache-hit != 'true'}}
name: Install Dependencies
run: pnpm install

- name: Eslint Check
run: pnpm lint
continue-on-error: ${{ github.event.inputs.fail-on-error != 'true'}}
53 changes: 53 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Prettier Check

on:
workflow_call:
inputs:
fail-on-error:
description: 'Fail on error'
required: false
default: false
type: boolean

jobs:
prettier:
name: Prettier Check
strategy:
matrix:
node-version: [18]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Use Dev Cache
id: dev-cache
uses: actions/cache@v3
env:
cache-name: cache-dev
with:
# Path for node_modules
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{steps.dev-cache.outputs.cache-hit != 'true'}}
name: Install Dependencies
run: pnpm install

- name: Prettier Check
run: pnpm format
continue-on-error: ${{ !inputs.fail-on-error }}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.github
.vscode
dist
node_modules
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": true,
"endOfLine": "auto",
"jsxSingleQuote": true,
"printWidth": 130,
"semi": true,
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 3,
"trailingComma": "es5",
"useTabs": true,
"vueIndentScriptAndStyle": true
}
Loading

0 comments on commit 15815bc

Please sign in to comment.