Skip to content

Commit

Permalink
Update to babel 7 final (#3261)
Browse files Browse the repository at this point in the history
* chore(babel): Upgrade master to babel 7 release

* update gatsby and babel

* rm custom html
  • Loading branch information
jquense committed Sep 6, 2018
1 parent aa678fd commit 4cf4a4e
Show file tree
Hide file tree
Showing 49 changed files with 3,960 additions and 4,024 deletions.
1 change: 1 addition & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = api => {
let modules = true;

switch (api.env()) {
case 'docs':
case 'test':
dev = true;
modules = false;
Expand Down
24 changes: 1 addition & 23 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["eslint-config-airbnb", "prettier"],
"extends": ["eslint-config-airbnb", "prettier", "prettier/react"],
"env": {
"browser": true
},
Expand Down Expand Up @@ -101,28 +101,6 @@
"jsx-a11y/no-static-element-interactions": "off",
"import/first": "off"
}
},
{
"files": ["www/src/**/*"],
"globals": {
"graphql": false
},
"rules": {
"global-require": "off",
"no-console": "off",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"import/no-webpack-loader-syntax": "off"
},
"settings": {
"import/core-modules": "react-bootstrap"
}
},
{
"files": ["www/src/examples/*"],
"rules": {
"comma-dangle": "off"
}
}
]
}
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,21 @@
"react-dom": "^0.14.9 || >=15.3.0"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.42",
"@babel/core": "7.0.0-beta.42",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.42",
"@babel/plugin-proposal-export-default-from": "7.0.0-beta.42",
"@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.42",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42",
"@babel/plugin-transform-runtime": "7.0.0-beta.42",
"@babel/preset-env": "7.0.0-beta.42",
"@babel/preset-react": "7.0.0-beta.42",
"@babel/register": "7.0.0-beta.42",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^8.0.0",
"babel-loader": "^8.0.0-beta.2",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-istanbul": "^5.0.1",
"chai": "^3.5.0",
"chalk": "^2.3.2",
"codecov": "^3.0.4",
Expand All @@ -83,6 +82,7 @@
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-import-resolver-webpack": "^0.10.1",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-mocha": "^5.0.0",
Expand Down Expand Up @@ -114,7 +114,7 @@
"webpack": "^4.4.1"
},
"dependencies": {
"@babel/runtime": "7.0.0-beta.42",
"@babel/runtime": "^7.0.0",
"classnames": "^2.2.5",
"dom-helpers": "^3.2.0",
"invariant": "^2.2.4",
Expand Down
26 changes: 0 additions & 26 deletions www/.babelrc.js

This file was deleted.

37 changes: 37 additions & 0 deletions www/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const path = require('path');

module.exports = {
globals: {
graphql: false
},
rules: {
'global-require': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'import/no-webpack-loader-syntax': 'off',
'prefer-arrow-callback': 'off'
},
settings: {
'import/resolver': {
webpack: {
config: {
resolve: {
alias: {
'react-bootstrap$': path.resolve(__dirname, '../src/index.js'),
'react-bootstrap/lib': path.resolve(__dirname, '../src')
}
}
}
}
}
},
overrides: [
{
files: ['src/examples/**'],
rules: {
'comma-dangle': 'off',
'no-console': 'off'
}
}
]
};
3 changes: 2 additions & 1 deletion www/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const nodeModules = `${path.sep}node_modules${path.sep}`;

// eslint-disable-next-line
require('@babel/register')({
...require('../.babelrc.js'),
...require('../.babelrc.js')({ env: () => 'build' }),
only: [
// Only the src directory
new RegExp(`^${escapeRegExp(path.join(root, '/src/'))}`, 'i')
Expand All @@ -32,6 +32,7 @@ module.exports = {
]
},
plugins: [
'gatsby-plugin-layout',
{
resolve: 'gatsby-source-filesystem',
options: {
Expand Down
23 changes: 8 additions & 15 deletions www/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const path = require('path');

exports.modifyWebpackConfig = function modifyWebpackConfig({
exports.onCreateWebpackConfig = function onCreateWebpackConfig({
actions,
plugins,
loaders
}) {
actions.setWebpackConfig({
devtool: 'cheap-inline-module-source-map',
module: {
rules: [
{
Expand All @@ -28,19 +29,11 @@ exports.modifyWebpackConfig = function modifyWebpackConfig({
};

exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPreset({
name: `@babel/preset-flow`
actions.setBabelOptions({
options: {
babelrc: true,
envName: 'docs',
root: path.resolve(__dirname, '../')
}
});
};

exports.onCreatePage = ({ page }) => {
if (page.path.startsWith('/getting-started')) {
page.layout = 'getting-started';
} else if (page.path.startsWith('/layout')) {
page.layout = 'layout';
} else if (page.path.startsWith('/components')) {
page.layout = 'components';
} else if (page.path.startsWith('/utilities')) {
page.layout = 'utilities';
}
};
19 changes: 19 additions & 0 deletions www/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const React = require('react');

exports.onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => {
setHeadComponents([
<link
key="eeee"
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"
/>
]);

setPostBodyComponents([
<script
key="asfasfasfas"
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"
/>
]);
};
30 changes: 15 additions & 15 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,25 @@
"dependencies": {
"bootstrap": "^3.3.6",
"classnames": "^2.2.5",
"gatsby": "2.0.0-alpha.8",
"gatsby-link": "^1.6.30",
"gatsby": "^2.0.0-rc.11",
"gatsby-link": "^2.0.0-rc.2",
"gatsby-plugin-catch-links": "2.0.1-1",
"gatsby-plugin-less": "2.0.0-alpha.3",
"gatsby-remark-prismjs": "^1.2.17",
"gatsby-source-filesystem": "2.0.0-alpha.3",
"gatsby-transformer-react-docgen": "2.0.1-1",
"gatsby-transformer-remark": "2.0.1-1",
"graphql": "^0.11.7",
"graphql-type-json": "^0.1.4",
"gatsby-plugin-layout": "^1.0.0-beta.1",
"gatsby-plugin-less": "^2.0.0-rc.1",
"gatsby-remark-prismjs": "^3.0.0-rc.2",
"gatsby-source-filesystem": "^2.0.1-rc.1",
"gatsby-transformer-react-docgen": "^2.1.1-rc.1",
"gatsby-transformer-remark": "^2.1.1-rc.1",
"less": "^2.0.0",
"lodash": "^4.15.0",
"prismjs": "^1.15.0",
"prop-types": "^15.6.0",
"react": "^16.4.2",
"react-bootstrap": "*",
"react-docgen": "3.0.0-rc.0",
"react-dom": "^16.4.2",
"react-helmet": "^5.2.0",
"react-live": "^1.9.2"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.42",
"@babel/preset-flow": "^7.0.0-beta.40"
},
"homepage": "https://react-bootstrap.github.io/",
"keywords": [
"gatsby"
Expand All @@ -46,6 +43,9 @@
"deploy": "gatsby build --prefix-links && gh-pages -d public"
},
"resolutions": {
"gatsby/@babel/core": "7.0.0-beta.42"
"react-docgen": "3.0.0-rc.0"
},
"devDependencies": {
"gatsby-codemods": "^1.0.0-rc.3"
}
}
6 changes: 2 additions & 4 deletions www/src/components/PropTable.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { graphql } from 'gatsby';
import React from 'react';
import PropTypes from 'prop-types';

Expand Down Expand Up @@ -217,10 +218,7 @@ export const metadataFragment = graphql`
}
props {
name
doclets {
type
controllable
}
doclets
defaultValue {
value
computed
Expand Down
54 changes: 0 additions & 54 deletions www/src/html.js

This file was deleted.

4 changes: 2 additions & 2 deletions www/src/layouts/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

import PageHeader from '../components/PageHeader';
import Main from '../components/Main';
import Default from './index';
import Default from './default';

const propTypes = {
location: PropTypes.object.isRequired
Expand All @@ -13,7 +13,7 @@ function ComponentsLayout({ children, ...props }) {
return (
<Default {...props}>
<PageHeader title="Components" />
<Main location={props.location}>{children()}</Main>
<Main location={props.location}>{children}</Main>
</Default>
);
}
Expand Down

0 comments on commit 4cf4a4e

Please sign in to comment.