Skip to content

Commit

Permalink
[chore] NodeJS 12 (#2722)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wyattjoh committed Nov 22, 2019
1 parent 7c2e56b commit bf89fc2
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -9,7 +9,7 @@ job_defaults: &job_defaults
working_directory: ~/coralproject/talk
resource_class: large
docker:
- image: circleci/node:10
- image: circleci/node:12
environment:
<<: *job_environment

Expand Down
3 changes: 1 addition & 2 deletions .nvmrc
@@ -1,2 +1 @@
10

12
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM node:10-alpine
FROM node:12-alpine

# Install build dependancies.
RUN apk --no-cache add git python
Expand Down
6 changes: 2 additions & 4 deletions doczrc.js
@@ -1,13 +1,11 @@
// Apply all the configuration provided in the .env file.
require("dotenv").config();

const path = require("path");
const fs = require("fs");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const extensions = [".ts", ".tsx", ".js"];
// TODO: There is some weird issue with including paths.ts here
const postCSSConfigPath = "./src/core/build/postcss.config";
const isProduction = process.NODE_ENV === "production";
const appDirectory = fs.realpathSync(process.cwd());

const styleLoader = {
Expand All @@ -18,7 +16,7 @@ const styleLoader = {
},
};

export default {
module.exports = {
title: "Coral 5.0",
source: "./src",
typescript: true,
Expand Down Expand Up @@ -60,7 +58,7 @@ export default {
"@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).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -11,7 +11,7 @@
"url": "git://github.com/coralproject/talk.git"
},
"engines": {
"node": ">=10.0.0",
"node": ">=12.0.0",
"npm": ">=6.9.0"
},
"bugs": "https://github.com/coralproject/talk/issues",
Expand Down
2 changes: 1 addition & 1 deletion src/core/build/createWebpackConfig.ts
Expand Up @@ -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).
Expand Down
Expand Up @@ -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",
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/client/admin/routes/Stories/StoryRowContainer.tsx
Expand Up @@ -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
Expand Down
Expand Up @@ -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",
});
Expand Down
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions src/core/server/graph/common/extensions/LoggerExtension.ts
Expand Up @@ -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.
Expand Down

0 comments on commit bf89fc2

Please sign in to comment.