Skip to content

Commit

Permalink
Merge branch 'upd-babel'
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel committed Oct 24, 2018
2 parents d538e24 + 5080c66 commit 003bb04
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 55 deletions.
14 changes: 6 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
{
"presets": [
"env",
"react"
"@babel/env",
"@babel/react"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-object-rest-spread",
"react-require",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
[
"transform-runtime",
"@babel/plugin-transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true
}
],
[
"module-resolver",
{
"root": [
"./src/"
"./src"
],
"alias": {
"material-ui": "@material-ui/core",
Expand Down
1 change: 0 additions & 1 deletion .babelrc.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"next/babel"
],
"plugins": [
"react-require",
[
"module-resolver",
{
Expand Down
14 changes: 6 additions & 8 deletions .babelrc.prod
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
{
"presets": [
"env",
"react"
"@babel/env",
"@babel/react"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-object-rest-spread",
"react-require",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
[
"transform-runtime",
"@babel/plugin-transform-runtime",
{
"helpers": false,
"polyfill": false,
"regenerator": true
}
],
[
"module-resolver",
{
"root": [
"./src/"
"./src"
],
"alias": {
"material-ui": "@material-ui/core",
Expand Down
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
},
"settings": {
"import/resolver": {
"babel-module": {}
"babel-module": {
"root": ["./src"]
}
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ yarn.lock

coverage/**/*

.babelrc
./.babelrc
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
### [Versions](https://github.com/thundermiracle/next-mui-helper/releases/)

## 1.1.0
###### *Oct 24, 2018*

#### Breaking Changes

N/A

#### Changes

- Upgrade to babel7
- Support [email protected] now


## 1.0.5
###### *Sep 14, 2018*

#### Breaking Changes

N/A

#### Changes

- Fix minor bugs
- Add DefaultNextDocument to makeNextDocument.js
- Add DefaultNextApp to makeNextApp.js


## 1.0.4
###### *Sep 14, 2018*

#### Breaking Changes

- Change name from nextjs-mui-helper to next-mui-helper


## 1.0.2
###### *Sep 13, 2018*

#### Breaking Changes

N/A

#### Changes

- Support next.js _app.js


## 1.0.1
###### *Aug 15, 2018*

#### Breaking Changes

N/A

#### Changes

- Add tests to improve quality of utils


## 1.0.0
###### *May 21, 2018*

#### Breaking Changes

- Support @material-ui/core ONLY
- If you want to use material-ui@beta version, please use v0.2.8 instead
2 changes: 1 addition & 1 deletion examples/withTheme/src/client/layout/CommonLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function ButtonAppBar(props) {
<div className={classes.root}>
<AppBar position="static">
<Toolbar>
<Typography variant="title" color="inherit" className={classes.flex}>
<Typography variant="h6" color="inherit" className={classes.flex}>
Title
</Typography>
</Toolbar>
Expand Down
3 changes: 3 additions & 0 deletions examples/withTheme/src/client/style/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const theme = {
primary: deepOrange,
secondary: teal,
},
typography: {
useNextVariants: true,
},
};

export default theme;
2 changes: 1 addition & 1 deletion examples/withThemeApp/src/client/layout/CommonLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function ButtonAppBar(props) {
<div className={classes.root}>
<AppBar position="static">
<Toolbar>
<Typography variant="title" color="inherit" className={classes.flex}>
<Typography variant="h6" color="inherit" className={classes.flex}>
Title
</Typography>
</Toolbar>
Expand Down
3 changes: 3 additions & 0 deletions examples/withThemeApp/src/client/style/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const theme = {
primary: deepOrange,
secondary: teal,
},
typography: {
useNextVariants: true,
},
};

export default theme;
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
collectCoverage: true,
transformIgnorePatterns: ['"/node_modules/(?!ramda).+\\.js$"'],
transformIgnorePatterns: ['"/node_modules/(?!ramda).+\\.js$"', 'dist'],
};
5 changes: 3 additions & 2 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"baseUrl": "./",
"baseUrl": ".",
"paths": {
"src/*": ["./src/*"]
"*": ["src/*"],
"material-ui": ["@material-ui/core"]
}
},
"exclude": [
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "next-mui-helper",
"version": "1.0.5",
"version": "1.1.0",
"description": "hocs for making material-ui project with next.js(SSR)",
"main": "./src/mui/withParts.js",
"scripts": {
"eslint": "eslint ./src",
"build:rm": "rm -rf dist/",
"build:cp": "node ./scripts/copyFiles dist/ package.json README.md LICENSE",
"build:cp": "node ./scripts/copyFiles dist/ package.json README.md CHANGELOG.md LICENSE",
"build": "npm run build:rm && cp .babelrc.prod .babelrc && NODE_ENV=production babel src --out-dir ./dist && npm run build:cp",
"jest": "jest",
"dev": "cp .babelrc.dev .babelrc && next",
Expand All @@ -31,38 +31,39 @@
},
"peerDependencies": {
"@material-ui/core": "^1.0 || ^3.0",
"next": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0",
"next": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
},
"devDependencies": {
"@material-ui/core": "^3.0.3",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^9.0.0",
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^3.3.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-plugin-add-module-exports": "^1.0.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-react-require": "^3.0.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"eslint": "^5.5.0",
"babel-plugin-react-require": "^3.0.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.19",
"eslint": "^5.7.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-react": "^1.1.7",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-import-resolver-babel-module": "^5.0.0-beta.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-jest": "^21.26.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"jest": "^23.6.0",
"next": "^6.1.2",
"next": "^7.0.2",
"prop-types": "^15.6.2",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"regenerator-runtime": "^0.12.1"
},
"jest": {
Expand Down
15 changes: 5 additions & 10 deletions src/mui/defaultTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ import { blue, pink } from 'material-ui/colors';

export default {
palette: {
primary: {
light: blue[300],
main: blue[500],
dark: blue[700],
},
secondary: {
light: pink[300],
main: pink[500],
dark: pink[700],
},
primary: blue,
secondary: pink,
},
typography: {
useNextVariants: true,
},
};
1 change: 1 addition & 0 deletions src/nextjs/extendsWithMui.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const extendsWithMui = theme => ((DocumentComponent) => {
const jssStyles = (
<style
id="jss-server-side"
key="jss-server-side-key"
dangerouslySetInnerHTML={{ __html: pageContext.sheetsRegistry.toString() }}
/>
);
Expand Down

0 comments on commit 003bb04

Please sign in to comment.