Skip to content

Commit

Permalink
Added packages
Browse files Browse the repository at this point in the history
  • Loading branch information
birkir committed Jan 6, 2019
1 parent 0c34e89 commit 0a8308e
Show file tree
Hide file tree
Showing 22 changed files with 12,809 additions and 53 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


# End of https://www.gitignore.io/api/node

lib/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}
2 changes: 2 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.0.0"
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"lerna": "^3.4.3"
"@types/node": "10.12.18",
"lerna": "^3.4.3",
"typescript": "3.2.2"
}
}

This file was deleted.

7 changes: 0 additions & 7 deletions packages/graphql-gatsby-express/lib/graphql-gatsby-express.js

This file was deleted.

16 changes: 13 additions & 3 deletions packages/graphql-gatsby-express/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "graphql-gatsby-express",
"version": "0.0.0",
"description": "> TODO: description",
"description": "Express middleware for graphql-express",
"author": "Birkir Gudjonsson <birkir.gudjonsson@gmail.com>",
"homepage": "https://github.com/birkir/graphql-gatsby#readme",
"license": "MIT",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
"lib": "lib"
},
"files": [
"lib"
Expand All @@ -22,5 +21,16 @@
},
"bugs": {
"url": "https://github.com/birkir/graphql-gatsby/issues"
},
"devDependencies": {
"@types/express": "4.16.0",
"typescript": "^3.2.2"
},
"dependencies": {
"apollo-server-express": "2.3.1",
"graphql-gatsby": "^0.0.1"
},
"publishConfig": {
"access": "public"
}
}
19 changes: 19 additions & 0 deletions packages/graphql-gatsby-express/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ApolloServer, ServerRegistration } from 'apollo-server-express';
import { getGatsbySchema, GetGatsbySchemaConfig } from 'graphql-gatsby';

interface GatsbyMiddlewareOptions {
app: ServerRegistration["app"];
config?: GetGatsbySchemaConfig;
}

export default {
applyMiddleware({ app, config }: GatsbyMiddlewareOptions) {
return getGatsbySchema(config).then(({ schema }) => {
const server = new ApolloServer({
schema
});

return server.applyMiddleware({ app });
});
}
}
7 changes: 7 additions & 0 deletions packages/graphql-gatsby-express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
}
}

This file was deleted.

7 changes: 0 additions & 7 deletions packages/graphql-gatsby-koa/lib/graphql-gatsby-koa.js

This file was deleted.

16 changes: 13 additions & 3 deletions packages/graphql-gatsby-koa/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "graphql-gatsby-koa",
"version": "0.0.0",
"description": "> TODO: description",
"description": "Koa middleware for graphql-gatsby",
"author": "Birkir Gudjonsson <birkir.gudjonsson@gmail.com>",
"homepage": "https://github.com/birkir/graphql-gatsby#readme",
"license": "MIT",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
"lib": "lib"
},
"files": [
"lib"
Expand All @@ -22,5 +21,16 @@
},
"bugs": {
"url": "https://github.com/birkir/graphql-gatsby/issues"
},
"devDependencies": {
"@types/koa": "2.0.48",
"typescript": "^3.2.2"
},
"dependencies": {
"apollo-server-koa": "2.3.1",
"graphql-gatsby": "^0.0.1"
},
"publishConfig": {
"access": "public"
}
}
19 changes: 19 additions & 0 deletions packages/graphql-gatsby-koa/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ApolloServer, ServerRegistration } from 'apollo-server-koa';
import { getGatsbySchema, GetGatsbySchemaConfig } from 'graphql-gatsby';

interface GatsbyMiddlewareOptions {
app: ServerRegistration["app"];
config?: GetGatsbySchemaConfig;
}

export default {
applyMiddleware({ app, config }: GatsbyMiddlewareOptions) {
return getGatsbySchema(config).then(({ schema }) => {
const server = new ApolloServer({
schema
});

return server.applyMiddleware({ app });
});
}
}
7 changes: 0 additions & 7 deletions packages/graphql-gatsby/__tests__/graphql-gatsby.test.js

This file was deleted.

26 changes: 22 additions & 4 deletions packages/graphql-gatsby/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "graphql-gatsby",
"version": "0.0.0",
"description": "> TODO: description",
"version": "0.0.1",
"description": "GraphQL tools for standalone Gatsby schema",
"keywords": [
"gatsby",
"graphql",
Expand All @@ -12,8 +12,7 @@
"license": "MIT",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
"lib": "lib"
},
"files": [
"lib"
Expand All @@ -27,5 +26,24 @@
},
"bugs": {
"url": "https://github.com/birkir/graphql-gatsby/issues"
},
"dependencies": {
"gatsby": "2.0.85",
"graphql": "14.0.2",
"lodash": "4.17.11",
"pkg-dir": "3.0.0",
"react": "16.7.0",
"react-dom": "16.7.0",
"slash": "2.0.0"
},
"resolutions": {
"graphql": "14.0.2"
},
"devDependencies": {
"@types/pkg-dir": "^2.0.0",
"typescript": "^3.2.2"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit 0a8308e

Please sign in to comment.