Skip to content

Commit

Permalink
ci: integration with GitHub Actions and Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 25, 2020
1 parent 23138e5 commit 1268902
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 58 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @1stg/browserslist-config/modern
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@1stg"
]
}
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "@1stg/eslint-config/loose",
"overrides": [
{
"files": "*.{vue,ts,tsx}",
"extends": [
"@nuxtjs/eslint-config-typescript",
"vuetify",
"@1stg/eslint-config/loose"
]
}
]
}
39 changes: 39 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Node CI

on: [push, pull_request]

jobs:
default:
strategy:
matrix:
node: [12]
os: [macOS-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Setup yarn
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$PATH"
- name: Install Dependencies
run: yarn --frozen-lockfile

- name: Lint, Build
run: |
yarn lint
yarn build
env:
EFF_NO_LINK_RULES: 'true'
PARSER_NO_WATCH: 'true'

- name: Code Checks
if: matrix.os == 'macOS-latest'
run: |
yarn global add @codechecks/client @codechecks/build-size-watcher @codechecks/type-coverage-watcher typescript
codechecks
env:
CI: 'true'
CC_SECRET: ${{ secrets.CC_SECRET }}
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@1stg/prettier-config"
5 changes: 5 additions & 0 deletions .remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
"@1stg/remark-config"
]
}
6 changes: 6 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"@1stg/stylelint-config/scss/loose",
"@1stg/stylelint-config/modules"
]
}
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Claps.dev

Help you funding the creators and projects you appreciate with crypto currencies.
[![GitHub Actions](https://github.com/JounQin/Claps.dev/workflows/Node%20CI/badge.svg)](https://github.com/JounQin/Claps.dev/actions?query=workflow%3A%22Node+CI%22)
[![Codacy Grade](https://img.shields.io/codacy/grade/69305f19103744fea0de2395afa2271e)](https://www.codacy.com/app/JounQin/Claps.dev)
[![David](https://img.shields.io/david/JounQin/Claps.dev.svg)](https://david-dm.org/JounQin/Claps.dev)
[![David Dev](https://img.shields.io/david/dev/JounQin/Claps.dev.svg)](https://david-dm.org/JounQin/Claps.dev?type=dev)

[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)

> Help you funding the creators and projects you appreciate with crypto currencies.
12 changes: 12 additions & 0 deletions codechecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
checks:
- name: build-size-watcher
options:
files:
- path: 'dist/**/*.*'
- path: 'node_modules/.nuxt/dist/**/*.*'
- name: type-coverage-watcher
options:
ignoreCatch: true
ignoreFiles:
- '**/*.d.ts'
strict: true
43 changes: 6 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"lint:ts": "tslint -p . -t stylish",
"lint:tsc": "tsc --noEmit",
"postinstall": "cpy env.js . --rename=.env.js && yarn-deduplicate || exit 0",
"start": "cross-env NODE_ENV=production env-cmd node dist/cjs.min"
"start": "cross-env NODE_ENV=production env-cmd node dist/cjs.min",
"type-coverage": "type-coverage --detail --ignore-catch --ignore-files '**/*.d.ts' --strict"
},
"dependencies": {
"@koa/router": "^8.0.6",
Expand Down Expand Up @@ -95,51 +96,19 @@
"sass-loader": "^8.0.2",
"style-resources-loader": "^1.3.3",
"ts-node-dev": "^1.0.0-pre.44",
"type-coverage": "^2.4.0",
"typescript": "^3.7.5",
"yarn-deduplicate": "^1.1.1"
},
"resolutions": {
"@babel/core": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@types/node": "^13.1.8"
},
"browserslist": [
"extends @1stg/browserslist-config/modern"
],
"commitlint": {
"extends": [
"@1stg"
]
},
"eslintConfig": {
"extends": "@1stg/eslint-config/loose",
"overrides": [
{
"files": "*.{vue,ts,tsx}",
"extends": [
"@nuxtjs/eslint-config-typescript",
"vuetify",
"@1stg/eslint-config/loose"
]
}
]
},
"postcss": {
"extends": "@1stg"
},
"prettier": "@1stg/prettier-config",
"remarkConfig": {
"plugins": [
"@1stg/remark-config"
]
"@types/node": "^13.5.0"
},
"renovate": {
"extends": "@1stg"
},
"stylelint": {
"extends": [
"@1stg/stylelint-config/scss/loose",
"@1stg/stylelint-config/modules"
]
"type-coverage": {
"atLeast": 93
}
}
2 changes: 1 addition & 1 deletion server/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const startRouter = async (app?: Koa) => {
(ctx, next) => {
ctx.conn = conn
const { gitHubToken } = ctx.session
if (gitHubToken) {
if (typeof gitHubToken === 'string') {
process.env.GITHUB_CLIENT_TOKEN = gitHubToken
}
return next()
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ClipboardVm extends Vue {

const bind: DirectiveFunction = (
el,
{ value },
{ value }: { value?: string },
{ context, componentInstance },
_oldVNode,
) => {
Expand Down Expand Up @@ -41,7 +41,7 @@ const destroy = (vnode: VNode) => {

export const VueClipboard: DirectiveOptions = {
inserted: bind,
update(_el, { value }, { context }) {
update(_el, { value }: { value?: string }, { context }) {
Object.assign(context, {
$$clipboardValue: value,
})
Expand Down
5 changes: 3 additions & 2 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Plugin } from '@nuxt/types'
import { AxiosInstance } from 'axios'
import { Asset } from 'mixin-node-sdk'
import Vue from 'vue'
import Vuex, { ActionTree, MutationTree } from 'vuex'
Expand Down Expand Up @@ -46,10 +47,10 @@ const actions: ActionTree<RootState, RootState> = {
}

const mutations: MutationTree<RootState> = {
SET_HTTP(state, http) {
SET_HTTP(state, http: AxiosInstance) {
state.http = http
},
SET_AUTH_INFO(state, authInfo) {
SET_AUTH_INFO(state, authInfo: AuthInfo) {
Object.assign(state, authInfo)
},
SET_LOADING(state, loading: boolean) {
Expand Down
56 changes: 41 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2531,10 +2531,10 @@
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@>= 8", "@types/node@^12.12.24", "@types/node@^13.1.8":
version "13.1.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.8.tgz#1d590429fe8187a02707720ecf38a6fe46ce294b"
integrity sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==
"@types/node@*", "@types/node@>= 8", "@types/node@^12.12.24", "@types/node@^13.5.0":
version "13.5.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.5.0.tgz#4e498dbf355795a611a87ae5ef811a8660d42662"
integrity sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
Expand Down Expand Up @@ -7458,7 +7458,7 @@ glob-to-regexp@^0.3.0:
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=

glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
glob@7, glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
Expand Down Expand Up @@ -10061,7 +10061,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=

minimatch@^3.0.0, minimatch@^3.0.4:
minimatch@3, minimatch@^3.0.0, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
Expand Down Expand Up @@ -10094,7 +10094,7 @@ minimist@1.1.x:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.1.3.tgz#3bedfd91a92d39016fcfaa1c681e8faa1a1efda8"
integrity sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=

minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
Expand Down Expand Up @@ -15168,6 +15168,14 @@ tryer@^1.0.1:
resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==

ts-lib-utils@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/ts-lib-utils/-/ts-lib-utils-2.2.0.tgz#dbf198ba67e2fee027f36bd2f9c0cbd638ed1731"
integrity sha512-yfZWuQs5bfQA2RLJdHUOSL2+Iw4NcZ8eKglVVW25aXi3sdLEoJxHB3tC2CN+x4MY4X39tcFCGlE5V7IF8O3m8w==
dependencies:
glob "7"
tslib "1"

ts-loader@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef"
Expand Down Expand Up @@ -15228,7 +15236,7 @@ tsconfig@^7.0.0:
strip-bom "^3.0.0"
strip-json-comments "^2.0.0"

tslib@^1.10.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
tslib@1, tslib@^1.10.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
Expand Down Expand Up @@ -15295,20 +15303,20 @@ tsscmp@1.0.6:
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==

tsutils@3, tsutils@^3.17.1, tsutils@^3.9.1:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
dependencies:
tslib "^1.8.1"

tsutils@^2.25.0, tsutils@^2.29.0:
version "2.29.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
dependencies:
tslib "^1.8.1"

tsutils@^3.17.1, tsutils@^3.9.1:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
dependencies:
tslib "^1.8.1"

tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
Expand All @@ -15328,6 +15336,24 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

type-coverage-core@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/type-coverage-core/-/type-coverage-core-2.4.0.tgz#1d0f0b59a1b8a42a6ae221580b50371c0efb6d7f"
integrity sha512-jBAgIa6ANrZffvxEYT5jER9c49l+xSGWxDUv6EfwN3c8efUT5NKLmc3AUW+Nien8KlLliRc+quKENmTiT9zHPQ==
dependencies:
minimatch "3"
ts-lib-utils "^2.2.0"
tslib "1"
tsutils "3"

type-coverage@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.4.0.tgz#db649b414e38bfe5dc4753bbaf143b27cd111d71"
integrity sha512-0hpRb0AYx6vXYWLzK6D1K2I0r+hCjp293X0Khe7wAsIZRT+VX6ztDBvu6UDFfGgkrwdL4x46lKhnTjJLbq494g==
dependencies:
minimist "1.2.0"
type-coverage-core "^2.4.0"

type-fest@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1"
Expand Down

0 comments on commit 1268902

Please sign in to comment.