-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* paths are all now within `constants/paths` * Fix email signup in redux example * Fix deploy to firebase errors * Build folders removed from `gitignore` * New project dialog fixed in redux example * Empty user image being copied correctly (not templated)
- Loading branch information
1 parent
1a84100
commit a3afaab
Showing
96 changed files
with
1,888 additions
and
503 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
node_modules | ||
example/node_modules | ||
**/node_modules/** | ||
coverage | ||
npm-debug.log | ||
.DS_Store | ||
**/.DS_Store | ||
**/build/** |
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,6 @@ | ||
{ | ||
"projects": { | ||
"stage": "redux-firebasev3", | ||
"prod": "redux-firebasev3" | ||
} | ||
} |
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) 2015 David Zukowski | ||
|
||
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
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,35 @@ | ||
const debug = require('debug')('app:build:config') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const pkg = require('../package.json') | ||
const outputPath = path.join(__dirname, '..', 'src/config.js') | ||
|
||
const createConfigFile = (cb) => { | ||
const configObj = { | ||
version: pkg.version, | ||
env: 'dev' | ||
} | ||
|
||
if (process.env.TRAVIS_PULL_REQUEST === false) { | ||
if (process.env.TRAVIS_BRANCH === 'prod') { | ||
configObj.env = 'prod' | ||
} | ||
} | ||
|
||
const fileString = `export default ${JSON.stringify(configObj, null, 2)}` | ||
|
||
fs.writeFile(outputPath, fileString, 'utf8', (err) => { | ||
if (err) { | ||
debug('Error writing config file:', err) | ||
if (cb) cb(err, null) | ||
return | ||
} | ||
if (cb) cb() | ||
}) | ||
} | ||
|
||
(function () { | ||
createConfigFile(() => { | ||
debug('Config file successfully written to src/config.js') | ||
}) | ||
})() |
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,53 @@ | ||
const _debug = require('debug') // eslint-disable-line no-underscore-dangle | ||
const exec = require('child_process').exec | ||
const { | ||
TRAVIS_BRANCH, | ||
TRAVIS_PULL_REQUEST, | ||
FIREBASE_TOKEN | ||
} = process.env | ||
const debug = _debug('app:build:deploy') | ||
|
||
const deployToFirebase = (cb) => { | ||
debug('Travis Variables:', { TRAVIS_PULL_REQUEST, TRAVIS_BRANCH }) | ||
if (!!TRAVIS_PULL_REQUEST && TRAVIS_PULL_REQUEST !== 'false') { | ||
debug('Skipping Firebase Deploy - Build is a Pull Request') | ||
return | ||
} | ||
|
||
if (TRAVIS_BRANCH !== 'prod' && TRAVIS_BRANCH !== 'stage' && TRAVIS_BRANCH !== 'master') { | ||
debug('Skipping Firebase Deploy - Build is a not a Build Branch', TRAVIS_BRANCH) | ||
return | ||
} | ||
|
||
if (!FIREBASE_TOKEN) { | ||
debug('Error: FIREBASE_TOKEN env variable not found') | ||
cb('Error: FIREBASE_TOKEN env variable not found', null) | ||
return | ||
} | ||
|
||
debug('Deploying to Firebase...') | ||
|
||
exec(`firebase deploy --token ${FIREBASE_TOKEN}`, (error, stdout) => { | ||
if (error !== null) { | ||
if (cb) { | ||
cb(error, null) | ||
console.log('error deploying', error) | ||
return | ||
} | ||
} | ||
if (cb) { | ||
cb(null, stdout) | ||
} | ||
}) | ||
} | ||
|
||
(function () { | ||
deployToFirebase((err, stdout) => { | ||
if (err || !stdout) { | ||
debug('error deploying to Firebase: ', err) | ||
return | ||
} | ||
debug(stdout) // log output of firebase cli | ||
debug('\nSuccessfully deployed to Firebase') | ||
}) | ||
})() |
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,72 @@ | ||
const argv = require('yargs').argv | ||
const config = require('../config') | ||
const webpackConfig = require('./webpack.config') | ||
const debug = require('debug')('app:karma') | ||
|
||
debug('Creating configuration.') | ||
const karmaConfig = { | ||
basePath : '../', // project root in relation to bin/karma.js | ||
files : [ | ||
{ | ||
pattern : `./${config.dir_test}/test-bundler.js`, | ||
watched : false, | ||
served : true, | ||
included : true | ||
} | ||
], | ||
singleRun : !argv.watch, | ||
frameworks : ['mocha'], | ||
reporters : ['mocha'], | ||
preprocessors : { | ||
[`${config.dir_test}/test-bundler.js`] : ['webpack'] | ||
}, | ||
browsers : ['PhantomJS'], | ||
webpack : { | ||
devtool : 'cheap-module-source-map', | ||
resolve : Object.assign({}, webpackConfig.resolve, { | ||
alias : Object.assign({}, webpackConfig.resolve.alias, { | ||
sinon : 'sinon/pkg/sinon.js' | ||
}) | ||
}), | ||
plugins : webpackConfig.plugins, | ||
module : { | ||
noParse : [ | ||
/\/sinon\.js/ | ||
], | ||
loaders : webpackConfig.module.loaders.concat([ | ||
{ | ||
test : /sinon(\\|\/)pkg(\\|\/)sinon\.js/, | ||
loader : 'imports?define=>false,require=>false' | ||
} | ||
]) | ||
}, | ||
// Enzyme fix, see: | ||
// https://github.com/airbnb/enzyme/issues/47 | ||
externals : Object.assign({}, webpackConfig.externals, { | ||
'react/addons' : true, | ||
'react/lib/ExecutionEnvironment' : true, | ||
'react/lib/ReactContext' : 'window' | ||
}), | ||
sassLoader : webpackConfig.sassLoader | ||
}, | ||
webpackMiddleware : { | ||
noInfo : true | ||
}, | ||
coverageReporter : { | ||
reporters : config.coverage_reporters | ||
} | ||
} | ||
|
||
if (config.globals.__COVERAGE__) { | ||
karmaConfig.reporters.push('coverage') | ||
karmaConfig.webpack.module.preLoaders = [{ | ||
test : /\.(js|jsx)$/, | ||
include : new RegExp(config.dir_client), | ||
loader : 'babel', | ||
query : Object.assign({}, config.compiler_babel, { | ||
plugins : (config.compiler_babel.plugins || []).concat('istanbul') | ||
}) | ||
}] | ||
} | ||
|
||
module.exports = (cfg) => cfg.set(karmaConfig) |
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,36 @@ | ||
const webpack = require('webpack') | ||
const debug = require('debug')('app:build:webpack-compiler') | ||
const config = require('../config') | ||
|
||
function webpackCompiler (webpackConfig, statsFormat) { | ||
statsFormat = statsFormat || config.compiler_stats | ||
|
||
return new Promise((resolve, reject) => { | ||
const compiler = webpack(webpackConfig) | ||
|
||
compiler.run((err, stats) => { | ||
if (err) { | ||
debug('Webpack compiler encountered a fatal error.', err) | ||
return reject(err) | ||
} | ||
|
||
const jsonStats = stats.toJson() | ||
debug('Webpack compile completed.') | ||
debug(stats.toString(statsFormat)) | ||
|
||
if (jsonStats.errors.length > 0) { | ||
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')) | ||
} else { | ||
debug('No errors or warnings encountered.') | ||
} | ||
resolve(jsonStats) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = webpackCompiler |
Oops, something went wrong.