-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Quiddlee/feature/add-ci-cd-pipeline
Feature/add ci cd pipeline
- Loading branch information
Showing
31 changed files
with
8,842 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{ts, tsx}] | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 2 | ||
rulers = 80, 100, 120 | ||
|
||
[{package.json}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'airbnb', | ||
'airbnb-typescript', | ||
'airbnb/hooks', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:import/recommended', | ||
"plugin:import/typescript", | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts', 'tailwind.config.js', 'postcss.config.js', '.prettierrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
project: ['tsconfig.json'], | ||
tsconfigRootDir: __dirname, | ||
ecmaVersion: 2021, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['react', 'import', 'react-refresh', '@typescript-eslint', 'simple-import-sort', 'prettier'], | ||
rules: { | ||
"import/no-extraneous-dependencies": 0, | ||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
'sort-imports': ['error', {ignoreCase: true, ignoreDeclarationSort: true}], | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
['external', 'builtin'], | ||
'internal', | ||
['sibling', 'parent'], | ||
'index', | ||
], | ||
pathGroups: [ | ||
{ | ||
pattern: '@(react|react-native)', | ||
group: 'external', | ||
position: 'before', | ||
}, | ||
{ | ||
pattern: '@src/**', | ||
group: 'internal', | ||
}, | ||
], | ||
pathGroupsExcludedImportTypes: ['internal', 'react'], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
settings: { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [ | ||
".ts", | ||
".tsx" | ||
] | ||
}, | ||
'import/resolver': { | ||
typescript: { | ||
alwaysTryTypes: true, | ||
project: './tsconfig.json', | ||
}, | ||
node: { | ||
path: ['./src'], | ||
extensions: ['.js','.jsx','.ts','.tsx'] | ||
}, | ||
}, | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Setup Continuous Integration" | ||
description: "Cache Dependencies" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "npm" | ||
|
||
- name: Cache NPM Dependencies | ||
uses: actions/cache@v3 | ||
id: cache-primes | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## What type of PR is this? (select all that apply) | ||
|
||
- [ ] 🍕 Feature | ||
- [ ] 🐛 Bug Fix | ||
- [ ] 🚧 Breaking Change | ||
- [ ] 🧑💻 Code Refactor | ||
- [ ] 📝 Documentation Update | ||
|
||
## Description | ||
|
||
## Related Tickets & Documents | ||
<!-- | ||
For pull requests that relate or close an issue, please include them | ||
below. We like to follow [Github's guidance on linking issues to pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). | ||
For example having the text: "closes #1234" would connect the current pull | ||
request to issue 1234. And when we merge the pull request, Github will | ||
automatically close the issue. | ||
--> | ||
|
||
- Related Issue # | ||
- Closes # | ||
|
||
## Screenshots, Recordings | ||
|
||
_Please replace this line with any relevant images for UI changes._ | ||
|
||
## Added/updated tests? | ||
|
||
- [ ] 👌 Yes | ||
- [ ] 🙅♂️ No, because they aren't needed | ||
- [ ] 🙋♂️ No, because I need help | ||
|
||
## [optional] Are there any post deployment tasks we need to perform? | ||
|
||
## [optional] What gif best describes this PR or how it makes you feel? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
NODE_VERSION: 18.16.0 | ||
|
||
jobs: | ||
if_merged: | ||
if: github.event.pull_request.merged == true | ||
name: Build And Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Continuous integration | ||
uses: ./.github/actions/ci-setup | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
env: | ||
NODE_VERSION: 18.16.0 | ||
|
||
jobs: | ||
linting: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Continuous integration | ||
uses: ./.github/actions/ci-setup | ||
|
||
- name: Lint Application | ||
run: npm run lint | ||
|
||
type-check: | ||
name: Types | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Continuous Integration | ||
uses: ./.github/actions/ci-setup | ||
|
||
- name: Check Application Types | ||
run: npm run type-check | ||
|
||
tests: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Continuous integration | ||
uses: ./.github/actions/ci-setup | ||
|
||
- name: test | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run prepush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
tabWidth: 2, | ||
semi: true, | ||
singleQuote: true, | ||
printWidth: 120, | ||
endOfLine: 'auto', | ||
arrowParens: 'always', | ||
bracketSpacing: true, | ||
tailwindConfig: './tailwind.config.js', | ||
plugins: [require.resolve("prettier-plugin-tailwindcss")], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
# Soon here will be readme for our graphiql project! | ||
# React + TypeScript + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.