Skip to content

Commit 6594989

Browse files
authored
build: upgrade babel and webpack (#360)
* build: upgrade babel and webpack * docs: upgrade Gatsby to v2 beta * WIP * docs: upgrade to gatsby 2 * Update package.json
1 parent e6d582e commit 6594989

File tree

15 files changed

+5678
-4387
lines changed

15 files changed

+5678
-4387
lines changed

.babelrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.babelrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
presets: [['babel-preset-jason', { runtime: false }]],
3+
plugins: [
4+
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }],
5+
],
6+
env: {
7+
esm: {
8+
presets: [['babel-preset-jason', { modules: false }]],
9+
},
10+
},
11+
}

commitlint.config.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

husky.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"test": "npm run lint && npm run testonly",
88
"testonly": "jest --verbose",
99
"tdd": "jest --watch",
10-
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist && cp README.md LICENSE ./lib",
10+
"build": "babel src --out-dir lib --delete-dir-on-start && npm run build:dist && cp README.md LICENSE ./lib",
1111
"build:docs": "npm -C www run build",
12-
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
12+
"build:dist": "webpack --mode production",
1313
"bootstrap": "yarn && yarn --cwd www",
1414
"lint": "eslint src test",
1515
"release": "release",
@@ -60,40 +60,31 @@
6060
"react-lifecycles-compat": "^3.0.4"
6161
},
6262
"devDependencies": {
63-
"@commitlint/cli": "^7.0.0",
64-
"@commitlint/config-angular": "^7.0.1",
65-
"@commitlint/prompt": "^7.0.0",
66-
"@commitlint/prompt-cli": "^7.0.0",
67-
"@commitlint/travis-cli": "^7.0.0",
63+
"@babel/cli": "^7.0.0-beta.51",
64+
"@babel/core": "^7.0.0-beta.51",
6865
"@semantic-release/changelog": "^2.0.1",
69-
"@semantic-release/git": "^4.0.1",
66+
"@semantic-release/git": "^6.0.1",
7067
"@semantic-release/github": "^4.2.11",
71-
"@semantic-release/npm": "^3.2.4",
68+
"@semantic-release/npm": "^3.3.3",
7269
"@storybook/addon-actions": "^3.2.11",
7370
"@storybook/react": "^3.2.11",
74-
"babel-cli": "^6.24.0",
75-
"babel-core": "^6.24.0",
76-
"babel-eslint": "^7.1.1",
77-
"babel-jest": "^20.0.3",
78-
"babel-loader": "^6.4.1",
79-
"babel-plugin-add-module-exports": "^0.2.1",
80-
"babel-plugin-dev-expression": "^0.2.1",
81-
"babel-plugin-transform-object-assign": "^6.22.0",
71+
"babel-core": "^7.0.0-bridge.0",
72+
"babel-eslint": "^8.2.5",
73+
"babel-jest": "^23.2.0",
74+
"babel-loader": "^8.0.0-beta.4",
8275
"babel-plugin-transform-react-remove-prop-types": "^0.4.5",
83-
"babel-preset-latest": "^6.24.0",
84-
"babel-preset-react": "^6.23.0",
85-
"babel-preset-stage-2": "^6.18.0",
76+
"babel-preset-jason": "^4.2.0",
8677
"enzyme": "^3.3.0",
8778
"enzyme-adapter-react-16": "^1.1.1",
88-
"eslint": "^3.17.1",
79+
"eslint": "^4.19.1",
8980
"eslint-config-jason": "^4.0.0",
9081
"eslint-config-prettier": "^2.9.0",
9182
"eslint-plugin-import": "^2.2.0",
92-
"eslint-plugin-jsx-a11y": "^4.0.0",
83+
"eslint-plugin-jsx-a11y": "^6.0.3",
9384
"eslint-plugin-prettier": "^2.6.0",
94-
"eslint-plugin-react": "^6.10.3",
85+
"eslint-plugin-react": "^7.10.0",
9586
"husky": "^1.0.0-rc.8",
96-
"jest": "^20.0.4",
87+
"jest": "^23.2.0",
9788
"prettier": "^1.11.1",
9889
"react": "^16.3.0",
9990
"react-dom": "^16.3.0",
@@ -102,10 +93,11 @@
10293
"rimraf": "^2.6.1",
10394
"semantic-release": "^15.1.7",
10495
"semantic-release-alt-publish-dir": "^2.1.1",
105-
"sinon": "^2.1.0",
96+
"sinon": "^6.0.1",
10697
"travis-deploy-once": "^4.4.1",
107-
"webpack": "^3.6.0",
108-
"webpack-atoms": "^3.0.2"
98+
"webpack": "^4.12.2",
99+
"webpack-atoms": "^7.0.1",
100+
"webpack-cli": "^3.0.8"
109101
},
110102
"release": {
111103
"pkgRoot": "lib",

www/.babelrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../.babelrc');

www/.eslintrc.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
globals:
3-
graphql: false
42
extends:
53
- prettier
64
- prettier/react

www/gatsby-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const path = require('path');
22
const config = require('./gatsby-config');
33

4-
exports.createPages = ({ boundActionCreators, graphql }) => {
5-
const { createPage } = boundActionCreators;
4+
exports.createPages = ({ actions, graphql }) => {
5+
const { createPage } = actions;
66
const componentTemplate = path.join(
77
__dirname,
88
'src',

www/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
"license": "MIT",
1414
"dependencies": {
1515
"bootstrap": "^3.3.7",
16-
"gatsby": "^1.0.0",
17-
"gatsby-link": "^1.0.0",
18-
"gatsby-plugin-sass": "^1.0.0",
16+
"gatsby": "^2.0.0-beta.12",
17+
"gatsby-plugin-sass": "^2.0.0-beta.3",
1918
"gatsby-remark-prismjs": "^1.0.0",
20-
"gatsby-source-filesystem": "^1.0.0",
21-
"gatsby-transformer-react-docgen": "^1.0.0",
19+
"gatsby-source-filesystem": "^2.0.1-beta.3",
20+
"gatsby-transformer-react-docgen": "^2.1.1-beta.3",
2221
"gatsby-transformer-remark": "^1.0.0",
2322
"lodash": "^4.17.4",
2423
"react-bootstrap": "^0.32.1"
2524
},
2625
"devDependencies": {
27-
"gh-pages": "^1.0.0"
26+
"gh-pages": "^1.0.0",
27+
"node-sass": "^4.9.0"
2828
}
2929
}
Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { graphql, Link } from 'gatsby';
12
import PropTypes from 'prop-types';
23
import React from 'react';
3-
import Link from 'gatsby-link';
4+
45
import { Grid, Navbar, Nav } from 'react-bootstrap';
56

67
import '../css/bootstrap.scss';
@@ -35,7 +36,7 @@ NavItem.propTypes = {
3536
to: PropTypes.string.isRequired,
3637
};
3738

38-
class BaseLayout extends React.Component {
39+
class Layout extends React.Component {
3940
render() {
4041
const { data, location, children } = this.props;
4142
return (
@@ -64,32 +65,24 @@ class BaseLayout extends React.Component {
6465
</Navbar.Collapse>
6566
</Navbar>
6667
<Grid style={{ paddingTop: '4rem', paddingBottom: '1rem' }}>
67-
{children()}
68+
{children}
6869
</Grid>
6970
</div>
7071
);
7172
}
7273
}
7374

74-
BaseLayout.propTypes = propTypes;
75+
Layout.propTypes = propTypes;
7576

76-
export default BaseLayout;
77+
export default Layout;
7778

7879
export const exposedComponentsFragment = graphql`
79-
fragment ComponentPages on RootQueryType {
80-
site {
81-
siteMetadata {
82-
componentPages {
83-
path
84-
displayName
85-
}
80+
fragment Layout_site on Site {
81+
siteMetadata {
82+
componentPages {
83+
path
84+
displayName
8685
}
8786
}
8887
}
8988
`;
90-
91-
export const query = graphql`
92-
query BaseLayout {
93-
...ComponentPages
94-
}
95-
`;

0 commit comments

Comments
 (0)