Skip to content

Commit 4140e88

Browse files
ci: setup repository
1 parent bb5c2ca commit 4140e88

File tree

12 files changed

+8521
-4
lines changed

12 files changed

+8521
-4
lines changed

.eslintrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2020: true,
5+
},
6+
extends: [
7+
'airbnb',
8+
'plugin:react/recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
],
11+
parser: '@typescript-eslint/parser',
12+
parserOptions: {
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
ecmaVersion: 11,
17+
sourceType: 'module',
18+
},
19+
plugins: [
20+
'react',
21+
'@typescript-eslint',
22+
],
23+
rules: {
24+
semi: ['error', 'never'],
25+
'no-unused-vars': 'off',
26+
'import/extensions': 'off',
27+
'import/no-unresolved': 'off',
28+
'react/jsx-filename-extension': 'off',
29+
indent: [
30+
'error',
31+
2,
32+
],
33+
'linebreak-style': ['error', 'unix'],
34+
'object-curly-newline': 'off',
35+
'@typescript-eslint/no-explicit-any': 'off',
36+
},
37+
overrides: [{
38+
files: ['*.tsx'],
39+
rules: {
40+
'react/prop-types': 'off',
41+
'react/jsx-props-no-spreading': 'off',
42+
},
43+
}],
44+
}

.github/workflows/push.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI/CD
2+
on: push
3+
jobs:
4+
test:
5+
name: test
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Dump GitHub context
9+
env:
10+
GITHUB_CONTEXT: ${{ toJson(github) }}
11+
run: echo "$GITHUB_CONTEXT"
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Setup
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: '10.x'
18+
- uses: actions/cache@v1
19+
id: yarn-cache
20+
with:
21+
path: node_modules
22+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
23+
restore-keys: |
24+
${{ runner.os }}-node_modules-
25+
- name: Install
26+
if: steps.yarn-cache.outputs.cache-hit != 'true'
27+
run: yarn install
28+
- name: Lint
29+
run: yarn lint
30+
- name: Build
31+
run: yarn build
32+
- name: Release
33+
env:
34+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: yarn release
38+
39+
notify:
40+
name: Notify
41+
runs-on: ubuntu-latest
42+
if: failure()
43+
needs:
44+
- test
45+
steps:
46+
- uses: technote-space/workflow-conclusion-action@v1
47+
- uses: 8398a7/action-slack@v3
48+
with:
49+
status: ${{ env.WORKFLOW_CONCLUSION }}
50+
fields: repo,message,commit,author,action,eventName,ref,workflow
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
54+
if: always()

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.LSOverride
1111

1212
# Icon must end with two \r
13-
Icon
13+
Icon
1414

1515
# Thumbnails
1616
._*
@@ -156,3 +156,5 @@ dist
156156

157157
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
158158

159+
types
160+
build

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.github
3+
coommitlint.config.js

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
access=public

.releaserc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"branches": [
3+
"+([0-9])?(.{+([0-9]),x}).x",
4+
"master",
5+
"next",
6+
"next-major",
7+
{
8+
"name": "beta",
9+
"prerelease": true
10+
}
11+
],
12+
"plugins": [
13+
"@semantic-release/commit-analyzer",
14+
"@semantic-release/release-notes-generator",
15+
"@semantic-release/npm",
16+
"@semantic-release/github",
17+
"@semantic-release/git",
18+
[
19+
"semantic-release-slack-bot",
20+
{
21+
"notifyOnSuccess": true,
22+
"notifyOnFail": true
23+
}
24+
]
25+
]
26+
}

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2018 SoftwareBrothers.co
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

commitlint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
extends: [
3+
'@commitlint/config-conventional',
4+
],
5+
}

package.json

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
{
2-
"name": "admin-bro-koa",
2+
"name": "@admin-bro/koa",
33
"version": "1.0.0",
4-
"main": "index.js",
5-
"license": "MIT"
4+
"main": "build/index.js",
5+
"types": "types/index.d.ts",
6+
"repository": "git@github.com:SoftwareBrothers/admin-bro-koa.git",
7+
"license": "MIT",
8+
"scripts": {
9+
"release": "semantic-release",
10+
"build": "tsc",
11+
"lint": "eslint './src/**/*' --ignore-pattern '*.json' --ignore-pattern 'yarn.lock'"
12+
},
13+
"husky": {
14+
"hooks": {
15+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
16+
}
17+
},
18+
"peerDependencies": {
19+
"@admin-bro/core": ">=3.0.0-beta.3"
20+
},
21+
"devDependencies": {
22+
"@admin-bro/core": ">=3.0.0-beta.3",
23+
"@commitlint/cli": "^8.3.5",
24+
"@commitlint/config-conventional": "^8.3.4",
25+
"@semantic-release/git": "^9.0.0",
26+
"@typescript-eslint/eslint-plugin": "^3.7.0",
27+
"@typescript-eslint/parser": "^3.7.0",
28+
"eslint": "^7.5.0",
29+
"eslint-config-airbnb": "^18.2.0",
30+
"eslint-plugin-import": "^2.22.0",
31+
"eslint-plugin-jsx-a11y": "^6.3.1",
32+
"eslint-plugin-react": "^7.20.3",
33+
"eslint-plugin-react-hooks": "^4.0.8",
34+
"husky": "^4.2.5",
35+
"semantic-release": "^17.0.7",
36+
"semantic-release-slack-bot": "^1.6.2",
37+
"typescript": "^3.9.7"
38+
}
639
}

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
3+
}

0 commit comments

Comments
 (0)