Skip to content

Commit 52cde1b

Browse files
committed
Init
0 parents  commit 52cde1b

File tree

12 files changed

+4352
-0
lines changed

12 files changed

+4352
-0
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": [
3+
"transform-object-rest-spread",
4+
"transform-flow-strip-types",
5+
["transform-runtime", { "polyfill": false }]
6+
],
7+
"presets": [
8+
["env", {
9+
"targets": {
10+
"node": 4
11+
},
12+
}]
13+
],
14+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/*
2+
es/*

.eslintrc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"extends": [
3+
"airbnb-base",
4+
"prettier"
5+
],
6+
"parser": "babel-eslint",
7+
"rules": {
8+
"no-underscore-dangle": 0,
9+
"arrow-body-style": 0,
10+
"arrow-parens": 0,
11+
"prefer-template": 0,
12+
"no-use-before-define": 0,
13+
"no-else-return": 0,
14+
"comma-dangle": ["error", {
15+
"arrays": "always-multiline",
16+
"objects": "always-multiline",
17+
"imports": "always-multiline",
18+
"exports": "always-multiline",
19+
"functions": "ignore",
20+
}],
21+
"no-plusplus": 0,
22+
"import/no-extraneous-dependencies": 0,
23+
"import/prefer-default-export": 0,
24+
"prettier/prettier": ["error", {
25+
"printWidth": 100,
26+
"singleQuote": true,
27+
"trailingComma": "es5",
28+
}],
29+
"no-unused-expressions": 0,
30+
"no-restricted-syntax": 0,
31+
},
32+
"env": {
33+
"jasmine": true,
34+
"jest": true
35+
},
36+
"globals": {
37+
"Class": true,
38+
"$Shape": true,
39+
},
40+
"plugins": [
41+
"flowtype",
42+
"prettier"
43+
],
44+
}

.flowconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[ignore]
2+
.*/coverage/.*
3+
.*/resources/.*
4+
<PROJECT_ROOT>/lib/.*
5+
<PROJECT_ROOT>/dist/.*
6+
.*/node_modules/ajv.*
7+
.*/node_modules/acorn.*
8+
.*/node_modules/async.*
9+
.*/node_modules/babel.*
10+
.*/node_modules/bluebird.*
11+
.*/node_modules/caniuse-db.*
12+
.*/node_modules/config-chain.*
13+
.*/node_modules/conventional-changelog.*
14+
.*/node_modules/core-js.*
15+
.*/node_modules/cssstyle.*
16+
.*/node_modules/diff.*
17+
.*/node_modules/es5-ext.*
18+
.*/node_modules/escope.*
19+
.*/node_modules/escodegen.*
20+
.*/node_modules/eslint.*
21+
.*/node_modules/github.*
22+
.*/node_modules/fsevents.*
23+
.*/node_modules/jsdoctypeparser.*
24+
.*/node_modules/jsdom.*
25+
.*/node_modules/iconv.*
26+
.*/node_modules/istanbul.*
27+
.*/node_modules/handlebars.*
28+
.*/node_modules/markdown.*
29+
.*/node_modules/node-notifier.*
30+
.*/node_modules/npmconf.*
31+
.*/node_modules/prettier.*
32+
.*/node_modules/source-map.*
33+
.*/node_modules/travis.*
34+
.*/node_modules/uglify.*
35+
.*/node_modules/yargs.*
36+
37+
[include]
38+
39+
[libs]
40+
41+
[options]
42+
esproposal.class_instance_fields=enable
43+
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
44+
unsafe.enable_getters_and_setters=true

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
15+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
16+
.grunt
17+
18+
# node-waf configuration
19+
.lock-wscript
20+
21+
# Compiled binary addons (http://nodejs.org/api/addons.html)
22+
build/Release
23+
24+
# IntelliJ Files
25+
*.iml
26+
*.ipr
27+
*.iws
28+
/out/
29+
.idea/
30+
.idea_modules/
31+
32+
# Dependency directory
33+
node_modules
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
# Transpiled code
42+
/es
43+
/lib
44+
45+
coverage
46+
.nyc_output

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
yarn: true
5+
directories:
6+
- node_modules
7+
notifications:
8+
email: true
9+
node_js:
10+
- "7"
11+
- "6"
12+
- "5"
13+
- "4"
14+
before_install: yarn global add greenkeeper-lockfile@1
15+
before_script: greenkeeper-lockfile-update
16+
after_script: greenkeeper-lockfile-upload
17+
script:
18+
- yarn run test
19+
- yarn run build
20+
after_success:
21+
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
22+
- python travis_after_all.py
23+
- export $(cat .to_export_back) &> /dev/null
24+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then bash <(curl -s https://codecov.io/bash); fi
25+
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi
26+
branches:
27+
except:
28+
- /^v\d+\.\d+\.\d+$/

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pavel Chertorogov <[email protected]>

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## master
2+
3+
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release).
4+
[Changelog](https://github.com/nodkz/graphql-compose-pagination/releases) is generated automatically and can be found here: https://github.com/nodkz/graphql-compose-pagination/releases

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-present Pavel Chertorogov
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# graphql-compose-pagination
2+
3+
[![travis build](https://img.shields.io/travis/nodkz/graphql-compose-pagination.svg)](https://travis-ci.org/nodkz/graphql-compose-pagination)
4+
[![codecov coverage](https://img.shields.io/codecov/c/github/nodkz/graphql-compose-pagination.svg)](https://codecov.io/github/nodkz/graphql-compose-pagination)
5+
[![](https://img.shields.io/npm/v/graphql-compose-pagination.svg)](https://www.npmjs.com/package/graphql-compose-pagination)
6+
[![npm](https://img.shields.io/npm/dt/graphql-compose-pagination.svg)](http://www.npmtrends.com/graphql-compose-pagination)
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+
[![Greenkeeper badge](https://badges.greenkeeper.io/nodkz/graphql-compose-pagination.svg)](https://greenkeeper.io/)
10+
11+
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose) family, which adds to the TypeComposer `pagination` resolver.
12+
13+
Live demo: [https://graphql-compose.herokuapp.com/](https://graphql-compose.herokuapp.com/)
14+
15+
[CHANGELOG](https://github.com/nodkz/graphql-compose-pagination/blob/master/CHANGELOG.md)
16+
17+
Installation
18+
============
19+
```
20+
npm install graphql graphql-compose graphql-compose-pagination --save
21+
```
22+
23+
Modules `graphql` and `graphql-compose` are in `peerDependencies`, so should be installed explicitly in your app. They should not installed as submodules, cause internally checks the classes instances.
24+
25+
26+
Example
27+
=======
28+
```js
29+
import composeWithPagination from 'graphql-compose-pagination';
30+
import userTypeComposer from './user.js';
31+
32+
composeWithPagination(userTypeComposer, {
33+
findResolverName: 'findMany',
34+
countResolverName: 'count',
35+
});
36+
```
37+
38+
Requirements
39+
============
40+
Types should have following resolvers:
41+
* `count` - for records count
42+
* `findMany` - for filtering records. Resolver `findMany` should have `limit` and `skip` args.
43+
44+
Used in plugins
45+
===============
46+
[graphql-compose-mongoose](https://github.com/nodkz/graphql-compose-mongoose) - converts mongoose models to graphql types
47+
48+
49+
License
50+
=======
51+
[MIT](https://github.com/nodkz/graphql-compose-pagination/blob/master/LICENSE.md)

package.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "graphql-compose-pagination",
3+
"version": "0.0.0-semantically-released",
4+
"description": "Plugin for `graphql-compose` which provide a pagination resolver for types.",
5+
"files": [
6+
"lib",
7+
"README.md"
8+
],
9+
"main": "lib/index.js",
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/nodkz/graphql-compose-pagination.git"
13+
},
14+
"keywords": [
15+
"graphql",
16+
"compose",
17+
"graphql-compose",
18+
"relay",
19+
"pagination"
20+
],
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/nodkz/graphql-compose-pagination/issues"
24+
},
25+
"homepage": "https://github.com/nodkz/graphql-compose-pagination",
26+
"peerDependencies": {
27+
"graphql-compose": ">=1.20.3 || >=2.0.0"
28+
},
29+
"devDependencies": {
30+
"babel-cli": "^6.24.1",
31+
"babel-eslint": "^7.2.3",
32+
"babel-jest": "^20.0.3",
33+
"babel-plugin-transform-flow-strip-types": "^6.22.0",
34+
"babel-plugin-transform-object-rest-spread": "^6.23.0",
35+
"babel-plugin-transform-runtime": "^6.23.0",
36+
"babel-preset-env": "^1.6.0",
37+
"cz-conventional-changelog": "^2.0.0",
38+
"eslint": "^4.4.0",
39+
"eslint-config-airbnb-base": "^11.3.1",
40+
"eslint-config-prettier": "^2.3.0",
41+
"eslint-plugin-flowtype": "^2.35.0",
42+
"eslint-plugin-import": "^2.7.0",
43+
"eslint-plugin-prettier": "^2.1.2",
44+
"flow-bin": "^0.52.0",
45+
"graphql": "^0.10.5",
46+
"graphql-compose": "^2.2.0",
47+
"jest": "^20.0.4",
48+
"prettier": "^1.5.3",
49+
"rimraf": "^2.6.1",
50+
"semantic-release": "^6.3.2"
51+
},
52+
"dependencies": {
53+
"babel-runtime": "^6.25.0"
54+
},
55+
"config": {
56+
"commitizen": {
57+
"path": "./node_modules/cz-conventional-changelog"
58+
}
59+
},
60+
"jest": {
61+
"roots": [
62+
"<rootDir>/src"
63+
]
64+
},
65+
"scripts": {
66+
"build": "npm run build-cjs && npm run build-flow",
67+
"build-cjs": "rimraf lib && babel src --ignore __tests__,__mocks__ -d lib",
68+
"build-flow": "find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow; done",
69+
"watch": "jest --watch",
70+
"coverage": "jest --coverage",
71+
"lint": "eslint --ext .js ./src",
72+
"flow": "./node_modules/.bin/flow stop && ./node_modules/.bin/flow",
73+
"test": "npm run coverage && npm run lint && npm run flow",
74+
"link": "yarn build && yarn link graphql-compose && yarn link",
75+
"unlink": "yarn unlink graphql-compose && yarn add graphql-compose",
76+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
77+
}
78+
}

0 commit comments

Comments
 (0)