Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Jul 20, 2022
0 parents commit f3c813b
Show file tree
Hide file tree
Showing 29 changed files with 17,925 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

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

[*.md]
max_line_length = off
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules/*
**/dist/*
*.ejs
40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
root: true,
extends: [
'prettier',
'plugin:prettier/recommended',
'plugin:jsx-a11y/recommended',
'@lomray/eslint-config-react'
],
ignorePatterns: ['/*.*', 'src/@types'],
plugins: [],
env: {
browser: true,
es6: true,
node: true,
serviceworker: true,
},
globals: {
NodeJS: true,
JSX: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
files: ['*.ts', '*.tsx'],
project: ['./tsconfig.json'],
tsconfigRootDir: './',
},
rules: {
'unicorn/import-index': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'prettier/prettier': [
'error',
{
endOfLine: 'auto'
}
]
}
}
34 changes: 34 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check PR

on:
pull_request:
branches: [ staging, prod ]

jobs:
check:
name: Check PR
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm ci

- name: Check prettier
run: npm run prettier:check

- name: Check eslint
run: npm run lint:check

- name: Typescript check
run: npm run ts:check

- uses: naveenk1223/action-pr-title@master
with:
regex: '^(feat|fix|perf|refactor|revert|test|test|build|chore)([(a-z-)]*):\s[a-z0-9\s,()]+$' # Regex the title should match.
prefix_case_sensitive: true
min_length: 10
max_length: 80
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build & Publish

on:
push:
branches: [ prod, staging ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc

- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish npm packages / create github release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Sonarqube
on:
push:
branches: [ staging ]

jobs:
sonarcube:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-sonarcube
cancel-in-progress: true

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.DS_Store
node_modules
lib
20 changes: 20 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# validate commit
npx --no-install commitlint -g commitlint.config.js --edit "$1"

LC_ALL=C

local_branch="$(git rev-parse --abbrev-ref HEAD)"

valid_branch_regex="^(feature|bugfix|improvement|hotfix)\/[a-z0-9-]+$"

message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again."

# validate branch name
# shellcheck disable=SC2039
if [ ! $local_branch =~ $valid_branch_regex ] && [ ! "$local_branch" == "staging" ] && [ ! "$local_branch" == "prod" ]; then
echo "$message"
exit 1
fi
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
6 changes: 6 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'*.{ts,tsx}': [
'eslint --max-warnings=0',
'prettier --write',
]
}
17 changes: 17 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
workflows
.gitignore
.github
commitlint.config.js
release.config.js
rollup.config.js
.eslintignore
.eslintrc.js
.lintstagedrc.js
.prettierrc.js
sonar-project.properties
.husky
.idea
.editorconfig
/index.ts
/src
tsconfig.json
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@lomray/prettier-config'),
};
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mobx stores manager for React

## Usage

1. Install package:

```sh
npm i --save-dev @lomray/react-mobx-manager
```
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
Loading

0 comments on commit f3c813b

Please sign in to comment.