Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
souporserious committed Oct 17, 2015
0 parents commit d59a96f
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Mac OSX Files
.DS_Store
.Trashes
.Spotlight-V100
.AppleDouble
.LSOverride

# Bower & Node Modules
node_modules
npm-debug.log
bower_components

# General Files
.sass-cache
.hg
.idea
.svn
.cache
.project
.tmp
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (c) 2015, Travis Arnold <[email protected]>

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.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## React Trix 0.0.1

React wrapper around [Trix](https://github.com/basecamp/trix)
28 changes: 28 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "react-trix",
"version": "0.0.1",
"homepage": "https://github.com/souporserious/react-trix",
"authors": [
"Travis Arnold <[email protected]>"
],
"description": "Build flexible WYSIWYG editors with ease.",
"main": ["./dist/react-trix.js"],
"keywords": [
"react",
"component",
"edit",
"editable",
"wysiwyg",
"trix",
"editor",
"trix-editor"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
12 changes: 12 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Component</title>
</head>
<body>
<div id="app"></div>
<script src="http://localhost:8080/webpack-dev-server.js"></script>
<script src="bundle.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions example/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react'
import Trix from '../src/react-trix'

class App extends Component {
render() {
return <Trix />
}
}

React.render(<App />, document.getElementById('app'));
7 changes: 7 additions & 0 deletions example/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* {
box-sizing: border-box;
}

body {
font-family: 'Helvetica', sans-serif;
}
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "react-trix",
"version": "0.0.1",
"description": "Build flexible WYSIWYG editors with ease.",
"main": "lib/react-trix.js",
"scripts": {
"build": "npm run build:lib && NODE_ENV=production webpack --config webpack.prod.config.js",
"build:lib": "babel src --out-dir lib --stage 0",
"dev": "webpack-dev-server --devtool eval --hot --progress --colors",
"prebuild": "rm -rf dist && mkdir dist",
"prepublish": "npm run build",
"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-trix"
},
"keywords": [
"react",
"component",
"edit",
"editable",
"wysiwyg",
"trix",
"editor",
"trix-editor"
],
"author": "Travis Arnold <[email protected]> (http://souporserious.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/souporserious/react-trix/issues"
},
"homepage": "https://github.com/souporserious/react-trix",
"peerDependencies": {
"react": ">=0.13.2 || ^0.14.0-beta1"
},
"devDependencies": {
"autoprefixer-loader": "^2.0.0",
"babel": "^5.8.23",
"babel-core": "^5.6.15",
"babel-loader": "^5.2.2",
"css-loader": "^0.15.1",
"http-server": "^0.8.0",
"node-sass": "^3.2.0",
"react": "^0.13.3 || ^0.14.0-beta1",
"sass-loader": "^1.0.2",
"style-loader": "^0.12.3",
"webpack": "^1.9.12",
"webpack-dev-server": "^1.9.0"
}
}
13 changes: 13 additions & 0 deletions src/Trix.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component, PropTypes } from 'react'

class Trix extends React.Component {
static propTypes = {
}
static defaultProps = {
}
render() {
return <div></div>
}
}

export default Trix
1 change: 1 addition & 0 deletions src/react-trix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from './Trix'
24 changes: 24 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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: /\.(js|jsx)/, exclude: /node_modules/, loader: 'babel?stage=0'},
{test: /\.scss$/, loader: 'style!css!autoprefixer!sass?sourceMap'}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
contentBase: './example',
}
};
44 changes: 44 additions & 0 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
var path = require('path');
var webpack = require('webpack');
var TARGET = process.env.TARGET || null;

var config = {
entry: {
index: './src/react-trix.js',
},
output: {
path: path.join(__dirname, 'dist'),
publicPath: 'dist/',
filename: 'react-trix.js',
sourceMapFilename: 'react-trix.sourcemap.js',
library: 'Trix',
libraryTarget: 'umd'
},
module: {
loaders: [
{test: /\.(js|jsx)/, loader: 'babel?stage=0'}
]
},
plugins: [],
resolve: {
extensions: ['', '.js', '.jsx']
},
externals: {
'react': 'React'
},
};

if(TARGET === 'minify') {
config.output.filename = 'react-trix.min.js';
config.output.sourceMapFilename = 'react-trix.min.js';
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: {
except: ['React', 'Trix']
}
}));
}

module.exports = config;

0 comments on commit d59a96f

Please sign in to comment.