Skip to content

Commit

Permalink
fix: npm vulnerabilities (material-components#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
태재영 authored and Matt Goo committed Jun 12, 2019
1 parent 2541ce2 commit 92a1840
Show file tree
Hide file tree
Showing 9 changed files with 13,914 additions and 11,749 deletions.
1 change: 1 addition & 0 deletions karma.ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function(config) {
karmaConfig.browsers = ['ChromeHeadless'];
karmaConfig.webpack.mode = 'production';
config.set(karmaConfig);
};
1 change: 1 addition & 0 deletions karma.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ const karmaConfig = require('./scripts/karma/config');

module.exports = function(config) {
karmaConfig.browsers = ['Chrome'];
karmaConfig.webpack.mode = 'development';
config.set(karmaConfig);
};
25,531 changes: 13,848 additions & 11,683 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/google-cloud__storage": "^1.7.2",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.5",
"@types/mocha": "^5.2.7",
"@types/prop-types": "^15.5.6",
"@types/puppeteer": "^1.11.1",
"@types/react": "^16.4.4",
"@types/react-dom": "^16.0.11",
"@types/react-is": "^16.7.1",
"@types/react-router-dom": "^4.3.1",
"@types/uuid": "^3.4.4",
"@types/webpack-env": "^1.13.6",
"@types/webpack-env": "^1.13.9",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"autoprefixer": "^8.5.1",
"axios": "^0.18.0",
"axios": "^0.19.0",
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.4",
Expand All @@ -122,49 +122,51 @@
"chai": "^4.1.2",
"cp-file": "^6.0.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.10",
"cssnano": "^4.1.10",
"css-loader": "^1.0.1",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2",
"enzyme-adapter-utils": "^1.10.1",
"eslint": "^5.9.0",
"eslint": "^5.16.0",
"eslint-config-google": "^0.9.1",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-typescript": "^0.14.0",
"extract-text-webpack-plugin": "^3.0.2",
"mini-css-extract-plugin": "^0.7.0",
"gts": "^0.9.0",
"husky": "^2.3.0",
"istanbul": "^0.4.5",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^2.0.4",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-mocha": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.13",
"lerna": "^2.9.0",
"mocha": "^5.0.2",
"node-sass": "^4.9.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"postcss-loader": "^2.1.5",
"mocha": "^6.1.4",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-loader": "^3.0.0",
"prettier": "^1.17.1",
"puppeteer": "^1.1.1",
"puppeteer": "^1.17.0",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-router-dom": "^4.3.1",
"remap-istanbul": "^0.12.0",
"resemblejs": "^3.0.1",
"rimraf": "^2.6.3",
"sass-loader": "^6.0.7",
"testdouble": "^3.6.0",
"ts-loader": "^3.5.0",
"ts-node": "^7.0.1",
"sass-loader": "^7.1.0",
"testdouble": "^3.11.0",
"ts-loader": "^6.0.2",
"ts-node": "^8.2.0",
"typescript": "^3.3.3",
"utility-types": "^2.1.0",
"uuid": "^3.3.2",
"validate-commit-msg": "^2.14.0",
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.2"
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.5.1"
}
}
51 changes: 24 additions & 27 deletions packages/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

const webpack = require('webpack');
const {readdirSync, lstatSync} = require('fs');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const {readMaterialPackages} = require('../scripts/package-json-reader');
const {
convertToImportMDCWebPaths,
Expand Down Expand Up @@ -58,7 +57,6 @@ function getWebpackConfigs() {
const tsxPath = getAbsolutePath(`${chunk}/index.tsx`);
const cssPath = getAbsolutePath(`${chunk}/index.scss`);
webpackEntries[chunk] = tsxPath;
webpackEntries[`${chunk}.min`] = tsxPath;
cssWebpackEntries[chunk] = cssPath;
cssWebpackEntriesMin[`${chunk}.min`] = cssPath;
});
Expand All @@ -72,6 +70,7 @@ function getWebpackConfigs() {

function getCommonWebpackParams({isCss} = {}) {
return {
mode: 'production',
output: {
path: getAbsolutePath('../build'),
filename: `${filename}${isCss ? '.css' : ''}.js`,
Expand Down Expand Up @@ -138,11 +137,6 @@ function getJavaScriptWebpackConfig() {
},
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
}),
],
});
}

Expand All @@ -152,30 +146,33 @@ function getCssWebpackConfig(shouldMinify) {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
minimize: shouldMinify,
},
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
modules: 'global',
localIdentName: '[local]',
},
{
loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')()],
},
},
{
loader: 'postcss-loader',
options: {
plugins: () =>
[require('autoprefixer')()].concat(
shouldMinify ? require('cssnano')() : []
),
},
{
loader: 'sass-loader',
options: {importer},
},
],
}),
},
{
loader: 'sass-loader',
options: {importer},
},
],
},
],
},
plugins: [new ExtractTextPlugin(`${filename}.css`)],
plugins: [new MiniCssExtractPlugin({filename: `${filename}.css`})],
});
}

Expand Down
1 change: 0 additions & 1 deletion scripts/karma/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Karma configuration
// Generated on Tue Mar 06 2018 14:20:28 GMT-0800 (PST)
const webpack = require('webpack');

module.exports = {
// base path that will be used to resolve all patterns (eg. files, exclude)
Expand Down
37 changes: 19 additions & 18 deletions test/screenshot/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const {read: readComponents} = require('../../scripts/directory-reader');
const {importer} = require('../../packages/webpack.util');
Expand All @@ -26,28 +26,29 @@ module.exports = {
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
},
{
loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')()],
},
{
loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')()],
},
},
{
loader: 'sass-loader',
options: {importer},
},
],
}),
},
{
loader: 'sass-loader',
options: {importer},
},
],
},
],
},
plugins: [
new ExtractTextPlugin('bundle.css'),
new MiniCssExtractPlugin({filename: 'bundle.css'}),
new OptimizeCssAssetsPlugin(),
new webpack.DefinePlugin({
COMPONENTS: JSON.stringify(readComponents()),
Expand Down
1 change: 0 additions & 1 deletion test/unit/floating-label/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import td from 'testdouble';
import {suite, test} from 'mocha';
import {assert} from 'chai';
import {mount, shallow} from 'enzyme';
import FloatingLabel from '../../../packages/floating-label/index';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({adapter: new Adapter()});
const context = require.context('.', true, /\.test\.(j|t)sx?$/);
const context = require.context('.', true, /\.test\.[tj]sx?$/);
context.keys().forEach(context);

0 comments on commit 92a1840

Please sign in to comment.