@jetshop/core 1.1.13-no-proxy.5 → 1.1.13

Sign up to get free protection for your applications and to get access to all the features.
package/boot/apollo.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface ApolloConfig {
14
14
  channel?: SelectedChannel;
15
15
  engineApiKey?: string;
16
16
  }
17
- export declare const createClient: ({ apolloConfig: { token, shopid, channel, graphQLURI } }: {
17
+ export declare const createClient: ({ apolloConfig: { token, shopid, channel } }: {
18
18
  apolloConfig: ApolloConfig;
19
19
  schema?: GraphQLSchema;
20
20
  }) => ApolloClient<NormalizedCacheObject> & {
package/boot/apollo.js CHANGED
@@ -4,10 +4,12 @@ import { onError } from 'apollo-link-error';
4
4
  import { createHttpLink } from 'apollo-link-http';
5
5
  import { withClientState } from 'apollo-link-state';
6
6
  import createCache from '../data/cache';
7
+ // import { SchemaLink } from 'apollo-link-schema';
7
8
  import resolvers from '../resolvers/';
8
9
  import report from '../errorReporting';
9
10
  import inServer from '../inServer';
10
11
  import get from 'lodash.get';
12
+ import { createPersistedQueryLink } from 'apollo-link-persisted-queries';
11
13
  let authToken = null;
12
14
  export const getAuthToken = () => {
13
15
  const localAuthToken = typeof window !== 'undefined' && localStorage.getItem('authToken');
@@ -38,17 +40,19 @@ let preview = false;
38
40
  export const setPreview = (usePreview) => {
39
41
  preview = usePreview;
40
42
  };
41
- export const createClient = ({ apolloConfig: { token, shopid, channel, graphQLURI } }) => {
43
+ export const createClient = ({ apolloConfig: { token, shopid, channel } }) => {
42
44
  if (!token || !shopid) {
43
45
  throw `Missing ${!token && `token`} ${!shopid && `shopid`}`;
44
46
  }
45
- const httpLink = createHttpLink({
46
- uri: graphQLURI,
47
- headers: {
48
- shopid: shopid,
49
- token: token
50
- }
51
- });
47
+ const httpLink = inServer
48
+ ? createHttpLink({
49
+ uri: `http://localhost:${process.env.PORT || 3000}/graphql`,
50
+ headers: {}
51
+ })
52
+ : createHttpLink({
53
+ uri: '/graphql',
54
+ headers: {}
55
+ });
52
56
  const cache = createCache();
53
57
  const channelMiddleware = new ApolloLink((operation, forward) => {
54
58
  // Sets the current channel before each new HTTP request is made
@@ -100,6 +104,7 @@ export const createClient = ({ apolloConfig: { token, shopid, channel, graphQLUR
100
104
  });
101
105
  const stateLink = withClientState(Object.assign({ cache }, resolvers));
102
106
  const link = ApolloLink.from([
107
+ createPersistedQueryLink({ useGETForHashedQueries: true }),
103
108
  errorMiddleware,
104
109
  stateLink,
105
110
  channelMiddleware,
@@ -1 +1 @@
1
- {"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,IAAI,SAAS,GAAkB,IAAI,CAAC;AAEpC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,cAAc,GAClB,OAAO,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACrE,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,EAAE;IAC/C,SAAS,GAAG,QAAQ,CAAC;IACrB,OAAO,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE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C;IAEH,MAAM,MAAM,GAER,IAAI,YAAY,CAAC;QACnB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,MAAc,CAAC,gBAAgB,CAAC;QACzE,OAAO,EAAE,QAAQ;QACjB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC;IAEH,MAAM,CAAC,UAAU,GAAG,CAAC,UAA2B,EAAE,EAAE;QAClD,OAAO,GAAG,UAAU,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -79,11 +79,6 @@ export default function createApolloServer({ apolloConfig, extensions = [] }) {
79
79
  schemas,
80
80
  resolvers
81
81
  });
82
- const engine = apolloConfig.engineApiKey
83
- ? {
84
- apiKey: apolloConfig.engineApiKey
85
- }
86
- : false;
87
82
  const apolloServer = new ApolloServer({
88
83
  schema,
89
84
  // Disable introspection in production
@@ -98,9 +93,13 @@ export default function createApolloServer({ apolloConfig, extensions = [] }) {
98
93
  persistedQueries: {
99
94
  cache: new InMemoryLRUCache()
100
95
  },
101
- tracing: false,
96
+ // Enable tracing if Apollo Engine is configured
97
+ tracing: !!apolloConfig.engineApiKey,
102
98
  cacheControl: true,
103
- engine
99
+ // By setting this to "false", we avoid using Apollo Server 2's
100
+ // integrated metric reporting and fall-back to using the Apollo
101
+ // Engine Proxy (running separately) for metric collection.
102
+ engine: false
104
103
  });
105
104
  return { apolloServer, schema };
106
105
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createApolloServer.js","sourceRoot":"","sources":["createApolloServer.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,YAAY,EAEb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBA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
@@ -19,6 +19,7 @@ export const createDevServer = ({ apolloConfig, port, schemaExtensions }) => __a
19
19
  });
20
20
  apolloServer.applyMiddleware({ app: app });
21
21
  const { port: listenPort } = yield listen({
22
+ apolloConfig,
22
23
  app,
23
24
  port
24
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createDevServer.js","sourceRoot":"","sources":["createDevServer.ts"],"names":[],"mappings":";;;;;;;;AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,kBAAwC,MAAM,sBAAsB,CAAC;AAC5E,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAQ7B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAO,EACpC,YAAY,EACZ,IAAI,EACJ,gBAAgB,EACO,EAAE,EAAE;IAC3B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAEhB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,kBAAkB,CAAC;QAChD,YAAY;QACZ,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IAEH,YAAY,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAE3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC;QACxC,GAAG;QACH,IAAI;KACL,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"createDevServer.js","sourceRoot":"","sources":["createDevServer.ts"],"names":[],"mappings":";;;;;;;;AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,kBAAwC,MAAM,sBAAsB,CAAC;AAC5E,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAQ7B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAO,EACpC,YAAY,EACZ,IAAI,EACJ,gBAAgB,EACO,EAAE,EAAE;IAC3B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAEhB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,kBAAkB,CAAC;QAChD,YAAY;QACZ,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IAEH,YAAY,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAE3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC;QACxC,YAAY;QACZ,GAAG;QACH,IAAI;KACL,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -2,6 +2,7 @@ import { ChannelOverrides, IntlOptions } from '@jetshop/core/boot/server';
2
2
  import { Request, Response } from 'express';
3
3
  import React from 'react';
4
4
  import { ApolloConfig } from '../apollo';
5
+ import { GraphQLSchema } from 'graphql';
5
6
  import { PreloadStats } from './getPrefetchFiles';
6
7
  export interface SlotData {
7
8
  [key: string]: string;
@@ -17,6 +18,7 @@ export interface RendererOptions {
17
18
  tagManagerID: string;
18
19
  intl: IntlOptions;
19
20
  channelOverrides: ChannelOverrides;
21
+ schema: GraphQLSchema;
20
22
  }
21
23
  declare const createRenderer: (template: string, tree: React.ReactElement<any>, options: RendererOptions) => (req: Request & {
22
24
  universalCookies: any;
@@ -102,11 +102,11 @@ const handleError = ({ streamName, res, foot }) => (error) => {
102
102
  endResponse({ res, foot });
103
103
  };
104
104
  const createRenderer = (template, tree, options) => (req, res) => __awaiter(this, void 0, void 0, function* () {
105
- const { apolloConfig, preloadStats, intl } = options;
105
+ const { schema, apolloConfig, preloadStats, intl } = options;
106
106
  // Set response headers immediately
107
107
  res.setHeader('Content-Type', 'text/html');
108
108
  const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
109
- const client = createClient({ apolloConfig });
109
+ const client = createClient({ apolloConfig, schema });
110
110
  const { data: { channels } } = yield client.query({
111
111
  query: channelsQuery
112
112
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["createRenderer.tsx"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAiB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAA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,EAAE,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAEvD,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAEzC,qBAAqB;IACrB,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC;SAC3C,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAExE,wCAAwC;SACvC,IAAI,CAAC,wBAAwB,EAAE,CAAC;SAChC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAE9D,2EAA2E;SAC1E,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACd,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEL,gEAAgE;IAChE,OAAO,MAAM,CAAC,IAAI,CAChB,GAAG,EACH,EAAE,GAAG,EAAE,KAAK,EAAE,CACf,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,4 +1,13 @@
1
- declare const createServer: () => Promise<{
1
+ import { ApolloServer } from 'apollo-server-express';
2
+ import { Client } from 'raven';
3
+ export interface CreateServerOptions {
4
+ Raven: Client;
5
+ apolloServer: ApolloServer;
6
+ }
7
+ declare const createServer: ({ Raven, apolloServer }: {
8
+ Raven: Client;
9
+ apolloServer: ApolloServer;
10
+ }) => Promise<{
2
11
  app: import("express-serve-static-core").Express;
3
12
  }>;
4
13
  export default createServer;
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  });
8
8
  };
9
9
  import express from 'express';
10
+ import compression from 'compression';
10
11
  import paths from '@jetshop/react-scripts/config/paths';
11
12
  import breakpointMiddleware from '@jetshop/core/boot/server/breakpointMiddleware';
12
13
  import cookiesMiddleware from 'universal-cookie-express';
@@ -18,13 +19,22 @@ process.on('unhandledRejection', err => {
18
19
  report(err, { reason: 'unhandledRejection' });
19
20
  throw err;
20
21
  });
21
- const createServer = () => __awaiter(this, void 0, void 0, function* () {
22
+ const createServer = ({ Raven, apolloServer }) => __awaiter(this, void 0, void 0, function* () {
22
23
  const app = express();
24
+ // hook up Sentry.io, Raven as the first middleware
25
+ app.use(Raven.requestHandler());
26
+ app.use(compression());
23
27
  app.use(breakpointMiddleware);
24
28
  app.use(cookiesMiddleware());
29
+ apolloServer.applyMiddleware({
30
+ app: app,
31
+ path: '/graphql'
32
+ });
25
33
  app.use(express.static(paths.appBuild + '/client', {
26
34
  maxAge: '365d'
27
35
  }));
36
+ // hook in Raven error handler as the first error middleware
37
+ app.use(Raven.errorHandler());
28
38
  return { app };
29
39
  });
30
40
  export default createServer;
@@ -1 +1 @@
1
- {"version":3,"file":"createServer.js","sourceRoot":"","sources":["createServer.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,MAAM,qCAAqC,CAAC;AACxD,OAAO,oBAAoB,MAAM,gDAAgD,CAAC;AAClF,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAE1C,qEAAqE;AACrE,6EAA6E;AAC7E,2DAA2D;AAC3D,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,CAAC,EAAE;IACrC,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC9C,MAAM,GAAG,CAAC;AACZ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,GAAS,EAAE;IAC9B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,GAAG,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,eAAe,CAAC;QAC3B,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,EAAE;QACzC,MAAM,EAAE,MAAM;KACf,CAAC,CACH,CAAC;IAEF,4DAA4D;IAC5D,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;IAE9B,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC,CAAA,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
+ import { SchemaExtensions } from './createApolloServer';
2
3
  import { ApolloConfig } from '@jetshop/core/boot/apollo';
3
4
  export declare type TranslationsPromises = {
4
5
  [locale: string]: () => Promise<any>;
@@ -19,7 +20,8 @@ export interface BootOptions {
19
20
  sentryServerDSN: string;
20
21
  intl: IntlOptions;
21
22
  channelOverrides: ChannelOverrides;
23
+ schemaExtensions?: SchemaExtensions;
22
24
  relewareEnabled?: boolean;
23
25
  }
24
- declare const boot: (Component: ReactElement<any>, { apolloConfig, trackingID, tagManagerID, sentryServerDSN, intl, channelOverrides }: BootOptions) => Promise<void>;
26
+ declare const boot: (Component: ReactElement<any>, { apolloConfig, trackingID, tagManagerID, sentryServerDSN, intl, channelOverrides, schemaExtensions }: BootOptions) => Promise<void>;
25
27
  export default boot;
@@ -10,8 +10,10 @@ import fs from 'fs';
10
10
  import checkRequiredFiles from 'react-dev-utils/checkRequiredFiles';
11
11
  import createServer from './createServer';
12
12
  import createRenderer from './createRenderer';
13
+ import createApolloServer from './createApolloServer';
13
14
  import listen from './listen';
14
15
  import asyncErrorHandler from './asyncErrorHandler';
16
+ import Raven from 'raven';
15
17
  import paths from '@jetshop/react-scripts/config/paths';
16
18
  // Increase global max sockets to fix issues with pending requests queuing up.
17
19
  // See http://glynnbird.tumblr.com/post/54587194641/increasing-number-of-outgoing-http-sockets-in
@@ -21,7 +23,7 @@ http.globalAgent.maxSockets = https.globalAgent.maxSockets = Infinity;
21
23
  const templatePath = paths.appBuild + '/index.html';
22
24
  const loadableStatsPath = paths.appBuild + '/react-loadable.json';
23
25
  const checkSentryDSN = (dsn) => !!dsn && dsn.length > 0;
24
- const boot = (Component, { apolloConfig, trackingID, tagManagerID, sentryServerDSN, intl, channelOverrides }) => __awaiter(this, void 0, void 0, function* () {
26
+ const boot = (Component, { apolloConfig, trackingID, tagManagerID, sentryServerDSN, intl, channelOverrides, schemaExtensions }) => __awaiter(this, void 0, void 0, function* () {
25
27
  if (!checkRequiredFiles([templatePath, loadableStatsPath])) {
26
28
  console.error('checkRequiredFiles failed!');
27
29
  process.exit(1);
@@ -31,21 +33,31 @@ const boot = (Component, { apolloConfig, trackingID, tagManagerID, sentryServerD
31
33
  'Check your shop.config.js for sentryServerDSN');
32
34
  process.exit(1);
33
35
  }
36
+ Raven.config(sentryServerDSN, { tags: { BUILD_TARGET: 'server' } }).install();
34
37
  const template = fs.readFileSync(templatePath, 'utf8');
35
38
  const preloadStats = JSON.parse(fs.readFileSync(loadableStatsPath, 'utf8'));
36
- const { app } = yield createServer();
39
+ const { apolloServer, schema } = yield createApolloServer({
40
+ apolloConfig,
41
+ extensions: schemaExtensions
42
+ });
43
+ const { app } = yield createServer({
44
+ Raven: Raven,
45
+ apolloServer
46
+ });
37
47
  const renderer = createRenderer(template, Component, {
38
48
  preloadStats,
39
49
  apolloConfig,
40
50
  trackingID,
41
51
  tagManagerID,
42
52
  intl,
43
- channelOverrides
53
+ channelOverrides,
54
+ schema
44
55
  });
45
56
  app.use(asyncErrorHandler(renderer));
46
57
  const port = parseInt(process.env.PORT, 10) || 3000;
47
- yield listen({ app, port });
58
+ yield listen({ app, port, apolloConfig });
48
59
  console.log(`🚀 App ready at http://localhost:${port}`);
60
+ console.log(`🕸️ GraphQL ready at http://localhost:${port}${apolloServer.graphqlPath}`);
49
61
  });
50
62
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AAE,CAAC,YAAY,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;IAE5E,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC;QACxD,YAAY;QACZ,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,YAAY,CAAC;QACjC,KAAK,EAAE,KAAY;QACnB,YAAY;KACb,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE;QACnD,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,YAAY;QACZ,IAAI;QACJ,gBAAgB;QAChB,MAAM;KACP,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAErC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC;IAEpD,MAAM,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IAE1C,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CACT,0CAA0C,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,CAC5E,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,12 +1,15 @@
1
+ import { ApolloConfig } from '@jetshop/core/boot/apollo';
1
2
  import { Application as ExpressApp } from 'express';
2
3
  export interface ListenOptions {
3
4
  app: ExpressApp;
4
5
  port: number;
6
+ apolloConfig: ApolloConfig;
5
7
  }
6
8
  /**
7
9
  * - Starts listening to `port`
10
+ * - Wraps Express server in Apollo Engine if `apolloConfig.engineApiKey` is set
8
11
  */
9
- declare const listen: ({ app, port }: ListenOptions) => Promise<{
12
+ declare const listen: ({ app, apolloConfig: { engineApiKey }, port }: ListenOptions) => Promise<{
10
13
  port: number;
11
14
  }>;
12
15
  export default listen;
@@ -1,7 +1,18 @@
1
+ import { ApolloEngine } from 'apollo-engine';
1
2
  /**
2
3
  * - Starts listening to `port`
4
+ * - Wraps Express server in Apollo Engine if `apolloConfig.engineApiKey` is set
3
5
  */
4
- const listen = ({ app, port }) => new Promise((resolve, reject) => {
6
+ const listen = ({ app, apolloConfig: { engineApiKey }, port }) => new Promise((resolve, reject) => {
7
+ if (engineApiKey) {
8
+ const engine = new ApolloEngine({
9
+ apiKey: engineApiKey
10
+ });
11
+ engine.listen({ port, expressApp: app }, () => {
12
+ resolve({ port: engine.engineListeningAddress.port });
13
+ });
14
+ return;
15
+ }
5
16
  const http = app.listen({ port }, (err) => {
6
17
  err
7
18
  ? reject(err)
@@ -1 +1 @@
1
- {"version":3,"file":"listen.js","sourceRoot":"","sources":["listen.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAiB,EAA6B,EAAE,CACzE,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,GAAW,EAAE,EAAE;QAChD,GAAG;YACD,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACb,CAAC,CAAC,OAAO,CAAC;gBACN,IAAI,EAAG,IAAI,CAAC,OAAO,EAAoB,CAAC,IAAI;aAC7C,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"listen.js","sourceRoot":"","sources":["listen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS7C;;;GAGG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,GAAG,EACH,YAAY,EAAE,EAAE,YAAY,EAAE,EAC9B,IAAI,EACU,EAA6B,EAAE,CAC7C,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,IAAI,YAAY,EAAE;QAChB,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC;YAC9B,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE;YAC5C,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,OAAO;KACR;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,GAAW,EAAE,EAAE;QAChD,GAAG;YACD,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACb,CAAC,CAAC,OAAO,CAAC;gBACN,IAAI,EAAG,IAAI,CAAC,OAAO,EAAkB,CAAC,IAAI;aAC3C,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
@@ -1,2 +1,4 @@
1
- declare const report: (error: Error, info?: any) => void;
1
+ declare const report: (error: Error, info?: {
2
+ [key: string]: any;
3
+ }) => string;
2
4
  export default report;
package/errorReporting.js CHANGED
@@ -1,3 +1,37 @@
1
- const report = (error, info) => console.error(error, info);
1
+ /*
2
+ use process.env.BUILD_TARGET as compile variable and not the
3
+ imported from @jetshop/core/inServer, because they get different behavior.
4
+ when the state is evaluated at compile time only one
5
+ of the lines will be picked and transpiled into the final code.
6
+ this is important because raven (not raven-js) cant be compiled in
7
+ the client due to non-existing modules in the browser and causes a
8
+ crash in webpack when building it.
9
+ */
10
+ let Raven;
11
+ if (process.env.BUILD_TARGET === 'server') {
12
+ Raven = require('raven');
13
+ }
14
+ else {
15
+ Raven = require('raven-js');
16
+ }
17
+ const convertAnyToError = (error) => {
18
+ const errorType = Object.prototype.toString.call(error);
19
+ try {
20
+ switch (errorType) {
21
+ case '[object Error]':
22
+ return error;
23
+ case '[object String]':
24
+ return new Error(error);
25
+ default:
26
+ return new Error(JSON.stringify(error));
27
+ }
28
+ }
29
+ catch (err) {
30
+ return err;
31
+ }
32
+ };
33
+ const report = (error, info = {}) => Raven.captureException(convertAnyToError(error), {
34
+ extra: info
35
+ });
2
36
  export default report;
3
37
  //# sourceMappingURL=errorReporting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorReporting.js","sourceRoot":"","sources":["errorReporting.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,CAAC,KAAY,EAAE,IAAU,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAExE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"errorReporting.js","sourceRoot":"","sources":["errorReporting.ts"],"names":[],"mappings":"AAEA;;;;;;;;EAQE;AACF,IAAI,KAAa,CAAC;AAClB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,QAAQ,EAAE;IACzC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B;KAAM;IACL,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED,MAAM,iBAAiB,GAAG,CAAC,KAAU,EAAE,EAAE;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,IAAI;QACF,QAAQ,SAAS,EAAE;YACjB,KAAK,gBAAgB;gBACnB,OAAO,KAAK,CAAC;YAEf,KAAK,iBAAiB;gBACpB,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;YAE1B;gBACE,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,GAAG,CAAC;KACZ;AACH,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,KAAY,EAAE,OAAgC,EAAE,EAAE,EAAE,CAClE,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;IAC/C,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetshop/core",
3
- "version": "1.1.13-no-proxy.5",
3
+ "version": "1.1.13",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -10,15 +10,17 @@
10
10
  "@types/lodash.get": "^4.4.4",
11
11
  "@types/lodash.merge": "^4.6.4",
12
12
  "@types/lodash.pick": "^4.4.4",
13
- "@types/node": "^10.12.12",
13
+ "@types/node": "^8.0.53",
14
14
  "@types/node-fetch": "^2.1.2",
15
15
  "@types/qs": "^6.5.1",
16
+ "@types/raven": "^2.5.1",
16
17
  "@types/react": "^16.4.18",
17
18
  "@types/react-dom": "^16.0.9",
18
19
  "@types/react-helmet-async": "^0.0.0",
19
20
  "@types/react-loadable": "^5.4.1",
20
21
  "apollo-cache-inmemory": "^1.3.9",
21
22
  "apollo-client": "^2.4.5",
23
+ "apollo-engine": "^1.1.2",
22
24
  "apollo-link": "^1.2.3",
23
25
  "apollo-link-context": "^1.0.9",
24
26
  "apollo-link-error": "^1.1.1",
@@ -52,6 +54,8 @@
52
54
  "nodemon": "^1.18.7",
53
55
  "prop-types": "^15.6.2",
54
56
  "qs": "^6.5.2",
57
+ "raven": "^2.6.4",
58
+ "raven-js": "^3.27.0",
55
59
  "react": "^16.6.0",
56
60
  "react-apollo": "^2.2.4",
57
61
  "react-cookie": "^3.0.8",
package/polyfills.js CHANGED
@@ -11,11 +11,7 @@ const polyfills = (locale) => [
11
11
  'String.prototype.endsWith',
12
12
  'String.prototype.startsWith',
13
13
  'Object.keys',
14
- 'IntersectionObserver',
15
14
  `Intl.~locale.${locale}`
16
15
  ];
17
- export const createPolyfill = (locale) => {
18
- const features = polyfills(locale).join(',');
19
- return `<script async defer src="//cdn.polyfill.io/v2/polyfill${process.env.NODE_ENV === 'production' ? '.min' : ''}.js?features=${features}&flags=gated&callback=bootShop"></script>`;
20
- };
16
+ export const createPolyfill = (locale) => `<script src="//cdn.polyfill.io/v2/polyfill${process.env.NODE_ENV === 'production' ? '.min' : ''}.js?features=${polyfills(locale).join(',')}&flags=gated"></script>`;
21
17
  //# sourceMappingURL=polyfills.js.map
package/polyfills.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["polyfills.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC;IACpC,KAAK;IACL,YAAY;IACZ,sBAAsB;IACtB,eAAe;IACf,gBAAgB;IAChB,sBAAsB;IACtB,2BAA2B;IAC3B,0BAA0B;IAC1B,sBAAsB;IACtB,2BAA2B;IAC3B,6BAA6B;IAC7B,aAAa;IACb,sBAAsB;IACtB,gBAAgB,MAAM,EAAE;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,yDACL,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EACnD,gBAAgB,QAAQ,2CAA2C,CAAC;AACtE,CAAC,CAAC"}
1
+ {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["polyfills.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC;IACpC,KAAK;IACL,YAAY;IACZ,sBAAsB;IACtB,eAAe;IACf,gBAAgB;IAChB,sBAAsB;IACtB,2BAA2B;IAC3B,0BAA0B;IAC1B,sBAAsB;IACtB,2BAA2B;IAC3B,6BAA6B;IAC7B,aAAa;IACb,gBAAgB,MAAM,EAAE;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE,CAC/C,6CACE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EACnD,gBAAgB,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC"}