Fix npm vulerabilities

pull/2854/head
Victor Baranov 5 years ago
parent 7286cbfa60
commit 6521204b9a
  1. 4
      apps/block_scout_web/assets/.babelrc
  2. 2
      apps/block_scout_web/assets/css/_typography.scss
  3. 1
      apps/block_scout_web/assets/css/app.scss
  4. 1
      apps/block_scout_web/assets/css/components/_tooltip.scss
  5. 1
      apps/block_scout_web/assets/css/non-critical.scss
  6. 4
      apps/block_scout_web/assets/css/theme/_base_variables.scss
  7. 14967
      apps/block_scout_web/assets/package-lock.json
  8. 60
      apps/block_scout_web/assets/package.json
  9. 52
      apps/block_scout_web/assets/webpack.config.js

@ -1,5 +1,3 @@
{ {
presets: [ "presets": ["@babel/preset-env"]
'env'
]
} }

@ -3,7 +3,7 @@ $blue: #4b89fb !default;
$success: #34c0ad !default; $success: #34c0ad !default;
body { body {
font-family: $font-family-sans-serif; font-family: $font-family;
font-size: 12px; font-size: 12px;
} }

@ -16,6 +16,7 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts";
// Bootstrap Core CSS // Bootstrap Core CSS
@import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins"; @import "node_modules/bootstrap/scss/mixins";
@import "theme/variables"; @import "theme/variables";

@ -10,6 +10,7 @@ $tooltip-color: #fff !default;
border-radius: 5px; border-radius: 5px;
color: $tooltip-color; color: $tooltip-color;
padding: 15px; padding: 15px;
font-size: 12px;
} }
.arrow::before { .arrow::before {

@ -1,5 +1,6 @@
// Bootstrap Core CSS // Bootstrap Core CSS
@import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins"; @import "node_modules/bootstrap/scss/mixins";
@import "theme/variables-non-critical"; @import "theme/variables-non-critical";

@ -255,11 +255,11 @@ $transition-cont: all 0.4s ease-in-out !default;
// Font, line-height, and color for body text, headings, and more. // Font, line-height, and color for body text, headings, and more.
// stylelint-disable value-keyword-case // stylelint-disable value-keyword-case
$font-family-sans-serif: Nunito, "Helvetica Neue", Arial, sans-serif, $font-family: Nunito, "Helvetica Neue", Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default; "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, $font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace !default; "Liberation Mono", "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default; $font-family-base: $font-family !default;
// stylelint-enable value-keyword-case // stylelint-enable value-keyword-case
$font-size-base: 1rem !default; // Assumes the browser default, typically `16px` $font-size-base: 1rem !default; // Assumes the browser default, typically `16px`

File diff suppressed because it is too large Load Diff

@ -21,51 +21,51 @@
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.1.0-4", "@fortawesome/fontawesome-free": "^5.1.0-4",
"awesomplete": "1.1.2", "awesomplete": "1.1.2",
"bignumber.js": "^7.2.1", "bignumber.js": "^9.0.0",
"bootstrap": "^4.1.3", "bootstrap": "^4.3.1",
"chart.js": "^2.7.2", "chart.js": "^2.9.2",
"clipboard": "^2.0.1", "clipboard": "^2.0.4",
"highlight.js": "^9.13.1", "highlight.js": "^9.16.2",
"highlightjs-solidity": "^1.0.6", "highlightjs-solidity": "^1.0.8",
"humps": "^2.0.1", "humps": "^2.0.1",
"jquery": "^3.4.0", "jquery": "^3.4.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"moment": "^2.22.1", "moment": "^2.24.0",
"nanomorph": "^5.1.3", "nanomorph": "^5.4.0",
"numeral": "^2.0.6", "numeral": "^2.0.6",
"path-parser": "^4.1.1", "path-parser": "^4.2.0",
"phoenix": "file:../../../deps/phoenix", "phoenix": "file:../../../deps/phoenix",
"phoenix_html": "file:../../../deps/phoenix_html", "phoenix_html": "file:../../../deps/phoenix_html",
"popper.js": "^1.14.3", "popper.js": "^1.14.7",
"reduce-reducers": "^0.4.3", "reduce-reducers": "^0.4.3",
"redux": "^4.0.0", "redux": "^4.0.0",
"urijs": "^1.19.1" "urijs": "^1.19.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/polyfill": "^7.0.0-beta.46", "@babel/core": "^7.7.2",
"@babel/polyfill": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"autoprefixer": "^8.4.1", "autoprefixer": "^8.4.1",
"babel-core": "^6.26.3", "babel-loader": "^8.0.6",
"babel-loader": "^7.1.4", "copy-webpack-plugin": "^5.0.5",
"babel-preset-env": "^1.6.1",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^3.1.0", "css-loader": "^3.1.0",
"eslint": "^4.15.0", "eslint": "^6.6.0",
"eslint-config-standard": "^11.0.0-beta.0", "eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.8.0", "eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^5.2.1", "eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^3.6.0", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^3.0.1", "eslint-plugin-standard": "^4.0.1",
"file-loader": "^1.1.11", "file-loader": "^4.2.0",
"jest": "^23.2.0", "jest": "^24.9.0",
"mini-css-extract-plugin": "^0.8.0", "mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.3", "optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-loader": "^2.1.4", "postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0", "sass-loader": "^8.0.0",
"style-loader": "^0.21.0", "style-loader": "^1.0.0",
"terser-webpack-plugin": "^1.3.0", "terser-webpack-plugin": "^2.2.1",
"webpack": "^4.6.0", "webpack": "^4.41.2",
"webpack-cli": "^3.0.8" "webpack-cli": "^3.3.10"
}, },
"jest": { "jest": {
"moduleNameMapper": { "moduleNameMapper": {

@ -1,10 +1,10 @@
const path = require('path'); const path = require('path')
const TerserJSPlugin = require('terser-webpack-plugin'); const TerserJSPlugin = require('terser-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin')
const { ContextReplacementPlugin } = require('webpack'); const { ContextReplacementPlugin } = require('webpack')
const glob = require("glob"); const glob = require('glob')
function transpileViewScript(file) { function transpileViewScript(file) {
return { return {
@ -19,9 +19,12 @@ function transpileViewScript(file) {
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: {
loader: 'babel-loader' loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
} }
},
] ]
} }
} }
@ -30,7 +33,7 @@ function transpileViewScript(file) {
const jsOptimizationParams = { const jsOptimizationParams = {
cache: true, cache: true,
parallel: true, parallel: true,
sourceMap: true, sourceMap: true
} }
const awesompleteJs = { const awesompleteJs = {
@ -51,19 +54,19 @@ const awesompleteJs = {
{ {
loader: "css-loader", loader: "css-loader",
} }
], ]
}, }
], ]
}, },
optimization: { optimization: {
minimizer: [ minimizer: [
new TerserJSPlugin(jsOptimizationParams), new TerserJSPlugin(jsOptimizationParams),
], ]
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '../css/awesomplete.css' filename: '../css/awesomplete.css'
}), })
] ]
} }
@ -72,7 +75,7 @@ const appJs =
entry: { entry: {
app: './js/app.js', app: './js/app.js',
stakes: './js/pages/stakes.js', stakes: './js/pages/stakes.js',
'non-critical': './css/non-critical.scss', 'non-critical': './css/non-critical.scss'
}, },
output: { output: {
filename: '[name].js', filename: '[name].js',
@ -87,7 +90,10 @@ const appJs =
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: {
loader: 'babel-loader' loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
} }
}, },
{ {
@ -95,12 +101,13 @@ const appJs =
use: [ use: [
MiniCssExtractPlugin.loader, MiniCssExtractPlugin.loader,
{ {
loader: "css-loader" loader: 'css-loader'
}, { }, {
loader: "postcss-loader" loader: 'postcss-loader'
}, { }, {
loader: "sass-loader", loader: 'sass-loader',
options: { options: {
sassOptions: {
precision: 8, precision: 8,
includePaths: [ includePaths: [
'node_modules/bootstrap/scss', 'node_modules/bootstrap/scss',
@ -108,6 +115,7 @@ const appJs =
] ]
} }
} }
}
] ]
}, { }, {
test: /\.(svg|ttf|eot|woff|woff2)$/, test: /\.(svg|ttf|eot|woff|woff2)$/,
@ -131,6 +139,6 @@ const appJs =
] ]
} }
const viewScripts = glob.sync('./js/view_specific/**/*.js').map(transpileViewScript); const viewScripts = glob.sync('./js/view_specific/**/*.js').map(transpileViewScript)
module.exports = viewScripts.concat(appJs, awesompleteJs); module.exports = viewScripts.concat(appJs, awesompleteJs)

Loading…
Cancel
Save