@gramps/data-source-base
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0
@@ -1,81 +0,1 @@ | ||
{ | ||
"name": "@gramps/data-source-base", | ||
"description": "Base modules for a GrAMPS GraphQL data source.", | ||
"contributors": [ | ||
"Jason Lengstorf <jason@lengstorf.com>" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gramps-graphql/data-source-base.git" | ||
}, | ||
"main": "dist/index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"files": [ | ||
"dist/" | ||
], | ||
"scripts": { | ||
"prepush": "npm test", | ||
"prebuild": "del-cli ./dist", | ||
"build": "babel src -d dist", | ||
"dev": "gramps dev --data-source .", | ||
"dev:mock-data": "gramps dev --data-source . --mock", | ||
"lint": "eslint src/", | ||
"test:unit": "NODE_ENV=test jest --coverage", | ||
"test": "npm run lint --silent && npm run test:unit --silent", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"keywords": [ | ||
"graphql" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"casual": "^1.5.19" | ||
}, | ||
"peerDependencies": { | ||
"graphql": "^0.9.0 || ^0.10.0 || ^0.11.0", | ||
"graphql-tools": "^1.2.1 || ^2.5.1" | ||
}, | ||
"devDependencies": { | ||
"@gramps/cli": "^1.0.0-beta.4", | ||
"@gramps/gramps": "^1.0.0-beta-7", | ||
"babel-cli": "^6.24.1", | ||
"babel-eslint": "^8.0.3", | ||
"babel-jest": "^21.2.0", | ||
"babel-plugin-inline-import": "^2.0.6", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"del-cli": "^1.1.0", | ||
"eslint": "^4.13.1", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-prettier": "^2.4.0", | ||
"graphql": "^0.11.7", | ||
"graphql-tools": "^2.13.0", | ||
"husky": "^0.14.3", | ||
"jest": "^21.2.1", | ||
"nodemon": "^1.13.3", | ||
"prettier": "^1.9.2", | ||
"semantic-release": "^8.2.0" | ||
}, | ||
"jest": { | ||
"coverageReporters": [ | ||
"text", | ||
"lcov" | ||
], | ||
"collectCoverageFrom": [ | ||
"src/**/*.js" | ||
], | ||
"coverageThreshold": { | ||
"global": { | ||
"branches": 80, | ||
"functions": 80, | ||
"lines": 80, | ||
"statements": 80 | ||
} | ||
} | ||
}, | ||
"version": "1.0.0-beta.1" | ||
} | ||
{"name":"@gramps/data-source-base","description":"Base modules for a GrAMPS GraphQL data source.","contributors":["Jason Lengstorf <jason@lengstorf.com>"],"repository":{"type":"git","url":"https://github.com/gramps-graphql/data-source-base.git"},"main":"dist/index.js","directories":{"test":"test"},"files":["dist/"],"scripts":{"prepush":"npm test","prebuild":"del-cli ./dist","build":"babel src -d dist","dev":"gramps dev --data-source .","dev:mock-data":"gramps dev --data-source . --mock","lint":"eslint src/","test:unit":"cross-env NODE_ENV=test jest --coverage","test":"npm run lint --silent && npm run test:unit --silent","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"keywords":["graphql"],"license":"MIT","dependencies":{"casual":"^1.5.19"},"peerDependencies":{"graphql":"^0.9.0 || ^0.10.0 || ^0.11.0","graphql-tools":"^1.2.1 || ^2.5.1"},"devDependencies":{"@gramps/cli":"^1.0.0-beta.4","@gramps/gramps":"^1.0.0-beta-7","babel-cli":"^6.24.1","babel-eslint":"^8.0.3","babel-jest":"^21.2.0","babel-plugin-inline-import":"^2.0.6","babel-preset-env":"^1.6.1","cross-env":"^5.1.1","del-cli":"^1.1.0","eslint":"^4.13.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.9.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"^2.4.0","graphql":"^0.11.7","graphql-tools":"^2.13.0","husky":"^0.14.3","jest":"^21.2.1","prettier":"^1.9.2","semantic-release":"^8.2.0"},"jest":{"coverageReporters":["text","lcov"],"collectCoverageFrom":["src/**/*.js"],"coverageThreshold":{"global":{"branches":80,"functions":80,"lines":80,"statements":80}}},"version":"1.0.0"} |
@@ -1,2 +0,2 @@ | ||
<img src="https://gramps-graphql.github.io/gramps-express/assets/img/gramps-banner.png" alt="GrAMPS · An easier way to manage the data sources powering your GraphQL server" width="450"> | ||
<a href="https://gramps.js.org/"><img src="https://gramps.js.org/assets/img/gramps-banner.png" alt="GrAMPS · An easier way to manage the data sources powering your GraphQL server" width="450"></a> | ||
@@ -8,9 +8,9 @@ # GrAMPS GraphQL Data Source Base | ||
- **Connector** — how to access the data source (e.g. a REST API) | ||
- **Model** — methods to retrieve/modify data from the data source (e.g. a | ||
CRUD wrapper) | ||
- **Schema** — description for GraphQL to interpret the data (see the | ||
- **Context** — an object with methods to retrieve/modify data from the data | ||
source (e.g. a CRUD wrapper) | ||
- **Schema** — type definitions for GraphQL to interpret the data (see the | ||
[GraphQL docs on schemas](http://graphql.org/learn/schema/)) | ||
- **Resolvers** — functions to map the results of calls to model methods to | ||
the schema | ||
- **Mock Resolvers** — mock functions for offline development | ||
@@ -36,4 +36,4 @@ Each file contains a `TODO` comment explaining the changes you’ll need to make to create a working data source. | ||
```sh | ||
# Clone the repo | ||
git clone git@github.com:gramps-graphql/data-source-base.git data-source-YOUR_DATA_SOURCE_NAME | ||
# Get a copy of the data source | ||
npx degit gramps-graphql/data-source-base data-source-YOUR_DATA_SOURCE_NAME | ||
@@ -43,5 +43,2 @@ # Move into it | ||
# Change the remote repo | ||
git remote set-url origin git@github.com:USER_OR_ORG/YOUR_REPO_NAME.git | ||
# IMPORTANT: Make sure to edit the name, description, contributors, and | ||
@@ -51,21 +48,27 @@ # repository fields in package.json | ||
# Install dependencies | ||
yarn install | ||
yarn | ||
# Start the dev server | ||
yarn dev | ||
``` | ||
### To Develop with Mock Data | ||
You'll see a message with URLs for the GraphQL gateway and the [GraphQL Playground](https://github.com/graphcool/graphql-playground). Open the Playground link (usually http://localhost:8080/playground if you don’t already have something running on port 8080), then run a query: | ||
Start the app with the following command: | ||
```sh | ||
# Develop with mock data | ||
yarn mock-data | ||
```graphql | ||
{ | ||
getById(id: 123) { | ||
id | ||
name | ||
lucky_numbers | ||
} | ||
} | ||
``` | ||
### To Develop with Live Data | ||
### To Develop with Mock Data | ||
Once you’ve got your data source configured to load live data, you can enable live data in development: | ||
Start the app with the following command: | ||
```sh | ||
# Develop with live data | ||
yarn live-data | ||
# Start the gateway with mock data | ||
yarn dev --mock | ||
``` | ||
@@ -75,2 +78,2 @@ | ||
Currently, there is no watch capability (PRs welcome!), so the service needs to be stopped (`control` + `C`) and restarted (`yarn [mock-data|live-data]`) to reflect new changes to the data source. | ||
Currently, there is no watch capability (PRs welcome!), so the service needs to be stopped (`control` + `C`) and restarted (`yarn dev`) to reflect new changes to the data source. |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7673
20
6
64
1
75
0