Skip to content

Commit

Permalink
Build/ci lint (#13)
Browse files Browse the repository at this point in the history
* add precommit hook

* add circleci n codecov
  • Loading branch information
koca committed Oct 1, 2018
1 parent ffe5596 commit 2b07f73
Show file tree
Hide file tree
Showing 3 changed files with 1,605 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,41 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:latest

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: test
command: yarn test:unit:cov
- run:
name: upload coverage
command: bash <(curl -s https://codecov.io/bash)
15 changes: 15 additions & 0 deletions package.json
Expand Up @@ -7,6 +7,7 @@
"lint": "vue-cli-service lint",
"build": "vue-cli-service build --target lib --name VuePrismEditor ./src/components/Editor.vue && rimraf dist/demo.html",
"test:unit": "vue-cli-service test:unit",
"test:unit:cov": "npm run lint && npm run test:unit -- --coverage",
"publish-pkg": "npm run build && npm publish"
},
"dependencies": {
Expand All @@ -24,6 +25,7 @@
"@vue/test-utils": "^1.0.0-beta.20",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"lint-staged": "^7.3.0",
"prismjs": "^1.15.0",
"register-service-worker": "^1.5.2",
"rimraf": "^2.6.2",
Expand Down Expand Up @@ -58,5 +60,18 @@
"author": {
"name": "Mesut Koca",
"email": "imesutkoca@gmail.com"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
}
}

0 comments on commit 2b07f73

Please sign in to comment.