This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// __IS_SERVER__ declared via Webpack globals | |
// const __IS_SERVER__ = typeof process === 'object' && process + '' === '[object process]'; | |
if (__IS_SERVER__) { | |
const RRNL = require('react-relay-network-modern/node8'); // eslint-disable-line | |
const graphql = require('graphql').graphql; // eslint-disable-line | |
const schema = require('schema').default; // eslint-disable-line | |
return new RRNL.RelayNetworkLayer([ | |
RRNL.cacheMiddleware({ | |
size: 100, | |
ttl: 900000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"ram": "yarn ram-check-disk && yarn ram-create-disk && yarn ram-link-node-modules && yarn ram-link-build && yarn install && yarn start", | |
"ram-check-disk": "[ -d /Volumes/npm_ram_disk ] && echo 'Disk already mounted!' && yarn build && exit 1 || exit 0", | |
"ram-create-disk": "diskutil erasevolume hfsx npm_ram_disk `hdiutil attach -nomount ram://1600000`", | |
"ram-link-node-modules": "mkdir /Volumes/npm_ram_disk/node_modules && rm -r -f ./node_modules && ln -s /Volumes/npm_ram_disk/node_modules ./node_modules", | |
"ram-link-build": "mkdir /Volumes/npm_ram_disk/build && rm -r -f ./build && ln -s /Volumes/npm_ram_disk/build ./build", | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
/* eslint-disable func-names */ | |
import { Schema } from 'mongoose'; | |
import DB from 'schema/db'; | |
import composeWithMongoose from 'graphql-compose-mongoose'; | |
import composeWithRelay from 'graphql-compose-relay'; | |
import crypto from 'crypto'; | |
import bcrypt from 'bcrypt'; | |
import type { $Request } from 'express'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
declare class RelayComponentClass<Props> extends React$Component<Props, any> { | |
static getFragment: Function; | |
}; | |
declare type createFragmentContainer = <TBase>( | |
Component: Class<React$Component<TBase, any>> | (props: TBase) => React.Node, | |
fragmentSpec: any | |
) => Class<RelayComponentClass<TBase>>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ignore] | |
.*/build/.* | |
.*/tools/.* | |
.*/node_modules/.*/test/.* | |
.*/node_modules/.*/tests/.* | |
.*/node_modules/ajv.* | |
.*/node_modules/acorn.* | |
.*/node_modules/async.* | |
.*/node_modules/babel.* | |
.*/node_modules/bluebird.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
/* eslint-disable */ | |
import mongoose from 'mongoose'; | |
export type MongoId = typeof mongoose.Types.ObjectId | { | |
toString(): string, | |
}; | |
export type MongoOrScalarId = MongoId | string | number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable prefer-template */ | |
const path = require('path'); | |
const aliases = require('./aliases'); | |
// /////////////////////////////////////////////////////////////// | |
// ////////////////// PLUGINS //////////////////////////////// | |
// /////////////////////////////////////////////////////////////// | |
const commonPlugins = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import express from 'express'; | |
import { merge } from 'lodash'; | |
import graphqlHTTP from 'express-graphql'; | |
import PrettyError from 'pretty-error'; | |
import expressHttpProxy from 'express-http-proxy'; | |
import bodyParser from 'body-parser'; | |
import raven from 'raven'; | |
import morgan from 'morgan'; | |
import { PORT, PUBLIC_URL } from 'config'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import { ApolloServer } from 'apollo-server-express'; | |
import { ApolloServerPlugin } from 'apollo-server-plugin-base'; | |
import * as Sentry from '@sentry/node'; | |
Sentry.init({ | |
environment: process.env.APP_ENV, | |
// see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482 | |
release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1', | |
dsn: process.env.SENTRY_DSN, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let relayStore; | |
function relayCreateStore() { | |
const env = new Relay.Environment(); | |
env.injectNetworkLayer(new Relay.DefaultNetworkLayer('/graphql')); | |
if (__DEV__) { | |
RelayNetworkDebug.init(env); | |
} | |
env.reset = () => relayCreateStore(); | |
env.mutate = ({ | |
query, |