Skip to content

Commit

Permalink
Big headway
Browse files Browse the repository at this point in the history
  • Loading branch information
jvgomg committed May 16, 2016
1 parent 3ff10fb commit e6ea3c7
Show file tree
Hide file tree
Showing 67 changed files with 845 additions and 504 deletions.
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
blueprints/**/files/**
bin
blueprints
coverage/**
node_modules/**
dist/**
*.spec.js
src/index.html
config
build
server
7 changes: 2 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"parser" : "babel-eslint",
"parser": "babel-eslint",
"extends" : [
"standard",
"standard-react"
"airbnb"
],
"env" : {
"browser" : true
Expand All @@ -15,7 +14,5 @@
"__BASENAME__" : false
},
"rules": {
"semi" : [2, "never"],
"max-len": [2, 120, 2]
}
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Climb Social Displayer

A standalone application which demonstrates different Climb Social views and helps users embed them in their own web pages.

---

# React Redux Starter Kit

[![Join the chat at https://gitter.im/davezuko/react-redux-starter-kit](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/davezuko/react-redux-starter-kit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Expand Down
30 changes: 15 additions & 15 deletions bin/compile.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import fs from 'fs-extra'
import _debug from 'debug'
import webpackCompiler from '../build/webpack-compiler'
import webpackConfig from '../build/webpack.config'
import config from '../config'
import fs from 'fs-extra';
import _debug from 'debug';
import webpackCompiler from '../build/webpack-compiler';
import webpackConfig from '../build/webpack.config';
import config from '../config';

const debug = _debug('app:bin:compile')
const debug = _debug('app:bin:compile');
const paths = config.utils_paths

;(async function () {
try {
debug('Run compiler')
const stats = await webpackCompiler(webpackConfig)
debug('Run compiler');
const stats = await webpackCompiler(webpackConfig);
if (stats.warnings.length && config.compiler_fail_on_warning) {
debug('Config set to fail on warning, exiting with status code "1".')
process.exit(1)
debug('Config set to fail on warning, exiting with status code "1".');
process.exit(1);
}
debug('Copy static assets to dist folder.')
fs.copySync(paths.client('static'), paths.dist())
debug('Copy static assets to dist folder.');
fs.copySync(paths.client('static'), paths.dist());
} catch (e) {
debug('Compiler encountered an error.', e)
process.exit(1)
debug('Compiler encountered an error.', e);
process.exit(1);
}
})()
})();
18 changes: 9 additions & 9 deletions bin/server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import config from '../config'
import server from '../server/main'
import _debug from 'debug'
import config from '../config';
import server from '../server/main';
import _debug from 'debug';

const debug = _debug('app:bin:server')
const port = config.server_port
const host = config.server_host
const debug = _debug('app:bin:server');
const port = config.server_port;
const host = config.server_host;

server.listen(port)
debug(`Server is now running at http://${host}:${port}.`)
debug(`Server accessible via localhost:${port} if you are using the project defaults.`)
server.listen(port);
debug(`Server is now running at http://${host}:${port}.`);
debug(`Server accessible via localhost:${port} if you are using the project defaults.`);
16 changes: 8 additions & 8 deletions blueprints/blueprint/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
description () {
return 'generates a blueprint and definition'
description() {
return 'generates a blueprint and definition';
},

beforeInstall () {
console.log('Before installation hook!')
beforeInstall() {
console.log('Before installation hook!');
},

afterInstall () {
console.log('After installation hook!')
}
}
afterInstall() {
console.log('After installation hook!');
},
};
8 changes: 4 additions & 4 deletions blueprints/duck/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
description () {
return 'generates a redux duck'
}
}
description() {
return 'generates a redux duck';
},
};
8 changes: 4 additions & 4 deletions blueprints/dumb/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
description () {
return 'generates a dumb (pure) component'
}
}
description() {
return 'generates a dumb (pure) component';
},
};
8 changes: 4 additions & 4 deletions blueprints/form/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
description () {
return 'generates a connected redux-form form component'
}
}
description() {
return 'generates a connected redux-form form component';
},
};
8 changes: 4 additions & 4 deletions blueprints/layout/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
description () {
return 'generates a functional layout component'
}
}
description() {
return 'generates a functional layout component';
},
};
16 changes: 8 additions & 8 deletions blueprints/smart/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
description () {
return 'generates a smart (container) component'
description() {
return 'generates a smart (container) component';
},

fileMapTokens () {
fileMapTokens() {
return {
__smart__: (options) => {
return options.settings.getSetting('smartPath')
}
}
}
}
return options.settings.getSetting('smartPath');
},
};
},
};
8 changes: 4 additions & 4 deletions blueprints/view/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
description () {
return 'generates a view component'
}
}
description() {
return 'generates a view component';
},
};
50 changes: 25 additions & 25 deletions build/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { argv } from 'yargs'
import config from '../config'
import webpackConfig from './webpack.config'
import _debug from 'debug'
import { argv } from 'yargs';
import config from '../config';
import webpackConfig from './webpack.config';
import _debug from 'debug';

const debug = _debug('app:karma')
debug('Create configuration.')
const debug = _debug('app:karma');
debug('Create configuration.');

const karmaConfig = {
basePath: '../', // project root in relation to bin/karma.js
Expand All @@ -14,14 +14,14 @@ const karmaConfig = {
pattern: `./${config.dir_test}/test-bundler.js`,
watched: false,
served: true,
included: true
}
included: true,
},
],
singleRun: !argv.watch,
frameworks: ['mocha'],
reporters: ['mocha'],
preprocessors: {
[`${config.dir_test}/test-bundler.js`]: ['webpack']
[`${config.dir_test}/test-bundler.js`]: ['webpack'],
},
browsers: ['PhantomJS'],
webpack: {
Expand All @@ -30,48 +30,48 @@ const karmaConfig = {
...webpackConfig.resolve,
alias: {
...webpackConfig.resolve.alias,
sinon: 'sinon/pkg/sinon.js'
}
sinon: 'sinon/pkg/sinon.js',
},
},
plugins: webpackConfig.plugins,
module: {
noParse: [
/\/sinon\.js/
/\/sinon\.js/,
],
loaders: webpackConfig.module.loaders.concat([
{
test: /sinon(\\|\/)pkg(\\|\/)sinon\.js/,
loader: 'imports?define=>false,require=>false'
}
])
loader: 'imports?define=>false,require=>false',
},
]),
},
// Enzyme fix, see:
// https://github.com/airbnb/enzyme/issues/47
externals: {
...webpackConfig.externals,
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window'
'react/lib/ReactContext': 'window',
},
sassLoader: webpackConfig.sassLoader
sassLoader: webpackConfig.sassLoader,
},
webpackMiddleware: {
noInfo: true
noInfo: true,
},
coverageReporter: {
reporters: config.coverage_reporters
}
}
reporters: config.coverage_reporters,
},
};

if (config.globals.__COVERAGE__) {
karmaConfig.reporters.push('coverage')
karmaConfig.reporters.push('coverage');
karmaConfig.webpack.module.preLoaders = [{
test: /\.(js|jsx)$/,
include: new RegExp(config.dir_client),
loader: 'isparta',
exclude: /node_modules/
}]
exclude: /node_modules/,
}];
}

// cannot use `export default` because of Karma.
module.exports = (cfg) => cfg.set(karmaConfig)
module.exports = (cfg) => cfg.set(karmaConfig);
42 changes: 21 additions & 21 deletions build/webpack-compiler.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import webpack from 'webpack'
import _debug from 'debug'
import config from '../config'
import webpack from 'webpack';
import _debug from 'debug';
import config from '../config';

const debug = _debug('app:build:webpack-compiler')
const DEFAULT_STATS_FORMAT = config.compiler_stats
const debug = _debug('app:build:webpack-compiler');
const DEFAULT_STATS_FORMAT = config.compiler_stats;

export default function webpackCompiler (webpackConfig, statsFormat = DEFAULT_STATS_FORMAT) {
export default function webpackCompiler(webpackConfig, statsFormat = DEFAULT_STATS_FORMAT) {
return new Promise((resolve, reject) => {
const compiler = webpack(webpackConfig)
const compiler = webpack(webpackConfig);

compiler.run((err, stats) => {
const jsonStats = stats.toJson()
const jsonStats = stats.toJson();

debug('Webpack compile completed.')
debug(stats.toString(statsFormat))
debug('Webpack compile completed.');
debug(stats.toString(statsFormat));

if (err) {
debug('Webpack compiler encountered a fatal error.', err)
return reject(err)
debug('Webpack compiler encountered a fatal error.', err);
return reject(err);
} else if (jsonStats.errors.length > 0) {
debug('Webpack compiler encountered errors.')
debug(jsonStats.errors.join('\n'))
return reject(new Error('Webpack compiler encountered errors'))
debug('Webpack compiler encountered errors.');
debug(jsonStats.errors.join('\n'));
return reject(new Error('Webpack compiler encountered errors'));
} else if (jsonStats.warnings.length > 0) {
debug('Webpack compiler encountered warnings.')
debug(jsonStats.warnings.join('\n'))
debug('Webpack compiler encountered warnings.');
debug(jsonStats.warnings.join('\n'));
} else {
debug('No errors or warnings encountered.')
debug('No errors or warnings encountered.');
}
resolve(jsonStats)
})
})
resolve(jsonStats);
});
});
}

Loading

0 comments on commit e6ea3c7

Please sign in to comment.