Skip to content

Commit

Permalink
Core:
Browse files Browse the repository at this point in the history
	- add .npmrc, prevent package-lock.json
	- gitignore package-lock.json as an extraneous measure
	- update dependencies

Examples:

- add .npmrc, prevent package-lock.json
- add README
- move babel from package.json to .babelrc
- eliminate unnecessary devdependencies:
	- babel-preset-stage-2
	- postcss-cssnext
	- postcss-import
	- postcss-loader
- update dependencies, devDependencies
- eliminate unnecessary webpack configurations:
- production logic to uglifyjs
- postcss loaders
- reference built CSS in example app (GridTestPage.jsx)

Dependencies not updated to latest:

	- webpack stopped at 2.6.1 [pending webpack-dev-server support](webpack/webpack-dev-server#946)
	- eslint stopped at 3.19 [pending airbnb support](airbnb/javascript#1447)
  • Loading branch information
kgregory committed Jul 3, 2017
1 parent 52625b1 commit 89a175a
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
node_modules
npm-debug.log
npm-debug.log
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
20 changes: 20 additions & 0 deletions examples/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"presets": [
"env",
"react"
],
"plugins": [
"transform-runtime"
],
"env": {
"development": {
"presets": []
},
"production": {
"presets": []
},
"test": {
"presets": []
}
}
}
1 change: 1 addition & 0 deletions examples/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
24 changes: 24 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Example #

This is an example of [material-responsive-grid](https://github.com/STORIS/material-responsive-grid) being used in a very simple React application.

This application uses [webpack](https://webpack.js.org/) to load the CSS that is produced when this library is built.

To build the *material-responsive-grid* library:

```
npm run build
```

Before attempting to run the example application, install the dependencies:

```
cd examples
npm install
```

From within the *examples* directory, run the application:

```
npm run start
```
45 changes: 11 additions & 34 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,31 @@
"devDependencies": {
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-loader": "^7.1.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.2.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"cross-env": "^3.1.4",
"css-loader": "^0.26.1",
"eslint": "^3.14.0",
"eslint-config-airbnb": "^14.0.0",
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-import-resolver-webpack": "^0.8.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0",
"extract-text-webpack-plugin": "^2.0.0-rc.3",
"html-webpack-plugin": "^2.26.0",
"postcss-cssnext": "^2.9.0",
"postcss-import": "^9.1.0",
"postcss-loader": "^1.2.2",
"react-hot-loader": "^3.0.0-beta.6",
"style-loader": "^0.13.1",
"webpack": "^2.2.1",
"style-loader": "^0.18.2",
"webpack": "^2.6.1",
"webpack-combine-loaders": "^2.0.3",
"webpack-dev-server": "^2.3.0"
"webpack-dev-server": "^2.5.0"
},
"dependencies": {
"babel-runtime": "^6.23.0",
"normalize.css": "^5.0.0",
"normalize.css": "^7.0.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"webfontloader": "^1.6.27"
},
"babel": {
"presets": [
"env",
"react",
"stage-2"
],
"plugins": ["transform-runtime"],
"env": {
"development": {
"presets": []
},
"production": {
"presets": []
},
"test": {
"presets": []
}
}
}
}
2 changes: 1 addition & 1 deletion examples/src/pages/GridTestPage/GridTestPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import mrg from 'index.css';
import mrg from 'material-responsive-grid.css';
import styles from './styles.css';

const GridTestPage = () => (
Expand Down
18 changes: 1 addition & 17 deletions examples/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const combineLoaders = require('webpack-combine-loaders');
const cssnext = require('postcss-cssnext');
const cssImport = require('postcss-import');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
Expand Down Expand Up @@ -35,8 +33,6 @@ const config = {
localIdentName: '[name]__[local]___[hash:base64:5]',
minimize: isProd,
},
}, {
loader: 'postcss-loader',
}]),
}),
}],
Expand All @@ -46,20 +42,12 @@ const config = {
filename: 'index.html',
template: path.join(__dirname, 'src', 'index.html'),
}),
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
cssImport(),
cssnext(),
],
},
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('styles.css'),
],
resolve: {
modules: ['node_modules', './src'],
modules: ['node_modules', './build'],
extensions: ['.js', '.jsx'],
},
};
Expand All @@ -79,10 +67,6 @@ if (isDev) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
}

if (isProd) {
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
}

config.entry.unshift('babel-polyfill'); // must always come first in entry list

module.exports = config;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-preset-es2015": "^6.24.0",
"cross-env": "^3.1.4",
"cross-env": "^5.0.1",
"cssnano": "^3.10.0",
"fs-extra": "^2.1.2",
"postcss-cli": "^3.0.0-beta",
"fs-extra": "^3.0.1",
"postcss-cli": "^4.1.0",
"postcss-cssnext": "^2.9.0",
"postcss-import": "^9.1.0",
"postcss-import": "^10.0.0",
"rimraf": "^2.5.4"
}
}

0 comments on commit 89a175a

Please sign in to comment.