diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 00000000..86cdca8f --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "gridproject-fd25f" + } +} diff --git a/database.rules.json b/database.rules.json new file mode 100644 index 00000000..7ea18d44 --- /dev/null +++ b/database.rules.json @@ -0,0 +1,34 @@ +{ + "rules": { + ".read": "auth != null && data.child('users').child(auth.uid).child('admin').val() == true", + ".write": "auth != null && data.child('users').child(auth.uid).child('admin').val() == true", + "users": { + ".read": "auth != null", + ".write": "auth != null", + ".indexOn": [ + "email" + ] + }, + "grids": { + "$grid": { + ".read": "auth != null && (data.child('users').child(auth.uid).exists() || !data.exists())", + ".write": "auth != null && (data.child('users').child(auth.uid).exists() || !data.exists())", + ".validate": "newData.hasChildren()", + "numCols": { + ".validate": "newData.val() > 0" + }, + "numRows": { + ".validate": "newData.val() > 0" + }, + "name": {}, + "users": {}, + "$row": { + ".validate": "$row.matches(/^(r)[0-9]+$/) && newData.hasChildren()", + "$col": { + ".validate": "$col.matches(/^(c)[0-9]+$/) && newData.val().matches(/^(rgb\\()(((0|1)?[0-9]{1,2}|2[0-4][0-9]|25[0-5]),( )?){2}((0|1)?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\\)$/)" + } + } + } + } + } +} diff --git a/firebase.json b/firebase.json new file mode 100644 index 00000000..9b3a6c8c --- /dev/null +++ b/firebase.json @@ -0,0 +1,14 @@ +{ + "database": { + "rules": "database.rules.json" + }, + "hosting": { + "public": "public", + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} diff --git a/webpack.production.config.js b/webpack.production.config.js index 63e2c3cc..2a4f8e31 100644 --- a/webpack.production.config.js +++ b/webpack.production.config.js @@ -10,19 +10,30 @@ var WebpackCleanupPlugin = require('webpack-cleanup-plugin'); loaders.push({ test: /[\/\\]src[\/\\].*\.css/, exclude: /(node_modules|bower_components|public)/, - loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]') + loaders: [ + 'style?sourceMap', + 'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]' + ] }); // local scss modules loaders.push({ test: /[\/\\]src[\/\\].*\.scss/, exclude: /(node_modules|bower_components|public)/, - loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass') + loaders: [ + 'style?sourceMap', + 'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]', + 'sass' + ] }); -// global css files + +// global css loaders.push({ test: /[\/\\](node_modules|global)[\/\\].*\.css$/, - loader: ExtractTextPlugin.extract('style', 'css') + loaders: [ + 'style?sourceMap', + 'css' + ] }); module.exports = { @@ -60,7 +71,7 @@ module.exports = { }), new HtmlWebpackPlugin({ template: './src/template.html', - title: 'Webpack App' + title: 'React Color' }), new webpack.optimize.DedupePlugin() ]