Skip to content

Commit 7a05585

Browse files
committed
Merge pull request dozoisch#13 from dozoisch/update_deps
Update deps & added build tools
2 parents 0ac46e9 + d217dd1 commit 7a05585

File tree

14 files changed

+77
-179
lines changed

14 files changed

+77
-179
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/**

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- "iojs"
4+
- "4.0"
55
- "0.10"
66
- "0.12"
7+
8+
branches:
9+
only:
10+
- master
11+
12+
script:
13+
- npm run test
14+
- npm run lint
15+
- npm run build

HISTORY.md renamed to CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# History
2-
31
# 0.4.0
42
- Added Size Props |Merge #5
53
- Fixed bug with refs

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@
55
[![Dependencies][deps.img]][deps.url]
66
[![Dev Dependencies][devdeps.img]][devdeps.url]
77

8-
Component wrapper for [Google reCAPTCHA][reCAPTCHA]
8+
Component wrapper for [Google reCAPTCHA v2][reCAPTCHA]
99

1010
## Installation
1111

1212
```shell
1313
npm install --save react-google-recaptcha
1414
```
1515

16+
### React 0.13
17+
With 0.13, install version 0.4.0
18+
```shell
19+
npm install --save [email protected]
20+
```
21+
1622
## Usage
1723

1824
All you need to do is [sign up for an API key pair][signup]. You will need the client key.
@@ -21,18 +27,21 @@ You can then use the reCAPTCHA. The default require, imports a wrapped component
2127

2228
```jsx
2329
var React = require("react");
30+
var render = require("react-dom").render
2431
var ReCAPTCHA = require("react-google-recaptcha");
2532

2633
function onChange(value) {
2734
console.log("Captcha value:", value);
2835
}
2936

30-
React.render(
31-
<ReCAPTCHA
32-
ref="recaptcha"
33-
sitekey="Your client site key"
34-
onChange={onChange}
35-
/>, document.body);
37+
render(
38+
<ReCAPTCHA
39+
ref="recaptcha"
40+
sitekey="Your client site key"
41+
onChange={onChange}
42+
/>,
43+
document.body
44+
);
3645
```
3746

3847
### Rendering Props
@@ -61,6 +70,7 @@ You can also use the barebone components doing the following. Using that compone
6170

6271
```jsx
6372
var React = require("react");
73+
var render = require("react-dom").render
6474
var ReCAPTCHA = require("react-google-recaptcha/lib/recaptcha");
6575

6676
var grecaptchaObject = grecaptcha // You must provide access to the google grecaptcha object.
@@ -69,24 +79,17 @@ function onChange(value) {
6979
console.log("Captcha value:", value);
7080
}
7181

72-
React.render(
73-
<ReCAPTCHA
74-
ref="recaptcha"
75-
sitekey="Your client site key"
76-
onChange={onChange}
77-
grecaptcha={grecaptchaObject}
78-
/>, document.body);
82+
render(
83+
<ReCAPTCHA
84+
ref="recaptcha"
85+
sitekey="Your client site key"
86+
onChange={onChange}
87+
grecaptcha={grecaptchaObject}
88+
/>,
89+
document.body
90+
);
7991
```
8092

81-
82-
83-
## To Come Soon
84-
- tests
85-
- examples
86-
- code coverage
87-
88-
*The build is highly inspired by [react-bootstrap][rb]*
89-
9093
[travis.img]: https://travis-ci.org/dozoisch/react-google-recaptcha.svg?branch=master
9194
[travis.url]: https://travis-ci.org/dozoisch/react-google-recaptcha
9295
[npm.img]: https://badge.fury.io/js/react-google-recaptcha.svg

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint no-var: 0 */
22
require("babel/register");
33

4-
var webpackConfig = require("./webpack/test.config.js");
4+
var webpackConfig = require("./webpack.config.test.js");
55
var isCI = process.env.CONTINUOUS_INTEGRATION === "true";
66

77
module.exports = function (config) {

package.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
"lib": "lib/"
88
},
99
"scripts": {
10-
"build": "node run-babel tools/build.js",
11-
"lint": "eslint src test tools webpack karma.conf.js",
12-
"test": "karma start --single-run && npm run build",
13-
"test-watch": "karma start"
10+
"build": "rm -rf lib && babel src --out-dir lib",
11+
"lint": "eslint ./",
12+
"test": "karma start --single-run",
13+
"test-watch": "karma start",
14+
"patch": "release patch --run",
15+
"minor": "release minor --run",
16+
"major": "release major --run"
1417
},
1518
"repository": {
1619
"type": "git",
@@ -33,37 +36,36 @@
3336
"react": ">=0.14"
3437
},
3538
"devDependencies": {
36-
"babel": "~5.8.21",
39+
"babel": "~5.8.21",
3740
"babel-core": "~5.8.22",
38-
"babel-eslint": "~4.0.8",
41+
"babel-eslint": "~4.1.3",
3942
"babel-loader": "~5.3.2",
40-
"chai": "~3.2.0",
43+
"chai": "~3.3.0",
4144
"child-process-promise": "~1.1.0",
4245
"colors": "~1.1.0",
4346
"es5-shim": "~4.1.3",
44-
"eslint": "~1.1.0",
45-
"eslint-config-defaults": "~4.0.1",
46-
"eslint-plugin-react": "~3.2.3",
47-
"fs-promise": "~0.3.1",
47+
"eslint": "~1.6.0",
48+
"eslint-config-defaults": "~7.0.1",
49+
"eslint-plugin-react": "~3.5.1",
4850
"karma": "~0.13.9",
4951
"karma-chai": "~0.1.0",
5052
"karma-chrome-launcher": "~0.2.0",
5153
"karma-cli": "~0.1.0",
5254
"karma-mocha": "~0.2.0",
5355
"karma-mocha-reporter": "~1.1.1",
54-
"karma-phantomjs-launcher": "~0.2.1",
56+
"karma-phantomjs-launcher": "^0.2.1",
5557
"karma-sourcemap-loader": "~0.3.5",
5658
"karma-webpack": "~1.7.0",
57-
"lodash": "~3.10.1",
58-
"mocha": "~2.2.5",
59+
"mocha": "~2.3.3",
60+
"mt-changelog": "^0.6.2",
5961
"phantomjs": "^1.9.18",
6062
"react": "~0.14.0",
6163
"react-dom": "~0.14.0",
62-
"webpack": "~1.11.0",
63-
"yargs": "~3.19.0"
64+
"release-script": "^0.5.3",
65+
"webpack": "~1.12.2"
6466
},
6567
"dependencies": {
6668
"babel-runtime": "^5.8.0",
67-
"react-async-script": "~0.4.0"
69+
"react-async-script": "~0.5.0"
6870
}
6971
}

run-babel

Lines changed: 0 additions & 9 deletions
This file was deleted.

tools/build.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

tools/lib/build.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

webpack.config.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { DefinePlugin } from "webpack";
2+
export default {
3+
output: {
4+
pathinfo: true,
5+
},
6+
devtool: "inline-source-map",
7+
8+
module: {
9+
loaders: [
10+
{ test: /\.js/, loader: "babel", exclude: /node_modules/ },
11+
],
12+
},
13+
plugins: [
14+
new DefinePlugin({
15+
"process.env": {
16+
NODE_ENV: JSON.stringify("production"),
17+
},
18+
}),
19+
],
20+
};

0 commit comments

Comments
 (0)