From 7b9cedd415911bdb042ca2871690420f69fe3dd0 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 13 Feb 2017 17:59:20 +0100 Subject: [PATCH 1/3] add missing dep, publish src to npm --- package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 670b6a1..bcfc0e8 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,13 @@ "version": "0.1.2", "description": "The Reactive Bond API", "main": "lib/index.js", + "jsnext:main": "src/index.jsx", "files": [ - "lib/*" + "lib/*", + "src/*" ], "scripts": { - "test": "npm run compile && mocha --compilers js:babel-core/register --reporter spec", + "test": "npm run compile && mocha --compilers js:babel-core/register --reporter spec", "compile": "babel --presets es2015,react -d lib/ src/", "prepublish": "npm run compile" }, @@ -31,7 +33,8 @@ "dependencies": { "material-ui": "^0.16.7", "oo7": "^0.1.2", - "react": "^15.4.2" + "react": "^15.4.2", + "react-dom": "^15.4.2" }, "devDependencies": { "babel-cli": "^6.22.2", From 190a840796dc1f19ddcd1f8360fbee198c239651 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 13 Feb 2017 17:59:44 +0100 Subject: [PATCH 2/3] let Travis build & run tests :green_heart: --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3a14c14 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +dist: trusty +sudo: false +language: node_js +node_js: + - 'stable' +cache: + directories: + - node_modules From 832f718e6f7dc63d8fc6d9fe722a5e0f0c7a190d Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 13 Feb 2017 18:18:22 +0100 Subject: [PATCH 3/3] readme: link to oo7, indentation --- README.md | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index d4f2e02..711a5cf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ oo7-react ========= -A small library to provide integration between React and `Bond`s. +A small library to provide integration between React and [`Bond`s](https://github.com/ethcore/oo7#oo7). Provides two React components: `ReactiveComponent` and `Reactive`. The first provides an alternative to `React.Component` for classes whose state shall @@ -18,47 +18,47 @@ The element will stay updated to the latest value of each expression. ## Installation ```sh - npm install oo7-react --save +npm install oo7-react --save ``` ## Usage ```javascript - // Assume React is already required. - var oo7react = require('oo7-react'), - setupBonds = oo7parity.setupBonds, - formatBlockNumber = oo7parity.formatBlockNumber; +// Assume React is already required. +var oo7react = require('oo7-react'), + setupBonds = oo7parity.setupBonds, + formatBlockNumber = oo7parity.formatBlockNumber; - class DateFormatter extends ReactiveComponent { - constructor() { - // Tell the object to look out for 'date' prop and keep the 'date' - // state up to date. - super(['date']); - } - render() { - return this.state.date === null ? -
Date unknown
: -
The date is {this.state.date}
; - } - } +class DateFormatter extends ReactiveComponent { + constructor() { + // Tell the object to look out for 'date' prop and keep the 'date' + // state up to date. + super(['date']); + } + render() { + return this.state.date === null ? +
Date unknown
: +
The date is {this.state.date}
; + } +} - class App extends React.Component { - render() { - // Evaluates to a pretty datetime. - let b = (new TimeBond).map(t => new Date(t) + ''); - // Prints two clocks. They both print the time and stay up to date. - return (
- -
The date is:
-
) - } - } +class App extends React.Component { + render() { + // Evaluates to a pretty datetime. + let b = (new TimeBond).map(t => new Date(t) + ''); + // Prints two clocks. They both print the time and stay up to date. + return (
+ +
The date is:
+
) + } +} ``` ## Tests ```sh - npm test +npm test ``` ## Contributing