Skip to content

Commit

Permalink
chore(monorepo): moved original code into one directory (WIP)
Browse files Browse the repository at this point in the history
TODO:
 [ ] Pending new lerna version with root-dev patch. (lerna/lerna#357)
 [ ] Pending new name for apollo-server to be chosen. (apollographql#163)
 [ ] Need to Create GitHub labels and modify lerna.json according it.
 [ ] Add Different README.md for each package ??
 [ ] Make sure tests/coverage are working
  • Loading branch information
DxCx committed Oct 4, 2016
1 parent b6819ec commit a4e5247
Show file tree
Hide file tree
Showing 51 changed files with 574 additions and 131 deletions.
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

16 changes: 16 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"lerna": "2.0.0-beta.29",
"version": "0.3.2",
"changelog": {
"repo": "apollostack/apollo-server",
"labels": {
"tag: spec compliancy": ":eyeglasses: Spec Compliancy",
"tag: breaking change": ":boom: Breaking Change",
"tag: new feature": ":rocket: New Feature",
"tag: bug fix": ":bug: Bug Fix",
"tag: polish": ":nail_care: Polish",
"tag: documentation": "Documentation",
"tag: internal": ":house: Internal"
}
}
}
89 changes: 16 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,98 +1,41 @@
{
"name": "apollo-server",
"version": "0.3.2",
"description": "Production-ready Node.js GraphQL server for Express, Hapi, Koa",
"main": "dist/index.js",
"directories": {
"test": "test"
"private": true,
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/apollostack/apollo-server.git"
},
"scripts": {
"compile": "tsc",
"typings": "typings install",
"compile": "lerna exec -- npm run compile",
"lint": "tslint ./packages/**/src/**/*.ts",
"prebootstrap": "npm install",
"bootstrap": "lerna bootstrap",
"pretest": "npm run compile",
"test": "npm run testonly --",
"posttest": "npm run lint",
"lint": "tslint ./src/**/*.ts",
"watch": "tsc -w",
"testonly": "mocha --compilers js:babel-core/register --reporter spec --full-trace ./dist/test/tests.js",
"coverage": "babel-node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js",
"testonly": "mocha --compilers js:babel-core/register --reporter spec --full-trace ./test/tests.js",
"coverage": "babel-node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./test/tests.js",
"postcoverage": "remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info"
},
"repository": {
"type": "git",
"url": "git+https://github.com/apollostack/apollo-server.git"
},
"keywords": [
"GraphQL",
"Apollo",
"Hapi",
"Koa",
"Express",
"Javascript"
],
"author": "Jonas Helfer <jonas@helfer.email>",
"license": "MIT",
"bugs": {
"url": "https://github.com/apollostack/apollo-proxy/issues"
},
"homepage": "https://github.com/apollostack/apollo-proxy#readme",
"dependencies": {
"@types/body-parser": "0.0.33",
"@types/boom": "0.0.32",
"@types/chai": "^3.4.34",
"@types/connect": "^3.4.30",
"@types/cookies": "^0.5.30",
"@types/express": "^4.0.33",
"@types/express-serve-static-core": "^4.0.36",
"@types/fibers": "0.0.29",
"@types/hapi": "^13.0.35",
"@types/http-errors": "^1.3.29",
"@types/koa": "^2.0.33",
"@types/koa-bodyparser": "^3.0.19",
"@types/koa-router": "^7.0.21",
"@types/mime": "0.0.29",
"@types/multer": "0.0.32",
"@types/node": "^6.0.41",
"@types/serve-static": "^1.7.31",
"boom": "^4.0.0",
"http-errors": "^1.5.0",
"source-map-support": "^0.4.2",
"typed-graphql": "^1.0.2"
},
"devDependencies": {
"@types/chai": "^3.4.34",
"@types/mocha": "^2.2.32",
"@types/node": "^6.0.42",
"@types/sinon": "^1.16.31",
"babel-cli": "^6.11.4",
"babel-core": "^6.11.4",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0",
"body-parser": "^1.15.2",
"chai": "^3.5.0",
"connect": "^3.4.1",
"express": "^4.14.0",
"fibers": "^1.0.13",
"graphql": "^0.7.0",
"hapi": "^15.0.3",
"istanbul": "1.0.0-alpha.2",
"koa": "^2.0.0-alpha.4",
"koa-bodyparser": "^3.0.0",
"koa-router": "^7.0.1",
"meteor-promise": "^0.7.3",
"lerna": "^2.0.0-beta.29",
"mocha": "^3.0.0",
"multer": "^1.1.0",
"remap-istanbul": "^0.6.4",
"sinon": "^1.17.5",
"sinon": "^1.17.6",
"supertest": "^2.0.0",
"supertest-as-promised": "^4.0.0",
"tslint": "^3.13.0",
"typescript": "^2.0.3",
"typings": "^1.3.2"
},
"peerDependencies": {
"graphql": "^0.6.1 || ^0.7.0"
},
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
"typescript": "^2.0.3"
}
}
5 changes: 5 additions & 0 deletions packages/apollo-server-core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!dist
!dist/**/*
dist/**/*.test.*
!package.json
41 changes: 41 additions & 0 deletions packages/apollo-server-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "apollo-server-core",
"version": "0.3.2",
"description": "Core engine ffor Apollo GraphQL server",
"main": "dist/index.js",
"scripts": {
"compile": "tsc",
"prepublish": "npm run compile"
},
"repository": {
"type": "git",
"url": "https://github.com/apollostack/apollo-server/tree/master/packages/apollo-server-core"
},
"keywords": [
"GraphQL",
"Apollo",
"Server",
"Javascript"
],
"author": "Jonas Helfer <jonas@helfer.email>",
"license": "MIT",
"bugs": {
"url": "https://github.com/apollostack/apollo-server/issues"
},
"homepage": "https://github.com/apollostack/apollo-server#readme",
"dependencies": {
"typed-graphql": "^1.0.2"
},
"devDependencies": {
"@types/fibers": "0.0.29",
"fibers": "^1.0.13",
"meteor-promise": "^0.7.3"
},
"peerDependencies": {
"graphql": "^0.6.1 || ^0.7.0"
},
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLSchema, ValidationRule } from 'graphql';
import { LogFunction } from '../core/runQuery';
import { LogFunction } from './runQuery';

/*
* ExpressApolloOptions
Expand Down
2 changes: 2 additions & 0 deletions packages/apollo-server-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { runQuery, LogFunction, LogMessage, LogStep, LogAction } from './runQuery'
export { default as ApolloOptions} from './apolloOptions'
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from 'chai';
import { stub } from 'sinon';
import 'mocha';

import {
GraphQLSchema,
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions packages/apollo-server-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"noImplicitAny": false,
"rootDir": "./src",
"outDir": "./dist",
"allowSyntheticDefaultImports": false,
"pretty": true,
"removeComments": true,
"typeRoots": [
"node_modules/@types"
],
"types": [
"typed-graphql",
"@types/node"
]
},
"exclude": [
"node_modules",
"dist"
]
}
5 changes: 5 additions & 0 deletions packages/apollo-server-express/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!dist
!dist/**/*
dist/**/*.test.*
!package.json
51 changes: 51 additions & 0 deletions packages/apollo-server-express/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "apollo-server-express",
"version": "0.3.2",
"description": "Production-ready Node.js GraphQL server for Express, Connect",
"main": "dist/index.js",
"scripts": {
"compile": "tsc",
"prepublish": "npm run compile"
},
"repository": {
"type": "git",
"url": "https://github.com/apollostack/apollo-server/tree/master/packages/apollo-server-express"
},
"keywords": [
"GraphQL",
"Apollo",
"Server",
"Express",
"Connect",
"Javascript"
],
"author": "Jonas Helfer <jonas@helfer.email>",
"license": "MIT",
"bugs": {
"url": "https://github.com/apollostack/apollo-server/issues"
},
"homepage": "https://github.com/apollostack/apollo-server#readme",
"dependencies": {
"@types/express": "^4.0.33",
"apollo-server-core": "^0.3.2",
"apollo-server-graphiql": "^0.3.2"
},
"devDependencies": {
"@types/body-parser": "0.0.33",
"@types/connect": "^3.4.30",
"@types/multer": "0.0.32",
"apollo-server-integration-testsuite": "^0.3.2",
"body-parser": "^1.15.2",
"connect": "^3.4.1",
"express": "^4.14.0",
"multer": "^1.2.0",
"typed-graphql": "^1.0.2"
},
"peerDependencies": {
"graphql": "^0.6.1 || ^0.7.0"
},
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* sure apolloServer still works if used in the place of express-graphql.
*/

import { apolloExpress } from '../integrations/expressApollo';
import { apolloExpress } from './expressApollo';

/**
* Copyright (c) 2015, Facebook, Inc.
Expand Down Expand Up @@ -108,7 +108,6 @@ function promiseTo(fn) {
});
}


describe('test harness', () => {

it('expects to catch errors', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as connect from 'connect';
import * as bodyParser from 'body-parser';
import { apolloConnect, graphiqlConnect } from './connectApollo';
import 'mocha';

import testSuite, { Schema, CreateAppOptions } from './integrations.test';
import testSuite, { Schema, CreateAppOptions } from 'apollo-server-integration-testsuite';

function createConnectApp(options: CreateAppOptions = {}) {
const app = connect();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as express from 'express';
import * as bodyParser from 'body-parser';
import { apolloExpress, graphiqlExpress } from './expressApollo';
import testSuite, { Schema, CreateAppOptions } from './integrations.test';
import testSuite, { Schema, CreateAppOptions } from 'apollo-server-integration-testsuite';
import { expect } from 'chai';
import ApolloOptions from './apolloOptions';
import { ApolloOptions } from 'apollo-server-core';
import 'mocha';

function createApp(options: CreateAppOptions = {}) {
const app = express();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as express from 'express';
import * as graphql from 'graphql';
import * as url from 'url';
import { runQuery } from '../core/runQuery';

import ApolloOptions from './apolloOptions';
import * as GraphiQL from '../modules/renderGraphiQL';
import { ApolloOptions, runQuery } from 'apollo-server-core';
import * as GraphiQL from 'apollo-server-graphiql';

export interface ExpressApolloOptionsFunction {
(req?: express.Request, res?: express.Response): ApolloOptions | Promise<ApolloOptions>;
Expand Down Expand Up @@ -149,7 +147,6 @@ export function graphiqlExpress(options: GraphiQL.GraphiQLData) {
const variables = q.variables || '{}';
const operationName = q.operationName || '';


const graphiQLString = GraphiQL.renderGraphiQL({
endpointURL: options.endpointURL,
query: query || options.query,
Expand Down
2 changes: 2 additions & 0 deletions packages/apollo-server-express/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { ExpressApolloOptionsFunction, ExpressHandler, apolloExpress, graphiqlExpress } from './expressApollo';
export { apolloConnect, graphiqlConnect } from './connectApollo';
26 changes: 26 additions & 0 deletions packages/apollo-server-express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"noImplicitAny": false,
"rootDir": "./src",
"outDir": "./dist",
"allowSyntheticDefaultImports": false,
"pretty": true,
"removeComments": true,
"typeRoots": [
"node_modules/@types"
],
"types": [
"typed-graphql",
"@types/node"
]
},
"exclude": [
"node_modules",
"dist"
]
}
5 changes: 5 additions & 0 deletions packages/apollo-server-graphiql/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!dist
!dist/**/*
dist/**/*.test.*
!package.json
Loading

0 comments on commit a4e5247

Please sign in to comment.