Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
glekner committed Jan 12, 2022
1 parent 5f64c7d commit e6a1a4e
Show file tree
Hide file tree
Showing 30 changed files with 13,138 additions and 102 deletions.
8 changes: 8 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version = 1

[[analyzers]]
name = "javascript"
enabled = true

[analyzers.meta]
plugins = ["react"]
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
dist/
node_modules/
types/
68 changes: 68 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "react-hooks", "prettier", "simple-import-sort"],
"settings": {
"react": {
"version": "latest"
},
"import/resolver": {
"typescript": {}, // this loads <rootdir>/tsconfig.json to eslint
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"react/prop-types": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"simple-import-sort/exports": "error",
"@typescript-eslint/no-shadow": ["error"],
"simple-import-sort/imports": [
"warn",
{
"groups": [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
],
// Packages
["^react", "^\\w"],
// Internal packages.
["^(@|config/)(/*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"]
]
}
]
}
}
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!---
Thanks for creating a Pull Request 💖!
Please read the following before submitting:
- PRs that adds new external dependencies might take a while to review.
- Keep your PR as small as possible.
- Limit your PR to one type (feature, refactoring, ci, or bugfix)
-->

## 📝 Description

> Add a brief description
## 🎥 Demo

> Please add a video or an image of the behavior/changes
46 changes: 46 additions & 0 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Yarn
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
- run: yarn install
- run: yarn build

unit-test:
name: unit-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Yarn
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
- run: yarn install

- name: Run Unit Tests
run: yarn test-cov

- name: Coverage Upload
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/pr_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR
on:
pull_request_target:
types:
- labeled
- unlabeled
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Merge Comment
if: github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: "${{ secrets.BOT_PAT }}"
header: 'pr-status'
recreate: true
message: |
✨PR Status ✨
| Condition | |
| ------------- | ------------- |
| Has Required Labels `approved, lgtm` | ${{ contains( github.event.pull_request.labels.*.name, 'approved') &&
contains( github.event.pull_request.labels.*.name, 'lgtm') && '✅' || '❌' }} |
| No Blocking Labels `wip, hold` | ${{ (contains( github.event.pull_request.labels.*.name, 'wip') ||
contains( github.event.pull_request.labels.*.name, 'hold')) && '❌' || '✅' }} |
_This Pull Request will not merge until all required tests have passed_
- name: Auto Merge
id: automerge
uses: 'pascalgn/[email protected]'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
MERGE_LABELS: 'approved,lgtm,!WIP,!hold'
MERGE_METHOD: squash
107 changes: 107 additions & 0 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: PR
on:
pull_request_target:
types:
- opened
- edited
- ready_for_review
- synchronize
issue_comment:
types: [created, edited]
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Remove LGTM Label if new push is made
if: |
github.event_name == 'pull_request_target' && github.event.action == 'synchronize' &&
contains(github.event.pull_request.labels.*.name, 'lgtm')
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
remove-labels: 'lgtm'

- name: Add Bug label / comment trigger
if: |
contains(github.event.pull_request.title, 'bug') ||
(contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/bug'))
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
add-labels: 'bug'

- name: Add Size label
if: github.event_name == 'pull_request_target'
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.BOT_PAT }}"

- name: Add WIP label / comment trigger
if: |
contains(github.event.pull_request.title, 'wip') ||
(contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/wip'))
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
add-labels: 'WIP'

- name: Remove WIP label
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/remove wip')
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
remove-labels: 'WIP'

- name: Checkout
uses: actions/checkout@v2

- name: Get Approvers
id: approvers
run: echo ::set-output name=approvers::$(cat ./OWNERS)

- name: Add Approved label
if: |
contains(github.event.comment.html_url, '/pull/') &&
(contains(github.event.comment.body, '/approve') || contains(github.event.comment.body, '/lgtm')) &&
contains(steps.approvers.outputs.approvers, github.event.comment.user.login || 'null')
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
add-labels: 'approved'

- name: Add LGTM label
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/lgtm') &&
contains(steps.approvers.outputs.approvers, github.event.comment.user.login || 'null') &&
github.event.issue.user.login != github.event.comment.user.login
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
add-labels: 'lgtm'
remove-labels: 'WIP'

- name: Add Hold label
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/hold') &&
contains(steps.approvers.outputs.approvers, github.event.comment.user.login || 'null')
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
add-labels: 'hold'

- name: Remove Hold label
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '/remove hold') &&
contains(steps.approvers.outputs.approvers, github.event.comment.user.login || 'null')
uses: andymckay/labeler@master
with:
repo-token: ${{ secrets.BOT_PAT }}
remove-labels: 'hold'

Loading

0 comments on commit e6a1a4e

Please sign in to comment.