Remove old deps
This commit is contained in:
parent
a1adf0e7fc
commit
ec796d9813
@ -39,8 +39,6 @@ By default, this build will expose only the "public" schema - to add other schem
|
||||
|
||||
Install dependencies with `yarn` and execute `yarn build`. The bundle produced by Webpack will be present in `build/dist/`.
|
||||
|
||||
This application currently uses the Postgraphile supporter plugin. This plugin is present in the `vendor/` directory and is copied to `node_modules/` after installation of packages. It is a fresh checkout of the plugin as of August 31st, 2018.
|
||||
|
||||
## Running
|
||||
|
||||
Provide the built bundle to node as a runnable script: `node ./build/dist/vulcanize-postgraphile-server.js`
|
||||
|
@ -5,7 +5,6 @@
|
||||
"scripts": {
|
||||
"build": "rm -rf ./build/dist && webpack --config=./webpack.config.js",
|
||||
"lint": "tslint --project ./tsconfig.json --config ./tslint.json",
|
||||
"postinstall": "rm -rf node_modules/@graphile && mkdir node_modules/@graphile && cp -R ./vendor/postgraphile-supporter/ ./node_modules/@graphile/plugin-supporter/",
|
||||
"start": "npm run build && node ./build/dist/vulcanize-postgraphile-server.js",
|
||||
"dev": "./node_modules/typescript/bin/tsc && node build/dist/src/index.js",
|
||||
"test": "rm -rf ./build/spec && tsc --build ./tsconfig.test.json && jasmine --config=./spec/support/jasmine.json",
|
||||
|
@ -33,7 +33,6 @@ describe('buildServerConfig', () => {
|
||||
|
||||
serverUtilities = {
|
||||
pluginHook: jasmine.createSpy('pluginHook'),
|
||||
enableSubscriptions: jasmine.createSpy('enableSubscriptions'),
|
||||
express: jasmine.createSpy('express'),
|
||||
expressSession: jasmine.createSpy('expressSession'),
|
||||
httpServerFactory: jasmine.createSpy('httpServerFactory'),
|
||||
@ -67,10 +66,6 @@ describe('buildServerConfig', () => {
|
||||
expect(serverConfig.options).not.toBeNull();
|
||||
});
|
||||
|
||||
it('enables simple subscriptions', () => {
|
||||
expect(serverConfig.options.simpleSubscriptions).toBe(true);
|
||||
});
|
||||
|
||||
it('it adds the express session handler as the first middleware', () => {
|
||||
expect(serverConfig.options.webSocketMiddlewares[0])
|
||||
.toBe(expressSessionHandler);
|
||||
|
@ -15,7 +15,6 @@ describe('bootServer', () => {
|
||||
beforeEach(() => {
|
||||
serverUtilities = {
|
||||
pluginHook: jasmine.createSpy('pluginHook'),
|
||||
enableSubscriptions: jasmine.createSpy('enableSubscriptions'),
|
||||
express: jasmine.createSpy('express'),
|
||||
expressSession: jasmine.createSpy('expressSession'),
|
||||
httpServerFactory: jasmine.createSpy('httpServerFactory'),
|
||||
@ -34,7 +33,6 @@ describe('bootServer', () => {
|
||||
ignoreRBAC: false,
|
||||
ownerConnectionString: '',
|
||||
pluginHook: jasmine.createSpy('pluginHook'),
|
||||
simpleSubscriptions: true,
|
||||
watchPg: true,
|
||||
webSocketMiddlewares: [] },
|
||||
port: 5678
|
||||
@ -61,14 +59,6 @@ describe('bootServer', () => {
|
||||
expect(useSpy).toHaveBeenCalledWith(serverConfig.middleware);
|
||||
});
|
||||
|
||||
it('enahances the Node HTTP server with Postgraphile subscriptions', () => {
|
||||
expect(serverUtilities.enableSubscriptions)
|
||||
.toHaveBeenCalledWith(
|
||||
mockHttpServer,
|
||||
serverConfig.middleware,
|
||||
serverConfig.options);
|
||||
});
|
||||
|
||||
it('instructs the server to listen on the given port', () => {
|
||||
const listenSpy = mockHttpServer.listen as jasmine.Spy;
|
||||
expect(listenSpy).toHaveBeenCalledWith(serverConfig.port);
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { RequestHandler } from 'express';
|
||||
import { Server } from 'http';
|
||||
import {PluginHookFn, PostGraphilePlugin} from 'postgraphile/build/postgraphile/pluginHook';
|
||||
import {PluginHookFn } from 'postgraphile/build/postgraphile/pluginHook';
|
||||
import {Plugin} from 'postgraphile';
|
||||
|
||||
// NOTE: Shape of the middleware is not
|
||||
@ -18,7 +17,6 @@ export interface PostgraphileOptions {
|
||||
ignoreRBAC: boolean;
|
||||
ownerConnectionString: string;
|
||||
pluginHook: PluginHookFn;
|
||||
simpleSubscriptions: boolean;
|
||||
watchPg: boolean;
|
||||
// NOTE Shape of the middlewares is not
|
||||
// currently important to this application, but if a need arises,
|
||||
@ -32,8 +30,3 @@ export type PostgraphileInitCallback = (
|
||||
options: PostgraphileOptions
|
||||
) => PostgraphileMiddleware;
|
||||
|
||||
export type AddSubscriptionsCallback = (
|
||||
httpServer: Server,
|
||||
middleware: PostgraphileMiddleware,
|
||||
options: PostgraphileOptions
|
||||
) => void;
|
||||
|
@ -7,11 +7,7 @@ import passport = require('passport');
|
||||
import session = require('express-session');
|
||||
import toml = require('toml');
|
||||
|
||||
const {
|
||||
default: PostGraphileSupporter,
|
||||
enhanceHttpServerWithSubscriptions,
|
||||
} = require('@graphile/plugin-supporter');
|
||||
const pluginHook = makePluginHook([PostGraphileSupporter]);
|
||||
const pluginHook = makePluginHook([]);
|
||||
|
||||
import { ServerUtilities } from './server/interface';
|
||||
import { bootServer } from './server/runtime';
|
||||
@ -27,7 +23,6 @@ const configPath = process.env[CONFIG_PATH_KEY];
|
||||
const serverPort = process.env[SERVER_PORT_KEY];
|
||||
|
||||
const serverUtilities: ServerUtilities = {
|
||||
enableSubscriptions: enhanceHttpServerWithSubscriptions,
|
||||
express,
|
||||
expressSession: session,
|
||||
httpServerFactory: createServer,
|
||||
|
@ -34,7 +34,6 @@ export function buildServerConfig(
|
||||
ignoreRBAC: false,
|
||||
ownerConnectionString: databaseConfig.ownerConnectionString,
|
||||
pluginHook: pluginHook,
|
||||
simpleSubscriptions: true,
|
||||
watchPg: true,
|
||||
webSocketMiddlewares: [
|
||||
expressSessionHandler,
|
||||
|
@ -7,7 +7,6 @@ import {
|
||||
} from '../adapters/session';
|
||||
|
||||
import {
|
||||
AddSubscriptionsCallback,
|
||||
PostgraphileInitCallback,
|
||||
PostgraphileMiddleware,
|
||||
PostgraphileOptions
|
||||
@ -28,7 +27,6 @@ export interface ServerConfig {
|
||||
}
|
||||
|
||||
export interface ServerUtilities {
|
||||
enableSubscriptions: AddSubscriptionsCallback;
|
||||
express: ExpressInitCallback;
|
||||
expressSession: ExpressSessionInitCallback;
|
||||
httpServerFactory: CreateHttpServerCallback;
|
||||
|
@ -8,11 +8,6 @@ export function bootServer(
|
||||
expressApp.use(config.middleware);
|
||||
|
||||
const httpServer = utilities.httpServerFactory(expressApp);
|
||||
|
||||
utilities.enableSubscriptions(
|
||||
httpServer,
|
||||
config.middleware,
|
||||
config.options);
|
||||
|
||||
httpServer.listen(config.port);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user