Skip to content

Commit

Permalink
Early 2.0 (#5)
Browse files Browse the repository at this point in the history
* Early 2.0

* Closer to 2.0.0

* Version 2.0.0

* Documentation

* Upd readme?1

* Update

* Add more tests

* Retry

* Fix workflow & retry

* Hmm

* Try

* retry

* Reduce number of CI actions

Co-authored-by: Denis Tokarev <denis.t@canva.com>
Co-authored-by: Denis Tokarev <github@devlato.com>
  • Loading branch information
3 people authored Feb 16, 2021
1 parent 06d2ce2 commit 960d93a
Show file tree
Hide file tree
Showing 36 changed files with 10,603 additions and 412 deletions.
45 changes: 30 additions & 15 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
engines:
eslint:
enabled: true
channel: 'eslint-3'
config:
extensions:
- .js
ratings:
paths:
- "src/**/*"
- "**.md"
version: '2'
checks:
method-lines:
argument-count:
enabled: false
complex-logic:
enabled: false
file-lines:
enabled: true
config:
threshold: 80
threshold: 250
method-complexity:
enabled: true
config:
threshold: 16
complex-logic:
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 6
threshold: 64
exclude_patterns:
- '.git/'
- '.github/'
- '.idea/'
- 'coverage/'
- 'dist/'
- 'docs/'
- 'node_modules/'
- 'src/tests/'
plugins:
eslint:
enabled: false
nodesecurity:
enabled: false
7 changes: 3 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# editorconfig.org
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
max_line_length=120
17 changes: 13 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
coverage
node_modules
test
# Folders
.git/
.github/
.idea/
coverage/
dist/
docs/
lint/
node_modules/

# Garbage
*.DS_Store
*.lock
*.log
*.md
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/react',
],
plugins: ['@typescript-eslint', 'prettier'],
parserOptions: {
ecmaVersion: 5,
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/no-use-before-define': [0],
'prettier/prettier': 'error',
},
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
root: true,
};
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: devlato
custom: http://paypal.me/devlatoau
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: '[Bug Report]'
labels: Bug Report
assignees: 'devlato'
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[Feature Request]'
labels: Feature Request
assignees: 'devlato'
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: New Pull Request
about: Create a report to help us improve
title: '[PR]'
labels: ''
assignees: 'devlato'
---

**Describe the problem this PR solves**
A clear and concise description of what the pull request solves.

**Features and behaviour**
A list of all the new features this PR adds, along with changed behavior.

**Describe how it solves the problem**
A bit more detailed explanation of technical implementation.

**Additional context**
Add any other context about the PR here, link issues, etc.
15 changes: 15 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
addReviewers: true
addAssignees: true

reviewers:
- devlato

numberOfReviewers: 0

assignees:
- devlato

numberOfAssignees: 0

skipKeywords:
- WIP
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: New Pull Request
about: Create a report to help us improve
title: '[PR]'
labels: ''
assignees: 'devlato'
---

**Describe the problem this PR solves**
A clear and concise description of what the pull request solves.

**Features and behaviour**
A list of all the new features this PR adds, along with changed behavior.

**Describe how it solves the problem**
A bit more detailed explanation of technical implementation.

**Additional context**
Add any other context about the PR here, link issues, etc.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
push:
branches-ignore:
- master
- gh-pages
tags-ignore:
- '*'

jobs:
secrets:
name: Secrets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install dependencies
run: npm ci
- name: Scan for secrets
uses: evanextreme/detect-secrets-action@1.0.0
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install dependencies
run: npm ci
- name: Lint the codebase
run: npm run lint:ci
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:ci
- name: Upload coverage
uses: actions/upload-artifact@v1
with:
name: test_coverage
path: coverage
build_code:
name: Build code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install dependencies
run: npm ci
- name: Build code
run: npm run build:ci
- name: Upload the dist folder
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
build_storybook:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run docs:ci
- name: Upload the storybook
uses: actions/upload-artifact@v1
with:
name: docs
path: docs
37 changes: 37 additions & 0 deletions .github/workflows/completion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Completion

on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}

jobs:
maybe_merge:
name: Merge
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: automerge
uses: 'pascalgn/automerge-action@v0.13.1'
env:
GITHUB_TOKEN: '${{ secrets.GH_PAT }}'
MERGE_LABELS: Ready to merge
MERGE_METHOD: rebase
MERGE_COMMIT_MESSAGE: 'Merge ${{ github.ref }} into master'
MERGE_RETRIES: 10
MERGE_RETRY_SLEEP: 30000
15 changes: 15 additions & 0 deletions .github/workflows/label_approved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Label Approved

on: pull_request_review

jobs:
label_when_approved:
name: Label when approved
runs-on: ubuntu-latest
steps:
- name: Label when approved
uses: pullreminders/label-when-approved-action@1.0.5
env:
APPROVALS: '1'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
ADD_LABEL: 'Ready to merge'
Loading

0 comments on commit 960d93a

Please sign in to comment.