-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 348a32e
Showing
16 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"presets": ["es2015", "stage-0", "react"], | ||
"plugins": [ | ||
["module-alias", [ | ||
{ "src": "./src", "expose": "src" } | ||
]] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": "airbnb" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# project specific | ||
dist/ | ||
lib/ | ||
|
||
# Git | ||
.git | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import Instant2FAComponent from './src/Instant2fa-component.jsx'; | ||
|
||
const App = () => ( | ||
<div> | ||
<Instant2FAComponent /> | ||
</div> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 MadaData | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Instant2fa-component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Instant2fa-component</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="dist/index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var Instant2FAComponent = require('./lib/Instant2fa-component').default; | ||
module.exports = Instant2FAComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import App from './App'; | ||
|
||
ReactDom.render( | ||
<App />, | ||
document.getElementById('app') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "instant2fa-component", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"dev": "webpack-dev-server --inline --hot --port 3000", | ||
"compile": "npm-run-all --parallel compile:source compile:postcss", | ||
"compile:postcss": "postcss --use precss --use postcss-cssnext -d lib src/*.css", | ||
"compile:source": "babel src --out-dir lib", | ||
"prepublish": "npm-run-all clean compile", | ||
"lint": "eslint src test --ext .jsx,.js", | ||
"clean": "rimraf lib dist", | ||
"test:watch": "mocha --watch", | ||
"test": "mocha" | ||
}, | ||
"keywords": [], | ||
"author": "Jesse Pollak", | ||
"license": "MIT", | ||
"config": { | ||
"ghooks": { | ||
"pre-commit": "npm run lint", | ||
"pre-push": "npm run clean" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"react": "15.x", | ||
"react-dom": "15.x" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.18.2", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.8", | ||
"babel-plugin-module-alias": "^1.6.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-react-hmre": "^1.1.1", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"css-loader": "^0.26.0", | ||
"enzyme": "^2.6.0", | ||
"eslint": "^3.10.2", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^3.0.1", | ||
"eslint-plugin-react": "^6.7.1", | ||
"expect": "^1.20.2", | ||
"expect-jsx": "^2.6.0", | ||
"file-loader": "^0.9.0", | ||
"ghooks": "^1.3.2", | ||
"ignore-styles": "^5.0.1", | ||
"jsdom": "^9.8.3", | ||
"mocha": "^3.1.2", | ||
"npm-run-all": "^3.1.1", | ||
"postcss": "^5.2.5", | ||
"postcss-cli": "^2.6.0", | ||
"postcss-cssnext": "^2.8.0", | ||
"postcss-loader": "^1.1.1", | ||
"precss": "^1.4.0", | ||
"react-addons-test-utils": "^15.4.0", | ||
"style-loader": "^0.13.1", | ||
"url-loader": "^0.5.7", | ||
"webpack": "^1.13.3", | ||
"webpack-dev-server": "^1.16.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* put your css here */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
const Instant2FAComponent = () => <div>Instant2fa-component</div>; | ||
|
||
export default Instant2FAComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable */ | ||
import React from 'react'; | ||
import expect from 'expect'; | ||
import expectJSX from 'expect-jsx'; | ||
import { shallow } from 'enzyme'; | ||
import { createRenderer } from 'react-addons-test-utils'; | ||
import Instant2fa-component from '../src/Instant2fa-component'; | ||
|
||
expect.extend(expectJSX); | ||
|
||
/* eslint-disable no-undef */ | ||
describe('Instant2fa-component', () => { | ||
it('should work', () => { | ||
|
||
}); | ||
}); | ||
|
||
/* eslint-enable */ | ||
// remove eslint-disable and eslint-enable and enable when you start writing test | ||
// keep eslint-disable no-undef. and remove the package you don't need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--require babel-register | ||
--require ignore-styles | ||
--require ./test/setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import jsdom from 'jsdom'; | ||
|
||
function setupDom() { | ||
if (typeof document !== 'undefined') { | ||
return; | ||
} | ||
|
||
global.document = jsdom.jsdom('<html><body></body></html>'); | ||
global.window = document.defaultView; | ||
global.navigator = window.navigator; | ||
} | ||
|
||
setupDom(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const cssnext = require('postcss-cssnext'); | ||
const precss = require('precss'); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: './main.js', | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'index.js', | ||
publicPath: '/dist/', | ||
}, | ||
extensions: [ | ||
"", ".js", ".jsx", | ||
], | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /node_modules/, | ||
loader: 'babel', | ||
query: { | ||
presets: ['es2015', 'stage-0', 'react', 'react-hmre'], | ||
} | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loader: 'style!css!postcss' | ||
}, | ||
{ | ||
test: /\.png$/, | ||
loader: 'url-loader' | ||
}, | ||
{ | ||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: "url-loader?limit=10000&minetype=application/font-woff" | ||
}, | ||
{ | ||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: "file-loader" | ||
} | ||
] | ||
}, | ||
postcss: function() { | ||
return [ | ||
precss, | ||
cssnext | ||
]; | ||
} | ||
} |