Skip to content

Commit

Permalink
Adding build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Jul 28, 2015
1 parent 1e4f76c commit 75b8ea9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/animation.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {render} from '../index.js';
import {render} from '../src/render.js';

class AnimatedBox extends Component {
constructor(props) {
Expand Down
2 changes: 1 addition & 1 deletion examples/dashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {render} from '../index.js';
import {render} from '../src/render.js';

/**
* Stylesheet
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {render} from '../index.js';
import {render} from '../src/render.js';

class App extends Component {
render() {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"name": "react-blessed",
"version": "0.0.1",
"description": "A react renderer for blessed.",
"main": "index.js",
"main": "./dist/render.js",
"scripts": {
"animation": "babel-node ./examples/animation.jsx",
"build": "babel ./src --out-dir ./dist",
"dashboard": "babel-node ./examples/dashboard.jsx",
"demo": "babel-node ./examples/demo.jsx",
"prepublish": "npm run build",
"test": "mocha -R spec --compilers js:babel/register ./test/endpoint.js"
},
"repository": {
Expand All @@ -33,7 +35,6 @@
"react": "^0.14.0-beta1"
},
"dependencies": {
"lodash": "^3.6.0",
"object-assign": "^3.0.0"
"lodash": "^3.6.0"
}
}
7 changes: 3 additions & 4 deletions src/ReactBlessedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import blessed from 'blessed';
import ReactMultiChild from 'react/lib/ReactMultiChild';
import ReactBlessedIDOperations from './ReactBlessedIDOperations';
import invariant from 'react/lib/invariant';
import assign from 'object-assign';
import update from './update';
import solveClass from './solveClass';
import _ from 'lodash';
import {extend, startCase} from 'lodash';

/**
* Renders the given react element with blessed.
Expand Down Expand Up @@ -89,7 +88,7 @@ export default class ReactBlessedComponent {
const node = blessed[type](solveClass(options));

node.onAny((type, ...args) => {
const handler = this._currentElement.props['on' + _.startCase(type)];
const handler = this._currentElement.props['on' + startCase(type)];

if (typeof handler === 'function')
handler.apply(null, args);
Expand Down Expand Up @@ -154,7 +153,7 @@ export default class ReactBlessedComponent {
/**
* Extending the component with the MultiChild mixin.
*/
assign(
extend(
ReactBlessedComponent.prototype,
ReactMultiChild.Mixin
);
5 changes: 2 additions & 3 deletions src/ReactBlessedReconcileTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import CallbackQueue from 'react/lib/CallbackQueue';
import PooledClass from 'react/lib/PooledClass';
import Transaction from 'react/lib/Transaction';

import assign from 'object-assign';
import {extend} from 'lodash';

const ON_BLESSED_READY_QUEUEING = {
initialize: function () {
Expand Down Expand Up @@ -40,7 +39,7 @@ const Mixin = {
}
};

assign(
extend(
ReactBlessedReconcileTransaction.prototype,
Transaction.Mixin,
Mixin
Expand Down
4 changes: 2 additions & 2 deletions index.js → src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import ReactInstanceHandles from 'react/lib/ReactInstanceHandles';
import ReactElement from 'react/lib/ReactElement';
import ReactUpdates from 'react/lib/ReactUpdates';
import ReactBlessedIDOperations from './src/ReactBlessedIDOperations';
import ReactBlessedIDOperations from './ReactBlessedIDOperations';
import invariant from 'react/lib/invariant';
import instantiateReactComponent from 'react/lib/instantiateReactComponent';
import inject from './src/ReactBlessedInjection';
import inject from './ReactBlessedInjection';
import blessed from 'blessed';

/**
Expand Down

0 comments on commit 75b8ea9

Please sign in to comment.