Skip to content

Commit

Permalink
Enable esModuleInterop and fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnwalraven committed Jun 11, 2018
1 parent 2f44a42 commit e4164c8
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import testSuite, {
import { expect } from 'chai';
import { GraphQLOptions } from 'apollo-server-core';
import 'mocha';
import * as url from 'url';
import url from 'url';

function createFunction(options: CreateAppOptions = {}) {
let route, context;
Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-server-core/src/ApolloServer.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* tslint:disable:no-unused-expression */
import { expect } from 'chai';
import { stub } from 'sinon';
import * as http from 'http';
import * as net from 'net';
import http from 'http';
import net from 'net';
import 'mocha';

import {
Expand All @@ -16,7 +16,7 @@ import {

import { PubSub } from 'graphql-subscriptions';
import { SubscriptionClient } from 'subscriptions-transport-ws';
import * as WebSocket from 'ws';
import WebSocket from 'ws';

import { createApolloFetch } from 'apollo-fetch';
import { ApolloServerBase } from './ApolloServer';
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/runHttpQuery.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable:no-unused-expression */
import { expect } from 'chai';
import 'mocha';
import * as MockReq from 'mock-req';
import MockReq from 'mock-req';

import { GraphQLSchema, GraphQLObjectType, GraphQLString } from 'graphql';

Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/runQuery.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable:no-unused-expression */
import { expect } from 'chai';
import { stub } from 'sinon';
import * as MockReq from 'mock-req';
import MockReq from 'mock-req';
import 'mocha';

import {
Expand Down
8 changes: 4 additions & 4 deletions packages/apollo-server-express/src/ApolloServer.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from 'chai';
import 'mocha';
import * as express from 'express';
import express from 'express';

import * as request from 'request';
import * as FormData from 'form-data';
import * as fs from 'fs';
import request from 'request';
import FormData from 'form-data';
import fs from 'fs';
import fetch from 'node-fetch';
import { createApolloFetch } from 'apollo-fetch';

Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-server-express/src/ApolloServer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as express from 'express';
import * as corsMiddleware from 'cors';
import express from 'express';
import corsMiddleware from 'cors';
import { json, OptionsJson } from 'body-parser';
import { createServer } from 'http';
import gui from 'graphql-playground-middleware-express';
import { ApolloServerBase, formatApolloErrors } from 'apollo-server-core';
import * as accepts from 'accepts';
import accepts from 'accepts';

import { graphqlExpress } from './expressApollo';

Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-server-express/src/apolloServerHttp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { graphqlExpress } from './expressApollo';
*/

import { expect } from 'chai';
import * as zlib from 'zlib';
import * as multer from 'multer';
import * as bodyParser from 'body-parser';
import zlib from 'zlib';
import multer from 'multer';
import bodyParser from 'body-parser';
const request = require('supertest');
const express4 = require('express'); // modern
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-express/src/connectApollo.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as connect from 'connect';
import * as bodyParser from 'body-parser';
import connect from 'connect';
import bodyParser from 'body-parser';
import { graphqlConnect, graphiqlConnect } from './connectApollo';
import 'mocha';

Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-express/src/expressApollo.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as express from 'express';
import * as bodyParser from 'body-parser';
import express from 'express';
import bodyParser from 'body-parser';
import { graphqlExpress, graphiqlExpress } from './expressApollo';
import testSuite, {
schema as Schema,
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-express/src/expressApollo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as express from 'express';
import * as url from 'url';
import express from 'express';
import url from 'url';
import {
GraphQLOptions,
HttpQueryError,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-hapi/src/ApolloServer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as hapi from 'hapi';
import hapi from 'hapi';
import { ApolloServerBase, EngineLauncherOptions } from 'apollo-server-core';
import { parseAll } from 'accept';
import { renderPlaygroundPage } from 'graphql-playground-html';
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-hapi/src/hapiApollo.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as hapi from 'hapi';
import hapi from 'hapi';
import { graphqlHapi, graphiqlHapi } from './hapiApollo';
import 'mocha';

Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-hapi/src/hapiApollo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Boom from 'boom';
import Boom from 'boom';
import { Server, Request } from 'hapi';
import * as GraphiQL from 'apollo-server-module-graphiql';
import {
Expand Down
8 changes: 4 additions & 4 deletions packages/apollo-server-koa/src/koaApollo.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as koa from 'koa';
import * as koaRouter from 'koa-router';
import * as koaBody from 'koa-bodyparser';
import koa from 'koa';
import koaRouter from 'koa-router';
import koaBody from 'koa-bodyparser';
import { graphqlKoa, graphiqlKoa } from './koaApollo';
import { GraphQLOptions } from 'apollo-server-core';
import { expect } from 'chai';
import * as http from 'http';
import http from 'http';

import testSuite, {
schema as Schema,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-koa/src/koaApollo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as koa from 'koa';
import koa from 'koa';
import {
GraphQLOptions,
HttpQueryError,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-lambda/src/lambdaApollo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import testSuite, {
import { expect } from 'chai';
import { GraphQLOptions } from 'apollo-server-core';
import 'mocha';
import * as url from 'url';
import url from 'url';

function createLambda(options: CreateAppOptions = {}) {
let route, handler, callback, event, context;
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-lambda/src/lambdaApollo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as lambda from 'aws-lambda';
import lambda from 'aws-lambda';
import { GraphQLOptions, runHttpQuery } from 'apollo-server-core';
import * as GraphiQL from 'apollo-server-module-graphiql';

Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-micro/src/microApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from 'apollo-server-core';
import * as GraphiQL from 'apollo-server-module-graphiql';
import { json, RequestHandler } from 'micro';
import * as url from 'url';
import url from 'url';
import { IncomingMessage, ServerResponse } from 'http';

export interface MicroGraphQLOptionsFunction {
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-restify/src/restifyApollo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as restify from 'restify';
import * as url from 'url';
import restify from 'restify';
import url from 'url';
import {
GraphQLOptions,
HttpQueryError,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import 'mocha';

import * as request from 'request';
import request from 'request';
import { createApolloFetch } from 'apollo-fetch';

import { gql, ApolloServer } from './index';
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as express from 'express';
import express from 'express';
import { Request } from 'express';
import { registerServer } from 'apollo-server-express';

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"target": "es2017",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"sourceMap": true,
"declaration": true,
"noImplicitAny": false,
Expand Down

0 comments on commit e4164c8

Please sign in to comment.