Skip to content
This repository has been archived by the owner on Nov 18, 2018. It is now read-only.

Commit

Permalink
Updatate boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Mar 1, 2016
1 parent c0d2561 commit 7779a23
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 60 deletions.
Empty file modified .babelrc
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
languages:
Ruby: true
JavaScript: true
PHP: true
Python: true
exclude_paths:
- example/*
- example/**/*
- karma.conf.js
- test/*
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "airbnb",
"parser": "babel-eslint"
}
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js

node_js:
- '4.3.0'

install:
- npm i

script:
- 'npm test'
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Bokuweb

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.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Components

- [ ] Button
- [ ] Input
- [ ] Textarea
- [ ] Select
- [ ] Checkbox
- [ ] Radio
- [ ] Titles
- [ ] Content
- [ ] Tag
- [ ] Message
- [ ] Notification
- [ ] Icon
- [ ] Navbar
- [ ] Grid (Columns, Column)
- [ ] Tabs (Tabs, Tab)
- [ ] Media
- [ ] Card
- [ ] Menu
- [ ] Table
- [ ] Header
- [ ] Footer
- [ ] Hero
- [ ] Section
Empty file removed dist/.keep
Empty file.
25 changes: 0 additions & 25 deletions example/index.html

This file was deleted.

9 changes: 2 additions & 7 deletions example/src/example.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React, {Component} from 'react';
import {Button, Columns, Column} from '../../src';
import {Button} from '../../src';

export default class Example extends Component{
render() {
return (
<Columns>
<Column size='isHalf'>a</Column>
<Column>b</Column>
<Column>c</Column>
<Column>c</Column>
</Columns>
<Button >test</Button>
);
}
}
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<head>
<title>Sample App</title>
</head>
<body>
<div id='root'>
</div>
<script src="/static/bundle.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha', 'browserify'],
files: [
'./node_modules/babel-polyfill/dist/polyfill.js',
'test/*.js'
],
exclude: [
],

babelPreprocessor: {
options: {
presets: ['airbnb']
}
},
browserify: {
debug: true,
extensions: ['.js'],
transform: [
[require('babelify').configure({
plugins: ['babel-plugin-espower']
}), { presets: ['airbnb'] }]
],
configure: function(bundle) {
bundle.on('prebundle', function() {
bundle.external('react/lib/ReactContext');
bundle.external('react/lib/ExecutionEnvironment');
});
}
},

preprocessors: {
'test/*.js': ['babel', 'browserify']
},

reporters: ['progress'],

port: 9876,

colors: true,

logLevel: config.LOG_INFO,

autoWatch: false,

browsers: ['PhantomJS'],

singleRun: true
})
}
69 changes: 41 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
{
"name": "react-bulma",
"version": "0.0.1",
"name": "react-develop-boilerplate",
"version": "0.1.0",
"description": "",
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"watch": "npm run watch:lib & npm run watch:example",
"watch:lib": "watchify --extension=js -o lib/index.js src/index.js",
"watch:example": "watchify --extension=js -o example/dist/bundle.js example/src/index.js",
"build": "npm run build:lib & npm run build:example",
"build:lib": "browserify --extension=js -o lib/index.js src/index.js",
"build:example": "browserify --extension=js -o example/dist/bundle.js example/src/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js",
"test": "karma start",
"test:watch": "karma start --auto-watch --no-single-run",
"compile": "babel -d lib/ src/",
"prepublish": "npm run compile"
"prepublish": "npm run compile",
"prepush": "npm run lint",
"lint": "eslint src"
},
"author": "",
"repository": {
"type": "git",
"url": "git+https://github.com/bokuweb/react-develop-boilerplate.git"
},
"author": "bokuweb",
"license": "MIT",
"peerDependencies": {
"react": ">=0.14.7",
"react-dom": ">=0.14.7"
"bugs": {
"url": "https://github.com/bokuweb/react-develop-boilerplate/issues"
},
"homepage": "https://github.com/bokuweb/react-develop-boilerplate#readme",
"devDependencies": {
"babel": "^6.1.18",
"babel-cli": "^6.2.0",
"babel-plugin-espower": "2.0.0",
"babel-plugin-transform-class-properties": "^6.4.0",
"babel": "^6.3.26",
"babel-cli": "^6.4.5",
"babel-core": "^6.5.2",
"babel-eslint": "^4.1.8",
"babel-loader": "^6.2.3",
"babel-plugin-espower": "^2.0.0",
"babel-polyfill": "^6.5.0",
"babel-preset-airbnb": "^1.1.1",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.1.18",
"babelify": "7.2.0",
"browserify": "^12.0.1",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"enzyme": "^2.0.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^5.0.0",
"eslint-plugin-react": "^3.16.1",
"espower-babel": "^3.3.0",
"husky": "^0.11.1",
"karma": "^0.13.19",
"karma-babel-preprocessor": "^6.0.1",
"karma-browserify": "^4.4.0",
"karma-cli": "^0.1.1",
"karma-mocha": "^0.2.0",
Expand All @@ -39,21 +50,23 @@
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "^0.0.1",
"power-assert": "^1.1.0",
"react": "^0.14.7",
"react-addons-test-utils": "^0.14.3",
"react-dom": "^0.14.7",
"react-hot-loader": "^1.3.0",
"sinon": "^1.17.2",
"watchify": "^3.5.0"
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
},
"browserify": {
"transform": [
"babelify"
]
"peerDependencies": {
"react": ">=0.14.7"
},
"files": [
"lib"
],
"dependencies": {
"babel-preset-stage-0": "^6.3.13",
"csjs": "^1.0.0",
"insert-css": "^0.2.0",
"react-inline-css": "^2.1.0"
}
}
15 changes: 15 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');

new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true
}).listen(3333, 'localhost', function (err, result) {
if (err) {
console.log(err);
}

console.log('Listening at localhost:3333');
});
24 changes: 24 additions & 0 deletions test/helloworld.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import { shallow } from 'enzyme';
import assert from 'power-assert';
import Hello from '../src/index';

describe('Hello', () => {
it('Should render as a <h1>', () => {
const wrapper = shallow(<Hello />);
assert.equal(wrapper.type(), 'h1');
});

it('Shoud have style with color red', () => {
const wrapper = shallow(<Hello />);
const expectedStyles = {
color: 'red'
};
assert.deepEqual(wrapper.prop('style'), expectedStyles);
});

it('Should contain string, Hello, world', () => {
const wrapper = shallow(<Hello />);
assert(wrapper.contains('Hello, world'));
});
});
26 changes: 26 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var path = require('path');
var webpack = require('webpack');

module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3333',
'webpack/hot/only-dev-server',
'./example/src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['react-hot', 'babel', 'babel-loader'],
include: [path.join(__dirname, 'src'), path.join(__dirname, 'example/src')]
}]
}
};

0 comments on commit 7779a23

Please sign in to comment.