From ab4c238f54c6e591aacc5e2ef4c073c9606c05e8 Mon Sep 17 00:00:00 2001 From: Travis Arnold Date: Wed, 8 Jul 2015 21:07:48 -0700 Subject: [PATCH] first commit --- .gitignore | 20 ++++++++++++++++++ LICENSE | 14 +++++++++++++ README.md | 7 +++++++ bower.json | 23 +++++++++++++++++++++ example/index.html | 11 ++++++++++ example/index.jsx | 5 +++++ example/main.scss | 0 package.json | 45 +++++++++++++++++++++++++++++++++++++++++ webpack.config.js | 24 ++++++++++++++++++++++ webpack.prod.config.js | 46 ++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 195 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 bower.json create mode 100644 example/index.html create mode 100644 example/index.jsx create mode 100644 example/main.scss create mode 100644 package.json create mode 100644 webpack.config.js create mode 100644 webpack.prod.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9215c69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Mac OSX Files +.DS_Store +.Trashes +.Spotlight-V100 +.AppleDouble +.LSOverride + +# Bower & Node Modules +node_modules +npm-debug.log +app/bower_components + +# General Files +.sass-cache +.hg +.idea +.svn +.cache +.project +.tmp \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7100fb --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Travis Arnold + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5a271cf --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## React Media Player 0.0.1 + +React video/audio player. + +## TODOS + +Playlist feature. \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..0e0df2b --- /dev/null +++ b/bower.json @@ -0,0 +1,23 @@ +{ + "name": "react-media-player", + "version": "0.0.1", + "homepage": "https://github.com/souporserious/react-media-player", + "authors": [ + "Travis Arnold " + ], + "description": "React media player.", + "main": ["./dist/ReactMediaPlayer.js", "./dist/ReactMediaPlayer.min.js"], + "keywords": [ + "react", + "transition", + "ui" + ], + "license": "ISC", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/example/index.html b/example/index.html new file mode 100644 index 0000000..3333cf9 --- /dev/null +++ b/example/index.html @@ -0,0 +1,11 @@ + + + + + Component + + + + + + \ No newline at end of file diff --git a/example/index.jsx b/example/index.jsx new file mode 100644 index 0000000..3ad3dda --- /dev/null +++ b/example/index.jsx @@ -0,0 +1,5 @@ +class ReactMediaPlayer { + +} + +export default ReactMediaPlayer; \ No newline at end of file diff --git a/example/main.scss b/example/main.scss new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..b11848e --- /dev/null +++ b/package.json @@ -0,0 +1,45 @@ +{ + "name": "react-media-player", + "version": "0.0.1", + "description": "React media player.", + "main": "scripts/index.jsx", + "scripts": { + "dev": "webpack-dev-server --devtool eval --hot --progress --colors", + "prebuild": "rm -rf dist && mkdir dist", + "build": "NODE_ENV=production webpack --config webpack.prod.config.js", + "postbuild": "NODE_ENV=production TARGET=minify webpack --config webpack.prod.config.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/souporserious/react-media-player" + }, + "keywords": [ + "react", + "component" + ], + "author": "Travis Arnold (http://souporserious.com)", + "license": "ISC", + "bugs": { + "url": "https://github.com/souporserious/react-media-player/issues" + }, + "homepage": "https://github.com/souporserious/react-media-player", + "dependencies": { + "react": "^0.13.3", + "velocity-animate": "^1.2.2" + }, + "devDependencies": { + "babel-core": "^5.6.15", + "babel-loader": "^5.2.2", + "babel-plugin-object-assign": "^1.2.0", + "css-loader": "^0.15.1", + "http-server": "^0.8.0", + "lodash": "^3.10.0", + "node-libs-browser": "^0.5.2", + "node-sass": "^3.2.0", + "sass-loader": "^1.0.2", + "style-loader": "^0.12.3", + "webpack": "^1.9.12", + "webpack-dev-server": "^1.9.0" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..47477fc --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,24 @@ +var path = require('path'); +var nodeModulesDir = path.resolve(__dirname, 'node_modules'); + +module.exports = { + entry: { + index: ['webpack/hot/dev-server', './example/index.jsx'] + }, + output: { + path: './example', + filename: 'bundle.js' + }, + module: { + loaders: [ + { test: /\.(jsx)/, exclude: /node_modules/, loader: 'babel' }, + { test: /\.scss$/, loader: 'style!css!sass?sourceMap' } + ] + }, + resolve: { + extensions: ['', '.js', '.jsx'] + }, + devServer: { + contentBase: './example', + } +}; \ No newline at end of file diff --git a/webpack.prod.config.js b/webpack.prod.config.js new file mode 100644 index 0000000..7432871 --- /dev/null +++ b/webpack.prod.config.js @@ -0,0 +1,46 @@ +var path = require('path'); +var webpack = require('webpack'); +var TARGET = process.env.TARGET || null; + +var config = { + entry: { + index: './scripts/VelocityTransitionGroup.jsx' + }, + output: { + path: path.join(__dirname, 'dist'), + publicPath: 'dist/', + filename: '[id].js', + sourceMapFilename: '[id].sourcemap.js', + library: '[id]', + libraryTarget: 'umd' + }, + module: { + loaders: [ + { test: /\.(js|jsx)/, loader: 'babel' } + ] + }, + plugins: [], + resolve: { + extensions: ['', '.js', '.jsx'] + }, + externals: { + 'react/addons': 'React', + 'velocity-animate': 'Velocity', + 'velocity-animate/velocity.ui': 'velocity-animate/velocity.ui' + }, +}; + +if(TARGET === 'minify') { + config.output.filename = 'VelocityTransitionGroup.min.js'; + config.output.sourceMapFilename = 'VelocityTransitionGroup.min.js'; + config.plugins.push(new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + mangle: { + except: ['React', 'Velocity', 'VelocityTransitionGroup'] + } + })); +} + +module.exports = config; \ No newline at end of file