Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 41f8df9

Browse files
alexbaluhintrioletas
authored andcommitted
Update dependencies (except apollo-server-koa) (#236)
1 parent a157abd commit 41f8df9

File tree

6 files changed

+2576
-1509
lines changed

6 files changed

+2576
-1509
lines changed

package.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,53 +27,53 @@
2727
},
2828
"dependencies": {
2929
"apollo-server-koa": "1.3.6",
30-
"bluebird": "3.5.1",
31-
"chalk": "2.4.1",
30+
"bluebird": "3.5.3",
31+
"chalk": "2.4.2",
3232
"envalid": "4.1.4",
3333
"flashheart": "2.9.0",
34-
"graphql": "0.13.2",
35-
"graphql-cost-analysis": "1.0.1",
36-
"graphql-playground-middleware-koa": "1.4.2",
37-
"graphql-tools": "3.0.2",
38-
"graphql-voyager": "1.0.0-rc.18",
39-
"koa": "2.5.1",
34+
"graphql": "14.0.2",
35+
"graphql-cost-analysis": "1.0.2",
36+
"graphql-playground-middleware-koa": "1.6.8",
37+
"graphql-tools": "4.0.3",
38+
"graphql-voyager": "1.0.0-rc.26",
39+
"koa": "2.6.2",
4040
"koa-bodyparser": "4.2.1",
4141
"koa-convert": "1.2.0",
4242
"koa-cors": "0.0.16",
4343
"koa-heartbeat": "0.1.2",
4444
"koa-router": "7.4.0",
45-
"lodash": "4.17.10",
46-
"moment": "2.22.2",
47-
"source-map-support": "0.5.6",
48-
"winston": "2.4.2"
45+
"lodash": "4.17.11",
46+
"moment": "2.23.0",
47+
"source-map-support": "0.5.9",
48+
"winston": "3.1.0"
4949
},
5050
"devDependencies": {
51-
"@types/bluebird": "3.5.23",
52-
"@types/graphql": "0.13.4",
53-
"@types/jest": "23.3.1",
54-
"@types/koa": "2.0.46",
55-
"@types/koa-router": "7.0.31",
51+
"@types/bluebird": "3.5.25",
52+
"@types/graphql": "14.0.4",
53+
"@types/jest": "23.3.12",
54+
"@types/koa": "2.0.48",
55+
"@types/koa-router": "7.0.37",
5656
"@types/nock": "9.3.0",
57-
"apollo-cache-inmemory": "1.2.7",
58-
"apollo-client": "2.3.8",
59-
"apollo-link-http": "1.5.4",
57+
"apollo-cache-inmemory": "1.3.12",
58+
"apollo-client": "2.4.8",
59+
"apollo-link-http": "1.5.9",
6060
"cash-touch": "0.2.0",
61-
"chokidar-cli": "1.2.0",
61+
"chokidar-cli": "1.2.1",
6262
"cpx": "1.5.0",
6363
"docker-share": "0.0.4",
64-
"graphql-tag": "2.9.2",
64+
"graphql-tag": "2.10.0",
6565
"graphql-to-typescript": "0.1.2",
6666
"isomorphic-fetch": "2.2.1",
67-
"jest": "23.5.0",
68-
"jest-junit": "5.1.0",
69-
"nock": "9.6.1",
70-
"npm-run-all": "4.1.3",
71-
"rimraf": "2.6.2",
72-
"ts-jest": "23.1.3",
73-
"tsc-watch": "1.0.26",
74-
"tslint": "5.11.0",
75-
"tslint-config-airbnb": "5.9.2",
76-
"typescript": "3.0.1"
67+
"jest": "23.6.0",
68+
"jest-junit": "6.0.0",
69+
"nock": "10.0.6",
70+
"npm-run-all": "4.1.5",
71+
"rimraf": "2.6.3",
72+
"ts-jest": "23.10.5",
73+
"tsc-watch": "1.0.31",
74+
"tslint": "5.12.1",
75+
"tslint-config-airbnb": "5.11.1",
76+
"typescript": "3.2.2"
7777
},
7878
"jest-junit": {
7979
"output": "./reports/test/junit.xml"

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const graphqlMiddleware = graphqlKoa(ctx => ({
4141
],
4242
formatError: (error) => {
4343
const { message, locations, path, stack } = error;
44-
logger.error(`GraphQL error`, { message, locations, path }, stack);
44+
logger.error('GraphQL error', { message, locations, path }, stack);
4545
return error;
4646
},
4747
}));

src/graphql/__tests__/joke.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ beforeAll(() => {
1313
type: 'success',
1414
value: {
1515
id: 2000,
16-
joke: `Chuck Norris can write to an output stream.`,
16+
joke: 'Chuck Norris can write to an output stream.',
1717
categories: [],
1818
},
1919
};
@@ -25,7 +25,7 @@ beforeAll(() => {
2525
type: 'success',
2626
value: {
2727
id: 1000,
28-
joke: `Mock Chuck Norris's database has only one table, 'Kick', which he DROPs frequently.`,
28+
joke: "Mock Chuck Norris's database has only one table, 'Kick', which he DROPs frequently.",
2929
categories: [
3030
'nerdy',
3131
],

src/logger.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
import winston from 'winston';
1+
import { createLogger, transports, format } from 'winston';
22
import moment from 'moment';
33

4-
const logger = new (winston.Logger)({
4+
const timestamp = () => moment().format('YYYY-MM-DD HH:mm:ss.SSSS');
5+
6+
const customFormat = format.printf(options =>
7+
`${timestamp()} ${options.level.toUpperCase()} ${(options.message ? options.message : '')}
8+
${(options.meta && Object.keys(options.meta).length
9+
? '\n\t' + JSON.stringify(options.meta) // tslint:disable-line:prefer-template
10+
: '')}`);
11+
12+
const logger = createLogger({
13+
level: process.env.LOG_LEVEL || 'info',
14+
format: customFormat,
515
transports: [
6-
new (winston.transports.Console)({
7-
timestamp: () => moment().format('YYYY-MM-DD HH:mm:ss.SSSS'),
8-
formatter: options =>
9-
options.timestamp() + ' ' +
10-
options.level.toUpperCase() + ' ' +
11-
(options.message ? options.message : '') +
12-
(
13-
options.meta && Object.keys(options.meta).length
14-
? '\n\t' + JSON.stringify(options.meta)
15-
: ''
16-
),
17-
}),
16+
new (transports.Console)(),
1817
],
1918
});
2019

21-
logger.level = process.env.LOG_LEVEL || 'info';
22-
2320
export default logger;

src/server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ const port = process.env.PORT;
1010
app.listen(port, () => {
1111
if (process.env.NODE_ENV === 'development') {
1212
if (process.env.GRAPHIQL) {
13-
console.log(`The GraphiQL App is running at:`);
13+
console.log('The GraphiQL App is running at:');
1414
console.log();
1515
console.log(` ${chalk.cyan(`http://localhost:${port}/${process.env.GRAPHIQL_PATH }`)}`);
1616
} else {
17-
console.log(`The Koa App is running at:`);
17+
console.log('The Koa App is running at:');
1818
console.log();
1919
console.log(` ${chalk.cyan(`http://localhost:${port}`)}`);
2020
}
2121
if (process.env.VOYAGER) {
2222
if (process.env.GRAPHIQL) {
2323
console.log();
2424
}
25-
console.log(`The GraphQL Voyager App is running at:`);
25+
console.log('The GraphQL Voyager App is running at:');
2626
console.log();
2727
console.log(` ${chalk.cyan(`http://localhost:${port}/${process.env.VOYAGER_PATH}`)}`);
2828
}
2929
if (process.env.PLAYGROUND) {
3030
if (process.env.GRAPHIQL || process.env.VOYAGER) {
3131
console.log();
3232
}
33-
console.log(`The GraphQL Plaground App is running at:`);
33+
console.log('The GraphQL Plaground App is running at:');
3434
console.log();
3535
console.log(` ${chalk.cyan(`http://localhost:${port}/${process.env.PLAYGROUND_PATH}`)}`);
3636
}
3737
} else {
38-
console.log(`The Koa App is running`);
38+
console.log('The Koa App is running');
3939
}
4040
});

0 commit comments

Comments
 (0)