Skip to content

Commit

Permalink
Fixes #28243 - upgrade vendor to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvit committed Dec 3, 2019
1 parent 563d426 commit 067939a
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 87 deletions.
35 changes: 0 additions & 35 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@theforeman/builder/babel'],
};
73 changes: 47 additions & 26 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const babelOptions = require('../.babelrc.js');
let path = require('path');

module.exports = {
Expand All @@ -7,53 +8,73 @@ module.exports = {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: [
path.join(__dirname, '..', 'node_modules/babel-preset-react'),
path.join(__dirname, '..', 'node_modules/babel-preset-env')
],
plugins: [
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-class-properties'),
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-rest-spread'),
path.join(__dirname, '..', 'node_modules/babel-plugin-transform-object-assign'),
path.join(__dirname, '..', 'node_modules/babel-plugin-syntax-dynamic-import')
]
}
options: babelOptions,
},
{
test: /(\.png|\.gif)$/,
loader: 'url-loader?limit=32767'
loader: 'url-loader?limit=32767',
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', {
loader: 'sass-loader',
options: {
includePaths: [
// teach webpack to resolve patternfly dependencies
path.resolve(__dirname, '..', 'node_modules', 'patternfly', 'dist', 'sass'),
path.resolve(__dirname, '..', 'node_modules', 'bootstrap-sass', 'assets', 'stylesheets'),
path.resolve(__dirname, '..', 'node_modules', 'font-awesome-sass', 'assets', 'stylesheets')
]
}
}]
loaders: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
includePaths: [
// teach webpack to resolve patternfly dependencies
path.resolve(
__dirname,
'..',
'node_modules',
'patternfly',
'dist',
'sass'
),
path.resolve(
__dirname,
'..',
'node_modules',
'bootstrap-sass',
'assets',
'stylesheets'
),
path.resolve(
__dirname,
'..',
'node_modules',
'font-awesome-sass',
'assets',
'stylesheets'
),
],
},
},
],
},
{
test: /\.md$/,
loaders: ['raw-loader']
loaders: ['raw-loader'],
},
{
test: /(\.ttf|\.woff|\.woff2|\.eot|\.svg|\.jpg)$/,
loaders: ['url-loader']
loaders: ['url-loader'],
},
],
},

resolve: {
alias: {
foremanReact: path.join(
__dirname,
'../../foreman/webpack/assets/javascripts/react_app'
),
},
modules: [
path.join(__dirname, '..', 'webpack'),
path.join(__dirname, '..', 'node_modules'),
Expand Down
28 changes: 11 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,32 @@
"url": "http://projects.theforeman.org/projects/foreman-tasks/issues"
},
"dependencies": {
"@theforeman/vendor": "^2.0.0",
"@theforeman/vendor": "^3.3.2",
"c3": "^0.4.11",
"humanize-duration": "^3.20.1",
"react-intl": "^2.8.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@storybook/addon-actions": "^5.0.1",
"@storybook/addon-knobs": "^5.0.1",
"@storybook/react": "^5.0.1",
"@theforeman/vendor-dev": "^2.0.0",
"babel-cli": "^6.10.1",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^2.0.0",
"babel-plugin-module-resolver": "^3.2.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.5.0",
"@theforeman/env": "^3.3.2",
"@theforeman/builder": "^3.3.2",
"@theforeman/vendor-dev": "^3.3.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.0",
"coveralls": "^3.0.0",
"enzyme": "^3.4.0",
"enzyme-adapter-react-16": "^1.4.0",
"enzyme-to-json": "^3.2.1",
"eslint": "^4.10.0",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-import-resolver-babel-module": "^5.1.0",
"eslint-plugin-patternfly-react": "0.2.0",
"identity-obj-proxy": "^3.0.0",
"jed": "^1.1.1",
"jest-cli": "^23.6.0",
"jest-cli": "^24.9.0",
"jest-prop-type-error": "^1.1.0",
"node-sass": "^4.5.0",
"patternfly": "^3.58.0",
Expand Down Expand Up @@ -95,6 +88,7 @@
"^.+\\.js$": "babel-jest"
},
"moduleDirectories": [
"node_modules/@theforeman/vendor-core/node_modules",
"node_modules",
"webpack"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date="2019-06-17 16:04:09 +0300"
defaultValue="N/A"
/>
Expand Down Expand Up @@ -115,7 +115,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date="2019-06-17 16:04:09 +0300"
defaultValue="N/A"
/>
Expand Down Expand Up @@ -168,7 +168,7 @@ exports[`TaskInfo rendering render with Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date={null}
defaultValue="N/A"
/>
Expand Down Expand Up @@ -359,7 +359,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date=""
defaultValue="N/A"
/>
Expand Down Expand Up @@ -418,7 +418,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date=""
defaultValue="N/A"
/>
Expand Down Expand Up @@ -469,7 +469,7 @@ exports[`TaskInfo rendering render without Props 1`] = `
md={3}
sm={6}
>
<Component
<_default
date=""
defaultValue="N/A"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export const fetchTaskDetails = (
id,
timeoutId,
refetchTaskDetailsAction
) => dispatch => {
) => async dispatch => {
showLoading();
dispatch(startRequest());
getTasksDetails(id, dispatch, timeoutId, refetchTaskDetailsAction);
await getTasksDetails(id, dispatch, timeoutId, refetchTaskDetailsAction);
};

const getTasksDetails = async (
Expand Down
3 changes: 2 additions & 1 deletion webpack/test_setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'babel-polyfill';
import 'core-js/shim';
import 'regenerator-runtime/runtime';

import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Expand Down

0 comments on commit 067939a

Please sign in to comment.