Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Commit c4cb751

Browse files
Merge pull request #15 from schneidmaster/react-bootstrap-1
Support react-bootstrap 1.0
2 parents d93f1b8 + 7002492 commit c4cb751

File tree

15 files changed

+4858
-2383
lines changed

15 files changed

+4858
-2383
lines changed

.babelrc

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

.eslintrc.json

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"commonjs": true,
5-
"es6": true
6-
},
7-
"extends": ["eslint:recommended", "plugin:react/recommended"],
8-
"parserOptions": {
9-
"sourceType": "module",
10-
"ecmaFeatures": {
11-
"jsx": true
12-
}
13-
},
14-
"plugins": [
15-
"react"
2+
"extends": [
3+
"standard",
4+
"standard-react",
5+
"prettier/standard",
6+
"plugin:prettier/recommended"
167
],
17-
"rules": {
18-
"indent": [
19-
"error",
20-
2
21-
],
22-
"linebreak-style": [
23-
"error",
24-
"unix"
25-
],
26-
"quotes": [
27-
"error",
28-
"single"
29-
],
30-
"semi": [
31-
"error",
32-
"always"
33-
],
34-
"object-curly-spacing": [
35-
"error",
36-
"always"
37-
]
38-
}
8+
"parser": "babel-eslint"
399
}

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage/
2+
lib/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
## Versioning
1010

1111
* For `react-bootstrap` < 0.29.0, use [v0.1.0](https://github.com/schneidmaster/react-bootstrap-maskedinput/releases/tag/v0.1.0).
12-
* For current versions of `react-bootstrap`, use >= 0.2.x.
13-
* For projects on React >= 0.15.5, use 0.3.x to get rid of the proptypes warning. 0.3.x is also the first version to support `react-maskedinput` 4.x.
12+
* For `react-bootstrap` >= 0.29.0 and < 1.0, use [v0.4.0](https://github.com/schneidmaster/react-bootstrap-maskedinput/releases/tag/v0.4.0).
13+
* For `react-bootstrap` >= 1.0, use [v0.5.0](https://github.com/schneidmaster/react-bootstrap-maskedinput/releases/tag/v0.5.0).
1414

1515
## Usage
1616

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@babel/preset-env", "@babel/preset-react"],
3+
};

example/index.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import { FormGroup, ControlLabel } from 'react-bootstrap';
4-
import MaskedFormControl from '../src';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import { Form } from "react-bootstrap";
4+
import MaskedFormControl from "../src";
55

66
const Example = () => {
77
return (
8-
<div className='container'>
8+
<div className="container">
99
<h1>Example</h1>
1010

11-
<FormGroup>
12-
<ControlLabel>Phone Number</ControlLabel>
13-
<MaskedFormControl type='text' name='phoneNumber' mask='111-111-1111' />
14-
</FormGroup>
11+
<Form>
12+
<Form.Group>
13+
<Form.Label>Phone Number</Form.Label>
14+
<MaskedFormControl
15+
type="text"
16+
name="phoneNumber"
17+
mask="111-111-1111"
18+
/>
19+
</Form.Group>
20+
</Form>
1521
</div>
1622
);
17-
}
23+
};
1824

19-
const rootDiv = document.createElement('div');
25+
const rootDiv = document.createElement("div");
2026
document.body.appendChild(rootDiv);
2127
ReactDOM.render(<Example />, rootDiv);

example/webpack.babel.js

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

example/webpack.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const HtmlWebpackPlugin = require("html-webpack-plugin");
2+
const HtmlWebpackIncludeAssetsPlugin = require("html-webpack-include-assets-plugin");
3+
4+
module.exports = {
5+
entry: "./example/index.js",
6+
module: {
7+
rules: [
8+
{
9+
test: /\.js$/,
10+
use: "babel-loader",
11+
},
12+
],
13+
},
14+
plugins: [
15+
new HtmlWebpackPlugin(),
16+
new HtmlWebpackIncludeAssetsPlugin({
17+
assets: [
18+
"https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css",
19+
],
20+
append: true,
21+
}),
22+
],
23+
};

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
collectCoverage: true,
3+
collectCoverageFrom: ["**/src/**/*.js"],
4+
transform: {
5+
"^.+\\.js?$": "babel-jest",
6+
},
7+
};

package.json

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "react-bootstrap-maskedinput",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "react-maskedinput form element that works with react-bootstrap",
55
"main": "lib/index.js",
66
"scripts": {
77
"test": "jest",
8-
"lint": "eslint src/*.js test/*.js",
8+
"format": "prettier --write '**/*.js'",
9+
"lint": "eslint src/*.js 'test/**/*.js'",
910
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
1011
"build": "babel src --out-dir lib",
11-
"example": "webpack-dev-server --config example/webpack.babel.js"
12+
"example": "webpack-dev-server --config example/webpack.config.js"
1213
},
1314
"repository": {
1415
"type": "git",
@@ -41,29 +42,41 @@
4142
"setupTestFrameworkScriptFile": "<rootDir>/test/setup"
4243
},
4344
"devDependencies": {
44-
"babel-cli": "^6.24.1",
45-
"babel-preset-es2015": "^6.24.1",
46-
"babel-preset-react": "^6.24.1",
45+
"@babel/cli": "^7.10.4",
46+
"@babel/core": "^7.10.4",
47+
"@babel/preset-env": "^7.10.4",
48+
"@babel/preset-react": "^7.10.4",
49+
"@testing-library/react": "^10.4.5",
50+
"babel-eslint": "^10.1.0",
51+
"babel-jest": "^26.1.0",
52+
"babel-loader": "^8.1.0",
4753
"coveralls": "^2.13.1",
48-
"enzyme": "^3.1.0",
49-
"enzyme-adapter-react-16": "^1.0.1",
50-
"enzyme-to-json": "^3.1.2",
51-
"eslint": "^4.2.0",
52-
"eslint-plugin-react": "^7.1.0",
54+
"eslint": "^7.4.0",
55+
"eslint-config-prettier": "^6.11.0",
56+
"eslint-config-standard": "^14.1.1",
57+
"eslint-config-standard-react": "^9.2.0",
58+
"eslint-plugin-import": "^2.22.0",
59+
"eslint-plugin-node": "^11.1.0",
60+
"eslint-plugin-prettier": "^3.1.4",
61+
"eslint-plugin-promise": "^4.2.1",
62+
"eslint-plugin-react": "^7.20.3",
63+
"eslint-plugin-standard": "^4.0.1",
5364
"html-webpack-include-assets-plugin": "^0.0.6",
5465
"html-webpack-plugin": "^2.29.0",
55-
"jest": "^21.2.1",
56-
"react": "^16.0.0",
57-
"react-dom": "^16.0.0",
58-
"react-test-renderer": "^16.0.0",
66+
"jest": "^26.1.0",
67+
"prettier": "^2.0.5",
68+
"react": "^16.13.1",
69+
"react-bootstrap": ">= 1.0.0",
70+
"react-dom": "^16.13.1",
71+
"react-test-renderer": "^16.13.1",
5972
"webpack": "^3.2.0",
6073
"webpack-dev-server": "^2.5.1"
6174
},
6275
"peerDependencies": {
63-
"react": "^15.5.0 || ^16.0.0"
76+
"react": ">= 16.0.0",
77+
"react-bootstrap": ">= 1.0.0"
6478
},
6579
"dependencies": {
66-
"react-bootstrap": ">= 0.29.0",
67-
"react-maskedinput": "^3.0.0 || ^4.0.0"
80+
"react-maskedinput": "^4.0.1"
6881
}
6982
}

0 commit comments

Comments
 (0)