[chore] NodeJS 12 (#2722)

* chore: upgraded node 12, more log lines

- upgraded from 10 LTS to 12 LTS
- added log line with userID to GraphQL
  log entry

* fix: adjusted some intl formats
This commit is contained in:
Wyatt Johnson
2019-11-22 22:46:16 +00:00
committed by GitHub
parent 7c2e56b751
commit bf89fc2b3e
11 changed files with 12 additions and 18 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ export default function createWebpackConfig(
"@babel/typescript",
[
"@babel/env",
{ targets: { node: "10.0.0" }, modules: "commonjs" },
{ targets: { node: "12.0.0" }, modules: "commonjs" },
],
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
@@ -37,7 +37,7 @@ const UserStatusDetailsContainer: FunctionComponent<Props> = ({ user }) => {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
hour: "numeric",
minute: "2-digit",
});
@@ -33,7 +33,7 @@ const StoryRowContainer: FunctionComponent<Props> = props => {
month: "2-digit",
year: "numeric",
hour12: true,
hour: "2-digit",
hour: "numeric",
minute: "2-digit",
}).format(new Date(publishedAt))
: null
@@ -41,7 +41,7 @@ const DownloadCommentsContainer: FunctionComponent<Props> = ({ viewer }) => {
month: "2-digit",
year: "numeric",
hour12: true,
hour: "2-digit",
hour: "numeric",
minute: "2-digit",
timeZoneName: "short",
});
@@ -84,11 +84,6 @@ export async function findOrCreateSSOUser(
token: SSOToken,
now = new Date()
) {
if (!token.user) {
// TODO: (wyattjoh) replace with better error.
throw new Error("token is malformed, missing user claim");
}
// Validate the token content.
const decodedToken: SSOToken = validate(SSOTokenSchema, token);
@@ -23,7 +23,9 @@ export function logQuery(
ctx.logger.info(
{
responseTime,
// deprecated: use of the `authenticated` log field is deprecated in favour of the `userID` field
authenticated: ctx.user ? true : false,
userID: ctx.user ? ctx.user.id : null,
...(persisted
? // A persisted query was provided, we can pull the operation metadata
// out from the persisted object.