Skip to content

Commit

Permalink
Remove logger - We don't want chalk tbundled on the client
Browse files Browse the repository at this point in the history
Signed-off-by: Janus Reith <mail@janusreith.de>
  • Loading branch information
Janus Reith authored and Janus Reith committed Apr 12, 2020
1 parent 88423c5 commit 937fdc6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 36 deletions.
5 changes: 2 additions & 3 deletions lib/apollo/apolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ApolloClient, ApolloLink, HttpLink, InMemoryCache, fromPromise } from "
import { setContext } from "@apollo/link-context";
import { onError } from "@apollo/link-error";
import fetch from "isomorphic-unfetch";
import logger from "../logger";
import { omitTypenameLink } from "./omitVariableTypenameLink";

const REFRESH_PATH = "/refresh";
Expand Down Expand Up @@ -57,7 +56,7 @@ export default function createApolloClient() {

if (graphQLErrors) {
graphQLErrors.forEach(({ message, locations, path }) => {
logger.error(`[GraphQL error]: ${message}`, {
console.error(`[GraphQL error]: ${message}`, {
locations,
operationName: operation && operation.operationName,
path
Expand Down Expand Up @@ -97,7 +96,7 @@ export default function createApolloClient() {
return pendingRequestsQueue.flatMap(() => forward(operation));
}
if (errorCode !== STATUS_BAD_REQUEST) {
logger.error(`Unable to access the GraphQL API. Is it running and accessible at ${graphqlUrl} from the Storefront UI server?`);
console.error(`Unable to access the GraphQL API. Is it running and accessible at ${graphqlUrl} from the Storefront UI server?`);
}
}
});
Expand Down
31 changes: 0 additions & 31 deletions lib/logger/index.js

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"apollo-client": "^2.6.8",
"babel-eslint": "^10.1.0",
"body-parser": "~1.19.0",
"chalk": "~2.4.2",
"classnames": "~2.2.6",
"client-sessions": "^0.8.0",
"compression": "~1.7.3",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ chai@~4.2.0:
pathval "^1.1.0"
type-detect "^4.0.5"

chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2, chalk@~2.4.2:
chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down

0 comments on commit 937fdc6

Please sign in to comment.