Upgrade packages + resolve vulnerabilities

This commit is contained in:
Barry Low committed 2019-02-10 10:49:51 -08:00
1 parent d73d63073b
commit 719316eff7
11 files changed
+2345 -1080

No files matched your search

+2 -1
View File
@@ -2,6 +2,7 @@
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-proposal-throw-expressions",
["@babel/plugin-proposal-class-properties", { "loose": true }]
["@babel/plugin-proposal-class-properties", { "loose": true }],
["@babel/plugin-transform-runtime", { "regenerator": true }]
]
}
+13 -11
View File
@@ -1,21 +1,23 @@
version: '3'
services:
node:
image: advancedalgosteamsmodule/teammodule-api:v9
build:
context: .
dockerfile: ./prod/Dockerfile
env_file: ./.env.prod
container_name: aateamapi
container_name: sateamapi
tty: true
stdin_open: true
volumes:
- ./:/var/www/app
- /var/www/app/node_modules
working_dir: /var/www/app
- ./dist:/usr/src/app
- /usr/src/app/node_modules
working_dir: /usr/src/app
restart: always
command: node --require @babel/register --require dotenv/config src/index.js
command: node -r dotenv/config index.js
expose:
- 4001
network_mode: webproxy
networks:
default:
external:
name: webproxy
# network_mode: webproxy
# networks:
# default:
# external:
# name: webproxy
-16
View File
@@ -1,16 +0,0 @@
version: '3'
services:
api:
image: advancedalgosteamsmodule/teammodule-api:v9
env_file: ./.env.prod
container_name: aateamapi-imagetest
tty: true
stdin_open: true
volumes:
- ./:/var/www/app
- /var/www/app/node_modules
working_dir: /var/www/app
restart: always
command: node --require @babel/register --require dotenv/config src/index.js
ports:
- "4001:4001"
+2268 -1014
View File
File diff suppressed because it is too large. Load diff
+24 -23
View File
@@ -1,48 +1,49 @@
{
"name": "aa-team-api",
"main": "src/index.js",
"scripts": {
"start": "NODE_ENV=production nodemon -e js,graphql -x node -r dotenv/config src/index.js",
"start": "node -r dotenv/config dist/index.js",
"debug": "nodemon src/index.js --watch ./src --exec \"node --require @babel/register --require dotenv/config\"",
"playground": "graphql playground --dotenv dotenv/config",
"dev": "npm-run-all --parallel debug playground"
"dev": "npm-run-all --parallel debug playground",
"build": "npx babel src --out-dir ../dist --relative -D --presets=@babel/env --plugins=@babel/plugin-proposal-throw-expressions,@babel/plugin-proposal-class-properties"
},
"dependencies": {
"@azure/storage-blob": "^10.1.0-preview",
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0",
"@babel/node": "^7.2.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.2.0",
"@azure/storage-blob": "^10.3.0",
"@babel/polyfill": "^7.2.5",
"@babel/register": "^7.0.0",
"apollo-errors": "^1.9.0",
"apollo-server-express": "^2.2.6",
"apollo-server-express": "^2.4.0",
"axios": "^0.18.0",
"cors": "^2.8.5",
"debug": "^4.1.0",
"dotenv": "^6.1.0",
"dotenv": "^6.2.0",
"express": "^4.16.4",
"express-jwt": "^5.3.1",
"fast-xml-parser": "^3.12.10",
"fast-xml-parser": "^3.12.12",
"graphql-import": "^0.7.1",
"graphql-middleware": "^1.7.8",
"graphql-subscriptions": "^1.0.0",
"graphql-tag": "^2.10.0",
"graphql-tools": "^4.0.3",
"graphql-tag": "^2.10.1",
"graphql-tools": "^4.0.4",
"jsonwebtoken": "^8.4.0",
"jwks-rsa": "^1.3.0",
"lodash.get": "^4.4.2",
"nodemon": "^1.18.7",
"prisma-binding": "^2.2.8",
"jwks-rsa": "^1.4.0",
"lodash": "^4.17.11",
"prisma-binding": "^2.3.2",
"request": "^2.88.0",
"request-promise-native": "^1.0.5",
"winston": "^3.1.0"
"winston": "^3.2.1"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.2.1",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/node": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-proposal-throw-expressions": "^7.2.0",
"graphql-cli": "^2.17.0",
"lodash.merge": "^4.6.1",
"@babel/preset-env": "^7.3.1",
"debug": "^4.1.1",
"graphql-cli": "^3.0.9",
"nodemon": "^1.18.10",
"npm-run-all": "4.1.5",
"prisma": "^1.22.0"
"prisma": "^1.26.4"
}
}
+28
View File
@@ -0,0 +1,28 @@
# ---- Base Node ----
FROM node:carbon AS base
# Create app directory
WORKDIR /usr/src/app
# ---- Dependencies ----
FROM base AS dependencies
WORKDIR /usr/src/app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./
# install app dependencies including 'devDependencies'
RUN npm install --only=production
# ---- Copy Files/Build ----
FROM dependencies AS build
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm run build
# --- Release with Alpine ----
FROM mhart/alpine-node:8 AS release
# Create app directory
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/dist ./
COPY --from=build /usr/src/app/node_modules ./node_modules
#CMD ["serve", "-s", "dist", "-p", "8080"]
CMD ["node", "dist/index.js"]
+1 -7
View File
@@ -4,13 +4,6 @@ import { applyMiddleware as applyGraphQLMiddleware } from 'graphql-middleware'
import { moduleAuth } from './middleware'
import { logger } from './logger'
/**
*
* @description Creates an Apollo Server. Setup based on `vue-cli-plugin-apollo`.
* @param {Object} app Express application
* @param {Object} options Apollo options
* @returns {Object} HTTP Server
*/
export default function createApolloServer(
app,
{
@@ -54,6 +47,7 @@ export default function createApolloServer(
tracing: true,
cacheControl: true,
introspection: true,
playground: true,
engine: engineKey ? { apiKey: engineKey } : false,
dataSources,
// Resolvers context in POST requests
+1 -1
View File
@@ -1,5 +1,5 @@
import { SchemaDirectiveVisitor } from 'apollo-server-express'
import _get from 'lodash.get'
import _get from 'lodash/get'
import { logger, AuthenticationError, DatabaseError } from '../logger'
const memberLocationOnContext = 'request.user'
+1 -1
View File
@@ -1,4 +1,4 @@
import merge from 'lodash.merge'
import merge from 'lodash/merge'
import { resolvers as queryResolvers } from './Query'
import { resolvers as mutationResolvers } from './Mutation'
+6 -5
View File
@@ -1,5 +1,5 @@
import '@babel/polyfill'
require('dotenv').config();
require("@babel/register");
require("@babel/polyfill");
import express from 'express'
import createApolloServer from './ApolloServer'
import { formatError } from './errors'
@@ -24,12 +24,13 @@ import wrongPreshared from './errors/notAllowed.json'
const GRAPHQL_ENDPOINT = '/graphql'
const GRAPHQL_SUBSCRIPTIONS = '/graphql'
const PORT = 4001
const NODE_ENV = 'development'
const PORT = process.env.PORT
const NODE_ENV = process.env.NODE_ENV
const SCHEMA_PATH = process.env.SCHEMA_PATH
const db = new Prisma({
fragmentReplacements: extractFragmentReplacements(resolvers),
typeDefs: 'src/generated/prisma.graphql',
typeDefs: importSchema(SCHEMA_PATH),
endpoint: process.env.PRISMA_ENDPOINT,
secret: process.env.PRISMA_SECRET,
debug: false
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@superalgos/teams-client",
"version": "0.0.32",
"version": "0.0.33",
"description": "Superalgos Project Team client-side web app",
"main": "src/index.js",
"scripts": {