Skip to content

Commit 77e5543

Browse files
committed
chore(build): Setup semantic-release, travis, coverage, and add badges
1 parent 4cd5c9c commit 77e5543

File tree

3 files changed

+67
-7
lines changed

3 files changed

+67
-7
lines changed

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
directories:
5+
- node_modules
6+
notifications:
7+
email: true
8+
node_js:
9+
- "6"
10+
- "5"
11+
- "4"
12+
- "iojs"
13+
- "0.12"
14+
- "0.10"
15+
before_install:
16+
- npm i -g npm@^2.0.0
17+
- npm i graphql graphql-compose graphql-compose-connection
18+
before_script:
19+
- npm prune
20+
script:
21+
- npm run coverage
22+
- npm run build
23+
after_success:
24+
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
25+
- python travis_after_all.py
26+
- export $(cat .to_export_back) &> /dev/null
27+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 ]]; then bash <(curl -s https://codecov.io/bash); fi
28+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 ]]; then npm run semantic-release; fi
29+
branches:
30+
only:
31+
- master

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
graphql-compose-mongoose
2-
======================
1+
# graphql-compose-mongoose
2+
3+
[![travis build](https://img.shields.io/travis/nodkz/graphql-compose-mongoose.svg)](https://travis-ci.org/nodkz/graphql-compose-mongoose)
4+
[![codecov coverage](https://img.shields.io/codecov/c/github/nodkz/graphql-compose-mongoose.svg)](https://codecov.io/github/nodkz/graphql-compose-mongoose)
5+
[![](https://img.shields.io/npm/v/graphql-compose-mongoose.svg)](https://www.npmjs.com/package/graphql-compose-mongoose)
6+
[![npm](https://img.shields.io/npm/dt/graphql-compose-mongoose.svg)](https://www.npmjs.com/package/graphql-compose-mongoose)
7+
[![Join the chat at https://gitter.im/graphql-compose/Lobby](https://badges.gitter.im/nodkz/graphql-compose.svg)](https://gitter.im/graphql-compose/Lobby)
8+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
9+
10+
311
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which derives GraphQLType from your [mongoose model](https://github.com/Automattic/mongoose). Also derives bunch of internal GraphQL Types. Provide all CRUD resolvers, including `graphql connection`, also provided basic search via operators ($lt, $gt and so on).
412

513
Installation

package.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "graphql-compose-mongoose",
3-
"version": "1.0.12",
43
"description": "Plugin for `graphql-compose` which derive a graphql type from a mongoose model.",
54
"files": [
65
"es",
@@ -10,7 +9,7 @@
109
"jsnext:main": "es/index.js",
1110
"repository": {
1211
"type": "git",
13-
"url": "git+https://github.com/nodkz/graphql-compose-mongoose.git"
12+
"url": "https://github.com/nodkz/graphql-compose-mongoose.git"
1413
},
1514
"keywords": [
1615
"graphql",
@@ -36,6 +35,7 @@
3635
},
3736
"devDependencies": {
3837
"babel-cli": "6.14.0",
38+
"babel-core": "6.14.0",
3939
"babel-eslint": "6.1.2",
4040
"babel-plugin-syntax-async-functions": "6.13.0",
4141
"babel-plugin-transform-class-properties": "6.11.5",
@@ -47,6 +47,7 @@
4747
"chai": "3.5.0",
4848
"chai-as-promised": "5.3.0",
4949
"chai-spies": "0.7.1",
50+
"cz-conventional-changelog": "1.2.0",
5051
"eslint": "3.4.0",
5152
"eslint-config-airbnb": "10.0.1",
5253
"eslint-plugin-flowtype": "2.15.0",
@@ -55,18 +56,38 @@
5556
"eslint-plugin-react": "6.2.0",
5657
"flow-bin": "0.32.0",
5758
"mocha": "3.0.2",
59+
"nyc": "8.1.0",
5860
"rimraf": "2.5.4",
59-
"sane": "1.4.1"
61+
"sane": "1.4.1",
62+
"semantic-release": "^4.3.5"
6063
},
6164
"scripts": {
6265
"build": "npm run build-cjs && npm run build-flow && npm run build-es",
6366
"build-cjs": "rimraf lib && babel src --ignore __tests__,__mocks__ -d lib",
6467
"build-es": "rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es",
6568
"build-flow": "find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow; done",
69+
"coverage": "nyc npm run test",
6670
"lint": "eslint src test *.js",
67-
"prepublish": "npm run test && npm run build",
6871
"test": "babel-node ./node_modules/.bin/_mocha --compilers js:babel-core/register --reporter dot --require ./resources/mocha-bootload src/**/__tests__/**/*-test.js",
6972
"watch": "babel-node ./resources/watch.js",
70-
"link": "npm link graphql && npm link graphql-compose && npm link graphql-compose-connection && npm link mongoose && npm link"
73+
"link": "npm link graphql && npm link graphql-compose && npm link graphql-compose-connection && npm link mongoose && npm link",
74+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
75+
},
76+
"config": {
77+
"commitizen": {
78+
"path": "./node_modules/cz-conventional-changelog"
79+
}
80+
},
81+
"nyc": {
82+
"exclude": [
83+
"**/__mocks__/**",
84+
"**/__tests__/**",
85+
"resources",
86+
"node_modules"
87+
],
88+
"reporter": [
89+
"lcov",
90+
"text"
91+
]
7192
}
7293
}

0 commit comments

Comments
 (0)