Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
migrating to babel 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ViBiOh committed Oct 30, 2018
1 parent 6f6d03b commit 46911d8
Show file tree
Hide file tree
Showing 9 changed files with 1,786 additions and 3,765 deletions.
5 changes: 2 additions & 3 deletions .babelrc
@@ -1,9 +1,8 @@
{
"presets": ["env", "react"],
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
"transform-object-rest-spread",
[
"module-resolver",
"babel-plugin-module-resolver",
{
"root": ["./src"]
}
Expand Down
1 change: 1 addition & 0 deletions .eslintrc
@@ -1,4 +1,5 @@
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"env": {
"browser": true
Expand Down
5,474 changes: 1,748 additions & 3,726 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 21 additions & 18 deletions package.json
Expand Up @@ -10,7 +10,7 @@
"lint": "npm run eslint && npm run stylelint",
"doc": "esdoc",
"start": "NODE_ENV=staging parcel src/index.html --public-url / -d ./dist --open",
"test": "nyc --reporter text --reporter lcov --extension .jsx --require babel-core/register ava --verbose",
"test": "nyc --reporter text --reporter lcov --extension .jsx --require @babel/register ava --verbose",
"prebuild": "npm run format && npm run lint && npm test",
"build": "parcel build src/index.html --public-url / -d ./dist",
"postbuild": "cp ./src/robots.txt ./src/favicon/* ./dist/"
Expand Down Expand Up @@ -40,53 +40,56 @@
},
"homepage": "https://github.com/ViBiOh/dashboard",
"devDependencies": {
"ava": "latest",
"babel-core": "latest",
"@babel/core": "^7",
"@babel/preset-env": "^7",
"@babel/preset-react": "^7",
"@babel/register": "^7",
"ava": "next",
"babel-eslint": "latest",
"babel-plugin-module-resolver": "latest",
"babel-plugin-transform-object-rest-spread": "latest",
"babel-preset-env": "latest",
"babel-preset-react": "latest",
"enzyme": "latest",
"enzyme-adapter-react-16": "latest",
"esdoc": "latest",
"esdoc-coverage-plugin": "latest",
"esdoc-ecmascript-proposal-plugin": "latest",
"esdoc-jsx-plugin": "latest",
"esdoc-publish-html-plugin": "latest",
"eslint": "4",
"eslint": "latest",
"eslint-config-airbnb": "latest",
"eslint-config-prettier": "latest",
"eslint-import-resolver-babel-module": "latest",
"eslint-import-resolver-babel-module": "5.0.0-beta.1",
"eslint-plugin-import": "latest",
"eslint-plugin-jsx-a11y": "latest",
"eslint-plugin-react": "latest",
"identity-obj-proxy": "latest",
"ignore-styles": "latest",
"jsdom": "^13.0.0",
"jsdom": "latest",
"nyc": "latest",
"parcel-bundler": "latest",
"postcss-modules": "latest",
"prettier": "latest",
"react-addons-test-utils": "latest",
"react-test-renderer": "^16.6.0",
"sinon": "^7.1.0",
"stylelint": "^9.7.0",
"react-test-renderer": "latest",
"sinon": "latest",
"stylelint": "latest",
"stylelint-config-standard": "latest"
},
"dependencies": {
"actions": "^1.3.0",
"babel-polyfill": "latest",
"chart.js": "latest",
"classnames": "latest",
"express": "latest",
"externals": "0.0.1",
"funtch": "latest",
"history": "latest",
"moment": "latest",
"normalize.css": "latest",
"prop-types": "latest",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-icons": "^3.2.2",
"react-redux": "^5.1.0",
"react": "latest",
"react-dom": "latest",
"react-icons": "latest",
"react-redux": "latest",
"react-router": "latest",
"react-router-dom": "latest",
"react-router-redux": "latest",
Expand All @@ -98,9 +101,9 @@
"./src/**/*.test.js"
],
"require": [
"@babel/register",
"ignore-styles",
"./src/utils/Test.js"
],
"babel": "inherit"
]
}
}
6 changes: 0 additions & 6 deletions src/presentationals/Container/Graph/index.test.js
Expand Up @@ -8,9 +8,3 @@ test('should render as canvas', t => {

t.is(wrapper.type(), 'canvas');
});

test('should render as canvas', t => {
const wrapper = shallow(<Graph type="line" data={{}} options={{}} />);

t.is(wrapper.type(), 'canvas');
});
18 changes: 10 additions & 8 deletions src/presentationals/ContainersList/index.jsx
Expand Up @@ -37,14 +37,16 @@ export default function ContainersList({
? `${containers.length} / ${containersTotalCount}`
: containers.length;

content = [
<ListTitle key="size" count={count} filter={filter} onFilterChange={onFilterChange} />,
<div key="containers" className={style.list}>
{containers.map(container => (
<ContainerCard key={container.Id} container={container} onClick={onSelect} />
))}
</div>,
];
content = (
<>
<ListTitle key="size" count={count} filter={filter} onFilterChange={onFilterChange} />
<div key="containers" className={style.list}>
{containers.map(container => (
<ContainerCard key={container.Id} container={container} onClick={onSelect} />
))}
</div>
</>
);
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/sagas/bus.test.js
Expand Up @@ -17,7 +17,7 @@ test('should wait for close action', t => {
t.deepEqual(iterator.next().value, take(actions.CLOSE_BUS));
});

test('should wait for close action', t => {
test('should cancel on CLOSE', t => {
const iterator = busSaga({});
iterator.next();

Expand Down
4 changes: 2 additions & 2 deletions src/services/LocalStorage/index.test.js
@@ -1,7 +1,7 @@
import test from 'ava';
import { LocalStorage } from './index';

test('should determine localStorage not available on error', t => {
test('should determine localStorage not available on set error', t => {
global.localStorage = {
setItem: () => {
throw new Error('Test');
Expand All @@ -11,7 +11,7 @@ test('should determine localStorage not available on error', t => {
t.false(new LocalStorage().isEnabled());
});

test('should determine localStorage not available on error', t => {
test('should determine localStorage not available on remove error', t => {
global.localStorage = {
setItem: () => null,
removeItem: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/statHelper.test.js
Expand Up @@ -42,6 +42,6 @@ test('humanSize', t => t.is(humanSize(102400, 2), `0.09 ${BYTES_NAMES[2]}`));

test('cpuPercentageMax', t => t.is(cpuPercentageMax(stat), 800));

test('cpuPercentageMax', t => t.is(cpuPercentageMax(), 0));
test('cpuPercentageEmpty', t => t.is(cpuPercentageMax(), 0));

test('computeCpuPercentage', t => t.is(computeCpuPercentage(stat), 355.55));

0 comments on commit 46911d8

Please sign in to comment.