Skip to content

Commit

Permalink
Import from previous repo
Browse files Browse the repository at this point in the history
  • Loading branch information
zowesiouff committed Feb 8, 2017
1 parent b0cb441 commit bc17835
Show file tree
Hide file tree
Showing 116 changed files with 11,506 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"es2015",
{ "modules": false }
],
"react",
],
"env": {
"test": {
"plugins": [
"rewire-exports",
"istanbul",
],
},
},
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/node_modules/*
/public/
/raw*
/tests*
/pm*
/certs
/coverage
.DS_Store
136 changes: 136 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*!
* kin
* Copyright(c) 2016-2017 Benoit Person
* Apache 2.0 Licensed
*/


"use strict";
const babel = require('gulp-babel');
const del = require('del');
const eslint = require('gulp-eslint');
const fs = require('fs');
const gulp = require('gulp');
const gutil = require('gulp-util');
const KarmaServer = require('karma').Server;
const webpack = require('webpack');
const webpack_config = require('./webpack.config.js');
const WebpackDevServer = require('webpack-dev-server');
const _ = require('lodash');


/**
* Environments configuration
*/
const chalk = require('chalk');
const ALLOWED_ENVS = ['dev', 'prod', 'preprod'];
const env_name = process.env.NODE_ENV;
if (ALLOWED_ENVS.indexOf(env_name) != -1) {
console.log(`Running environment ${chalk.green(env_name)}`);
} else {
console.error(chalk.red(`Environment ${chalk.blue(env_name)} not in ${chalk.yellow(ALLOWED_ENVS)}`));
process.exit(1);
}


/**
* Globbing expressions
*/
const client_files = 'src/client/**/*.js';
const test_files = 'test/**/*.js';


/**
* Main tasks
*/
gulp.task('lint', () => {
return gulp.src([
client_files,
test_files,
'!src/client/rollbar.umd.nojson.min.js',
])
.pipe(eslint())
.pipe(eslint.format())
});

gulp.task('webpack', (callback) => {
const config = webpack_config({
env: env_name,
});
webpack(config, (error, stats) => {
if (error) {
throw new gutil.PluginError('webpack', error)
};
gutil.log("[webpack]", stats.toString({
'colors': true,
}));
callback();
});
});

gulp.task('webpack-dev-server', (callback) => {
const host = 'dev.kin.today';
const port = 8080;

const config = webpack_config({
env: env_name,
});

// FIXME: Webpack dev server's inline mode seems to auto-reload the page in rare
// occasions (first install iOS simulator -> first connector),
// might need further investigations
_.forEach(config.entry, entry => {
entry.unshift('webpack-dev-server/client?https://' + host + ':' + port + '/');
});

// Start a webpack-dev-server
new WebpackDevServer(webpack(config), {
key: fs.readFileSync('./certs/localhost-key.pem'),
cert: fs.readFileSync('./certs/localhost-cert.pem'),
https: true,
stats: {
colors: true
},
}).listen(port, host, (error) => {
if (error) {
throw new gutil.PluginError('webpack-dev-server', error);
}
gutil.log('[webpack-dev-server]', 'https://' + host + ':' + port + '/index.html');
});
});


/**
* Test tasks
*/
gulp.task('test', ['_set-test-node-env'], (done) => {
new KarmaServer({
configFile: `${__dirname}/karma.config.js`,
singleRun: true,
}, done).start();
});

gulp.task('test-watch', ['_set-test-node-env'], (done) => {
new KarmaServer({
configFile: `${__dirname}/karma.config.js`,
}, done).start();
});

gulp.task('_set-test-node-env', function() {
return process.env.NODE_ENV = 'test';
});


/**
* Utils tasks
*/
gulp.task('clean', () => {
del([
'./public/*.otf',
'./public/*.html',
'./public/*.css',
'./public/*.map',
'./public/*.js',
'./public/*.png',
]);
});
40 changes: 40 additions & 0 deletions karma.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*!
* kin
* Copyright(c) 2016-2017 Benoit Person
* Apache 2.0 Licensed
*/


var webpack_config = require('./webpack.config.js')({
env: 'test',
});

module.exports = function(config) {
config.set({
frameworks: ['mocha', 'sinon-chai'],
reporters: ['mocha', 'coverage'],
browsers: ['Chrome'],

files: [
'./test/index.js',
],

preprocessors: {
'./test/index.js': ['webpack'],
},

webpack: webpack_config,
webpackMiddleware: {
noInfo: true
},

plugins: [
'karma-chrome-launcher',
'karma-coverage',
'karma-mocha',
'karma-mocha-reporter',
'karma-sinon-chai',
'karma-webpack',
],
});
};
109 changes: 109 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"name": "kin-web-client",
"version": "0.1.0",
"description": "Desktop Web Client for Kin Calendar.",
"repository": "https://github.com/KinToday/kin-web-client",
"author": "Zowe Siouff <[email protected]>",
"license": "Apache-2.0",
"keywords": [
"calendar",
"react",
"redux",
"event",
"kin"
],
"bugs": {
"url": "https://github.com/KinToday/kin-web-client/issues"
},
"dependencies": {
"babel-register": "^6.9.0",
"backoff": "^2.5.0",
"bluebird": "^3.4.6",
"chalk": "^1.1.3",
"classnames": "^2.2.5",
"foundation-sites": "^6.2.1",
"fullcalendar": "^3.0.0",
"fuse.js": "^2.2.0",
"jquery": "^3.1.1",
"lodash": "^4.5.1",
"moment": "^2.13.0",
"moment-timezone": "^0.5.4",
"normalize-wheel": "^1.0.1",
"popper.js": "^0.6.4",
"push.js": "0.0.11",
"react": "^15.1.0",
"react-addons-css-transition-group": "^15.1.0",
"react-addons-perf": "^15.4.1",
"react-addons-shallow-compare": "^15.4.1",
"react-dates": "^4.1.1",
"react-dom": "^15.1.0",
"react-redux": "^5.0.1",
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
"spotoninc-moment-round": "^2.0.0",
"time-input": "^1.3.1",
"whatwg-fetch": "^2.0.1"
},
"devDependencies": {
"autoprefixer": "^6.5.3",
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-plugin-istanbul": "^3.0.0",
"babel-plugin-rewire-exports": "0.0.3",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"brfs": "^1.4.3",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"css-loader": "^0.26.0",
"del": "^2.2.0",
"eslint": "^3.8.1",
"eslint-config-airbnb": "^14.0.0",
"eslint-loader": "^1.5.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.4.1",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"fetch-mock": "^5.5.0",
"file-loader": "^0.9.0",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.2",
"gulp-eslint": "^3.0.1",
"gulp-util": "^3.0.7",
"html-webpack-plugin": "^2.15.0",
"json-loader": "^0.5.4",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.2.0",
"karma-mocha-reporter": "^2.2.0",
"karma-sinon-chai": "^1.2.4",
"karma-webpack": "^2.0.1",
"mocha": "^3.1.2",
"node-sass": "^4.0.0",
"postcss-loader": "^1.2.0",
"rollbar-sourcemap-webpack-plugin": "^1.2.1",
"sass-loader": "^4.0.2",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"style-loader": "^0.13.1",
"stylelint": "^7.6.0",
"stylelint-config-standard": "^15.0.0",
"stylelint-scss": "^1.3.4",
"transform-loader": "^0.2.3",
"url-loader": "^0.5.7",
"webpack": "^2.1.0-beta.27",
"webpack-cleanup-plugin": "^0.4.1",
"webpack-dev-server": "^2.1.0-beta.12"
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"jsx": true
}
}
}
}
14 changes: 14 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*!
* kin
* Copyright(c) 2016-2017 Benoit Person
* Apache 2.0 Licensed
*/


module.exports = {
plugins: [
require('autoprefixer')({
browsers: ['last 2 versions'],
})
]
};
44 changes: 44 additions & 0 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
"extends": "airbnb",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"jsx": true
}
},
"env": {
"browser": true,
},
"rules": {
"camelcase": 0,
"no-underscore-dangle": 0,
"indent": ["error", 4],
"react/jsx-indent": [2, 4],
"comma-dangle": 0,
"max-len": ["error", 100, 2, {
ignoreUrls: true,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
"arrow-body-style": 0, // Both styles are awesome ;)
"class-methods-use-this": 0,
"jsx-a11y/no-static-element-interactions": 0,
"no-console": 0,
"no-bitwise": 0,
"react/require-default-props": 0,
},
"globals": {
"$": false,
"KIN_ENV_NAME": false,
},
"settings": {
"import/core-modules": [
"config",
"utils",
"prop_types",
],
},
}
12 changes: 12 additions & 0 deletions src/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"rules": {
"color-hex-case": "upper",
"color-hex-length": "long",
"indentation": 4,
"declaration-block-no-redundant-longhand-properties": null
}
}
Loading

0 comments on commit bc17835

Please sign in to comment.