Merge branch 'master' into multi-file-upload

This commit is contained in:
Michael Merrill 2017-04-03 21:30:49 -06:00
commit 2db7e194b4
11 changed files with 10 additions and 61 deletions

View File

@ -18,19 +18,17 @@
"koa-router": "^7.1.1",
"rethinkdbdash": "^2.3.28",
"source-map-support": "^0.4.14",
"webpack": "^2.3.2",
"webpack": "^2.3.3",
"zoo": "^0.1.9"
},
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-eslint": "^7.2.1",
"chalk": "^1.1.3",
"indent-string": "^3.1.0",
"standard": "^9.0.2"
"standard": "^9.0.2",
"webpack-watch-server": "^1.0.0"
},
"scripts": {
"lint": "standard",
"dev": "zoo babel-node scripts/dev",
"dev": "zoo webpack-watch-server",
"build": "zoo webpack",
"start": "zoo node dist"
},

View File

@ -1,4 +1,4 @@
# Apollo upload examples API
# Apollo upload example API
An example GraphQL API using [Apollo upload server](https://github.com/jaydenseric/apollo-upload-server).

View File

@ -1,49 +0,0 @@
import 'source-map-support/register'
import {spawn} from 'child_process'
import chalk from 'chalk'
import indentString from 'indent-string'
import webpack from 'webpack'
import webpackConfig from '../webpack.config.babel'
let serverProcess
let wasServerMessage
function startServer () {
serverProcess = spawn('node', [webpackConfig.output.path])
serverProcess.stdout.on('data', data => {
console.log((wasServerMessage ? '' : '\n') + indentString(chalk.white(data), 4))
wasServerMessage = true
})
serverProcess.stderr.on('data', data => {
console.error((wasServerMessage ? '' : '\n') + indentString(chalk.red(data), 4))
wasServerMessage = true
})
}
function stopServer () {
if (serverProcess) serverProcess.kill()
}
const compiler = webpack(webpackConfig)
const watcher = compiler.watch({}, (errors, stats) => {
const hasErrors = errors || stats.hasErrors()
console[hasErrors ? 'error' : 'log']((stats.toString('minimal')))
wasServerMessage = false
stopServer()
if (!hasErrors) startServer()
})
function exit () {
watcher.close()
stopServer()
}
;[
'SIGINT',
'SIGTERM',
'SIGHUP',
'SIGQUIT',
'exit',
'uncaughtException'
].forEach(event => process.on(event, exit))

View File

View File

@ -1,5 +1,5 @@
{
"name": "apollo-upload-examples-client",
"name": "apollo-upload-examples-app",
"private": true,
"dependencies": {
"apollo-upload-client": "^3.0.1",

View File

@ -1,6 +1,6 @@
# Apollo upload examples client
# Apollo upload example web application
An example [Next.js](https://github.com/zeit/next.js) [React Apollo client](http://dev.apollodata.com/react) using [Apollo upload client](https://github.com/jaydenseric/apollo-upload-client).
An example web application using [Next.js](https://github.com/zeit/next.js), [React Apollo client](http://dev.apollodata.com/react) and [Apollo upload client](https://github.com/jaydenseric/apollo-upload-client).
## Setup

View File

@ -1,4 +1,4 @@
# ![Apollo upload examples](https://cdn.rawgit.com/jaydenseric/apollo-upload-examples/v1.0.0/apollo-upload-logo.svg)
# ![Apollo upload examples](https://cdn.rawgit.com/jaydenseric/apollo-upload-examples/v1.0.1/apollo-upload-logo.svg)
![Github release](https://img.shields.io/github/release/jaydenseric/apollo-upload-examples.svg?style=flat-square) ![Github issues](https://img.shields.io/github/issues/jaydenseric/apollo-upload-examples.svg?style=flat-square) ![Github stars](https://img.shields.io/github/stars/jaydenseric/apollo-upload-examples.svg?style=flat-square)
@ -8,4 +8,4 @@ An example GraphQL API using [Apollo upload server](https://github.com/jaydenser
## Setup
See readmes in `/client` and `/api`.
See readmes in `/api` and `/app`.